package nccloud.hrkq.hrkq.monthottimevo.action;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

import nc.bs.logging.Logger;
import nc.vo.hrkq.monthottime.MonthOtTimeBVO;
import nc.vo.pub.SuperVO;
import nc.vo.uif2.LoginContext;
import nccloud.framework.web.container.IRequest;
import nccloud.framework.web.container.SessionContext;
import nccloud.framework.web.ui.model.row.Cell;
import nccloud.framework.web.ui.pattern.form.Form;
import nccloud.web.hr.pub.HRCommonAction;
import nccloud.web.hr.pub.HRNccTemplateUtils;
import nccloud.web.hr.pub.HRNccUtils;
import nccloud.web.uapbd.commons.web.ParamUtils;

public class MonthOtTimeVODefaultAction extends HRCommonAction {

	public <T> Object execute(IRequest request, T arg1) throws Exception {
		Logger.error("#####ÅúÁ¿¼Ó°à:#####£º" + System.currentTimeMillis());
		Long time1 = Long.valueOf(System.currentTimeMillis());
	    ParamUtils param = new ParamUtils(request);
	    LoginContext context = HRNccUtils.getLoginContext(param);
	    String pageCode = param.getString("pageCode", SessionContext.getInstance().getAppcode()+"t");
	    String areaCode = param.getString("areaCode", "overtime_card");
	    String appCode = param.getString("appCode", SessionContext.getInstance().getAppcode());
	    
	    MonthOtTimeBVO vo = new MonthOtTimeBVO();
	    int operat = param.getInt("operat", Integer.valueOf(-1)).intValue();
	    String pk = param.getString("pk", null);
	    if (operat == 1) {
	    	
//	    	vo.setStatus(1);
	    } else if (operat == 0) {
//	    	vo.setAttributeValue("otdate", new UFDate());
//	    	vo.setAttributeValue(vo.getPKFieldName(), AttendDataUtil.getBillId());
//	    	vo.setStatus(0);
	    }
	    
	    Map<String, Cell> fieldValueMap = new HashMap<String, Cell>();
	    setDefaultData(vo, fieldValueMap, param);
	    Form form = HRNccTemplateUtils.getFormWithArea(appCode, pageCode, areaCode, vo);
//	    if (!fieldValueMap.isEmpty()) {
//	      for (String attrCode : fieldValueMap.keySet()) {
//	        form.getModel().getRows()[0].addCell(attrCode, (Cell)fieldValueMap.get(attrCode));
//	      }
//	    }
//	    Long time2 = Long.valueOf(System.currentTimeMillis());
//	    Logger.error("#####time spend:#####£º" + (time2.longValue() - time1.longValue()));
//	    
	    return form;
	}
	protected void setDefaultData(SuperVO vo, Map<String, Cell> fieldValueMap, ParamUtils param) {
   }

   protected String getPageCode() { return "60656040nccloud"; }
   protected String getAreaCode() { return "overtime_card"; }
   protected String getBillType() { return "6QOT"; }
}
