qingwu 1 hónapja
szülő
commit
c06fc8a636

+ 161 - 90
GDYSL/websrc/com/kingdee/eas/hr/emp/web/handler/PositionAdminRangeF7HandlerEx.java

@@ -1,107 +1,178 @@
 package com.kingdee.eas.hr.emp.web.handler;
 
 
+import java.sql.SQLException;
+import java.text.MessageFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
+import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.Context;
+import com.kingdee.bos.metadata.entity.*;
+import com.kingdee.eas.basedata.cm.util.BDUtils;
+import com.kingdee.eas.basedata.framework.util.BDUtil;
+import com.kingdee.eas.hr.base.EmpPosOrgRelationCollection;
+import com.kingdee.eas.hr.base.EmpPosOrgRelationFactory;
+import com.kingdee.eas.hr.base.EmpPosOrgRelationInfo;
+import com.kingdee.eas.hr.base.IEmpPosOrgRelation;
+import com.kingdee.eas.util.app.DbUtil;
+import com.kingdee.jdbc.rowset.IRowSet;
+import com.kingdee.shr.base.syssetting.context.SHRContext;
+import com.kingdee.shr.base.syssetting.json.GridDataEntity;
+import com.kingdee.shr.base.syssetting.web.handler.ListHandler;
+import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
 import com.kingdee.util.DateTimeUtils;
 import com.kingdee.util.StringUtils;
+import org.apache.log4j.Logger;
 import org.springframework.ui.ModelMap;
 import com.kingdee.shr.base.syssetting.exception.SHRWebException;
 
 
 /**
  * 兼职单
- * @author coyle 
+ *
+ * @author coyle
  * 20250331
  */
 public class PositionAdminRangeF7HandlerEx extends EmpOrgF7Handler {
-	
-	
-	public String getListDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws SHRWebException {
-		String modelFilter = (String) modelMap.get("filter");
-		if (StringUtils.isEmpty(modelFilter)) {
-			String filter = request.getParameter("filter");
-			if (null != filter) {
-				String empBatchEnrollConsecutiveAddNew;
-				String filterEndSign;
-				if (filter.indexOf("idRanFromPluralityAdd") != -1) {
-					empBatchEnrollConsecutiveAddNew = filter.substring(0, filter.indexOf("idRanFromPluralityAdd"));
-					filterEndSign = filter
-							.substring(filter.indexOf("idRanFromPluralityAdd") + "idRanFromPluralityAdd".length());
-					if (!StringUtils.isEmpty(filterEndSign)) {
-						
-						filter = empBatchEnrollConsecutiveAddNew
-								+ " id not in (select fpositionid from T_HR_EmpOrgRelation t where t.fpersonid='"
-								+ filterEndSign + "' and t.fleffdt = {2199-12-31}  and t.FISSYSTEM = 1)";
-					} else {
-						filter = empBatchEnrollConsecutiveAddNew;
-					}
-					modelMap.put("filter", filter);
-				}
-
-				if (filter.indexOf("idRanFromPluralityDel") != -1) {
-					////202503 日期更改
-					Date curDate  = new Date();
-					String dateStr = DateTimeUtils.format(curDate, "yyyy-MM-dd");
-					
-					empBatchEnrollConsecutiveAddNew = filter.substring(0, filter.indexOf("idRanFromPluralityDel"));
-					filterEndSign = filter
-							.substring(filter.indexOf("idRanFromPluralityDel") + "idRanFromPluralityDel".length());
-					filter = empBatchEnrollConsecutiveAddNew
-							+ " id in (select fpositionid from T_HR_EmpOrgRelation t where t.fpersonid='"
-							+ filterEndSign
-							+ "' and t.fleffdt >= {"+dateStr+"}  and t.fassigntype=0 and t.fisInner = 1 and t.FActionID not in ('jpoAAAH/03nmaL7Z','V2vNOLaKRuGuv9/HNB5laOZovtk='))";
-					modelMap.put("filter", filter);
-				}
-
-				if (filter.indexOf("idRanFromPositionHierarchy") != -1) {
-					empBatchEnrollConsecutiveAddNew = filter.substring(0, filter.indexOf("idRanFromPositionHierarchy"));
-					filterEndSign = filter.substring(
-							filter.indexOf("idRanFromPositionHierarchy") + "idRanFromPositionHierarchy".length());
-					filter = empBatchEnrollConsecutiveAddNew
-							+ " id in (select fchildid from T_ORG_PositionHierarchy where FHierarchyID = '"
-							+ filterEndSign + "')";
-					modelMap.put("filter", filter);
-				}
-
-				if (filter.indexOf("F7query") != -1) {
-					filter = filter.replace("F7query", "select");
-					modelMap.put("filter", filter);
-				}
-
-				if (filter.indexOf("=''") != -1) {
-					filter = filter.replace("=''", " is not null");
-					modelMap.put("filter", filter);
-				}
-
-				if (filter.indexOf("empBatchEnrollConsecutiveAddNew") != -1) {
-					empBatchEnrollConsecutiveAddNew = "empBatchEnrollConsecutiveAddNew";
-					filterEndSign = "filterEndSign";
-					int start = filter.indexOf(empBatchEnrollConsecutiveAddNew);
-					int end = filter.indexOf(filterEndSign) + filterEndSign.length();
-					String partFilterStr = filter.substring(start, end);
-					String partFilterParam = partFilterStr.substring(empBatchEnrollConsecutiveAddNew.length(),
-							partFilterStr.indexOf(filterEndSign));
-					String[] partFilterParamArr = partFilterParam.split(",");
-					String partFilterStrAfterTranfer = "";
-					if (partFilterParamArr.length == 2) {
-						String bizManageTypeId = partFilterParamArr[0];
-						String manageHrOrgID = partFilterParamArr[1];
-						partFilterStrAfterTranfer = "adminOrgUnit.id in (select FAdminOrgID from T_HR_AdminOrgBURelation where fbizManagetypeId='"
-								+ bizManageTypeId + "' and FManageHrOrgID = '" + manageHrOrgID + "' and fstate = 1)";
-					}
-
-					filter = filter.replace(partFilterStr, partFilterStrAfterTranfer);
-					modelMap.put("filter", filter);
-				}
-			}
-		}
-
-		return super.getListDataAction(request, response, modelMap);
-	}
-	
-	
-	
-}
+
+    private static Logger logger = Logger.getLogger(PositionAdminRangeF7HandlerEx.class);
+    Context ctx = SHRContext.getInstance().getContext();
+
+    public String getListDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+            throws SHRWebException {
+        String modelFilter = (String) modelMap.get("filter");
+        if (StringUtils.isEmpty(modelFilter)) {
+            String filter = request.getParameter("filter");
+            String personId = filter.substring(filter.indexOf("idRanFromPluralityDel") + "idRanFromPluralityDel".length());
+            logger.error("filter ----" + filter);
+            logger.error("personId-----" + personId);
+            if (null != filter) {
+                String empBatchEnrollConsecutiveAddNew;
+                String filterEndSign;
+                if (filter.indexOf("idRanFromPluralityAdd") != -1) {
+                    empBatchEnrollConsecutiveAddNew = filter.substring(0, filter.indexOf("idRanFromPluralityAdd"));
+                    filterEndSign = filter
+                            .substring(filter.indexOf("idRanFromPluralityAdd") + "idRanFromPluralityAdd".length());
+                    if (!StringUtils.isEmpty(filterEndSign)) {
+
+                        filter = empBatchEnrollConsecutiveAddNew
+                                + " id not in (select fpositionid from T_HR_EmpOrgRelation t where t.fpersonid='"
+                                + filterEndSign + "' and t.fleffdt = {2199-12-31}  and t.FISSYSTEM = 1)";
+                    } else {
+                        filter = empBatchEnrollConsecutiveAddNew;
+                    }
+                    modelMap.put("filter", filter);
+                }
+
+                if (filter.indexOf("idRanFromPluralityDel") != -1) {
+                    ////202503 日期更改
+                    Date curDate = new Date();
+                    String dateStr = DateTimeUtils.format(curDate, "yyyy-MM-dd");
+
+                    empBatchEnrollConsecutiveAddNew = filter.substring(0, filter.indexOf("idRanFromPluralityDel"));
+                    filterEndSign = filter
+                            .substring(filter.indexOf("idRanFromPluralityDel") + "idRanFromPluralityDel".length());
+                    filter = empBatchEnrollConsecutiveAddNew
+                            + " id in (select fpositionid from T_HR_EmpOrgRelation t where t.fpersonid='"
+                            + filterEndSign
+                            + "' and t.fleffdt >= {" + dateStr + "}  and t.fassigntype=0 and t.fisInner = 1 and t.FActionID not in ('jpoAAAH/03nmaL7Z','V2vNOLaKRuGuv9/HNB5laOZovtk='))";
+                    modelMap.put("filter", filter);
+                }
+
+                if (filter.indexOf("idRanFromPositionHierarchy") != -1) {
+                    empBatchEnrollConsecutiveAddNew = filter.substring(0, filter.indexOf("idRanFromPositionHierarchy"));
+                    filterEndSign = filter.substring(
+                            filter.indexOf("idRanFromPositionHierarchy") + "idRanFromPositionHierarchy".length());
+                    filter = empBatchEnrollConsecutiveAddNew
+                            + " id in (select fchildid from T_ORG_PositionHierarchy where FHierarchyID = '"
+                            + filterEndSign + "')";
+                    modelMap.put("filter", filter);
+                }
+
+                if (filter.indexOf("F7query") != -1) {
+                    filter = filter.replace("F7query", "select");
+                    modelMap.put("filter", filter);
+                }
+
+                if (filter.indexOf("=''") != -1) {
+                    filter = filter.replace("=''", " is not null");
+                    modelMap.put("filter", filter);
+                }
+
+                if (filter.indexOf("empBatchEnrollConsecutiveAddNew") != -1) {
+                    empBatchEnrollConsecutiveAddNew = "empBatchEnrollConsecutiveAddNew";
+                    filterEndSign = "filterEndSign";
+                    int start = filter.indexOf(empBatchEnrollConsecutiveAddNew);
+                    int end = filter.indexOf(filterEndSign) + filterEndSign.length();
+                    String partFilterStr = filter.substring(start, end);
+                    String partFilterParam = partFilterStr.substring(empBatchEnrollConsecutiveAddNew.length(),
+                            partFilterStr.indexOf(filterEndSign));
+                    String[] partFilterParamArr = partFilterParam.split(",");
+                    String partFilterStrAfterTranfer = "";
+                    if (partFilterParamArr.length == 2) {
+                        String bizManageTypeId = partFilterParamArr[0];
+                        String manageHrOrgID = partFilterParamArr[1];
+                        partFilterStrAfterTranfer = "adminOrgUnit.id in (select FAdminOrgID from T_HR_AdminOrgBURelation where fbizManagetypeId='"
+                                + bizManageTypeId + "' and FManageHrOrgID = '" + manageHrOrgID + "' and fstate = 1)";
+                    }
+
+                    filter = filter.replace(partFilterStr, partFilterStrAfterTranfer);
+                    modelMap.put("filter", filter);
+                }
+            }
+
+            this.prepareQueryList(request, response, modelMap);
+            long start = 0L;
+            long end = 0L;
+            if (logger.isDebugEnabled()) {
+                start = (new Date()).getTime();
+            }
+            GridDataEntity gridDataEntity = this.getGridRequestData(request, response, modelMap);
+            if (logger.isDebugEnabled()) {
+                end = (new Date()).getTime();
+                logger.debug(MessageFormat.format("handler: {0}, get list data, cost: {1}", this.getClass().getName(), end - start));
+            }
+            this.afterGetListData(request, response, gridDataEntity);
+            this.doFieldPermFilter(gridDataEntity);
+            try {
+                //新增开始结束数据
+                List<Map<String, Object>> rows = gridDataEntity.getRows();
+                for (Map<String, Object> map : rows) {
+                    String positionNumber = (String) map.get("number");
+                    String effdeAndLeffdeSql = getEffdeAndLeffdeSql(personId, positionNumber);
+                    logger.error("effdeAndLeffdeSql" + effdeAndLeffdeSql);
+                    IRowSet rowSet = DbUtil.executeQuery(ctx, effdeAndLeffdeSql);
+                    if (rowSet.next()) {
+                        map.put("EmpPosOrgRelation.EFFDT", rowSet.getString("effdt"));
+                        map.put("EmpPosOrgRelation.LEFFDT", rowSet.getString("leffdt"));
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+                throw new RuntimeException(e);
+            }
+            JSONUtils.writeJson(response, gridDataEntity);
+        }
+        return null;
+    }
+
+    public String getEffdeAndLeffdeSql(String personId, String positionNumber) {
+        StringBuilder sb = new StringBuilder();
+        sb.append("select ").append("\n");
+        sb.append("porgerelation.feffdt as effdt ,").append("\n");
+        sb.append("porgerelation.fleffdt as leffdt ").append("\n");
+        sb.append("from T_HR_EMPORGRELATION porgerelation").append("\n");
+        sb.append("left join T_ORG_Position position on porgerelation.FPOSITIONID= position.fid").append("\n");
+        sb.append(" where position.fnumber='" + positionNumber + "' ").append("\n");
+        sb.append("and fpersonid = '" + personId + "' ").append("\n");
+        sb.append("order by porgerelation.feffdt desc").append("\n");
+        return sb.toString();
+    }
+
+}

+ 220 - 0
GDYSL/websrc/com/kingdee/shr/affair/web/handler/hrman/EmpEnrollBizBillHrManEditHandlerEx.java

@@ -3,6 +3,7 @@ package com.kingdee.shr.affair.web.handler.hrman;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.sql.SQLException;
+import java.text.MessageFormat;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -15,23 +16,56 @@ import org.springframework.ui.ModelMap;
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
+import com.kingdee.bos.metadata.entity.EntityViewInfo;
+import com.kingdee.bos.metadata.entity.FilterInfo;
+import com.kingdee.bos.metadata.entity.FilterItemInfo;
+import com.kingdee.bos.metadata.entity.SelectorItemCollection;
+import com.kingdee.bos.metadata.entity.SelectorItemInfo;
+import com.kingdee.bos.util.BOSUuid;
+import com.kingdee.eas.basedata.org.AdminOrgUnitInfo;
+import com.kingdee.eas.basedata.org.HROrgUnitInfo;
+import com.kingdee.eas.basedata.person.PersonCollection;
+import com.kingdee.eas.basedata.person.PersonFactory;
+import com.kingdee.eas.basedata.person.PersonInfo;
 import com.kingdee.eas.common.EASBizException;
 import com.kingdee.eas.framework.CoreBaseInfo;
 import com.kingdee.eas.hr.affair.EmpEnrollBizBillEntryCollection;
 import com.kingdee.eas.hr.affair.EmpEnrollBizBillEntryInfo;
 import com.kingdee.eas.hr.affair.EmpEnrollBizBillFactory;
 import com.kingdee.eas.hr.affair.EmpEnrollBizBillInfo;
+import com.kingdee.eas.hr.base.EmpPosOrgRelationException;
+import com.kingdee.eas.hr.base.EmpPosOrgRelationInfo;
+import com.kingdee.eas.hr.base.EnrollAgainCodingEnum;
 import com.kingdee.eas.hr.base.HRBillStateEnum;
 import com.kingdee.eas.hr.base.HRBizDefineFactory;
 import com.kingdee.eas.hr.base.HRBizDefineInfo;
+import com.kingdee.eas.hr.base.VariationReasonCollection;
+import com.kingdee.eas.hr.base.VariationReasonFactory;
 import com.kingdee.eas.hr.base.util.HRUtilExtend;
+import com.kingdee.eas.hr.emp.IPersonOtherInfo;
+import com.kingdee.eas.hr.emp.IPersonPhoto;
+import com.kingdee.eas.hr.emp.PersonOtherInfoCollection;
+import com.kingdee.eas.hr.emp.PersonOtherInfoFactory;
+import com.kingdee.eas.hr.emp.PersonPhotoCollection;
+import com.kingdee.eas.hr.emp.PersonPhotoFactory;
+import com.kingdee.eas.hr.emp.PersonPhotoInfo;
+import com.kingdee.eas.hr.emp.app.util.SHREmpOptEmpOrgRelationTool;
 import com.kingdee.eas.util.app.DbUtil;
 import com.kingdee.jdbc.rowset.IRowSet;
 import com.kingdee.shr.affair.web.handler.util.EmployeeUtil;
 import com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException;
 import com.kingdee.shr.base.syssetting.context.SHRContext;
 import com.kingdee.shr.base.syssetting.exception.SHRWebException;
+import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
+import com.kingdee.shr.base.syssetting.ml.SHRWebResource;
 import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
+import com.kingdee.shr.preentry.PreEntryCollection;
+import com.kingdee.shr.preentry.PreEntryFactory;
+import com.kingdee.shr.preentry.PreEntryInfo;
+import com.kingdee.shr.preentry.PreEntryPersonInfo;
+import com.kingdee.eas.hr.base.HRBizDefineTypeEnum;
+import com.kingdee.eas.hr.base.util.HRParamUtil;
+
 
 /**
  * 入职单Handler扩展
@@ -293,4 +327,190 @@ public class EmpEnrollBizBillHrManEditHandlerEx extends EmpEnrollBizBillHrManEdi
 		modelMap.put("userName", "");
 		return null;
 	}
+	
+	
+	//******************************************重新getPreEntryInitDataAction方法****************************20250504
+	public void getPreEntryInitDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+			throws BOSException, SHRWebException {
+		String billId = "";
+		if (request.getParameter("billId") != null && !request.getParameter("billId").equals("")) {
+			billId = request.getParameter("billId");
+		}
+
+		PreEntryInfo preEntryInfo = new PreEntryInfo();
+		StringBuffer sql = new StringBuffer();
+		sql.append("select *,talent.*").append(",position.id,position.name").append(",hrOrgUnit.id,hrOrgUnit.name").append(",empType.id,empType.name")
+				.append(",adminOrg.id,adminOrg.name").append(",enrollSource.id,enrollSource.name,enrollSource.number")
+				.append(",talent.folk.id,talent.folk.name,talent.zodiac.id,talent.zodiac.name,talent.constellation.id,talent.constellation.name")
+				.append(",sourceBillType").append(" where id = '").append(billId).append("'");
+		PreEntryCollection coll = PreEntryFactory.getRemoteInstance().getPreEntryCollection(sql.toString());
+		String tempid;
+		if (coll.size() > 0) {
+			preEntryInfo = coll.get(0);
+			if (preEntryInfo.getEnrollSource() != null && preEntryInfo.getEnrollSource().getNumber() != null) {
+				VariationReasonCollection vrColl = VariationReasonFactory.getRemoteInstance()
+						.getVariationReasonCollection("select id,name,number where number='"
+								+ preEntryInfo.getEnrollSource().getNumber() + "'");
+				if (vrColl.size() > 0) {
+					preEntryInfo.put("enrollSource", vrColl.get(0));
+				}
+			}
+
+			try {
+				this.assemblePreEntryEnrollAgainInfo(preEntryInfo.getTalent(), preEntryInfo.getHrOrgUnit(), modelMap);
+			} catch (EASBizException var16) {
+				var16.printStackTrace();
+				throw new ShrWebBizException(var16.getMessage(), var16);
+			}
+
+			if (preEntryInfo.getTalent() != null && preEntryInfo.getTalent().getPerson() != null
+					&& preEntryInfo.getTalent().getPerson().getId() != null) {
+				IPersonPhoto iPersonPhoto = PersonPhotoFactory.getRemoteInstance();
+				PersonPhotoCollection phcoll = iPersonPhoto.getPersonPhotoCollection(
+						"where person = '" + preEntryInfo.getTalent().getPerson().getId().toString() + "'");
+				if (phcoll.size() > 0) {
+					tempid = request.getParameter("tempId");
+					PersonPhotoInfo personPhotoInfo = phcoll.get(0);
+					PersonPhotoInfo addPhoto = new PersonPhotoInfo();
+					PersonInfo pInfo = new PersonInfo();
+					pInfo.setId(BOSUuid.read(tempid));
+					addPhoto.setPerson(pInfo);
+					addPhoto.setImageDataSource(personPhotoInfo.getImageDataSource());
+					addPhoto.setImageData(personPhotoInfo.getImageData());
+					addPhoto.setSourceImageHeight(personPhotoInfo.getSourceImageHeight());
+					addPhoto.setSourceImageWidth(personPhotoInfo.getSourceImageWidth());
+					addPhoto.setImageContentType(personPhotoInfo.getImageContentType());
+
+					try {
+						iPersonPhoto.addnew(addPhoto);
+					} catch (EASBizException var15) {
+						var15.printStackTrace();
+						throw new ShrWebBizException(var15.getMessage(), var15);
+					}
+				}
+			}
+		}
+
+		AdminOrgUnitInfo adminOrg = preEntryInfo.getAdminOrg();
+		HROrgUnitInfo hrOrgUnit = preEntryInfo.getHrOrgUnit();
+		tempid = request.getParameter("uipk");
+		if (!"com.kingdee.eas.hr.affair.app.team.EmpEnrollBizBill.form".equals(tempid)) {
+			this.checkAdminOrgUnitDataPermission(request, adminOrg.getId().toString());
+		}
+
+		this.checkHROrgUnitDataPermission(request, hrOrgUnit.getId().toString());
+		modelMap.put("preEntryInfo", preEntryInfo);
+		JSONUtils.writeJson(response, modelMap);
+	}
+	
+	
+	private void assemblePreEntryEnrollAgainInfo(PreEntryPersonInfo preEntryPerson, HROrgUnitInfo hrOrg,
+			ModelMap modelMap) throws BOSException, EASBizException {
+		if (preEntryPerson != null) {
+			EntityViewInfo viewInfo = new EntityViewInfo();
+			FilterInfo filter = new FilterInfo();
+			if (!StringUtils.isEmpty(preEntryPerson.getPassportNO())) {
+				filter.getFilterItems().add(new FilterItemInfo("passportNo", preEntryPerson.getPassportNO()));
+			}
+
+			if (!StringUtils.isEmpty(preEntryPerson.getIdCardNO())) {
+				String maskStr = "#0 or #1";
+				if (filter.getFilterItems().size() > 0) {
+					maskStr = "#0 or #1 or #2";
+				}
+
+				filter.getFilterItems().add(new FilterItemInfo("idCardNO", preEntryPerson.getIdCardNO().toUpperCase()));
+				filter.getFilterItems().add(new FilterItemInfo("idCardNO", preEntryPerson.getIdCardNO()));
+				filter.setMaskString(maskStr);
+			}
+
+			if (filter.getFilterItems().size() > 0) {
+				viewInfo.setFilter(filter);
+				SelectorItemCollection selector = new SelectorItemCollection();
+				selector.add(new SelectorItemInfo("id"));
+				selector.add(new SelectorItemInfo("number"));
+				selector.add(new SelectorItemInfo("employeeType.id"));
+				selector.add(new SelectorItemInfo("employeeType.isInCount"));
+				viewInfo.setSelector(selector);
+				PersonCollection pColl = PersonFactory.getRemoteInstance().getPersonCollection(viewInfo);
+				if (pColl.size() > 0) {
+					PersonInfo pInfo = pColl.get(0);
+					if (!pInfo.getEmployeeType().isIsInCount()) {
+						String personId = pInfo.getId().toString();
+						Context ctx = SHRContext.getInstance().getContext();
+						EmpPosOrgRelationInfo empPosOrgInfo = SHREmpOptEmpOrgRelationTool
+								.getCurrntMainEmpOrgRelationInfo(ctx, personId);
+						if (empPosOrgInfo == null) {
+							modelMap.put("errorMsg", (new EmpPosOrgRelationException(
+									EmpPosOrgRelationException.PERSON_NO_EMPPOSRELATION_ENROLL)).getMessage());
+						} else {
+							HRBizDefineInfo actionInfo = empPosOrgInfo.getAction();
+							if (this.judgeActionCanEnrollAgain(actionInfo)) {
+								Map<String, Object> personOldInfo = this.fillPersonBaseInfoData(ctx, preEntryPerson,
+										pInfo, empPosOrgInfo, hrOrg);
+								modelMap.put("personOldInfo", personOldInfo);
+								modelMap.put("personExist", "true");
+							}
+						}
+					}
+				}
+			}
+
+		}
+	}
+	
+	
+	
+	private boolean judgeActionCanEnrollAgain(HRBizDefineInfo actionInfo) {
+		return !HRBizDefineTypeEnum.ENROLL.equals(actionInfo.getBizDefineType())
+				&& !HRBizDefineTypeEnum.ENROLLAGAIN.equals(actionInfo.getBizDefineType())
+				&& !HRBizDefineTypeEnum.EMPHIRE.equals(actionInfo.getBizDefineType())
+				&& !HRBizDefineTypeEnum.FLUCTUACTION.equals(actionInfo.getBizDefineType())
+				&& !HRBizDefineTypeEnum.REINVITE.equals(actionInfo.getBizDefineType());
+	}
+	
+	
+	private Map<String, Object> fillPersonBaseInfoData(Context ctx, PreEntryPersonInfo preEntryPerson,
+			PersonInfo personInfo, EmpPosOrgRelationInfo empPosOrgInfo, HROrgUnitInfo hrOrg)
+			throws BOSException, EASBizException {
+		Map<String, Object> personOldInfo = new HashMap();
+		personOldInfo.put("empId", personInfo.getId().toString());
+		personOldInfo.put("empNumber", personInfo.getNumber());
+		personOldInfo.put("oldEmpType", personInfo.getEmployeeType().getId().toString());
+		EnrollAgainCodingEnum codingEnum = EnrollAgainCodingEnum.getEnum(Integer.parseInt((String) HRParamUtil
+				.getParamByKey(ctx, hrOrg == null ? null : hrOrg.getId().toString(), "ENROLL_AGAIN_CODING_RULE")));
+		personOldInfo.put("useOldNumber", codingEnum.getValue());
+		if (empPosOrgInfo != null) {
+			personOldInfo.put("oldPersonDepId", empPosOrgInfo.getAdminOrg().getId().toString());
+			personOldInfo.put("oldPersonPosId", empPosOrgInfo.getPosition().getId().toString());
+		}
+
+		IPersonOtherInfo iPersonOtherInfo = PersonOtherInfoFactory.getLocalInstance(ctx);
+		PersonOtherInfoCollection personOtherInfoCollection = iPersonOtherInfo
+				.getPersonOtherInfoCollection("where person = '" + personInfo.getId().toString() + "'");
+		if (personOtherInfoCollection.size() > 0) {
+			personOldInfo.put("jobStartDate", personOtherInfoCollection.get(0).getJobStartDate());
+		}
+
+		String msg = SHRWebResource.getString("com.kingdee.eas.hr.affair.EnrollResource", "personEnrollAgainNumber");
+		if (hrOrg != null) {
+			Object[] params;
+			if (hrOrg != null && EnrollAgainCodingEnum.USE_NEW_NUMBER.equals(codingEnum)) {
+				params = new Object[]{personInfo.getNumber(), preEntryPerson.getName(), hrOrg.getName(),
+						EnrollAgainCodingEnum.USE_NEW_NUMBER.getAlias()};
+				msg = MessageFormat.format(msg, params);
+			} else {
+				params = new Object[]{personInfo.getNumber(), preEntryPerson.getName(), hrOrg.getName(),
+						EnrollAgainCodingEnum.USE_OLD_NUMBER.getAlias()};
+				msg = MessageFormat.format(msg, params);
+			}
+
+			personOldInfo.put("personNumberMsg", msg);
+		}
+
+		return personOldInfo;
+	}
+	//******************************************重新getPreEntryInitDataAction方法****************************20250504********完毕
+	
+	
 }

+ 101 - 0
GDYSL/websrc/com/kingdee/shr/affair/web/handler/hrman/PluralityDelBizBillHrManEditHandlerEx.java

@@ -0,0 +1,101 @@
+package com.kingdee.shr.affair.web.handler.hrman;
+
+import com.kingdee.bos.BOSException;
+import com.kingdee.bos.metadata.entity.*;
+import com.kingdee.eas.basedata.org.AdminOrgUnitInfo;
+import com.kingdee.eas.basedata.org.PositionInfo;
+import com.kingdee.eas.common.EASBizException;
+import com.kingdee.eas.hr.base.EmpPosOrgRelationCollection;
+import com.kingdee.eas.hr.base.EmpPosOrgRelationFactory;
+import com.kingdee.eas.hr.base.EmpPosOrgRelationInfo;
+import com.kingdee.shr.base.syssetting.exception.SHRWebException;
+import com.kingdee.util.StringUtils;
+import org.springframework.ui.ModelMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author qingwu
+ * @date 2025/4/10
+ * @apiNote 员工兼职终止(专员)
+ */
+public class PluralityDelBizBillHrManEditHandlerEx extends PluralityDelBizBillHrManEditHandler {
+    /**
+     * 选择兼职职位 带出兼职部门
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @return
+     * @throws SHRWebException
+     * @throws EASBizException
+     * @throws BOSException
+     */
+    public String getPluralityPositionDataExAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException, EASBizException, BOSException {
+        Map map = new HashMap();
+        int assignType = 1;
+        PositionInfo positionInfo = null;
+        AdminOrgUnitInfo adminOrgInfo = null;
+        AdminOrgUnitInfo companyInfo = null;
+        AdminOrgUnitInfo departmentInfo = null;
+        Date beginDate = null;
+        String positionId = request.getParameter("positionId");
+        String personId = request.getParameter("personId");
+        if (!StringUtils.isEmpty(positionId)) {
+            EntityViewInfo entityView = new EntityViewInfo();
+            SelectorItemCollection selectors = this.getEmpPosOrgRelSelectors();
+            FilterInfo filterInfo = new FilterInfo();
+            filterInfo.getFilterItems().add(new FilterItemInfo("assignType", 0));
+            filterInfo.getFilterItems().add(new FilterItemInfo("position.id", positionId));
+            filterInfo.getFilterItems().add(new FilterItemInfo("person.id", personId));
+            //filterInfo.getFilterItems().add(new FilterItemInfo("LEFFDT", HRUtil.getMaxEndDate(), CompareType.GREATER_EQUALS));
+            entityView.setSelector(selectors);
+            entityView.setFilter(filterInfo);
+            EmpPosOrgRelationCollection coll = EmpPosOrgRelationFactory.getRemoteInstance().getEmpPosOrgRelationCollection(entityView);
+            EmpPosOrgRelationInfo empPosOrgRelationInfo = null;
+            if (coll.size() > 0) {
+                empPosOrgRelationInfo = coll.get(0);
+                if (empPosOrgRelationInfo.getAssignType() != null && empPosOrgRelationInfo.getPosition() != null) {
+                    assignType = empPosOrgRelationInfo.getAssignType().getValue();
+                    positionInfo = empPosOrgRelationInfo.getPosition();
+                    adminOrgInfo = empPosOrgRelationInfo.getPosition().getAdminOrgUnit();
+                    companyInfo = empPosOrgRelationInfo.getPosition().getAdminOrgUnit().getCompany();
+                    departmentInfo = empPosOrgRelationInfo.getPosition().getAdminOrgUnit().getDepartment();
+                    beginDate = empPosOrgRelationInfo.getEFFDT();
+                }
+            }
+        }
+
+        map.put("assignType", assignType);
+        map.put("position", positionInfo);
+        map.put("adminOrgUnit", adminOrgInfo);
+        map.put("company", companyInfo);
+        map.put("department", departmentInfo);
+        map.put("beginDate", beginDate);
+        this.writeSuccessData(map);
+        return null;
+    }
+
+    private SelectorItemCollection getEmpPosOrgRelSelectors() {
+        SelectorItemCollection selectors = new SelectorItemCollection();
+        selectors.add(new SelectorItemInfo("position.id"));
+        selectors.add(new SelectorItemInfo("position.name"));
+        selectors.add(new SelectorItemInfo("position.number"));
+        selectors.add(new SelectorItemInfo("position.adminOrgUnit.id"));
+        selectors.add(new SelectorItemInfo("position.adminOrgUnit.name"));
+        selectors.add(new SelectorItemInfo("position.adminOrgUnit.displayName"));
+        selectors.add(new SelectorItemInfo("position.adminOrgUnit.company.id"));
+        selectors.add(new SelectorItemInfo("position.adminOrgUnit.company.name"));
+        selectors.add(new SelectorItemInfo("position.adminOrgUnit.company.displayName"));
+        selectors.add(new SelectorItemInfo("position.adminOrgUnit.department.id"));
+        selectors.add(new SelectorItemInfo("position.adminOrgUnit.department.name"));
+        selectors.add(new SelectorItemInfo("position.adminOrgUnit.department.displayName"));
+        selectors.add(new SelectorItemInfo("EFFDT"));
+        selectors.add(new SelectorItemInfo("assignType"));
+        return selectors;
+    }
+}

+ 76 - 75
GDYSL/websrc/com/kingdee/shr/ats/web/handler/AtsLeaveBillListHandlerEx.java

@@ -3,6 +3,7 @@ package com.kingdee.shr.ats.web.handler;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.log4j.Logger;
 import org.springframework.ui.ModelMap;
@@ -17,80 +18,80 @@ import com.kingdee.shr.ats.web.handler.util.AtsLeaveBillOperationUtil;
 import com.kingdee.shr.base.syssetting.context.SHRContext;
 import com.kingdee.shr.base.syssetting.exception.SHRWebException;
 
-public class AtsLeaveBillListHandlerEx extends AtsLeaveBillListHandler{
-	
-	private static Logger logger =
-	        Logger.getLogger("com.kingdee.shr.ats.web.handler.AtsLeaveBillListHandlerEx");
-	
-	/**
-	 * 提交工作流
-	 */
-	@Override
-	protected void doBeforeSubmitForWF(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model) {
-		// TODO 自动生成的方法存根
-		logger.info("AtsLeaveBillListHandlerEx.....doBeforeSubmitForWF...start");
-		super.doBeforeSubmitForWF(request, response, model);
-		try {
-			Context ctx = SHRContext.getInstance().getContext();
-			AtsLeaveBillInfo info=(AtsLeaveBillInfo)model;
-			AtsLeaveBillCollection atsCollection = AtsLeaveBillFactory.getLocalInstance(ctx).getAtsLeaveBillCollection(" where id='" + info.getId().toString() + "'");
-			if(atsCollection !=null && atsCollection.size()>0) {
-				for (int i = 0; i < atsCollection.size(); ++i) {
-					AtsLeaveBillInfo atsLeaveBillInfo = atsCollection.get(i);
-					logger.info("AtsLeaveBillListHandlerEx.....number..."+atsLeaveBillInfo.getNumber());
-					
-					logger.info("AtsLeaveBillListHandlerEx.....BillID..."+atsLeaveBillInfo.getId().toString());
-					//先删除拆分数据
-					String billFormatter = "('" + atsLeaveBillInfo.getId().toString() + "')";
-					AtsLeaveBillOperationUtil.deleteInfo(ctx, billFormatter);
-					//审批中的数据存入拆分表
-					AtsLeaveBillOperationUtil.saveInfo(ctx, atsLeaveBillInfo);
-				}
-			}
-		
-			logger.info("AtsLeaveBillListHandlerEx.....doBeforeSubmitForWF...end");
-		}catch(Exception e) {
-			
-		}
-	}
-	
-	
-	/**
-	 * 撤销方法
-	 */
-	@Override
-	public void abortBillAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws SHRWebException, EASBizException, BOSException {
-		// TODO 自动生成的方法存根
-		logger.info("AtsLeaveBillListHandlerEx.....abortBillAction...start");
-		super.abortBillAction(request, response, modelMap);
-		Context ctx = SHRContext.getInstance().getContext();
-		String billId = request.getParameter("billId");
-		if(StringUtils.isNotBlank(billId)) {
-			String billFormatter = "('" + billId.replaceAll(",", "','") + "')";
-			AtsLeaveBillOperationUtil.deleteInfo(ctx, billFormatter);
-		}
-		logger.info("AtsLeaveBillListHandlerEx.....abortBillAction...start");
-		
-	}
-	
-	/**
-	 * 反审核
-	 */
-	@Override
-	public void againstApproveAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws SHRWebException {
-		logger.info("AtsLeaveBillListHandlerEx.....againstApproveAction...start");
-		// TODO 自动生成的方法存根
-		super.againstApproveAction(request, response, modelMap);
-		
-		String billId = request.getParameter("billId");
-		Context ctx = SHRContext.getInstance().getContext();
-		if(StringUtils.isNotBlank(billId)) {
-			String billFormatter = "('" + billId.replaceAll(",", "','") + "')";
-			AtsLeaveBillOperationUtil.deleteInfo(ctx, billFormatter);
-		}
-	}	
-	
+public class AtsLeaveBillListHandlerEx extends AtsLeaveBillListHandler {
+
+    private static Logger logger =
+            Logger.getLogger("com.kingdee.shr.ats.web.handler.AtsLeaveBillListHandlerEx");
+
+    /**
+     * 提交工作流
+     */
+    @Override
+    protected void doBeforeSubmitForWF(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model) {
+        // TODO 自动生成的方法存根
+        logger.info("AtsLeaveBillListHandlerEx.....doBeforeSubmitForWF...start");
+        super.doBeforeSubmitForWF(request, response, model);
+        try {
+            Context ctx = SHRContext.getInstance().getContext();
+            AtsLeaveBillInfo info = (AtsLeaveBillInfo) model;
+            AtsLeaveBillCollection atsCollection = AtsLeaveBillFactory.getLocalInstance(ctx).getAtsLeaveBillCollection(" where id='" + info.getId().toString() + "'");
+            if (atsCollection != null && atsCollection.size() > 0) {
+                for (int i = 0; i < atsCollection.size(); ++i) {
+                    AtsLeaveBillInfo atsLeaveBillInfo = atsCollection.get(i);
+                    logger.info("AtsLeaveBillListHandlerEx.....number..." + atsLeaveBillInfo.getNumber());
+
+                    logger.info("AtsLeaveBillListHandlerEx.....BillID..." + atsLeaveBillInfo.getId().toString());
+                    //先删除拆分数据
+                    String billFormatter = "('" + atsLeaveBillInfo.getId().toString() + "')";
+                    AtsLeaveBillOperationUtil.deleteInfo(ctx, billFormatter);
+                    //审批中的数据存入拆分表
+                    AtsLeaveBillOperationUtil.saveInfo(ctx, atsLeaveBillInfo);
+                }
+            }
+
+            logger.info("AtsLeaveBillListHandlerEx.....doBeforeSubmitForWF...end");
+        } catch (Exception e) {
+
+        }
+    }
+
+
+    /**
+     * 撤销方法
+     */
+    @Override
+    public void abortBillAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+            throws SHRWebException, EASBizException, BOSException {
+        // TODO 自动生成的方法存根
+        logger.info("AtsLeaveBillListHandlerEx.....abortBillAction...start");
+        super.abortBillAction(request, response, modelMap);
+        Context ctx = SHRContext.getInstance().getContext();
+        String billId = request.getParameter("billId");
+        if (StringUtils.isNotBlank(billId)) {
+            String billFormatter = "('" + billId.replaceAll(",", "','") + "')";
+            AtsLeaveBillOperationUtil.deleteInfo(ctx, billFormatter);
+        }
+        logger.info("AtsLeaveBillListHandlerEx.....abortBillAction...start");
+
+    }
+
+    /**
+     * 反审核
+     */
+    @Override
+    public void againstApproveAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+            throws SHRWebException {
+        logger.info("AtsLeaveBillListHandlerEx.....againstApproveAction...start");
+        // TODO 自动生成的方法存根
+        super.againstApproveAction(request, response, modelMap);
+
+        String billId = request.getParameter("billId");
+        Context ctx = SHRContext.getInstance().getContext();
+        if (StringUtils.isNotBlank(billId)) {
+            String billFormatter = "('" + billId.replaceAll(",", "','") + "')";
+            AtsLeaveBillOperationUtil.deleteInfo(ctx, billFormatter);
+        }
+    }
+
 
 }

+ 52 - 52
GDYSL/websrc/com/kingdee/shr/base/syssetting/app/io/fileImport/DynamicModelHelper.java

@@ -60,32 +60,32 @@ public class DynamicModelHelper {
 	private SHRImportTypeEnum importTypeEnum = null;
 	private static Logger logger = Logger.getLogger(DynamicModelHelper.class);
 	private Map<String, String> importPropNameAndEntityPropMap = null;
-	private Map<String, com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo> entityInfoMap = null;
+	private Map<String, ImportEntityInfo> entityInfoMap = null;
 	private Map<String, ICoreBase> entityICoreBase = null;
 	private String mainEntityFullName = null;
 	private String mainEntityShortName = null;
 	private boolean multiImport;
-	private com.kingdee.shr.base.syssetting.app.io.fileImport.BaseRowInfo currentRow = null;
+	private BaseRowInfo currentRow = null;
 	private String currentBillid = null;
 
-	public DynamicModelHelper(String scheme, Context ctx, Map<String, com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo> columnMap, SHRImportTypeEnum importType) throws BOSException, EASBizException {
+	public DynamicModelHelper(String scheme, Context ctx, Map<String, BaseColumnInfo> columnMap, SHRImportTypeEnum importType) throws BOSException, EASBizException {
 		this.ctx = ctx;
 		this.scheme = scheme;
 		this.importPropNameAndEntityPropMap = new HashMap();
 		this.importTypeEnum = importType;
 		StructureConfigInfo main = StructureConfigConvertHelper.getMain(this.ctx, this.scheme);
 		if (main == null) {
-			throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "unable_get_primary_entity", this.ctx));
+			throw new ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "unable_get_primary_entity", this.ctx));
 		} else {
 			this.mainEntityFullName = main.getEntityName();
 			this.entityInfoMap = new HashMap();
-			Iterator<Entry<String, com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo>> iter = columnMap.entrySet().iterator();
+			Iterator<Entry<String, BaseColumnInfo>> iter = columnMap.entrySet().iterator();
 			this.multiImport = true;
-			com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo = null;
+			BaseColumnInfo columnInfo = null;
 			ArrayList temp = new ArrayList();
 
 			while(iter.hasNext()) {
-				columnInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo)((Entry)iter.next()).getValue();
+				columnInfo = (BaseColumnInfo)((Entry)iter.next()).getValue();
 				if (!this.handleColumnInfo(columnInfo)) {
 					temp.add(columnInfo);
 				}
@@ -94,14 +94,14 @@ public class DynamicModelHelper {
 			Iterator tempIter = temp.iterator();
 
 			while(tempIter.hasNext()) {
-				columnInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo)tempIter.next();
+				columnInfo = (BaseColumnInfo)tempIter.next();
 				this.handleColumnInfo(columnInfo);
 			}
 
 		}
 	}
 
-	private boolean handleColumnInfo(com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo) throws EASBizException, BOSException {
+	private boolean handleColumnInfo(BaseColumnInfo columnInfo) throws EASBizException, BOSException {
 		return this.handleColumnInfo(columnInfo, true);
 	}
 
@@ -109,9 +109,9 @@ public class DynamicModelHelper {
 		this.currentBillid = billId;
 	}
 
-	private boolean handleColumnInfo(com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo, boolean convertColumn) throws EASBizException, BOSException {
+	private boolean handleColumnInfo(BaseColumnInfo columnInfo, boolean convertColumn) throws EASBizException, BOSException {
 		String shortName = this.getEntityShortNameByPropName(columnInfo.getPropName());
-		com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo importEntityInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo)this.entityInfoMap.get(shortName);
+		ImportEntityInfo importEntityInfo = (ImportEntityInfo)this.entityInfoMap.get(shortName);
 		if (importEntityInfo == null) {
 			if (convertColumn) {
 				columnInfo = this.convertColumnInfo(columnInfo);
@@ -138,7 +138,7 @@ public class DynamicModelHelper {
 		return true;
 	}
 
-	private com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo convertColumnInfo(com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo) throws BOSException {
+	private BaseColumnInfo convertColumnInfo(BaseColumnInfo columnInfo) throws BOSException {
 		String propName = columnInfo.getPropName();
 		if (logger.isDebugEnabled()) {
 			logger.debug("debugxg1" + propName);
@@ -167,7 +167,7 @@ public class DynamicModelHelper {
 					}
 
 					String parentShortName = parentConfigInfo.getClientNumber().toUpperCase();
-					com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo tempColumnInfo = new com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo(parentShortName + "." + tempRelationName, columnInfo.getName(), columnInfo.isNecessary(), 0, (String)null);
+					BaseColumnInfo tempColumnInfo = new BaseColumnInfo(parentShortName + "." + tempRelationName, columnInfo.getName(), columnInfo.isNecessary(), 0, (String)null);
 					tempColumnInfo.setColumnIndex(columnInfo.getColumnIndex());
 					return tempColumnInfo;
 				}
@@ -180,7 +180,7 @@ public class DynamicModelHelper {
 		return strs.length > 0 ? strs[0].toUpperCase() : propName.toUpperCase();
 	}
 
-	private com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo getImportEntityInfo(String propName) throws BOSException, EASBizException {
+	private ImportEntityInfo getImportEntityInfo(String propName) throws BOSException, EASBizException {
 		QueryConfigFieldInfo fieldInfo = StructureConfigConvertHelper.getQueryFieldByKey(this.ctx, this.scheme, propName);
 		StructureConfigInfo configInfo = null;
 		String tempRelationName;
@@ -197,7 +197,7 @@ public class DynamicModelHelper {
 			}
 		}
 
-		com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo = new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo();
+		ImportEntityInfo entityInfo = new ImportEntityInfo();
 		if (configInfo == null) {
 			configInfo = fieldInfo.getFactField().getStructureConfig();
 			configInfo = StructureConfigConvertHelper.getStructureConfigByID(this.ctx, configInfo.getId().toString(), configInfo.getScheme().getNumber());
@@ -245,7 +245,7 @@ public class DynamicModelHelper {
 		return tempRelationName;
 	}
 
-	public void setRow(com.kingdee.shr.base.syssetting.app.io.fileImport.BaseRowInfo row) {
+	public void setRow(BaseRowInfo row) {
 		this.currentRow = row;
 	}
 
@@ -262,26 +262,26 @@ public class DynamicModelHelper {
 				coreBase = (ICoreBase)BOSObjectFactory.createCommonBOSObject(this.ctx, entityPK);
 				this.entityICoreBase.put(entityName, coreBase);
 			} catch (BOSException var5) {
-				throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "get_api_instance_error", this.ctx), var5);
+				throw new ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "get_api_instance_error", this.ctx), var5);
 			}
 		}
 
 		return coreBase;
 	}
 
-	public DynamicModelInfo convertRowToDynamicModel(com.kingdee.shr.base.syssetting.app.io.fileImport.BaseRowInfo row) throws com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException {
+	public DynamicModelInfo convertRowToDynamicModel(BaseRowInfo row) throws ImportException {
 		this.currentRow = row;
 		return this.convertRowToDynamicModel();
 	}
 
 	public DynamicModelInfo convertRowToDynamicModel() {
 		if (this.currentRow == null) {
-			throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "row_data_isempty", this.ctx));
+			throw new ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "row_data_isempty", this.ctx));
 		} else {
-			com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo mainEntityInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo)this.entityInfoMap.get(this.mainEntityShortName);
+			ImportEntityInfo mainEntityInfo = (ImportEntityInfo)this.entityInfoMap.get(this.mainEntityShortName);
 			CoreBaseInfo mainCoreBaseInfo = this.loadMainEntityInfo(mainEntityInfo);
 			if (mainCoreBaseInfo == null) {
-				throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "entity_not_found", this.ctx));
+				throw new ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "entity_not_found", this.ctx));
 			} else {
 				this.currentBillid = mainCoreBaseInfo.getId().toString();
 				DynamicModelInfo dyModelInfo = new DynamicModelInfo();
@@ -290,11 +290,11 @@ public class DynamicModelHelper {
 				valueMap.put(mainEntityInfo.getEntityFullName(), mainCoreBaseInfo);
 				hasData.put(mainEntityInfo.getEntityFullName(), true);
 				dyModelInfo.setValueMap(valueMap);
-				Iterator<Entry<String, com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo>> iter = this.entityInfoMap.entrySet().iterator();
-				com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo = null;
+				Iterator<Entry<String, ImportEntityInfo>> iter = this.entityInfoMap.entrySet().iterator();
+				ImportEntityInfo entityInfo = null;
 
 				while(iter.hasNext()) {
-					entityInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo)((Entry)iter.next()).getValue();
+					entityInfo = (ImportEntityInfo)((Entry)iter.next()).getValue();
 					if (!valueMap.containsKey(entityInfo.getEntityFullName())) {
 						CoreBaseInfo baseInfo = this.loadEntityInfo(entityInfo);
 						// start xiaoxin 员工证件信息新增导入时,不根据证件类型做唯一校验更新数据,进入新增操作
@@ -325,8 +325,8 @@ public class DynamicModelHelper {
 	private void verifyOrCreateBlankBaseInfo(DynamicModelInfo dyModelInfo, HashMap<String, Boolean> hasData) {
 		HashMap<String, IObjectValue> valueMap = dyModelInfo.getValueMap();
 		StringBuffer errorMsg = new StringBuffer();
-		Iterator<Entry<String, com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo>> iter = this.entityInfoMap.entrySet().iterator();
-		com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo = null;
+		Iterator<Entry<String, ImportEntityInfo>> iter = this.entityInfoMap.entrySet().iterator();
+		ImportEntityInfo entityInfo = null;
 		IObjectValue baseInfo = null;
 		String tempEntityFullName = null;
 
@@ -337,13 +337,13 @@ public class DynamicModelHelper {
 					if (!iter.hasNext()) {
 						emsg = errorMsg.toString();
 						if (!StringUtils.isEmpty(emsg)) {
-							throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(emsg);
+							throw new ImportException(emsg);
 						}
 
 						return;
 					}
 
-					entityInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo)((Entry)iter.next()).getValue();
+					entityInfo = (ImportEntityInfo)((Entry)iter.next()).getValue();
 				} while(entityInfo.isMainEntity());
 
 				tempEntityFullName = entityInfo.getEntityFullName();
@@ -394,10 +394,10 @@ public class DynamicModelHelper {
 	private void assignInfoSaveValue(DynamicModelInfo dyModelInfo, HashMap<String, Boolean> hasData) {
 		HashMap<String, IObjectValue> tempObjMap = dyModelInfo.getValueMap();
 		LinkedHashMap<String, IObjectValue> saveModelMap = new LinkedHashMap();
-		Iterator<Entry<String, com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo>> iter = this.entityInfoMap.entrySet().iterator();
-		com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo = null;
+		Iterator<Entry<String, ImportEntityInfo>> iter = this.entityInfoMap.entrySet().iterator();
+		ImportEntityInfo entityInfo = null;
 		IObjectValue coreBase = null;
-		com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo tempColumnInfo = null;
+		BaseColumnInfo tempColumnInfo = null;
 		Object tempValue = null;
 		boolean hasUpdate = this.importTypeEnum.getValue() == 40 || this.importTypeEnum.getValue() == 30;
 
@@ -415,18 +415,18 @@ public class DynamicModelHelper {
 					return;
 				}
 
-				entityInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo)((Entry)iter.next()).getValue();
+				entityInfo = (ImportEntityInfo)((Entry)iter.next()).getValue();
 				has = (Boolean)hasData.get(entityInfo.getEntityFullName());
 			} while(has != null && !has);
 
 			coreBase = (IObjectValue)tempObjMap.get(entityInfo.getEntityFullName());
 			boolean tempBoolean = hasUpdate && coreBase.get(coreBase.getPKField()) != null;
-			List<com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo> columnInfoList = entityInfo.getImportColumn();
+			List<BaseColumnInfo> columnInfoList = entityInfo.getImportColumn();
 			boolean isPersonEntity = this.isPersonEntity(entityInfo.getEntityFullName());
 			int i = 0;
 
 			for(int size = columnInfoList.size(); i < size; ++i) {
-				tempColumnInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo)columnInfoList.get(i);
+				tempColumnInfo = (BaseColumnInfo)columnInfoList.get(i);
 				if (!isPersonEntity || !"person.name".equals(tempColumnInfo.getPropName()) && !"person.number".equals(tempColumnInfo.getPropName())) {
 					String valString;
 					if (tempBoolean) {
@@ -435,7 +435,7 @@ public class DynamicModelHelper {
 							continue;
 						}
 
-						if (com.kingdee.shr.base.syssetting.app.io.fileImport.ValueCovertUtils.UPDATE_BLANK_FLAG.equals(valString)) {
+						if (ValueCovertUtils.UPDATE_BLANK_FLAG.equals(valString)) {
 							tempValue = null;
 						}
 					}
@@ -461,13 +461,13 @@ public class DynamicModelHelper {
 		}
 	}
 
-	private CoreBaseInfo loadEntityInfo(com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo) {
+	private CoreBaseInfo loadEntityInfo(ImportEntityInfo entityInfo) {
 		FilterInfo filter = null;
 		SelectorItemCollection coll = this.getLoadSelectorColl(entityInfo.getImportColumn());
 		if (coll.size() == 0) {
 			return null;
 		} else {
-			List<com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo> keyColumn = entityInfo.getKeyColumn();
+			List<BaseColumnInfo> keyColumn = entityInfo.getKeyColumn();
 			if (keyColumn != null && keyColumn.size() > 0) {
 				filter = new FilterInfo();
 				this.getLoadFilterInfo(filter, keyColumn);
@@ -496,25 +496,25 @@ public class DynamicModelHelper {
 					} else if (size == 1) {
 						return coreBaseColl.get(0);
 					} else {
-						throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_entity_fails_mult", this.ctx), entityInfo.entityAliasName));
+						throw new ImportException(MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_entity_fails_mult", this.ctx), entityInfo.entityAliasName));
 					}
 				} catch (BOSException var9) {
-					throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_existing_entity_fails", this.ctx), entityInfo.entityAliasName), var9);
+					throw new ImportException(MessageFormat.format(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_existing_entity_fails", this.ctx), entityInfo.entityAliasName), var9);
 				}
 			}
 		}
 	}
 
-	private CoreBaseInfo loadMainEntityInfo(com.kingdee.shr.base.syssetting.app.io.fileImport.ImportEntityInfo entityInfo) {
+	private CoreBaseInfo loadMainEntityInfo(ImportEntityInfo entityInfo) {
 		if (!StringUtils.isEmpty(this.currentBillid)) {
 			try {
 				ICoreBase iCoreBase = this.getEntityInterface(entityInfo.getEntityFullName());
 				CoreBaseInfo coreBase = iCoreBase.getValue(new ObjectUuidPK(this.currentBillid));
 				return coreBase;
 			} catch (EASBizException var13) {
-				throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(var13.getMessage(), var13);
+				throw new ImportException(var13.getMessage(), var13);
 			} catch (BOSException var14) {
-				throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_existing_entity_error", this.ctx), var14);
+				throw new ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_existing_entity_error", this.ctx), var14);
 			}
 		} else {
 			FilterInfo filter = null;
@@ -538,7 +538,7 @@ public class DynamicModelHelper {
 					CoreBaseCollection coreBaseColl = iCoreBase.getCollection(view);
 					int size = coreBaseColl.size();
 					if (size == 0) {
-						throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "unable_load_entity", this.ctx, new Object[]{entityInfo.getEntityAliasName()}));
+						throw new ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "unable_load_entity", this.ctx, new Object[]{entityInfo.getEntityAliasName()}));
 					} else if (size == 1) {
 						return coreBaseColl.get(0);
 					} else {
@@ -556,11 +556,11 @@ public class DynamicModelHelper {
 						if (count == 1) {
 							return base;
 						} else {
-							throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_mult_entity", this.ctx, new Object[]{entityInfo.getEntityAliasName()}));
+							throw new ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_mult_entity", this.ctx, new Object[]{entityInfo.getEntityAliasName()}));
 						}
 					}
 				} catch (BOSException var15) {
-					throw new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_existing_entity_fails", this.ctx, new Object[]{entityInfo.getEntityAliasName()}), var15);
+					throw new ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "load_existing_entity_fails", this.ctx, new Object[]{entityInfo.getEntityAliasName()}), var15);
 				}
 			} else {
 				return this.loadEntityInfo(entityInfo);
@@ -572,12 +572,12 @@ public class DynamicModelHelper {
 		return "com.kingdee.eas.basedata.person.app.Person".equals(entityFullName);
 	}
 
-	private FilterInfo getLoadFilterInfo(FilterInfo filter, List<com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo> keyColumn) {
-		com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo = null;
+	private FilterInfo getLoadFilterInfo(FilterInfo filter, List<BaseColumnInfo> keyColumn) {
+		BaseColumnInfo columnInfo = null;
 		int i = 0;
 
 		for(int size = keyColumn.size(); i < size; ++i) {
-			columnInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo)keyColumn.get(i);
+			columnInfo = (BaseColumnInfo)keyColumn.get(i);
 			String key = columnInfo.getPropName();
 			String entityPropName = this.getEntityPropName(key);
 			Object value = this.currentRow.getValueOfObjectByIndex(columnInfo.getColumnIndex());
@@ -606,13 +606,13 @@ public class DynamicModelHelper {
 		return filter;
 	}
 
-	private SelectorItemCollection getLoadSelectorColl(List<com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo> columnList) {
-		com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo columnInfo = null;
+	private SelectorItemCollection getLoadSelectorColl(List<BaseColumnInfo> columnList) {
+		BaseColumnInfo columnInfo = null;
 		SelectorItemCollection coll = new SelectorItemCollection();
 		int i = 0;
 
 		for(int size = columnList.size(); i < size; ++i) {
-			columnInfo = (com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo)columnList.get(i);
+			columnInfo = (BaseColumnInfo)columnList.get(i);
 			String key = columnInfo.getPropName();
 			String entityPropName = this.getEntityPropName(key);
 			String value = this.currentRow.getValueOfStringByIndex(columnInfo.getColumnIndex());
@@ -663,7 +663,7 @@ public class DynamicModelHelper {
 
 			return info;
 		} catch (Exception var10) {
-			com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException importException = new com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "creat_object_fails", this.ctx), var10);
+			ImportException importException = new ImportException(SHRWebResource.getString("com.kingdee.shr.base.syssetting.CommonserviceResource", "creat_object_fails", this.ctx), var10);
 			throw importException;
 		}
 	}

+ 6 - 6
GDYSL/websrc/com/kingdee/shr/compensation/web/handler/integrate/CmpWorkFlowPersonalDetailHandlerEx.java

@@ -24,7 +24,7 @@ public class CmpWorkFlowPersonalDetailHandlerEx extends CmpWorkFlowPersonalDetai
 			logger.error("进入二开导出方法");
             request.setAttribute("title", this.getExportTitle(request));
             List<Map<String, Object>> colModel = this.getGirdColModel(request);
-            com.kingdee.shr.compensation.web.handler.integrate.FileExportHelper excel = new com.kingdee.shr.compensation.web.handler.integrate.FileExportHelper();
+            FileExportHelper excel = new FileExportHelper();
             String exportSql = this.getExportSql(request);
             String[] queryMode = excel.doAssembleQueryMode(request, colModel);
             boolean isPdfExport = this.isPdfExport(request);
@@ -39,7 +39,7 @@ public class CmpWorkFlowPersonalDetailHandlerEx extends CmpWorkFlowPersonalDetai
 
         return null;
 	}
-	
+
 	private List<Map<String, Object>> getGirdColModel(HttpServletRequest request) throws SHRWebException {
         HttpSession session = request.getSession();
         List<Map<String, Object>> colModel = (List)session.getAttribute(this.getModelCacheKey());
@@ -50,19 +50,19 @@ public class CmpWorkFlowPersonalDetailHandlerEx extends CmpWorkFlowPersonalDetai
 
         return colModel;
     }
-	
+
 	private String getModelCacheKey() throws SHRWebException {
         return this.getExprotSqlCacheKey() + "grid_model";
     }
-	
+
 	private String getExprotSqlCacheKey() throws SHRWebException {
         return this.getCacheKeyPrefix() + "export_sql";
     }
-	
+
 	private String getExportSql(HttpServletRequest request) throws SHRWebException {
         return this.getExportSqlCache(request);
     }
-	
+
 	private boolean isPdfExport(HttpServletRequest request) {
         String suffix = request.getParameter("suffix");
         return "pdf".equalsIgnoreCase(suffix);

+ 913 - 914
GDYSL/websrc/com/kingdee/shr/customer/gtiit/handler/BatchSubmitShemeBillMySubmissionEditHandlerEx.java

@@ -64,927 +64,926 @@ import com.kingdee.bos.metadata.query.util.CompareType;
  * @author xiaoxin
  */
 public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitShemeBillMySubmissionEditHandler {
-	private static Logger logger =
-			Logger.getLogger("com.kingdee.shr.customer.gtiit.handler.BatchSubmitShemeBillMySubmissionEditHandlerEx");
-
-	private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-
-	/**
-	 * 获取开始结束时间
-	 *
-	 * @param request
-	 * @param response
-	 * @param modelMap
-	 * @throws BOSException
-	 * @throws SHRWebException
-	 */
-	public void getDateTimeAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws BOSException, SHRWebException {
-		String personId = request.getParameter("personId");
-		String type = request.getParameter("type");
-		String adminOrgId = request.getParameter("adminOrgId");
-		String positionId = request.getParameter("positionId");
-		String hourlywage = request.getParameter("hourlywage");
-		Context ctx = SHRContext.getInstance().getContext();
-		if (StringUtils.isEmpty(personId) || StringUtils.isEmpty(type)) {
-			throw new ShrWebBizException("员工编码或任职类型不能为空!!");
-		}
-		//返回信息
-		Map map = new HashMap();
-		//员工信息
-		IPerson iPerson = PersonFactory.getLocalInstance(ctx);
-		IDynamicObject iDynamicObject = DynamicObjectFactory.getLocalInstance(ctx);
-		try {
-			PersonInfo personInfo = iPerson.getPersonInfo(new ObjectUuidPK(personId));
-			//主要任职
-			if (type.equals("Full")) {
-				//EE23D375=全职或兼职
-				DataBaseInfo ftorptInfo = (DataBaseInfo) personInfo.get("ftorpt");
-				if (ftorptInfo == null) {
-					throw new ShrWebBizException("请在员工信息维护全职或兼职字段!!");
-				}
-				IObjectValue ftorpt = iDynamicObject.getValue(BOSObjectType.create("EE23D375"), new ObjectUuidPK(ftorptInfo.getId()));
-				//入职日期
-				Date hireDate = personInfo.getHireDate();
-				map.put("startDate", sdf.format(hireDate));
-				if (ftorpt.get("number").equals("FULL")) {
-					//全职  获取入职日期以及合同信息最新的结束日期   D8595360=合同信息
-					//查询条件
-					FilterInfo filterInfo = new FilterInfo();
-					FilterItemCollection filterItems = filterInfo.getFilterItems();
-					filterItems.add(new FilterItemInfo("person", personId));
-					//排序
-					SorterItemCollection sc = new SorterItemCollection();
-					SorterItemInfo sorterItem = new SorterItemInfo("ExpiredDate");
-					sorterItem.setSortType(SortType.DESCEND);
-					sc.add(sorterItem);
-					//排序获取第一条最新的数据
-					EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, sc);
-					IObjectCollection collection = iDynamicObject.getCollection(BOSObjectType.create("D8595360"), entityViewInfo);
-					//结束时间
-					Date expiredDate = null;
-					if (collection.size() > 0) {
-						IObjectValue pcontractinfo = collection.getObject(0);
-						expiredDate = (Date) pcontractinfo.get("ExpiredDate");
-
-					}
-					map.put("endDate", expiredDate == null ? "" : sdf.format(expiredDate));
-				} else if (ftorpt.get("number").equals("PART")) {
-					//兼职  获取入职日期以及员工信息兼职类人员任职结束时间
-					Date jobEndTime = (Date) personInfo.get("jobEndTime");
-					map.put("endDate", jobEndTime == null ? "" : sdf.format(jobEndTime));
-				}
-			} else if (type.equals("Part")) {//兼职任职
-				if (StringUtils.isEmpty(adminOrgId) || StringUtils.isEmpty(positionId)) {
-					throw new ShrWebBizException("组织ID或职位ID不能为空!!");
-				}
-				//发薪档案任职分录
-				ICmpEmpORelation iCmpEmpORelation = CmpEmpORelationFactory.getLocalInstance(ctx);
-				FilterInfo filterInfo = new FilterInfo();
-				FilterItemCollection filterItems = filterInfo.getFilterItems();
-				filterItems.add(new FilterItemInfo("empOrgRelation.person", personInfo.getId().toString()));
-				filterItems.add(new FilterItemInfo("empOrgRelation.adminOrg", adminOrgId));
-				filterItems.add(new FilterItemInfo("empOrgRelation.position", positionId));
-				filterItems.add(new FilterItemInfo("empOrgRelation.hourlywage", StringUtils.isEmpty(hourlywage)? null : hourlywage ));
-				EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, null);
-				logger.error("发薪档案任职分录查询person:" +personInfo.getId().toString()+";adminOrg:" +adminOrgId +"; position:"+positionId +"; hourlywage:"+hourlywage );
-				
-				
-				CmpEmpORelationCollection cmpEmpORelationCollection = iCmpEmpORelation.getCmpEmpORelationCollection(entityViewInfo);
-				logger.error("查询到CmpEmpORelationCollection数量:" +cmpEmpORelationCollection.size());
-				 
-				if (cmpEmpORelationCollection.size() > 1) {
-					throw new ShrWebBizException("员工任职信息数据异常,请排查是否存在多条[人员、组织、职位、时薪]数据!!");
-				}
-				if(null != cmpEmpORelationCollection &&  cmpEmpORelationCollection.size() == 1 ) {
-					CmpEmpORelationInfo cmpEmpORelationInfo = cmpEmpORelationCollection.get(0);
-					//生效日期
-					Date effectDate = cmpEmpORelationInfo.getEffectDate();
-					//失效日期
-					Date leffectDate = cmpEmpORelationInfo.getLeffectDate();
-					map.put("startDate", sdf.format(effectDate));
-					map.put("endDate", sdf.format(leffectDate));
-				}
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw new ShrWebBizException(e);
-		}
-		JSONUtils.writeJson(response, map);
-	}
-
-
-	@Override
-	public String getEditGridColModelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws SHRWebException {
-		String submitSchemeId = request.getParameter("submitSchemeId");
-		if (StringUtils.isEmpty(submitSchemeId)) {
-			JSONUtils.writeJson(response, modelMap);
-			return null;
-		} else {
-			boolean dynamicColmunRequired = this.isDynamicColmunRequired(request);
-			Map<String, Object> params = Maps.newHashMap();
-			params.put("datasource", Integer.valueOf(request.getParameter("datasource")));
-			params.put("costTypeId", request.getParameter("costTypeId"));
-			params.put("dynamicColmunRequired", dynamicColmunRequired);
-			params.put("hrOrgUnitId", request.getParameter("hrOrgUnitId"));
-			Context ctx = SHRContext.getInstance().getContext();
-			CmpColumnModels cmpColumnModels = new BaseSubmitBillEntryGenerator().getEntryColumnModels(ctx, submitSchemeId, params);
-			modelMap.put("colNames", cmpColumnModels.getColNames());
-			modelMap.put("colModel", cmpColumnModels.getColModel());
-			modelMap.put("defaultSortname", (Object) null);
-
-			CalSubmitSchemeInfo schemeInfo;
-			try {
-				schemeInfo = CalSubmitSchemeFactory.getLocalInstance(ctx).getCalSubmitSchemeInfo(new ObjectUuidPK(submitSchemeId));
-			} catch (EASBizException var11) {
-				throw new ShrWebBizException(var11.getMessage(), var11);
-			} catch (BOSException var12) {
-				throw new SHRWebException(var12.getMessage(), var12);
-			}
-
-			modelMap.put("description", schemeInfo.getDescription());
-			JSONUtils.writeJson(response, modelMap);
-			return null;
-		}
-	}
-
-	@Override
-	protected void beforeSubmit(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model)
-			throws SHRWebException {
-		super.beforeSubmit(request, response, model);
-		Context ctx = SHRContext.getInstance().getContext();
-		BatchSubmitShemeBillInfo info = (BatchSubmitShemeBillInfo) model;
-		if (StringUtils.isNotBlank(info.getString("id"))) {
-			try {
-				info = BatchSubmitShemeBillFactory.getLocalInstance(ctx).getBatchSubmitShemeBillInfo(new ObjectUuidPK(info.getString("id")));
-			} catch (EASBizException e) {
-				e.printStackTrace();
-			} catch (BOSException e) {
-				e.printStackTrace();
-			}
-		}
-		String sql = "select cfistakecheck,CFIsCurrentDepart from T_HR_SCalSubmitScheme where fid = '" + info.getSubmitScheme().getId().toString() + "'";
-		//是否参与校验
-		boolean isPlanCheck = false;
-		try {
-			IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
-			while (iRowSet.next()) {
-				if (StringUtils.equals("1", iRowSet.getString("cfistakecheck"))) {
-					isPlanCheck = true;
-				}
-			}
-		} catch (BOSException e) {
-			e.printStackTrace();
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-		checkPosition(info);
-		checkDateOverlap(info);
-		if (isPlanCheck) {
-			checkPositionCount(info);
-			checkHours(info);
-		}
-	}
-
-	/**
-	 * 校验职位不允许提交法定节假日那天
-	 *
-	 * @param info
-	 * @throws ShrWebBizException
-	 */
-	public void checkPosition(BatchSubmitShemeBillInfo info) throws ShrWebBizException {
-		Context ctx = SHRContext.getInstance().getContext();
-		String billId = info.getId().toString();
-		String sql = "select b.FNAME_L1 from T_HR_SchemeBillEntry a left join T_ORG_Position b on a.FPOSITIONID = b.FID "
-				+ "where a.FBILLID = '" + billId + "' "
-				+ "and b.FNAME_L1 = (SELECT fname_l2 FROM T_HR_SHRRSVITEM0 where fstate = '1' and FNUMBER = '1007') "
-				+ "and EXISTS (SELECT d.CFWORKMULTIPLE FROM T_HR_ATS_LegalHoliday c "
-				+ "left join T_HR_ATS_LegalHolidayItem d on c.fid = d.FGROUPID where c.FSTATE = '1' "
-				+ "and d.CFWORKMULTIPLE = '3' and d.FSTARTDATE <= a.feffectdate and d.FENDDATE >= a.feffectdate)";
-		logger.error("查询职位对应日期是否在法定节假日SQL:" + sql);
-		try {
-			boolean flag = false;
-			String positionName = "";
-			IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
-			while (rowSet.next()) {
-				flag = true;
-				positionName = rowSet.getString("FNAME_L1");
-			}
-			if (flag) {
-				throw new ShrWebBizException("This position (" + positionName + ") does not allow submission of documents that occur on statutory holidays");
-			}
-		} catch (SQLException e) {
-			e.printStackTrace();
-		} catch (BOSException e) {
-			e.printStackTrace();
-		}
-	}
-
-	/**
-	 * 校验该员工本月的开始时间和结束时间有没有重叠
-	 *
-	 * @param info
-	 * @throws ShrWebBizException
-	 */
-	public void checkDateOverlap(BatchSubmitShemeBillInfo info) throws ShrWebBizException {
-		Context ctx = SHRContext.getInstance().getContext();
-		String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
-		BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
-		String billId = info.getId().toString();
-		logger.error("单据ID:" + billId);
-		Date effectDate = entryColl.get(0).getEffectDate();
-		Calendar calendar = Calendar.getInstance();
-		calendar.setTime(effectDate);
-		calendar.set(Calendar.DAY_OF_MONTH, 1);
-		Date startDate = calendar.getTime();
-		calendar.add(Calendar.MONTH, 1);
-		Date endDate = calendar.getTime();
-		String startDateStr = DateTimeUtils.dateFormat(startDate, "yyyy-MM-dd");
-		String endDateStr = DateTimeUtils.dateFormat(endDate, "yyyy-MM-dd");
-
-		boolean flag = false;
-		String sql = "SELECT a.*,b.billNumber FROM T_HR_SchemeBillEntry a , "
-				+ "(SELECT a.fnumber billNumber,b.* FROM T_HR_SBatchSubmitShemeBill a "
-				+ "left join T_HR_SchemeBillEntry b on a.fid = b.fbillid "
-				+ "where a.FBILLSTATE in ('1','2','3') and b.FPERSONID = '" + personId + "' "
-				+ "and b.FEFFECTDATE >= '" + startDateStr + "' and b.FEFFECTDATE < '" + endDateStr + "' and a.FDATASOURCE = '1') b "
-				+ "where a.FBILLID = '" + billId + "' and a.cfstarttime < b.CFENDTIME "
-				+ "and a.cfendtime > b.CFSTARTTIME";
-		logger.error("查询是否有时间段重叠数据SQL:" + sql);
-		try {
-			IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
-			String billNumber = "";
-			while (rowSet.next()) {
-				billNumber = rowSet.getString("billNumber");
-				flag = true;
-			}
-			if (flag) {
-				throw new ShrWebBizException("The start and end times overlap with another document (" + billNumber + ")");
-			}
-		} catch (BOSException e1) {
-			e1.printStackTrace();
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-
-	}
-
-	/**
-	 * 校验员工每月提交工时不能超过最大工时数
-	 *
-	 * @param info
-	 * @throws ShrWebBizException
-	 */
-	public void checkHours(BatchSubmitShemeBillInfo info) throws ShrWebBizException {
-		Context ctx = SHRContext.getInstance().getContext();
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-		String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
-		BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
-		//上月工时数
-		BigDecimal lastHours = BigDecimal.ZERO;
-		//当月工时数
-		BigDecimal currentHour = BigDecimal.ZERO;
-		Calendar calendar = Calendar.getInstance();
-		int currentYear = calendar.get(Calendar.YEAR);
-		int currentMonth = calendar.get(Calendar.MONTH);
-		for (int i = 0; i < entryColl.size(); i++) {
-			BatchSubmitShemeBillEntryInfo entryInfo = entryColl.get(i);
-			Date effectDate = entryInfo.getEffectDate();
-			calendar.setTime(effectDate);
-			if (currentYear == calendar.get(Calendar.YEAR) && currentMonth == calendar.get(Calendar.MONTH)) {
-				currentHour = currentHour.add(entryInfo.getBigDecimal("totalWorkHours"));
-			} else {
-				lastHours = lastHours.add(entryInfo.getBigDecimal("totalWorkHours"));
-			}
-		}
-
-		try {
-			BigDecimal maxHour = BigDecimal.ZERO;
-			String paramSql = "SELECT FNUMBER,fname_l2 name FROM T_HR_SHRRSVITEM0 where fstate = '1' and FNUMBER = '1003'";
-			IRowSet paramRow = DbUtil.executeQuery(ctx, paramSql);
-			while (paramRow.next()) {
-				//最大工时数
-				if (paramRow.getString("FNUMBER").equals("1003")) {
-					maxHour = paramRow.getObject("name") == null ? BigDecimal.ZERO : paramRow.getBigDecimal("name");
-				}
-			}
-
-			if (lastHours.compareTo(BigDecimal.ZERO) != 0) {
-				calendar = Calendar.getInstance();
-				calendar.set(Calendar.DAY_OF_MONTH, 1);
-				Date endDate = calendar.getTime();
-				calendar.add(Calendar.MONTH, -1);
-				Date startDate = calendar.getTime();
-				BigDecimal totalHour = BigDecimal.ZERO;
-				String hourSql = "SELECT sum(b.cftotalworkhours) as totalHour FROM T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where  b.fpersonid='" + personId + "' and b.feffectdate>='" + sdf.format(startDate) + "' and b.feffectdate<'" + sdf.format(endDate) + "' and a.FBILLSTATE in ('1','2','3')";
-				IRowSet iRowSet = DbUtil.executeQuery(ctx, hourSql);
-				while (iRowSet.next()) {
-					totalHour = iRowSet.getObject("totalHour") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("totalHour");
-				}
-				totalHour = totalHour.add(lastHours);
-
-				BigDecimal adjustHour = BigDecimal.ZERO;
-				//获取调整工时数
-				String adjustSql = "/*dialect*/SELECT cfadjustinghours FROM CT_MP_Ptworkinghours where fpersonid='" + personId + "' and DATE_TRUNC('month', cfeffectivedate)<='" + sdf.format(startDate) + "' and cfenddate>='" + sdf.format(startDate) + "' order by FLastUpdateTime desc limit 1";
-				logger.error("获取调整工时SQL:" + adjustSql);
-				IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
-				while (adjustRow.next()) {
-					adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
-				}
-				if (totalHour.compareTo(maxHour.add(adjustHour)) > 0) {
-					throw new ShrWebBizException("The total reported working hours for the previous month cannot exceed the maximum number of working hours");
-				}
-			}
-
-			if (currentHour.compareTo(BigDecimal.ZERO) != 0) {
-				calendar = Calendar.getInstance();
-				calendar.set(Calendar.DAY_OF_MONTH, 1);
-				Date startDate = calendar.getTime();
-				calendar.add(Calendar.MONTH, 1);
-				Date endDate = calendar.getTime();
-				BigDecimal totalHour = BigDecimal.ZERO;
-				String hourSql = "SELECT sum(b.cftotalworkhours) as totalHour FROM T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where  b.fpersonid='" + personId + "' and b.feffectdate>='" + sdf.format(startDate) + "' and b.feffectdate<'" + sdf.format(endDate) + "' and a.FBILLSTATE in ('1','2','3')";
-				IRowSet iRowSet = DbUtil.executeQuery(ctx, hourSql);
-				while (iRowSet.next()) {
-					totalHour = iRowSet.getObject("totalHour") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("totalHour");
-				}
-				totalHour = totalHour.add(lastHours);
-
-				BigDecimal adjustHour = BigDecimal.ZERO;
-				//获取调整工时数
-				String adjustSql = "/*dialect*/SELECT cfadjustinghours FROM CT_MP_Ptworkinghours where fpersonid='" + personId + "' and DATE_TRUNC('month', cfeffectivedate)<='" + sdf.format(startDate) + "' and cfenddate>='" + sdf.format(startDate) + "' order by FLastUpdateTime desc limit 1";
-				logger.error("获取调整工时SQL:" + adjustSql);
-				IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
-				while (adjustRow.next()) {
-					adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
-				}
-				if (totalHour.compareTo(maxHour.add(adjustHour)) > 0) {
-					throw new ShrWebBizException("The total reported working hours for the current month cannot exceed the maximum number of working hours");
-				}
-			}
-		} catch (BOSException e) {
-			e.printStackTrace();
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-	}
-
-	/**
-	 * 校验员工该职位每个月只能提交一次
-	 *
-	 * @param info
-	 * @throws ShrWebBizException
-	 */
-	public void checkPositionCount(BatchSubmitShemeBillInfo info) throws ShrWebBizException {
-		Context ctx = SHRContext.getInstance().getContext();
-		String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
-		BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
-		//是否有上月发生日期
-		boolean isLastMonth = false;
-		//是否有当月发生日期
-		boolean isCurrentMonth = false;
-		String positionId = "";
-		String superiorId = "";
-		Calendar calendar = Calendar.getInstance();
-		int currentYear = calendar.get(Calendar.YEAR);
-		int currentMonth = calendar.get(Calendar.MONTH);
-		for (int i = 0; i < entryColl.size(); i++) {
-			BatchSubmitShemeBillEntryInfo entryInfo = entryColl.get(i);
-			Date effectDate = entryInfo.getEffectDate();
-			calendar.setTime(effectDate);
-			if (currentYear == calendar.get(Calendar.YEAR) && currentMonth == calendar.get(Calendar.MONTH)) {
-				isCurrentMonth = true;
-			} else {
-				isLastMonth = true;
-			}
-			positionId = entryInfo.getPosition().getId().toString();
-			superiorId = entryInfo.getString("superiorId");
-		}
-		logger.error("职位ID:" + positionId + ", 直接上级ID:" + superiorId);
-
-		try {
-			if (isLastMonth) {
-				calendar = Calendar.getInstance();
-				calendar.set(Calendar.DAY_OF_MONTH, 1);
-				String endDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
-				calendar.add(Calendar.MONTH, -1);
-				String startDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
-
-				int count = 0;
-				String sql = "select count(1) count from T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where b.FPERSONID  = '" + personId + "' and b.FPOSITIONID = '" + positionId + "' and b.CFSuperiorID = '" + superiorId + "' and a.fbillstate in ('1','2','3') and a.fdatasource = '1' and b.FEFFECTDATE >= '" + startDate + "' and b.FEFFECTDATE < '" + endDate + "'";
-				logger.error("查询员工该职位当月提交次数SQL:" + sql);
-				IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
-				while (iRowSet.next()) {
-					count = iRowSet.getInt("count");
-				}
-				logger.error("员工该职位当月提交次数:" + count);
-				if (count > 0) {
-					throw new ShrWebBizException("The employee submits the position once within a month");
-				}
-			}
-
-			if (isCurrentMonth) {
-				calendar = Calendar.getInstance();
-				calendar.set(Calendar.DAY_OF_MONTH, 1);
-				String startDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
-				calendar.add(Calendar.MONTH, 1);
-				String endDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
-
-				int count = 0;
-				String sql = "select count(1) count from T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where b.FPERSONID  = '" + personId + "' and b.FPOSITIONID = '" + positionId + "' and b.CFSuperiorID = '" + superiorId + "' and a.fbillstate in ('1','2','3') and a.fdatasource = '1' and b.FEFFECTDATE >= '" + startDate + "' and b.FEFFECTDATE < '" + endDate + "'";
-				logger.error("查询员工该职位当月提交次数SQL:" + sql);
-				IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
-				while (iRowSet.next()) {
-					count = iRowSet.getInt("count");
-				}
-				logger.error("员工该职位当月提交次数:" + count);
-				if (count > 0) {
-					throw new ShrWebBizException("The employee submits the position once within a month");
-				}
-			}
-		} catch (BOSException e) {
-			e.printStackTrace();
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-	}
-
-	/**
-	 * 校验XX号之后不允许提交
-	 *
-	 * @param request
-	 * @param response
-	 * @param modelMap
-	 * @throws SHRWebException
-	 */
-	public void checkSumbitDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws SHRWebException {
-		Context ctx = SHRContext.getInstance().getContext();
-		int day = 0;
-		Calendar calendar = Calendar.getInstance();
-		int thisDay = calendar.get(Calendar.DAY_OF_MONTH);
-		String resultMessage = "";
-		try {
-			String paramSql = "SELECT FNUMBER,fname_l2 name FROM T_HR_SHRRSVITEM0 where fstate = '1' and FNUMBER = '1004'";
-			IRowSet paramRow = DbUtil.executeQuery(ctx, paramSql);
-			while (paramRow.next()) {
-				if (paramRow.getString("FNUMBER").equals("1004")) {
-					day = paramRow.getObject("name") == null ? 0 : paramRow.getInt("name");
-				}
-			}
-			if (day != 0 && thisDay > day) {
-				resultMessage = "It is not allowed to submit the previous month's work hours after the " + day + "th of each month";
-			}
-		} catch (BOSException e) {
-			e.printStackTrace();
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-		modelMap.put("resultMessage", resultMessage);
-		JSONUtils.writeJson(response, modelMap);
-	}
-
-
-	/**
-	 * 根据人员id获取它的直属上级id和时薪
-	 *
-	 * @param request
-	 * @param response
-	 * @param modelMap
-	 * @return
-	 * @throws SHRWebException
-	 */
-	public String getPersonCareerDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws SHRWebException {
-		Context ctx = SHRContext.getInstance().getContext();
-		String personId = request.getParameter("personId");
-		String parentId = "";
-		String workHour = "";
-		String sql = "select re.FPERSONID,rl.cflinemanagernameI linemanagername,rl.cfhourlywage from (SELECT FPERSONID,max(FEFFDT) as maxDate FROM T_HR_EmpOrgRelation where fassignType = '1' group by  FPERSONID) as re  left join T_HR_EmpOrgRelation rl on re.fpersonid = rl.fpersonid and re.maxDate = rl.feffdt and rl.fassignType = '1' where re.fpersonid='" + personId + "'";
-		try {
-			IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
-			while (iRowSet.next()) {
-				parentId = iRowSet.getString("linemanagername");
-				workHour = iRowSet.getString("cfhourlywage");
-			}
-		} catch (BOSException e) {
-			e.printStackTrace();
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-		modelMap.put("parentId", parentId);
-		modelMap.put("workHour", workHour);
-		JSONUtils.writeJson(response, modelMap);
-		return null;
-	}
-
-	/**
-	 * 获取当前员工的最新入职日期
-	 *
-	 * @param request
-	 * @param response
-	 * @param modelMap
-	 * @return
-	 * @throws SHRWebException
-	 */
-	public String getInductionDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws SHRWebException {
-		Context ctx = SHRContext.getInstance().getContext();
-		String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
-		String sql = "select b.fenterdate from (SELECT FPERSONID,max(FEFFDT) as maxDate FROM T_HR_EmpLaborRelationHis group by fpersonid) a left join T_HR_EmpLaborRelationHis b on a.fpersonid=b.fpersonid and a.maxdate=b.FEFFDT where a.fpersonid='" + personId + "'";
-		String enterDate = "";
-		try {
-			IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
-			while (iRowSet.next()) {
-				enterDate = iRowSet.getString("fenterdate");
-			}
-		} catch (BOSException e) {
-			e.printStackTrace();
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-		modelMap.put("enterDate", enterDate);
-		JSONUtils.writeJson(response, modelMap);
-		return null;
-	}
-
-	/**
-	 * 查询人员对应职位的最新的合同开始和结束日期
-	 *
-	 * @param request
-	 * @param response
-	 * @param modelMap
-	 * @throws SHRWebException
-	 */
-	public void getContractDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
-		//职位id
-		String positionId = request.getParameter("positionId");
-		Context ctx = SHRContext.getInstance().getContext();
-		String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
+    private static Logger logger =
+            Logger.getLogger("com.kingdee.shr.customer.gtiit.handler.BatchSubmitShemeBillMySubmissionEditHandlerEx");
+
+    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+
+    /**
+     * 获取开始结束时间
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws BOSException
+     * @throws SHRWebException
+     */
+    public void getDateTimeAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws BOSException, SHRWebException {
+        String personId = request.getParameter("personId");
+        String type = request.getParameter("type");
+        String adminOrgId = request.getParameter("adminOrgId");
+        String positionId = request.getParameter("positionId");
+        String hourlywage = request.getParameter("hourlywage");
+        Context ctx = SHRContext.getInstance().getContext();
+        if (StringUtils.isEmpty(personId) || StringUtils.isEmpty(type)) {
+            throw new ShrWebBizException("员工编码或任职类型不能为空!!");
+        }
+        //返回信息
+        Map map = new HashMap();
+        //员工信息
+        IPerson iPerson = PersonFactory.getLocalInstance(ctx);
+        IDynamicObject iDynamicObject = DynamicObjectFactory.getLocalInstance(ctx);
+        try {
+            PersonInfo personInfo = iPerson.getPersonInfo(new ObjectUuidPK(personId));
+            //主要任职
+            if (type.equals("Full")) {
+                //EE23D375=全职或兼职
+                DataBaseInfo ftorptInfo = (DataBaseInfo) personInfo.get("ftorpt");
+                if (ftorptInfo == null) {
+                    throw new ShrWebBizException("请在员工信息维护全职或兼职字段!!");
+                }
+                IObjectValue ftorpt = iDynamicObject.getValue(BOSObjectType.create("EE23D375"), new ObjectUuidPK(ftorptInfo.getId()));
+                //入职日期
+                Date hireDate = personInfo.getHireDate();
+                map.put("startDate", sdf.format(hireDate));
+                if (ftorpt.get("number").equals("FULL")) {
+                    //全职  获取入职日期以及合同信息最新的结束日期   D8595360=合同信息
+                    //查询条件
+                    FilterInfo filterInfo = new FilterInfo();
+                    FilterItemCollection filterItems = filterInfo.getFilterItems();
+                    filterItems.add(new FilterItemInfo("person", personId));
+                    //排序
+                    SorterItemCollection sc = new SorterItemCollection();
+                    SorterItemInfo sorterItem = new SorterItemInfo("ExpiredDate");
+                    sorterItem.setSortType(SortType.DESCEND);
+                    sc.add(sorterItem);
+                    //排序获取第一条最新的数据
+                    EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, sc);
+                    IObjectCollection collection = iDynamicObject.getCollection(BOSObjectType.create("D8595360"), entityViewInfo);
+                    //结束时间
+                    Date expiredDate = null;
+                    if (collection.size() > 0) {
+                        IObjectValue pcontractinfo = collection.getObject(0);
+                        expiredDate = (Date) pcontractinfo.get("ExpiredDate");
+
+                    }
+                    map.put("endDate", expiredDate == null ? "" : sdf.format(expiredDate));
+                } else if (ftorpt.get("number").equals("PART")) {
+                    //兼职  获取入职日期以及员工信息兼职类人员任职结束时间
+                    Date jobEndTime = (Date) personInfo.get("jobEndTime");
+                    map.put("endDate", jobEndTime == null ? "" : sdf.format(jobEndTime));
+                }
+            } else if (type.equals("Part")) {//兼职任职
+                if (StringUtils.isEmpty(adminOrgId) || StringUtils.isEmpty(positionId)) {
+                    throw new ShrWebBizException("组织ID或职位ID不能为空!!");
+                }
+                //发薪档案任职分录
+                ICmpEmpORelation iCmpEmpORelation = CmpEmpORelationFactory.getLocalInstance(ctx);
+                FilterInfo filterInfo = new FilterInfo();
+                FilterItemCollection filterItems = filterInfo.getFilterItems();
+                filterItems.add(new FilterItemInfo("empOrgRelation.person", personInfo.getId().toString()));
+                filterItems.add(new FilterItemInfo("empOrgRelation.adminOrg", adminOrgId));
+                filterItems.add(new FilterItemInfo("empOrgRelation.position", positionId));
+                filterItems.add(new FilterItemInfo("empOrgRelation.hourlywage", StringUtils.isEmpty(hourlywage) ? null : hourlywage));
+                EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, null);
+                logger.error("发薪档案任职分录查询person:" + personInfo.getId().toString() + ";adminOrg:" + adminOrgId + "; position:" + positionId + "; hourlywage:" + hourlywage);
+
+
+                CmpEmpORelationCollection cmpEmpORelationCollection = iCmpEmpORelation.getCmpEmpORelationCollection(entityViewInfo);
+                logger.error("查询到CmpEmpORelationCollection数量:" + cmpEmpORelationCollection.size());
+                if (cmpEmpORelationCollection.size() > 1) {
+                    throw new ShrWebBizException("员工任职信息数据异常,请排查是否存在多条[人员、组织、职位、时薪]数据!!");
+                }
+                if (null != cmpEmpORelationCollection && cmpEmpORelationCollection.size() == 1) {
+                    CmpEmpORelationInfo cmpEmpORelationInfo = cmpEmpORelationCollection.get(0);
+                    //生效日期
+                    Date effectDate = cmpEmpORelationInfo.getEffectDate();
+                    //失效日期
+                    Date leffectDate = cmpEmpORelationInfo.getLeffectDate();
+                    map.put("startDate", sdf.format(effectDate));
+                    map.put("endDate", sdf.format(leffectDate));
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new ShrWebBizException(e);
+        }
+        JSONUtils.writeJson(response, map);
+    }
+
+
+    @Override
+    public String getEditGridColModelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+            throws SHRWebException {
+        String submitSchemeId = request.getParameter("submitSchemeId");
+        if (StringUtils.isEmpty(submitSchemeId)) {
+            JSONUtils.writeJson(response, modelMap);
+            return null;
+        } else {
+            boolean dynamicColmunRequired = this.isDynamicColmunRequired(request);
+            Map<String, Object> params = Maps.newHashMap();
+            params.put("datasource", Integer.valueOf(request.getParameter("datasource")));
+            params.put("costTypeId", request.getParameter("costTypeId"));
+            params.put("dynamicColmunRequired", dynamicColmunRequired);
+            params.put("hrOrgUnitId", request.getParameter("hrOrgUnitId"));
+            Context ctx = SHRContext.getInstance().getContext();
+            CmpColumnModels cmpColumnModels = new BaseSubmitBillEntryGenerator().getEntryColumnModels(ctx, submitSchemeId, params);
+            modelMap.put("colNames", cmpColumnModels.getColNames());
+            modelMap.put("colModel", cmpColumnModels.getColModel());
+            modelMap.put("defaultSortname", (Object) null);
+
+            CalSubmitSchemeInfo schemeInfo;
+            try {
+                schemeInfo = CalSubmitSchemeFactory.getLocalInstance(ctx).getCalSubmitSchemeInfo(new ObjectUuidPK(submitSchemeId));
+            } catch (EASBizException var11) {
+                throw new ShrWebBizException(var11.getMessage(), var11);
+            } catch (BOSException var12) {
+                throw new SHRWebException(var12.getMessage(), var12);
+            }
+
+            modelMap.put("description", schemeInfo.getDescription());
+            JSONUtils.writeJson(response, modelMap);
+            return null;
+        }
+    }
+
+    @Override
+    protected void beforeSubmit(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model)
+            throws SHRWebException {
+        super.beforeSubmit(request, response, model);
+        Context ctx = SHRContext.getInstance().getContext();
+        BatchSubmitShemeBillInfo info = (BatchSubmitShemeBillInfo) model;
+        if (StringUtils.isNotBlank(info.getString("id"))) {
+            try {
+                info = BatchSubmitShemeBillFactory.getLocalInstance(ctx).getBatchSubmitShemeBillInfo(new ObjectUuidPK(info.getString("id")));
+            } catch (EASBizException e) {
+                e.printStackTrace();
+            } catch (BOSException e) {
+                e.printStackTrace();
+            }
+        }
+        String sql = "select cfistakecheck,CFIsCurrentDepart from T_HR_SCalSubmitScheme where fid = '" + info.getSubmitScheme().getId().toString() + "'";
+        //是否参与校验
+        boolean isPlanCheck = false;
+        try {
+            IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
+            while (iRowSet.next()) {
+                if (StringUtils.equals("1", iRowSet.getString("cfistakecheck"))) {
+                    isPlanCheck = true;
+                }
+            }
+        } catch (BOSException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        checkPosition(info);
+        checkDateOverlap(info);
+        if (isPlanCheck) {
+            checkPositionCount(info);
+            checkHours(info);
+        }
+    }
+
+    /**
+     * 校验职位不允许提交法定节假日那天
+     *
+     * @param info
+     * @throws ShrWebBizException
+     */
+    public void checkPosition(BatchSubmitShemeBillInfo info) throws ShrWebBizException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String billId = info.getId().toString();
+        String sql = "select b.FNAME_L1 from T_HR_SchemeBillEntry a left join T_ORG_Position b on a.FPOSITIONID = b.FID "
+                + "where a.FBILLID = '" + billId + "' "
+                + "and b.FNAME_L1 = (SELECT fname_l2 FROM T_HR_SHRRSVITEM0 where fstate = '1' and FNUMBER = '1007') "
+                + "and EXISTS (SELECT d.CFWORKMULTIPLE FROM T_HR_ATS_LegalHoliday c "
+                + "left join T_HR_ATS_LegalHolidayItem d on c.fid = d.FGROUPID where c.FSTATE = '1' "
+                + "and d.CFWORKMULTIPLE = '3' and d.FSTARTDATE <= a.feffectdate and d.FENDDATE >= a.feffectdate)";
+        logger.error("查询职位对应日期是否在法定节假日SQL:" + sql);
+        try {
+            boolean flag = false;
+            String positionName = "";
+            IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
+            while (rowSet.next()) {
+                flag = true;
+                positionName = rowSet.getString("FNAME_L1");
+            }
+            if (flag) {
+                throw new ShrWebBizException("This position (" + positionName + ") does not allow submission of documents that occur on statutory holidays");
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+        } catch (BOSException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 校验该员工本月的开始时间和结束时间有没有重叠
+     *
+     * @param info
+     * @throws ShrWebBizException
+     */
+    public void checkDateOverlap(BatchSubmitShemeBillInfo info) throws ShrWebBizException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
+        BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
+        String billId = info.getId().toString();
+        logger.error("单据ID:" + billId);
+        Date effectDate = entryColl.get(0).getEffectDate();
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(effectDate);
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        Date startDate = calendar.getTime();
+        calendar.add(Calendar.MONTH, 1);
+        Date endDate = calendar.getTime();
+        String startDateStr = DateTimeUtils.dateFormat(startDate, "yyyy-MM-dd");
+        String endDateStr = DateTimeUtils.dateFormat(endDate, "yyyy-MM-dd");
+
+        boolean flag = false;
+        String sql = "SELECT a.*,b.billNumber FROM T_HR_SchemeBillEntry a , "
+                + "(SELECT a.fnumber billNumber,b.* FROM T_HR_SBatchSubmitShemeBill a "
+                + "left join T_HR_SchemeBillEntry b on a.fid = b.fbillid "
+                + "where a.FBILLSTATE in ('1','2','3') and b.FPERSONID = '" + personId + "' "
+                + "and b.FEFFECTDATE >= '" + startDateStr + "' and b.FEFFECTDATE < '" + endDateStr + "' and a.FDATASOURCE = '1') b "
+                + "where a.FBILLID = '" + billId + "' and a.cfstarttime < b.CFENDTIME "
+                + "and a.cfendtime > b.CFSTARTTIME";
+        logger.error("查询是否有时间段重叠数据SQL:" + sql);
+        try {
+            IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
+            String billNumber = "";
+            while (rowSet.next()) {
+                billNumber = rowSet.getString("billNumber");
+                flag = true;
+            }
+            if (flag) {
+                throw new ShrWebBizException("The start and end times overlap with another document (" + billNumber + ")");
+            }
+        } catch (BOSException e1) {
+            e1.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    /**
+     * 校验员工每月提交工时不能超过最大工时数
+     *
+     * @param info
+     * @throws ShrWebBizException
+     */
+    public void checkHours(BatchSubmitShemeBillInfo info) throws ShrWebBizException {
+        Context ctx = SHRContext.getInstance().getContext();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
+        BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
+        //上月工时数
+        BigDecimal lastHours = BigDecimal.ZERO;
+        //当月工时数
+        BigDecimal currentHour = BigDecimal.ZERO;
+        Calendar calendar = Calendar.getInstance();
+        int currentYear = calendar.get(Calendar.YEAR);
+        int currentMonth = calendar.get(Calendar.MONTH);
+        for (int i = 0; i < entryColl.size(); i++) {
+            BatchSubmitShemeBillEntryInfo entryInfo = entryColl.get(i);
+            Date effectDate = entryInfo.getEffectDate();
+            calendar.setTime(effectDate);
+            if (currentYear == calendar.get(Calendar.YEAR) && currentMonth == calendar.get(Calendar.MONTH)) {
+                currentHour = currentHour.add(entryInfo.getBigDecimal("totalWorkHours"));
+            } else {
+                lastHours = lastHours.add(entryInfo.getBigDecimal("totalWorkHours"));
+            }
+        }
+
+        try {
+            BigDecimal maxHour = BigDecimal.ZERO;
+            String paramSql = "SELECT FNUMBER,fname_l2 name FROM T_HR_SHRRSVITEM0 where fstate = '1' and FNUMBER = '1003'";
+            IRowSet paramRow = DbUtil.executeQuery(ctx, paramSql);
+            while (paramRow.next()) {
+                //最大工时数
+                if (paramRow.getString("FNUMBER").equals("1003")) {
+                    maxHour = paramRow.getObject("name") == null ? BigDecimal.ZERO : paramRow.getBigDecimal("name");
+                }
+            }
+
+            if (lastHours.compareTo(BigDecimal.ZERO) != 0) {
+                calendar = Calendar.getInstance();
+                calendar.set(Calendar.DAY_OF_MONTH, 1);
+                Date endDate = calendar.getTime();
+                calendar.add(Calendar.MONTH, -1);
+                Date startDate = calendar.getTime();
+                BigDecimal totalHour = BigDecimal.ZERO;
+                String hourSql = "SELECT sum(b.cftotalworkhours) as totalHour FROM T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where  b.fpersonid='" + personId + "' and b.feffectdate>='" + sdf.format(startDate) + "' and b.feffectdate<'" + sdf.format(endDate) + "' and a.FBILLSTATE in ('1','2','3')";
+                IRowSet iRowSet = DbUtil.executeQuery(ctx, hourSql);
+                while (iRowSet.next()) {
+                    totalHour = iRowSet.getObject("totalHour") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("totalHour");
+                }
+                totalHour = totalHour.add(lastHours);
+
+                BigDecimal adjustHour = BigDecimal.ZERO;
+                //获取调整工时数
+                String adjustSql = "/*dialect*/SELECT cfadjustinghours FROM CT_MP_Ptworkinghours where fpersonid='" + personId + "' and DATE_TRUNC('month', cfeffectivedate)<='" + sdf.format(startDate) + "' and cfenddate>='" + sdf.format(startDate) + "' order by FLastUpdateTime desc limit 1";
+                logger.error("获取调整工时SQL:" + adjustSql);
+                IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
+                while (adjustRow.next()) {
+                    adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
+                }
+                if (totalHour.compareTo(maxHour.add(adjustHour)) > 0) {
+                    throw new ShrWebBizException("The total reported working hours for the previous month cannot exceed the maximum number of working hours");
+                }
+            }
+
+            if (currentHour.compareTo(BigDecimal.ZERO) != 0) {
+                calendar = Calendar.getInstance();
+                calendar.set(Calendar.DAY_OF_MONTH, 1);
+                Date startDate = calendar.getTime();
+                calendar.add(Calendar.MONTH, 1);
+                Date endDate = calendar.getTime();
+                BigDecimal totalHour = BigDecimal.ZERO;
+                String hourSql = "SELECT sum(b.cftotalworkhours) as totalHour FROM T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where  b.fpersonid='" + personId + "' and b.feffectdate>='" + sdf.format(startDate) + "' and b.feffectdate<'" + sdf.format(endDate) + "' and a.FBILLSTATE in ('1','2','3')";
+                IRowSet iRowSet = DbUtil.executeQuery(ctx, hourSql);
+                while (iRowSet.next()) {
+                    totalHour = iRowSet.getObject("totalHour") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("totalHour");
+                }
+                totalHour = totalHour.add(lastHours);
+
+                BigDecimal adjustHour = BigDecimal.ZERO;
+                //获取调整工时数
+                String adjustSql = "/*dialect*/SELECT cfadjustinghours FROM CT_MP_Ptworkinghours where fpersonid='" + personId + "' and DATE_TRUNC('month', cfeffectivedate)<='" + sdf.format(startDate) + "' and cfenddate>='" + sdf.format(startDate) + "' order by FLastUpdateTime desc limit 1";
+                logger.error("获取调整工时SQL:" + adjustSql);
+                IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
+                while (adjustRow.next()) {
+                    adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
+                }
+                if (totalHour.compareTo(maxHour.add(adjustHour)) > 0) {
+                    throw new ShrWebBizException("The total reported working hours for the current month cannot exceed the maximum number of working hours");
+                }
+            }
+        } catch (BOSException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 校验员工该职位每个月只能提交一次
+     *
+     * @param info
+     * @throws ShrWebBizException
+     */
+    public void checkPositionCount(BatchSubmitShemeBillInfo info) throws ShrWebBizException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
+        BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
+        //是否有上月发生日期
+        boolean isLastMonth = false;
+        //是否有当月发生日期
+        boolean isCurrentMonth = false;
+        String positionId = "";
+        String superiorId = "";
+        Calendar calendar = Calendar.getInstance();
+        int currentYear = calendar.get(Calendar.YEAR);
+        int currentMonth = calendar.get(Calendar.MONTH);
+        for (int i = 0; i < entryColl.size(); i++) {
+            BatchSubmitShemeBillEntryInfo entryInfo = entryColl.get(i);
+            Date effectDate = entryInfo.getEffectDate();
+            calendar.setTime(effectDate);
+            if (currentYear == calendar.get(Calendar.YEAR) && currentMonth == calendar.get(Calendar.MONTH)) {
+                isCurrentMonth = true;
+            } else {
+                isLastMonth = true;
+            }
+            positionId = entryInfo.getPosition().getId().toString();
+            superiorId = entryInfo.getString("superiorId");
+        }
+        logger.error("职位ID:" + positionId + ", 直接上级ID:" + superiorId);
+
+        try {
+            if (isLastMonth) {
+                calendar = Calendar.getInstance();
+                calendar.set(Calendar.DAY_OF_MONTH, 1);
+                String endDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
+                calendar.add(Calendar.MONTH, -1);
+                String startDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
+
+                int count = 0;
+                String sql = "select count(1) count from T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where b.FPERSONID  = '" + personId + "' and b.FPOSITIONID = '" + positionId + "' and b.CFSuperiorID = '" + superiorId + "' and a.fbillstate in ('1','2','3') and a.fdatasource = '1' and b.FEFFECTDATE >= '" + startDate + "' and b.FEFFECTDATE < '" + endDate + "'";
+                logger.error("查询员工该职位当月提交次数SQL:" + sql);
+                IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
+                while (iRowSet.next()) {
+                    count = iRowSet.getInt("count");
+                }
+                logger.error("员工该职位当月提交次数:" + count);
+                if (count > 0) {
+                    throw new ShrWebBizException("The employee submits the position once within a month");
+                }
+            }
+
+            if (isCurrentMonth) {
+                calendar = Calendar.getInstance();
+                calendar.set(Calendar.DAY_OF_MONTH, 1);
+                String startDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
+                calendar.add(Calendar.MONTH, 1);
+                String endDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
+
+                int count = 0;
+                String sql = "select count(1) count from T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where b.FPERSONID  = '" + personId + "' and b.FPOSITIONID = '" + positionId + "' and b.CFSuperiorID = '" + superiorId + "' and a.fbillstate in ('1','2','3') and a.fdatasource = '1' and b.FEFFECTDATE >= '" + startDate + "' and b.FEFFECTDATE < '" + endDate + "'";
+                logger.error("查询员工该职位当月提交次数SQL:" + sql);
+                IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
+                while (iRowSet.next()) {
+                    count = iRowSet.getInt("count");
+                }
+                logger.error("员工该职位当月提交次数:" + count);
+                if (count > 0) {
+                    throw new ShrWebBizException("The employee submits the position once within a month");
+                }
+            }
+        } catch (BOSException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 校验XX号之后不允许提交
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    public void checkSumbitDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+            throws SHRWebException {
+        Context ctx = SHRContext.getInstance().getContext();
+        int day = 0;
+        Calendar calendar = Calendar.getInstance();
+        int thisDay = calendar.get(Calendar.DAY_OF_MONTH);
+        String resultMessage = "";
+        try {
+            String paramSql = "SELECT FNUMBER,fname_l2 name FROM T_HR_SHRRSVITEM0 where fstate = '1' and FNUMBER = '1004'";
+            IRowSet paramRow = DbUtil.executeQuery(ctx, paramSql);
+            while (paramRow.next()) {
+                if (paramRow.getString("FNUMBER").equals("1004")) {
+                    day = paramRow.getObject("name") == null ? 0 : paramRow.getInt("name");
+                }
+            }
+            if (day != 0 && thisDay > day) {
+                resultMessage = "It is not allowed to submit the previous month's work hours after the " + day + "th of each month";
+            }
+        } catch (BOSException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        modelMap.put("resultMessage", resultMessage);
+        JSONUtils.writeJson(response, modelMap);
+    }
+
+
+    /**
+     * 根据人员id获取它的直属上级id和时薪
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @return
+     * @throws SHRWebException
+     */
+    public String getPersonCareerDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+            throws SHRWebException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String personId = request.getParameter("personId");
+        String parentId = "";
+        String workHour = "";
+        String sql = "select re.FPERSONID,rl.cflinemanagernameI linemanagername,rl.cfhourlywage from (SELECT FPERSONID,max(FEFFDT) as maxDate FROM T_HR_EmpOrgRelation where fassignType = '1' group by  FPERSONID) as re  left join T_HR_EmpOrgRelation rl on re.fpersonid = rl.fpersonid and re.maxDate = rl.feffdt and rl.fassignType = '1' where re.fpersonid='" + personId + "'";
+        try {
+            IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
+            while (iRowSet.next()) {
+                parentId = iRowSet.getString("linemanagername");
+                workHour = iRowSet.getString("cfhourlywage");
+            }
+        } catch (BOSException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        modelMap.put("parentId", parentId);
+        modelMap.put("workHour", workHour);
+        JSONUtils.writeJson(response, modelMap);
+        return null;
+    }
+
+    /**
+     * 获取当前员工的最新入职日期
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @return
+     * @throws SHRWebException
+     */
+    public String getInductionDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+            throws SHRWebException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
+        String sql = "select b.fenterdate from (SELECT FPERSONID,max(FEFFDT) as maxDate FROM T_HR_EmpLaborRelationHis group by fpersonid) a left join T_HR_EmpLaborRelationHis b on a.fpersonid=b.fpersonid and a.maxdate=b.FEFFDT where a.fpersonid='" + personId + "'";
+        String enterDate = "";
+        try {
+            IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
+            while (iRowSet.next()) {
+                enterDate = iRowSet.getString("fenterdate");
+            }
+        } catch (BOSException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        modelMap.put("enterDate", enterDate);
+        JSONUtils.writeJson(response, modelMap);
+        return null;
+    }
+
+    /**
+     * 查询人员对应职位的最新的合同开始和结束日期
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    public void getContractDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        //职位id
+        String positionId = request.getParameter("positionId");
+        Context ctx = SHRContext.getInstance().getContext();
+        String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
 //		String sql = "SELECT b.cfcommencingdate,b.cfexpireddate FROM (SELECT max(cfcommencingdate) maxdate,fpersonid,cfpositionid FROM CT_MP_Pcontractinfo group by fpersonid,cfpositionid) a left join CT_MP_Pcontractinfo b on a.maxdate=b.cfcommencingdate and a.fpersonid=b.fpersonid and a.cfpositionid=b.cfpositionid where a.fpersonid='"+personId+"' and a.cfpositionid='"+positionId+"' and b.cftype!='1'";
-		String sql = "SELECT cfcommencingdate,cfexpireddate,cftype FROM CT_MP_Pcontractinfo where fpersonid='" + personId + "' and cfpositionid='" + positionId + "' order by cfcommencingdate asc";
-		logger.error("查询合同信息SQL:" + sql);
-		Date beginContractDate = null;
-		Date endContractDate = null;
-		String contractType = "";
-		try {
-			IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
+        String sql = "SELECT cfcommencingdate,cfexpireddate,cftype FROM CT_MP_Pcontractinfo where fpersonid='" + personId + "' and cfpositionid='" + positionId + "' order by cfcommencingdate asc";
+        logger.error("查询合同信息SQL:" + sql);
+        Date beginContractDate = null;
+        Date endContractDate = null;
+        String contractType = "";
+        try {
+            IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
 			/*while(iRowSet.next()) {
 				//合同开始日期
 				beginContractDate = iRowSet.getDate("cfcommencingdate");
 				//合同结束日期
 				endContractDate = iRowSet.getDate("cfexpireddate");
 			}*/
-			List<Map<String, Object>> list = new ArrayList<>();
-			while (iRowSet.next()) {
-				//合同开始日期
-				Date beginDate = iRowSet.getDate("cfcommencingdate");
-				//合同结束日期
-				Date endDate = iRowSet.getDate("cfexpireddate");
-				//合同类型
-				String type = iRowSet.getString("cftype");
-				Map<String, Object> map = new HashMap<String, Object>();
-				map.put("beginDate", beginDate);
-				map.put("endDate", endDate);
-				map.put("type", type);
-				list.add(map);
-			}
-
-			for (int i = 0; i < list.size(); i++) {
-				Map<String, Object> map = list.get(i);
-				Date beginDate = (Date) map.get("beginDate");
-				Date endDate = (Date) map.get("endDate");
-				String type = (String) map.get("type");
-
-				//获取连续时间段的开始日期和结束日期,如果中间合同类型发生变动或者日期中断,则重新计算
-				if (StringUtils.equals(contractType, type)) {
-					Calendar beginCalendar = Calendar.getInstance();
-					Calendar endCalendar = Calendar.getInstance();
-					beginCalendar.setTime(beginDate);
-					beginCalendar.add(Calendar.DAY_OF_MONTH, -1);
-					endCalendar.setTime(endContractDate);
-
-					boolean isYear = beginCalendar.get(Calendar.YEAR) == endCalendar.get(Calendar.YEAR);
-					boolean isMonth = beginCalendar.get(Calendar.MONTH) == endCalendar.get(Calendar.MONTH);
-					boolean isDay = beginCalendar.get(Calendar.DAY_OF_MONTH) == endCalendar.get(Calendar.DAY_OF_MONTH);
-					boolean flag = isYear && isMonth && isDay;
-
-					if (flag) {
-						endContractDate = endDate;
-					} else {
-						beginContractDate = beginDate;
-						endContractDate = endDate;
-					}
-				} else {
-					beginContractDate = beginDate;
-					endContractDate = endDate;
-					contractType = type;
-				}
-			}
-
-		} catch (SQLException e) {
-			e.printStackTrace();
-		} catch (BOSException e) {
-			e.printStackTrace();
-		}
-		modelMap.put("beginContractDate", beginContractDate);
-		modelMap.put("endContractDate", endContractDate);
-		JSONUtils.writeJson(response, modelMap);
-	}
-
-	/**
-	 * 校验月提交总工时不能大于最大工时(废弃)
-	 *
-	 * @param request
-	 * @param response
-	 * @param modelMap
-	 * @return
-	 * @throws SHRWebException
-	 */
-	public String checkEscalationDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws SHRWebException {
-		Context ctx = SHRContext.getInstance().getContext();
-		String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
-		BigDecimal hours = new BigDecimal(request.getParameter("hours"));
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-		Calendar calendar = Calendar.getInstance();
-		int thisDay = calendar.get(Calendar.DAY_OF_MONTH);
-		calendar.set(Calendar.DAY_OF_MONTH, 1);
-		Date endDate = calendar.getTime();
-		calendar.add(Calendar.MONTH, -1);
-		Date stratDate = calendar.getTime();
-
-		try {
-			BigDecimal maxHour = BigDecimal.ZERO;
-			int day = 0;
-			String paramSql = "SELECT FNUMBER,fname_l2 name FROM T_HR_SHRRSVITEM0 where fstate = '1' and (FNUMBER = '1003' or FNUMBER = '1004')";
-			IRowSet paramRow = DbUtil.executeQuery(ctx, paramSql);
-			while (paramRow.next()) {
-				//最大工时数
-				if (paramRow.getString("FNUMBER").equals("1003")) {
-					maxHour = paramRow.getObject("name") == null ? BigDecimal.ZERO : paramRow.getBigDecimal("name");
-				}
-				if (paramRow.getString("FNUMBER").equals("1004")) {
-					day = paramRow.getObject("name") == null ? 0 : paramRow.getInt("name");
-				}
-			}
-			//校验XX号之后不允许提交
-			if (thisDay > day) {
-				modelMap.put("resultMessage", "It is not allowed to submit the previous month's work hours after the " + day + "th of each month");
-				JSONUtils.writeJson(response, modelMap);
-				return null;
-			}
-
-			BigDecimal totalHour = BigDecimal.ZERO;
-			String hourSql = "SELECT sum(b.cftotalworkhours) as totalHour FROM T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where  b.fpersonid='" + personId + "' and b.feffectdate>='" + sdf.format(stratDate) + "' and b.feffectdate<'" + sdf.format(endDate) + "' and a.FBILLSTATE in ('1','2','3')";
-			IRowSet iRowSet = DbUtil.executeQuery(ctx, hourSql);
-			while (iRowSet.next()) {
-				totalHour = iRowSet.getObject("totalHour") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("totalHour");
-			}
-			totalHour = totalHour.add(hours);
-
-			BigDecimal adjustHour = BigDecimal.ZERO;
-			//获取调整工时数
-			String adjustSql = "SELECT cfadjustinghours FROM CT_MP_Ptworkinghours where fpersonid='" + personId + "' and cfeffectivedate>='" + sdf.format(stratDate) + "' and cfeffectivedate<'" + sdf.format(endDate) + "'";
-			IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
-			while (adjustRow.next()) {
-				adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
-			}
-			if (totalHour.compareTo(maxHour.add(adjustHour)) > 0) {
-				modelMap.put("resultMessage", "The total working hours in a month cannot exceed the maximum number of hours");
-				JSONUtils.writeJson(response, modelMap);
-			}
-
-		} catch (BOSException e) {
-			e.printStackTrace();
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	/**
-	 * 汇总分录的工时和金额到单头
-	 *
-	 * @param request
-	 * @param response
-	 * @param modelMap
-	 * @throws SHRWebException
-	 */
-	public void countHourAmountAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
-		String billId = request.getParameter("billId");
-		if (StringUtils.isEmpty(billId)) {
-			return;
-		}
-		Context ctx = SHRContext.getInstance().getContext();
-		try {
-			BatchSubmitShemeBillInfo batchSubmitShemeBillInfo = BatchSubmitShemeBillFactory.getLocalInstance(ctx).getBatchSubmitShemeBillInfo(new ObjectUuidPK(billId));
-			BatchSubmitShemeBillEntryCollection entryColl = batchSubmitShemeBillInfo.getEntry();
-			BigDecimal sumHours = BigDecimal.ZERO;
-			BigDecimal sumAmount = BigDecimal.ZERO;
-			for (int i = 0; i < entryColl.size(); i++) {
-				BatchSubmitShemeBillEntryInfo entryInfo = entryColl.get(i);
-				BigDecimal hour = entryInfo.getBigDecimal("totalWorkHours") == null ? BigDecimal.ZERO : entryInfo.getBigDecimal("totalWorkHours");
-				BigDecimal amount = entryInfo.getBigDecimal("totalAmount") == null ? BigDecimal.ZERO : entryInfo.getBigDecimal("totalAmount");
-				sumHours = sumHours.add(hour);
-				sumAmount = sumAmount.add(amount);
-			}
-			batchSubmitShemeBillInfo.put("totalWorkHours", sumHours);
-			batchSubmitShemeBillInfo.put("totalAmount", sumAmount);
-			BatchSubmitShemeBillFactory.getLocalInstance(ctx).save(batchSubmitShemeBillInfo);
-		} catch (EASBizException e) {
-			e.printStackTrace();
-		} catch (BOSException e) {
-			e.printStackTrace();
-		}
-	}
-
-	/**
-	 * 根据提报日期判断法定节假日和休息日
-	 *
-	 * @param request
-	 * @param response
-	 * @param modelMap
-	 * @throws SHRWebException
-	 */
-	public void workMultipleAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
-		Context ctx = SHRContext.getInstance().getContext();
-		String otDate = request.getParameter("otDate");
-		logger.error("提报日期:" + otDate);
-		Date parseDate = DateTimeUtils.parseDate(otDate, "yyyy-MM-dd");
-		otDate = DateTimeUtils.dateFormat(parseDate, "yyyy-MM-dd");
-		String sql = "SELECT b.CFWORKMULTIPLE FROM T_HR_ATS_LegalHoliday a left join T_HR_ATS_LegalHolidayItem b on a.fid = b.FGROUPID where a.FSTATE = '1' and b.FSTARTDATE <= '" + otDate + "' and b.FENDDATE >= '" + otDate + "'";
-		logger.error("查询加班类型SQL:" + sql);
-		Map<String, String> returnMap = new HashMap<String, String>();
-		try {
-			IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
-			boolean flag = false;
-			while (iRowSet.next()) {
-				if (StringUtils.equals(iRowSet.getString("CFWORKMULTIPLE"), "3")) {
-					//法定节假日加班
-					flag = true;
-				}
-			}
-			if (flag) {
-				returnMap.put("returnType", "0");
-			} else {
-				Calendar calendar = Calendar.getInstance();
-				calendar.setTime(parseDate);
-				int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
-				if (dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY) {
-					//休息日加班
-					returnMap.put("returnType", "1");
-				}
-			}
-		} catch (BOSException e) {
-			e.printStackTrace();
-		} catch (SQLException throwables) {
-			throwables.printStackTrace();
-		}
-		JSONUtils.writeJson(response, returnMap);
-	}
-
-	/**
-	 * 根据人员档案获取当月是否离职或兼职失效
-	 *
-	 * @param request
-	 * @param response
-	 * @param modelMap
-	 * @throws SHRWebException
-	 */
-	public void checkDepartDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
-		Context ctx = SHRContext.getInstance().getContext();
-		String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
-		String cmpOrgRelationId = request.getParameter("cmpOrgRelationId");
-		Calendar calendar = Calendar.getInstance();
-		int currentYear = calendar.get(Calendar.YEAR);
-		int currentMonth = calendar.get(Calendar.MONTH) + 1;
-		boolean flag = false;
-		String cmpSql = "select b.fassigntype,b.fpositionid from T_HR_SCmpEmpORelation a left join T_HR_EmpOrgRelation b on a.FEMPORGRELATIONID = b.fid where a.fid ='" + cmpOrgRelationId + "'";
-		logger.error("查询员工档案信息SQL:" + cmpSql);
-		try {
-			IRowSet iRowSet = DbUtil.executeQuery(ctx, cmpSql);
-			//任职类型
-			String assignType = "";
-			//职位id
-			String positionId = "";
-			while (iRowSet.next()) {
-				assignType = iRowSet.getString("fassigntype");
-				positionId = iRowSet.getString("fpositionid");
-			}
-			//主要任职时
-			if (StringUtils.equals(assignType, "1")) {
-				String resignSql = "select year(b.FBIZDATE) year,month(b.FBIZDATE) month from T_HR_ResignBizBill a left join T_HR_ResignBizBillentry b on a.fid=b.fbillid where b.FPERSONID ='" + personId + "' and a.FBILLSTATE = '3' order by b.FBIZDATE desc";
-				logger.error("查询员工离职单SQL:" + resignSql);
-				IRowSet resignRow = DbUtil.executeQuery(ctx, resignSql);
-				int resignYear = 0;
-				int resignMonth = 0;
-				while (resignRow.next()) {
-					resignYear = resignRow.getInt("year");
-					resignMonth = resignRow.getInt("month");
-				}
-				if (currentYear == resignYear && currentMonth == resignMonth) {
-					flag = true;
-				}
-			} else {
-				String empSql = "select top 1 year(fleffdt) year,month(fleffdt) month from T_HR_EmpOrgRelation where fpositionid = '" + positionId + "' and fpersonid='" + personId + "' order by feffdt desc";
-				logger.error("查询员工兼职SQL:" + empSql);
-				int leffdtYear = 0;
-				int leffdtMonth = 0;
-				IRowSet empRow = DbUtil.executeQuery(ctx, empSql);
-				while (empRow.next()) {
-					leffdtYear = empRow.getInt("year");
-					leffdtMonth = empRow.getInt("month");
-				}
-				if (currentYear == leffdtYear && currentMonth == leffdtMonth) {
-					flag = true;
-				}
-			}
-		} catch (BOSException e) {
-			e.printStackTrace();
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-		modelMap.put("flag", flag);
-		JSONUtils.writeJson(response, modelMap);
-	}
-
-	/**
-	 * 员工同一职位一个月内只能提交一次
-	 *
-	 * @param request
-	 * @param response
-	 * @param modelMap
-	 * @throws SHRWebException
-	 */
-	public void checkSubmitCountAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
-		Context ctx = SHRContext.getInstance().getContext();
-		String positionId = request.getParameter("positionId");
-		String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
-
-		Calendar calendar = Calendar.getInstance();
-		calendar.set(Calendar.DAY_OF_MONTH, 1);
-		String startDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
-		calendar.add(Calendar.MONTH, 1);
-		String endDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
-
-		int count = 0;
-		String sql = "SELECT count(1) count FROM T_HR_SBatchSubmitShemeBill where fid in (select distinct a.fid from T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where a.FPROPOSERID  = '" + personId + "' and b.FPOSITIONID = '" + positionId + "' and a.fbillstate in ('1','2','3') and a.fdatasource = '1' and a.FSUBMITTIME >= '" + startDate + "' and a.FSUBMITTIME < '" + endDate + "')";
-		logger.error("查询员工该职位当月提交次数SQL:" + sql);
-		try {
-			IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
-			while (iRowSet.next()) {
-				count = iRowSet.getInt("count");
-			}
-			logger.error("员工该职位当月提交次数:" + count);
-		} catch (BOSException e) {
-			e.printStackTrace();
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-		modelMap.put("count", count);
-		JSONUtils.writeJson(response, modelMap);
-	}
-
-	/**
-	 * 判断是否参与校验
-	 *
-	 * @param request
-	 * @param response
-	 * @param modelMap
-	 * @throws SHRWebException
-	 */
-	public void isTakeCheckAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
-		Context ctx = SHRContext.getInstance().getContext();
-		//提报方案ID
-		String calSchemeId = request.getParameter("calSchemeId");
-		logger.error("提报方案ID:" + calSchemeId);
-		//是否参与校验
-		boolean isPlanCheck = false;
-		//当月离职处理
-		boolean isCurrentDepart = false;
-		String sql = "select cfistakecheck,CFIsCurrentDepart from T_HR_SCalSubmitScheme where fid = '" + calSchemeId + "'";
-		logger.error("查询提报方案SQL:" + sql);
-		try {
-			IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
-			while (iRowSet.next()) {
-				if (StringUtils.equals("1", iRowSet.getString("cfistakecheck"))) {
-					isPlanCheck = true;
-				}
-				if (StringUtils.equals("1", iRowSet.getString("CFIsCurrentDepart"))) {
-					isCurrentDepart = true;
-				}
-			}
-		} catch (BOSException e) {
-			e.printStackTrace();
-		} catch (SQLException e) {
-			e.printStackTrace();
-		}
-		modelMap.put("isPlanCheck", isPlanCheck);
-		modelMap.put("isCurrentDepart", isCurrentDepart);
-		JSONUtils.writeJson(response, modelMap);
-	}
+            List<Map<String, Object>> list = new ArrayList<>();
+            while (iRowSet.next()) {
+                //合同开始日期
+                Date beginDate = iRowSet.getDate("cfcommencingdate");
+                //合同结束日期
+                Date endDate = iRowSet.getDate("cfexpireddate");
+                //合同类型
+                String type = iRowSet.getString("cftype");
+                Map<String, Object> map = new HashMap<String, Object>();
+                map.put("beginDate", beginDate);
+                map.put("endDate", endDate);
+                map.put("type", type);
+                list.add(map);
+            }
+
+            for (int i = 0; i < list.size(); i++) {
+                Map<String, Object> map = list.get(i);
+                Date beginDate = (Date) map.get("beginDate");
+                Date endDate = (Date) map.get("endDate");
+                String type = (String) map.get("type");
+
+                //获取连续时间段的开始日期和结束日期,如果中间合同类型发生变动或者日期中断,则重新计算
+                if (StringUtils.equals(contractType, type)) {
+                    Calendar beginCalendar = Calendar.getInstance();
+                    Calendar endCalendar = Calendar.getInstance();
+                    beginCalendar.setTime(beginDate);
+                    beginCalendar.add(Calendar.DAY_OF_MONTH, -1);
+                    endCalendar.setTime(endContractDate);
+
+                    boolean isYear = beginCalendar.get(Calendar.YEAR) == endCalendar.get(Calendar.YEAR);
+                    boolean isMonth = beginCalendar.get(Calendar.MONTH) == endCalendar.get(Calendar.MONTH);
+                    boolean isDay = beginCalendar.get(Calendar.DAY_OF_MONTH) == endCalendar.get(Calendar.DAY_OF_MONTH);
+                    boolean flag = isYear && isMonth && isDay;
+
+                    if (flag) {
+                        endContractDate = endDate;
+                    } else {
+                        beginContractDate = beginDate;
+                        endContractDate = endDate;
+                    }
+                } else {
+                    beginContractDate = beginDate;
+                    endContractDate = endDate;
+                    contractType = type;
+                }
+            }
+
+        } catch (SQLException e) {
+            e.printStackTrace();
+        } catch (BOSException e) {
+            e.printStackTrace();
+        }
+        modelMap.put("beginContractDate", beginContractDate);
+        modelMap.put("endContractDate", endContractDate);
+        JSONUtils.writeJson(response, modelMap);
+    }
+
+    /**
+     * 校验月提交总工时不能大于最大工时(废弃)
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @return
+     * @throws SHRWebException
+     */
+    public String checkEscalationDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+            throws SHRWebException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
+        BigDecimal hours = new BigDecimal(request.getParameter("hours"));
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar calendar = Calendar.getInstance();
+        int thisDay = calendar.get(Calendar.DAY_OF_MONTH);
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        Date endDate = calendar.getTime();
+        calendar.add(Calendar.MONTH, -1);
+        Date stratDate = calendar.getTime();
+
+        try {
+            BigDecimal maxHour = BigDecimal.ZERO;
+            int day = 0;
+            String paramSql = "SELECT FNUMBER,fname_l2 name FROM T_HR_SHRRSVITEM0 where fstate = '1' and (FNUMBER = '1003' or FNUMBER = '1004')";
+            IRowSet paramRow = DbUtil.executeQuery(ctx, paramSql);
+            while (paramRow.next()) {
+                //最大工时数
+                if (paramRow.getString("FNUMBER").equals("1003")) {
+                    maxHour = paramRow.getObject("name") == null ? BigDecimal.ZERO : paramRow.getBigDecimal("name");
+                }
+                if (paramRow.getString("FNUMBER").equals("1004")) {
+                    day = paramRow.getObject("name") == null ? 0 : paramRow.getInt("name");
+                }
+            }
+            //校验XX号之后不允许提交
+            if (thisDay > day) {
+                modelMap.put("resultMessage", "It is not allowed to submit the previous month's work hours after the " + day + "th of each month");
+                JSONUtils.writeJson(response, modelMap);
+                return null;
+            }
+
+            BigDecimal totalHour = BigDecimal.ZERO;
+            String hourSql = "SELECT sum(b.cftotalworkhours) as totalHour FROM T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where  b.fpersonid='" + personId + "' and b.feffectdate>='" + sdf.format(stratDate) + "' and b.feffectdate<'" + sdf.format(endDate) + "' and a.FBILLSTATE in ('1','2','3')";
+            IRowSet iRowSet = DbUtil.executeQuery(ctx, hourSql);
+            while (iRowSet.next()) {
+                totalHour = iRowSet.getObject("totalHour") == null ? BigDecimal.ZERO : iRowSet.getBigDecimal("totalHour");
+            }
+            totalHour = totalHour.add(hours);
+
+            BigDecimal adjustHour = BigDecimal.ZERO;
+            //获取调整工时数
+            String adjustSql = "SELECT cfadjustinghours FROM CT_MP_Ptworkinghours where fpersonid='" + personId + "' and cfeffectivedate>='" + sdf.format(stratDate) + "' and cfeffectivedate<'" + sdf.format(endDate) + "'";
+            IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
+            while (adjustRow.next()) {
+                adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
+            }
+            if (totalHour.compareTo(maxHour.add(adjustHour)) > 0) {
+                modelMap.put("resultMessage", "The total working hours in a month cannot exceed the maximum number of hours");
+                JSONUtils.writeJson(response, modelMap);
+            }
+
+        } catch (BOSException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * 汇总分录的工时和金额到单头
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    public void countHourAmountAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        String billId = request.getParameter("billId");
+        if (StringUtils.isEmpty(billId)) {
+            return;
+        }
+        Context ctx = SHRContext.getInstance().getContext();
+        try {
+            BatchSubmitShemeBillInfo batchSubmitShemeBillInfo = BatchSubmitShemeBillFactory.getLocalInstance(ctx).getBatchSubmitShemeBillInfo(new ObjectUuidPK(billId));
+            BatchSubmitShemeBillEntryCollection entryColl = batchSubmitShemeBillInfo.getEntry();
+            BigDecimal sumHours = BigDecimal.ZERO;
+            BigDecimal sumAmount = BigDecimal.ZERO;
+            for (int i = 0; i < entryColl.size(); i++) {
+                BatchSubmitShemeBillEntryInfo entryInfo = entryColl.get(i);
+                BigDecimal hour = entryInfo.getBigDecimal("totalWorkHours") == null ? BigDecimal.ZERO : entryInfo.getBigDecimal("totalWorkHours");
+                BigDecimal amount = entryInfo.getBigDecimal("totalAmount") == null ? BigDecimal.ZERO : entryInfo.getBigDecimal("totalAmount");
+                sumHours = sumHours.add(hour);
+                sumAmount = sumAmount.add(amount);
+            }
+            batchSubmitShemeBillInfo.put("totalWorkHours", sumHours);
+            batchSubmitShemeBillInfo.put("totalAmount", sumAmount);
+            BatchSubmitShemeBillFactory.getLocalInstance(ctx).save(batchSubmitShemeBillInfo);
+        } catch (EASBizException e) {
+            e.printStackTrace();
+        } catch (BOSException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 根据提报日期判断法定节假日和休息日
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    public void workMultipleAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String otDate = request.getParameter("otDate");
+        logger.error("提报日期:" + otDate);
+        Date parseDate = DateTimeUtils.parseDate(otDate, "yyyy-MM-dd");
+        otDate = DateTimeUtils.dateFormat(parseDate, "yyyy-MM-dd");
+        String sql = "SELECT b.CFWORKMULTIPLE FROM T_HR_ATS_LegalHoliday a left join T_HR_ATS_LegalHolidayItem b on a.fid = b.FGROUPID where a.FSTATE = '1' and b.FSTARTDATE <= '" + otDate + "' and b.FENDDATE >= '" + otDate + "'";
+        logger.error("查询加班类型SQL:" + sql);
+        Map<String, String> returnMap = new HashMap<String, String>();
+        try {
+            IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
+            boolean flag = false;
+            while (iRowSet.next()) {
+                if (StringUtils.equals(iRowSet.getString("CFWORKMULTIPLE"), "3")) {
+                    //法定节假日加班
+                    flag = true;
+                }
+            }
+            if (flag) {
+                returnMap.put("returnType", "0");
+            } else {
+                Calendar calendar = Calendar.getInstance();
+                calendar.setTime(parseDate);
+                int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
+                if (dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY) {
+                    //休息日加班
+                    returnMap.put("returnType", "1");
+                }
+            }
+        } catch (BOSException e) {
+            e.printStackTrace();
+        } catch (SQLException throwables) {
+            throwables.printStackTrace();
+        }
+        JSONUtils.writeJson(response, returnMap);
+    }
+
+    /**
+     * 根据人员档案获取当月是否离职或兼职失效
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    public void checkDepartDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
+        String cmpOrgRelationId = request.getParameter("cmpOrgRelationId");
+        Calendar calendar = Calendar.getInstance();
+        int currentYear = calendar.get(Calendar.YEAR);
+        int currentMonth = calendar.get(Calendar.MONTH) + 1;
+        boolean flag = false;
+        String cmpSql = "select b.fassigntype,b.fpositionid from T_HR_SCmpEmpORelation a left join T_HR_EmpOrgRelation b on a.FEMPORGRELATIONID = b.fid where a.fid ='" + cmpOrgRelationId + "'";
+        logger.error("查询员工档案信息SQL:" + cmpSql);
+        try {
+            IRowSet iRowSet = DbUtil.executeQuery(ctx, cmpSql);
+            //任职类型
+            String assignType = "";
+            //职位id
+            String positionId = "";
+            while (iRowSet.next()) {
+                assignType = iRowSet.getString("fassigntype");
+                positionId = iRowSet.getString("fpositionid");
+            }
+            //主要任职时
+            if (StringUtils.equals(assignType, "1")) {
+                String resignSql = "select year(b.FBIZDATE) year,month(b.FBIZDATE) month from T_HR_ResignBizBill a left join T_HR_ResignBizBillentry b on a.fid=b.fbillid where b.FPERSONID ='" + personId + "' and a.FBILLSTATE = '3' order by b.FBIZDATE desc";
+                logger.error("查询员工离职单SQL:" + resignSql);
+                IRowSet resignRow = DbUtil.executeQuery(ctx, resignSql);
+                int resignYear = 0;
+                int resignMonth = 0;
+                while (resignRow.next()) {
+                    resignYear = resignRow.getInt("year");
+                    resignMonth = resignRow.getInt("month");
+                }
+                if (currentYear == resignYear && currentMonth == resignMonth) {
+                    flag = true;
+                }
+            } else {
+                String empSql = "select top 1 year(fleffdt) year,month(fleffdt) month from T_HR_EmpOrgRelation where fpositionid = '" + positionId + "' and fpersonid='" + personId + "' order by feffdt desc";
+                logger.error("查询员工兼职SQL:" + empSql);
+                int leffdtYear = 0;
+                int leffdtMonth = 0;
+                IRowSet empRow = DbUtil.executeQuery(ctx, empSql);
+                while (empRow.next()) {
+                    leffdtYear = empRow.getInt("year");
+                    leffdtMonth = empRow.getInt("month");
+                }
+                if (currentYear == leffdtYear && currentMonth == leffdtMonth) {
+                    flag = true;
+                }
+            }
+        } catch (BOSException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        modelMap.put("flag", flag);
+        JSONUtils.writeJson(response, modelMap);
+    }
+
+    /**
+     * 员工同一职位一个月内只能提交一次
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    public void checkSubmitCountAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        Context ctx = SHRContext.getInstance().getContext();
+        String positionId = request.getParameter("positionId");
+        String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
+
+        Calendar calendar = Calendar.getInstance();
+        calendar.set(Calendar.DAY_OF_MONTH, 1);
+        String startDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
+        calendar.add(Calendar.MONTH, 1);
+        String endDate = DateTimeUtils.dateFormat(calendar.getTime(), "yyyy-MM-dd");
+
+        int count = 0;
+        String sql = "SELECT count(1) count FROM T_HR_SBatchSubmitShemeBill where fid in (select distinct a.fid from T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where a.FPROPOSERID  = '" + personId + "' and b.FPOSITIONID = '" + positionId + "' and a.fbillstate in ('1','2','3') and a.fdatasource = '1' and a.FSUBMITTIME >= '" + startDate + "' and a.FSUBMITTIME < '" + endDate + "')";
+        logger.error("查询员工该职位当月提交次数SQL:" + sql);
+        try {
+            IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
+            while (iRowSet.next()) {
+                count = iRowSet.getInt("count");
+            }
+            logger.error("员工该职位当月提交次数:" + count);
+        } catch (BOSException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        modelMap.put("count", count);
+        JSONUtils.writeJson(response, modelMap);
+    }
+
+    /**
+     * 判断是否参与校验
+     *
+     * @param request
+     * @param response
+     * @param modelMap
+     * @throws SHRWebException
+     */
+    public void isTakeCheckAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
+        Context ctx = SHRContext.getInstance().getContext();
+        //提报方案ID
+        String calSchemeId = request.getParameter("calSchemeId");
+        logger.error("提报方案ID:" + calSchemeId);
+        //是否参与校验
+        boolean isPlanCheck = false;
+        //当月离职处理
+        boolean isCurrentDepart = false;
+        String sql = "select cfistakecheck,CFIsCurrentDepart from T_HR_SCalSubmitScheme where fid = '" + calSchemeId + "'";
+        logger.error("查询提报方案SQL:" + sql);
+        try {
+            IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
+            while (iRowSet.next()) {
+                if (StringUtils.equals("1", iRowSet.getString("cfistakecheck"))) {
+                    isPlanCheck = true;
+                }
+                if (StringUtils.equals("1", iRowSet.getString("CFIsCurrentDepart"))) {
+                    isCurrentDepart = true;
+                }
+            }
+        } catch (BOSException e) {
+            e.printStackTrace();
+        } catch (SQLException e) {
+            e.printStackTrace();
+        }
+        modelMap.put("isPlanCheck", isPlanCheck);
+        modelMap.put("isCurrentDepart", isCurrentDepart);
+        JSONUtils.writeJson(response, modelMap);
+    }
 
 
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1179 - 1160
GDYSL/websrc/com/kingdee/shr/customer/gtiit/rpt/AbsenceSummaryForAllLeaveListHandler.java


+ 15 - 10
GDYSL/websrc/com/kingdee/shr/customer/gtiit/rpt/AllSalaryListHandler.java

@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package com.kingdee.shr.customer.gtiit.rpt;
 
@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.json.JSONArray;
+import org.json.JSONException;
 import org.json.JSONObject;
 
 import com.cloudera.impala.jdbc4.internal.apache.log4j.Logger;
@@ -105,7 +106,7 @@ public class AllSalaryListHandler extends ListHandler {
 				getPaydata();
 				getSaveData(rs, currentUserInfo, nowdate);
 				updateFiled(countFiled);
-			} 
+			}
 			// 判断薪酬项目的数量的值是否在list里面 不在就要修改数据
 			else if (!filedList.contains(countFiled)) {
 				System.out.println("判断薪酬项目的数量的值是否在list里面");
@@ -191,8 +192,12 @@ public class AllSalaryListHandler extends ListHandler {
 			// // 根据前端过滤条件处理
 			// getFilter(fastFilterItems, defaultViewInfo, fastFilterItems, currentUserInfo,
 			// nowdate, null);
-			getFilter(fastFilterItems, defaultViewInfo, personid, currentUserInfo, nowdate);
-			logger.error("执行成功3");
+            try {
+                getFilter(fastFilterItems, defaultViewInfo, personid, currentUserInfo, nowdate);
+            } catch (JSONException e) {
+                throw new RuntimeException(e);
+            }
+            logger.error("执行成功3");
 			// }
 
 			// defaultViewInfo.setFilter(filterInfo);
@@ -207,7 +212,7 @@ public class AllSalaryListHandler extends ListHandler {
 
 	/**
 	 * 存储薪酬核算表里面的最后修改时间
-	 * 
+	 *
 	 */
 	public List<String> getUpdateTime(IRowSet rs,Date nowdate) {
 		List<String> updateTimeList = new ArrayList<>();
@@ -259,7 +264,7 @@ public class AllSalaryListHandler extends ListHandler {
 
 	/**
 	 * 处理查询薪酬的语句
-	 * 
+	 *
 	 * @param date
 	 * @param peronid
 	 * @return
@@ -1773,7 +1778,7 @@ public class AllSalaryListHandler extends ListHandler {
 
 	/***
 	 * 获取薪酬项目的值 map 可以是字段标识 value是薪酬项目值
-	 * 
+	 *
 	 */
 	public Map<String, String> getPayVlue(IRowSet rs) {
 		Map<String, String> payVlueMap = new HashMap<>();
@@ -1811,7 +1816,7 @@ public class AllSalaryListHandler extends ListHandler {
 	 */
 
 	public void getFilter(String fastFilterItems, EntityViewInfo defaultViewInfo, String personid,
-			UserInfo currentUserInfo, Date nowdate) {
+			UserInfo currentUserInfo, Date nowdate) throws JSONException {
 		// 获取过虑条件
 		JSONObject tofastFilterItems = new JSONObject(fastFilterItems);
 		// 获取过滤的日期
@@ -1862,7 +1867,7 @@ public class AllSalaryListHandler extends ListHandler {
 
 	/***
 	 * 获取动态新增薪酬项目的数量 判断薪酬项目有没有新增
-	 * 
+	 *
 	 * @return
 	 */
 	public String countFiled() {
@@ -1882,7 +1887,7 @@ public class AllSalaryListHandler extends ListHandler {
 
 	/***
 	 * 修改数据库统计薪酬字段数量的字段
-	 * 
+	 *
 	 * @param countFiled
 	 */
 	public void updateFiled(String countFiled) {

+ 10 - 9
GDYSL/websrc/com/kingdee/shr/customer/gtiit/rpt/DeclarationListHandler.java

@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package com.kingdee.shr.customer.gtiit.rpt;
 
@@ -32,6 +32,7 @@ import org.apache.poi.xssf.usermodel.XSSFFont;
 import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.json.JSONException;
 import org.json.JSONObject;
 import org.springframework.ui.ModelMap;
 
@@ -66,7 +67,7 @@ public class DeclarationListHandler extends ListHandler {
 	}
 
 	public void getGridDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws BOSException, SQLException, SHRWebException {
+            throws BOSException, SQLException, SHRWebException, JSONException {
 		int rows = Integer.parseInt(request.getParameter("rows"));
 		int page = Integer.parseInt(request.getParameter("page"));
 		// 获取过滤条件
@@ -166,7 +167,7 @@ public class DeclarationListHandler extends ListHandler {
 
 	public String getSql(String starTime, String endTime, String status) {
 		StringBuffer sql = new StringBuffer();
-		sql.append("SELECT distinct d.FName_L1 as person,d.FNumber,e.FName_L1 as positionName,c.CFSuperiorName,c.CFHourlyWage ,a.CFTotalWorkHours,a.CFTotalAmount FROM T_HR_SBatchSubmitShemeBill a  right join T_HR_SchemeBillEntry c on a.fid=c.FBillID left join t_bd_person d on c.FPersonID=d.fid left join T_ORG_Position e on c.FPositionID= e.fid where 1 =1  and a.fsubmitschemeid in(SELECT fid FROM T_HR_SCalSubmitScheme where fnumber in ('eply_GS','eply_LZGS'))\r\n" + 
+		sql.append("SELECT distinct d.FName_L1 as person,d.FNumber,e.FName_L1 as positionName,c.CFSuperiorName,c.CFHourlyWage ,a.CFTotalWorkHours,a.CFTotalAmount FROM T_HR_SBatchSubmitShemeBill a  right join T_HR_SchemeBillEntry c on a.fid=c.FBillID left join t_bd_person d on c.FPersonID=d.fid left join T_ORG_Position e on c.FPositionID= e.fid where 1 =1  and a.fsubmitschemeid in(SELECT fid FROM T_HR_SCalSubmitScheme where fnumber in ('eply_GS','eply_LZGS'))\r\n" +
 				"");
 
 		// 可能传多个状态过来
@@ -210,7 +211,7 @@ public class DeclarationListHandler extends ListHandler {
 	// 导出
 	// 导出数据
 	public String toExcelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws BOSException, SQLException, SHRWebException {
+            throws BOSException, SQLException, SHRWebException, JSONException {
 		// 获取过滤条件
 		String fastFilterItems = request.getParameter("fastFilterItems");
 		JSONObject tofastFilterItems = new JSONObject(fastFilterItems);
@@ -250,10 +251,10 @@ public class DeclarationListHandler extends ListHandler {
 		exportData(response, rs, "StaffTimekeepingList.xlsx", selectFieldsTypeMap, list,fieldlist);
 		return null;
 	}
-	
-	
+
+
 	/**
-	 * 
+	 *
 	 * @param response
 	 *            response
 	 * @param resource
@@ -306,8 +307,8 @@ public class DeclarationListHandler extends ListHandler {
 						XSSFCell cell = titleRow.createCell(j);
 						//cell.setCellValue(keyList.get(j));
 						//cell.setCellValue(chineseList.get(j));
-						cell.setCellValue(list.get(j));	
-						
+						cell.setCellValue(list.get(j));
+
 						cell.setCellValue(list.get(j));
 						// 调整列宽
 						sheet.setColumnWidth(j, 6000);

+ 7 - 8
GDYSL/websrc/com/kingdee/shr/customer/gtiit/rpt/FacultyAbsenceSummaryListHandler.java

@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package com.kingdee.shr.customer.gtiit.rpt;
 
@@ -73,7 +73,7 @@ public class FacultyAbsenceSummaryListHandler extends ListHandler {
 	}
 
 	public void getGridDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws BOSException, SQLException, SHRWebException, JSONException {
+            throws BOSException, SQLException, SHRWebException, JSONException, org.json.JSONException {
 		logger.info(">>> FacultyAbsenceSummaryReportHandler...getGridDataAction");
 		int rows = Integer.parseInt(request.getParameter("rows"));
 		int page = Integer.parseInt(request.getParameter("page"));
@@ -312,13 +312,12 @@ public class FacultyAbsenceSummaryListHandler extends ListHandler {
 
 	/***
 	 * 计算假期数据
-	 * 
+	 *
 	 * @param rs
 	 *            查询的假期数据
 	 * @param policySet
 	 *            假期类型是年假 id
 	 * @param otherSet
-	 * @param days
 	 *            天数 businessSet 出差id dateList 工作日期
 	 */
 	public Map<String, VacationInfo> calcuteVacation(IRowSet rs, Set<String> policySet, Set<String> otherSet,
@@ -373,7 +372,7 @@ public class FacultyAbsenceSummaryListHandler extends ListHandler {
 					if (policySet.contains(cfpolicy)) {
 						BigDecimal annualLeave = vacationInfo.getAnnualLeave();
 						if(annualLeave!=null) {
-							
+
 							vacationInfo.setAnnualLeave(annualLeave.add(leavelenth));
 						}else {
 							vacationInfo.setAnnualLeave(new BigDecimal(0).add(leavelenth));
@@ -386,7 +385,7 @@ public class FacultyAbsenceSummaryListHandler extends ListHandler {
 						if (dateList.contains(leavedate)) {
 							if(businessTrip!=null) {
 								vacationInfo.setBusinessTrip(businessTrip.add(leavelenth));
-								
+
 							}else {
 								vacationInfo.setBusinessTrip(new BigDecimal(0).add(leavelenth));
 							}
@@ -475,7 +474,7 @@ public class FacultyAbsenceSummaryListHandler extends ListHandler {
 	// 导出
 	// 导出数据
 	public String toExcelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws BOSException, SQLException, SHRWebException {
+            throws BOSException, SQLException, SHRWebException, org.json.JSONException {
 		// 构建参数去查询数据库
 		// 获取过滤条件
 		String fastFilterItems = request.getParameter("fastFilterItems");
@@ -701,7 +700,7 @@ public class FacultyAbsenceSummaryListHandler extends ListHandler {
 	//
 
 	/***
-	 * 
+	 *
 	 * @param response
 	 * @param fileName
 	 */

+ 239 - 178
GDYSL/websrc/com/kingdee/shr/customer/gtiit/rpt/PassportsListHandler.java

@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package com.kingdee.shr.customer.gtiit.rpt;
 
@@ -19,12 +19,16 @@ import java.util.stream.Collectors;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.kingdee.eas.hr.base.HRBillStateEnum;
+import com.kingdee.shr.preentry.*;
+import com.kingdee.util.StringUtils;
 import org.apache.poi.ss.usermodel.DataFormat;
 import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFCellStyle;
 import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.json.JSONException;
 import org.json.JSONObject;
 import org.springframework.ui.ModelMap;
 
@@ -43,188 +47,245 @@ import com.kingdee.shr.customer.gtiit.util.ExportAllUtils;
  * @author ISSUSER 护照邮箱报表
  */
 public class PassportsListHandler extends ListHandler {
-	Context ctx = SHRContext.getInstance().getContext();
-	private static Logger logger1 = Logger.getLogger("com.kingdee.shr.customer.gtiit.rpt.PassportsListHandler");
-	private int totalCount;
-
-	public String getGridColModelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws SHRWebException, BOSException, SQLException {
-		List<String> colNames = this.getcolNamesAction();
-		List<Map<String, Object>> colModel = this.getcolModelAction();
-		LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>();
-		map.put("colNames", colNames);
-		map.put("colModel", colModel);
-		JSONUtils.writeJson(response, map);
-		return null;
-	}
-
-	public void getGridDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws BOSException, SQLException, SHRWebException {
-		int rows = Integer.parseInt(request.getParameter("rows"));
-		int page = Integer.parseInt(request.getParameter("page"));
-		// 获取过滤条件
-		String fastFilterItems = request.getParameter("fastFilterItems");
-		JSONObject tofastFilterItems = new JSONObject(fastFilterItems);
-		// 获取人员
-		JSONObject personJson = tofastFilterItems.getJSONObject("person");
-		String personid = personJson.getString("values");
-		JSONObject statusJson = tofastFilterItems.getJSONObject("status");
-		String status = statusJson.getString("values");
-		IRowSet rs = DbUtil.executeQuery(this.ctx, this.getSql(personid, status));
-		List<Map<String, Object>> maplist = new ArrayList<Map<String, Object>>();
-		int num = 0;
-		while (rs.next()) {
-			++num;
-			if (num >= rows * (page - 1) + 1 && num <= rows * page) {
-				Map<String, Object> map = new HashMap<String, Object>();
-				map.put("FName_L1", rs.getString("FName_L1"));
-				map.put("FCredentialsTypeNO", rs.getString("FCredentialsTypeNO"));
-				map.put("FEmail", rs.getString("FEmail"));
-				map.put("CFPrivateemail", rs.getString("CFPrivateemail"));
-				map.put("Person Number", rs.getString("FNumber"));
-				maplist.add(map);
-			}
-		}
-		this.totalCount = num;
-		Map<String, Object> gridDataMap = new LinkedHashMap<String, Object>();
-		if (this.totalCount % rows == 0) {
-			gridDataMap.put("total", this.totalCount / rows);
-		} else {
-			gridDataMap.put("total", this.totalCount / rows + 1);
-		}
-		gridDataMap.put("page", page);
-		gridDataMap.put("records", this.totalCount);
-		gridDataMap.put("rows", maplist);
-		JSONUtils.writeJson(response, gridDataMap);
-	}
-
-	public ArrayList<String> getcolNamesAction() throws SHRWebException {
-		ArrayList<String> list = new ArrayList<String>();
-		list.add("Display Name");
-		list.add("Passport Number");
-		list.add("Work Email");
-		list.add("Private Email");
-		list.add("Person Number");
-		return list;
-
-	}
-
-	public List<Map<String, Object>> getcolModelAction() {
-		List<Map<String, Object>> modelColList = new ArrayList<Map<String, Object>>();
-		modelColList.add(this.buildColModelMap("FName_L1", "Display Name", 70));
-		modelColList.add(this.buildColModelMap("FCredentialsTypeNO", "Passport Number", 70));
-		modelColList.add(this.buildColModelMap("FEmail", "Work Email", 70));
-		modelColList.add(this.buildColModelMap("CFPrivateemail", "Private Email", 70));
-		modelColList.add(this.buildColModelMap("Person Number", "Person Number", 70));
-		return modelColList;
-	}
-
-	private Map<String, Object> buildColModelMap(String index, String label, int width) {
-		return this.buildColModelMap(index, label, width, false, false, false);
-	}
-
-	private Map<String, Object> buildColModelMap(String index, String label, int width, boolean rowspan, boolean isKey,
-			boolean isHedden) {
-		Map<String, Object> gridIdMap = new LinkedHashMap<String, Object>();
-		gridIdMap.put("index", index);
-		gridIdMap.put("name", index);
-		gridIdMap.put("label", label);
-		gridIdMap.put("width", width);
-		if (rowspan) {
-			gridIdMap.put("rowspan", rowspan);
-		}
-		if (isKey) {
-			gridIdMap.put("key", isKey);
-		}
-		if (isHedden) {
-			gridIdMap.put("hidden", isHedden);
-		}
-		return gridIdMap;
-	}
-
-	public String getSql(String peronid, String status) {
-		StringBuffer sql = new StringBuffer();
-		sql.append("\r\n" + 
-				"\r\n" + 
-				"\r\n" + 
-				"select a.FCredentialsTypeNO, c.FName_L1,d.FEmail,d.CFPrivateemail, c.FNumber from T_HR_PersonCredentialsType a left join T_HR_CredentialsType b on a.FCredentialsTypeID=b.fid left join T_BD_Person c \r\n" + 
-				" on a.FPERSONID =c.fid \r\n" + 
-				" left join T_HR_PersonContactMethod d on d.FPERSONID =c.fid   left join (select * from T_HR_EmpLaborRelationHis where FIsLatestInAday = 1  ) k on  c.fid = k.FPERSONID\r\n" + 
-				"left join T_HR_BDEmployeeType p on k.FLABORRELATIONSTATEID=p.fid where   k.FEndDateTime>='2199-01-01'  and  b.FNumber='OT001' ");
-		// 传了多个人员需要拆开拼接sql
-		StringBuffer personsql = new StringBuffer();
-		String[] personidArry = new String[0];
-		if (!peronid.isEmpty()) {
-
-			personidArry = peronid.split(",");
-		}
-		// 状态的sql
-		StringBuffer statussql = new StringBuffer();
-		statussql.append(" and p.FINSERVICE = ");
-		statussql.append("'");
-		statussql.append(status);
-		statussql.append("'");
-		if (personidArry.length > 0) {
-			personsql.append(" and c.fid in ");
-			personsql.append("(");
-			for (String pid : personidArry) {
-				personsql.append("'");
-				personsql.append(pid);
-				personsql.append("'");
-				personsql.append(",");
-			}
-			// 删除最后一个逗号
-			personsql.deleteCharAt(personsql.length() - 1);
-			personsql.append(")");
-			sql.append(personsql);
-			// 和状态拼接
-			if (status != null && !status.equals("")) {
-				sql.append(statussql);
-			}
-		} else if (status != null && !status.equals("")) {
-			sql.append(statussql);
-		} else {
-			sql.append(" and p.FINSERVICE in ('1','2') ");
-		}
-		System.out.println("这个sql是:" + sql.toString());
-		return sql.toString();
-	}
-
-	// 导出
-	// 导出数据
-	public String toExcelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws BOSException, SQLException, SHRWebException {
-		// 获取过滤条件
-		String fastFilterItems = request.getParameter("fastFilterItems");
-		JSONObject tofastFilterItems = new JSONObject(fastFilterItems);
-		// 获取人员
-		JSONObject personJson = tofastFilterItems.getJSONObject("person");
-		String personid = personJson.getString("values");
-		String newperonid = personid.replace(" ", "+"); // 传过来id+可能是空格需要转
-		JSONObject statusJson = tofastFilterItems.getJSONObject("status");
-		String status = statusJson.getString("values");
-		IRowSet rs = DbUtil.executeQuery(this.ctx, this.getSql(newperonid, status));
-
-		LinkedHashMap<String, String> selectFieldsTypeMap = new LinkedHashMap<String, String>();
-		 String stringType = "String_@";
-		// String dateType = "Date_yyyy/MM/dd";
-		// String numberType = "Number_0_%s";
-		selectFieldsTypeMap.put("FName_L1", stringType);
-		selectFieldsTypeMap.put("FCredentialsTypeNO", stringType);
-		selectFieldsTypeMap.put("FEmail", stringType);
-		selectFieldsTypeMap.put("CFPrivateemail", stringType);
-		selectFieldsTypeMap.put("FNumber", stringType);
-		//ArrayList<String> list = this.getcolNamesAction();
+    Context ctx = SHRContext.getInstance().getContext();
+    private static Logger logger1 = Logger.getLogger("com.kingdee.shr.customer.gtiit.rpt.PassportsListHandler");
+    private int totalCount;
+
+    public String getGridColModelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+            throws SHRWebException, BOSException, SQLException {
+        List<String> colNames = this.getcolNamesAction();
+        List<Map<String, Object>> colModel = this.getcolModelAction();
+        LinkedHashMap<String, Object> map = new LinkedHashMap<String, Object>();
+        map.put("colNames", colNames);
+        map.put("colModel", colModel);
+        JSONUtils.writeJson(response, map);
+        return null;
+    }
+
+    public void getGridDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+            throws BOSException, SQLException, SHRWebException, JSONException {
+        int rows = Integer.parseInt(request.getParameter("rows"));
+        int page = Integer.parseInt(request.getParameter("page"));
+        // 获取过滤条件
+        String fastFilterItems = request.getParameter("fastFilterItems");
+        JSONObject tofastFilterItems = new JSONObject(fastFilterItems);
+        // 获取人员
+        JSONObject personJson = tofastFilterItems.getJSONObject("person");
+        String personid = personJson.getString("values");
+        JSONObject statusJson = tofastFilterItems.getJSONObject("status");
+        String status = statusJson.getString("values");
+        IRowSet rs = DbUtil.executeQuery(this.ctx, this.getSql(personid, status));
+        List<Map<String, Object>> maplist = new ArrayList<Map<String, Object>>();
+        int num = 0;
+        while (rs.next()) {
+            ++num;
+            if (num >= rows * (page - 1) + 1 && num <= rows * page) {
+                Map<String, Object> map = new HashMap<String, Object>();
+                map.put("FName_L1", rs.getString("FName_L1"));//名称
+                map.put("FCredentialsTypeNO", rs.getString("FCredentialsTypeNO"));//证件号
+                map.put("FEmail", rs.getString("FEmail"));//邮箱
+                map.put("CFPrivateemail", rs.getString("CFPrivateemail"));//私人邮箱
+                map.put("Person Number", rs.getString("FNumber"));//员工编码
+                maplist.add(map);
+            }
+        }
+        //新增预入职数据  1、条件为入职状态等于“未入职”、单据状态等于“审批通过”的数据; status.equals("1") 在职数据
+        //if (status.equals("1")) {
+        //    getPreEntryColl(maplist, num);
+        //}
+        this.totalCount = num;
+        Map<String, Object> gridDataMap = new LinkedHashMap<String, Object>();
+        if (this.totalCount % rows == 0) {
+            gridDataMap.put("total", this.totalCount / rows);
+        } else {
+            gridDataMap.put("total", this.totalCount / rows + 1);
+        }
+        gridDataMap.put("page", page);
+        gridDataMap.put("records", this.totalCount);
+        gridDataMap.put("rows", maplist);
+        JSONUtils.writeJson(response, gridDataMap);
+    }
+
+    /**
+     * 获取预入职入职状态等于“未入职”、单据状态等于“审批通过”的数据
+     *
+     * @return
+     * @throws SHRWebException
+     */
+    public void getPreEntryColl(List maplist, int num) throws BOSException {
+        IPreEntry iPreEntry = PreEntryFactory.getLocalInstance(this.ctx);
+        PreEntryCollection preEntryCollection = iPreEntry.getPreEntryCollection("select * ,talent.* where billState = '3' and  checkInState = '4'");
+        for (int i = 0; i < preEntryCollection.size(); i++) {
+            num++;
+            Map map = new HashMap();
+            PreEntryInfo preEntryInfo = preEntryCollection.get(i);
+            map.put("FName_L1", preEntryInfo.getName());//名称
+            //预入职人员
+            PreEntryPersonInfo preEntryPersonInfo = preEntryInfo.getTalent();
+            //身份证号
+            String idCardNO = preEntryPersonInfo.getIdCardNO();
+            //证件号码
+            String passportNO = preEntryPersonInfo.getPassportNO();
+            String cardNumber = "";
+            if (!StringUtils.isEmpty(idCardNO)) {
+                cardNumber = idCardNO;
+            } else if (!StringUtils.isEmpty(passportNO)) {
+                cardNumber = passportNO;
+            }
+            map.put("FCredentialsTypeNO", cardNumber);//证件号
+            map.put("FEmail", preEntryInfo.getString("workemail"));//邮箱
+            map.put("CFPrivateemail", preEntryInfo.getEmail());//私人邮箱
+            map.put("Person Number", preEntryInfo.getString("empNumber"));//员工编码
+            maplist.add(map);
+        }
+
+    }
+
+
+    public ArrayList<String> getcolNamesAction() throws SHRWebException {
+        ArrayList<String> list = new ArrayList<String>();
+        list.add("Display Name");
+        list.add("Passport Number");
+        list.add("Work Email");
+        list.add("Private Email");
+        list.add("Person Number");
+        return list;
+
+    }
+
+    public List<Map<String, Object>> getcolModelAction() {
+        List<Map<String, Object>> modelColList = new ArrayList<Map<String, Object>>();
+        modelColList.add(this.buildColModelMap("FName_L1", "Display Name", 70));
+        modelColList.add(this.buildColModelMap("FCredentialsTypeNO", "Passport Number", 70));
+        modelColList.add(this.buildColModelMap("FEmail", "Work Email", 70));
+        modelColList.add(this.buildColModelMap("CFPrivateemail", "Private Email", 70));
+        modelColList.add(this.buildColModelMap("Person Number", "Person Number", 70));
+        return modelColList;
+    }
+
+    private Map<String, Object> buildColModelMap(String index, String label, int width) {
+        return this.buildColModelMap(index, label, width, false, false, false);
+    }
+
+    private Map<String, Object> buildColModelMap(String index, String label, int width, boolean rowspan, boolean isKey,
+                                                 boolean isHedden) {
+        Map<String, Object> gridIdMap = new LinkedHashMap<String, Object>();
+        gridIdMap.put("index", index);
+        gridIdMap.put("name", index);
+        gridIdMap.put("label", label);
+        gridIdMap.put("width", width);
+        if (rowspan) {
+            gridIdMap.put("rowspan", rowspan);
+        }
+        if (isKey) {
+            gridIdMap.put("key", isKey);
+        }
+        if (isHedden) {
+            gridIdMap.put("hidden", isHedden);
+        }
+        return gridIdMap;
+    }
+
+    public String getSql(String peronid, String status) {
+        StringBuffer sql = new StringBuffer();
+        sql.append("\r\n" +
+                "\r\n" +
+                "\r\n" +
+                "select a.FCredentialsTypeNO, c.FName_L1,d.FEmail,d.CFPrivateemail, c.FNumber from T_HR_PersonCredentialsType a left join T_HR_CredentialsType b on a.FCredentialsTypeID=b.fid left join T_BD_Person c \r\n" +
+                " on a.FPERSONID =c.fid \r\n" +
+                " left join T_HR_PersonContactMethod d on d.FPERSONID =c.fid   left join (select * from T_HR_EmpLaborRelationHis where FIsLatestInAday = 1  ) k on  c.fid = k.FPERSONID\r\n" +
+                "left join T_HR_BDEmployeeType p on k.FLABORRELATIONSTATEID=p.fid where   k.FEndDateTime>='2199-01-01'  and  b.FNumber='OT001' ");
+        // 传了多个人员需要拆开拼接sql
+        StringBuffer personsql = new StringBuffer();
+        String[] personidArry = new String[0];
+        if (!peronid.isEmpty()) {
+
+            personidArry = peronid.split(",");
+        }
+        // 状态的sql
+        StringBuffer statussql = new StringBuffer();
+        statussql.append(" and p.FINSERVICE = ");
+        statussql.append("'");
+        statussql.append(status);
+        statussql.append("'");
+        if (personidArry.length > 0) {
+            personsql.append(" and c.fid in ");
+            personsql.append("(");
+            for (String pid : personidArry) {
+                personsql.append("'");
+                personsql.append(pid);
+                personsql.append("'");
+                personsql.append(",");
+            }
+            // 删除最后一个逗号
+            personsql.deleteCharAt(personsql.length() - 1);
+            personsql.append(")");
+            sql.append(personsql);
+            // 和状态拼接
+            if (status != null && !status.equals("")) {
+                sql.append(statussql);
+            }
+        } else if (status != null && !status.equals("")) {
+            sql.append(statussql);
+        } else {
+            sql.append(" and p.FINSERVICE in ('1','2') ");
+        }
+        //获取预入职入职状态等于“未入职”、单据状态等于“审批通过”的数据
+        sql.append("   UNION ALL");
+        sql.append("  SELECT");
+        sql.append("      CASE ");
+        sql.append("          WHEN fidcardno IS NULL THEN fpassportno");
+        sql.append("          ELSE fidcardno");
+        sql.append("      END AS FCredentialsTypeNO,");
+        sql.append("      perEntry.fname_l1 as name,");
+        sql.append("      perEntry.CFWorkemail as FEmail,");
+        sql.append("      perEntry.FEMAIL as CFPrivateemail,");
+        sql.append("      perEntry.CFEmpNumber as empNumber");
+        sql.append("  FROM ");
+        sql.append("      T_HR_PreEntry perEntry");
+        sql.append("  LEFT JOIN ");
+        sql.append("      T_HR_PreEntryPerson perPerson ON perEntry.FTALENTID = perPerson.fid");
+        sql.append("  WHERE ");
+        sql.append("      fbillState = '3' AND fcheckInState = '4'");
+        System.out.println("这个sql是:" + sql.toString());
+        return sql.toString();
+    }
+
+    // 导出
+    // 导出数据
+    public String toExcelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
+            throws BOSException, SQLException, SHRWebException, JSONException {
+        // 获取过滤条件
+        String fastFilterItems = request.getParameter("fastFilterItems");
+        JSONObject tofastFilterItems = new JSONObject(fastFilterItems);
+        // 获取人员
+        JSONObject personJson = tofastFilterItems.getJSONObject("person");
+        String personid = personJson.getString("values");
+        String newperonid = personid.replace(" ", "+"); // 传过来id+可能是空格需要转
+        JSONObject statusJson = tofastFilterItems.getJSONObject("status");
+        String status = statusJson.getString("values");
+        IRowSet rs = DbUtil.executeQuery(this.ctx, this.getSql(newperonid, status));
+
+        LinkedHashMap<String, String> selectFieldsTypeMap = new LinkedHashMap<String, String>();
+        String stringType = "String_@";
+        // String dateType = "Date_yyyy/MM/dd";
+        // String numberType = "Number_0_%s";
+        selectFieldsTypeMap.put("FName_L1", stringType);
+        selectFieldsTypeMap.put("FCredentialsTypeNO", stringType);
+        selectFieldsTypeMap.put("FEmail", stringType);
+        selectFieldsTypeMap.put("CFPrivateemail", stringType);
+        selectFieldsTypeMap.put("FNumber", stringType);
+        //ArrayList<String> list = this.getcolNamesAction();
 //		LinkedHashMap<String,String> fieldsTypeMap = new LinkedHashMap<String, String>();
 //		fieldsTypeMap.put("Display Name", stringType);
 //		fieldsTypeMap.put("Passport Number", stringType);
 //		fieldsTypeMap.put("Work Email", stringType);
 //		fieldsTypeMap.put("Private Email", stringType);
-		ArrayList<String> list = this.getcolNamesAction();
-		ExportAllUtils.exportData(response, rs, "PassportsNumberList.xlsx", selectFieldsTypeMap,list);
-		return null;
+        ArrayList<String> list = this.getcolNamesAction();
+        ExportAllUtils.exportData(response, rs, "PassportsNumberList.xlsx", selectFieldsTypeMap, list);
+        return null;
+
+    }
 
-	}
 
-	
 }

+ 83 - 99
GDYSL/websrc/com/kingdee/shr/customer/gtiit/rpt/PersonRosterListHandler.java

@@ -77,7 +77,7 @@ public class PersonRosterListHandler extends ListHandler {
 	}
 
 	public void getGridDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws BOSException, SQLException, SHRWebException, JSONException {
+            throws BOSException, SQLException, SHRWebException, JSONException {
 		int rows = Integer.parseInt(request.getParameter("rows"));
 		int page = Integer.parseInt(request.getParameter("page"));
 		// 获取过滤条件
@@ -463,87 +463,79 @@ public class PersonRosterListHandler extends ListHandler {
 		StringBuffer sql = new StringBuffer();
 		sql.append(
 				"SELECT a.fnumber as PersonNumber , a.CFSurname as LastName , a.CFMiddleNames as MiddleName , a.CFGivenName as FirstName , a.CFLocalName as LocalName ,");
-		sql.append(" a.fname_l1 as DisplayName,c.fname_l1 as Department,c.fsimplename as Dept , e.fname_l1 as Job , f.Level , d.CFLongname_l1 as Position , d.fnumber as\r\n" + 
-				" PositionCode ,g.fname_l1 as WorkCategory , case when blx.fname_l1 is not null then blx.fname_l1 else lsx.fname_l1  end as PersonType,\r\n" + 
-				"case when qzjz.fname_l1 is not null then qzjz.fname_l1 else lsqzjz.fname_l1  end as FullTimeorPartTime , \r\n" + 
-				"j.fnumber as LineManager ,\r\n" + 
-				" j.fname_l2 as LineManagerName ,b.feffdt as StartTime , b.fleffdt as EndTime , k.FEnterDate as HireDate , k.FTryoutMonth as ProbationPeriod ,\r\n" + 
-				" 'months' as ProbationPeriodUnit , k.FPlanFormalDate as ProbationEndDate , l.FOfficePhone as WorkPhone , l.FMobile as CellPhone , l.FEmail as PrimaryEmail\r\n" + 
-				" , l.CFPrivateemail as Email , m.fname_l1 as Nationality ,v.FIssueDate as WorkPermitIssueDate, v.CFExpirationDate as WorkPermitExpirationDate,w.FIssueDate \r\n" + 
-				"as ResidencePermitIssueDate, w.CFExpirationDate as ResidencePermitExpirationDate,\r\n" + 
-				" case when a.FIDCardNO is  not null then a.FIDCardNO when a.FPassportNO is not null then a.FPassportNO  end as IDcardnoorPassportno, a.FIdCardBeginDate as IDcardcommencingdate,a.FIdCardEndDate as IDcardexpireddate,\r\n" + 
-				" a.FIDCardAddress,\r\n" + 
-				"l.FWORKPLACE as CurrentAddress , case when a.FGender = 1 then 'male' when  a.FGender = 2 then 'female' else '' end as Sex , a.FBirthday as BirthDate ,\r\n" + 
-				"mz.FName_L1 as Ethnicity , hj.FName_L1 as HukouType , a.cfhrd as HouseholdRegisteredDate , a.FNativePlace_L2 as Nativeplace ,\r\n" + 
-				"zm.FName_L1 as PoliticaStatus , hy.FName_L1 as MaritalStatus , l.FPostalcode as Zipcode,\r\n" + 
-				"qrz.CFSchool as GraduatedSchoolofHighestAcademicDegree , qxl.FName_L1 as  HighestAcademicDegree , qxw.FName_L1 as HighestQualificationOfFulltimeEducation ,\r\n" + 
-				" qrz.CFMajor as Majoroffulltimeeducation , qrz.CFGraduation as GraduatedDate ,\r\n" + 
-				"fqrz.CFSchool as GraduateSchoolofHighestDegreeofParttimeEducation  ,\r\n" + 
-				" fqxl.FName_L1  as  HighestDegreeofParttimeEducation ,  fqxw.FName_L1 as HighestQualificationofParttimeeducation , fqrz.CFMajor as MajorofParttimeeducation ,\r\n" + 
-				"l.FLinkName as emergencyContact , l.FLinkTelNum as telephoneofemergency , l.CFRelationship as relationship,\r\n" + 
-				" case when tui.fbizdate is not null then tui.fbizdate  when depart.fbizdate is not  null then depart.fbizdate else ygls.feffdt  end as TerminationDate,\r\n" + 
-				"case when tt.FName_L1 is  not  null then tt.FName_L1 else  a.CFReason end as TerminationReason\r\n" + 
-				" FROM t_bd_person a \r\n" + 
-				"left join ( SELECT * FROM T_HR_EMPORGRELATION where FASSIGNTYPE  = 1 and FIsLatestInAday = 1  ) b on a.fid = b.FPERSONID\r\n" + 
-				"left join T_BD_HRFolk mz on mz.fid=a.FFOLKID\r\n" + 
-				"left join T_BD_HRPolitical zm on zm.fid=a.FPoliticalFaceID\r\n" + 
-				"left join T_BD_HRWed hy on hy.fid=a.FWedID\r\n" + 
-				"left join T_BD_Regpermresidence hj on hj.fid=a.FREGRESIDENCEID\r\n" + 
-				"left join t_org_admin c on b.FAdminOrgID = c.FID \r\n" + 
-				"left join t_org_position d on b.fpositionid = d.FID \r\n" + 
+		sql.append(" a.fname_l1 as DisplayName,c.fname_l1 as Department,c.fsimplename as Dept , e.fname_l1 as Job , f.Level , d.CFLongname_l1 as Position , d.fnumber as\r\n" +
+				" PositionCode ,g.fname_l1 as WorkCategory , case when blx.fname_l1 is not null then blx.fname_l1 else lsx.fname_l1  end as PersonType,\r\n" +
+				"case when qzjz.fname_l1 is not null then qzjz.fname_l1 else lsqzjz.fname_l1  end as FullTimeorPartTime , \r\n" +
+				"j.fnumber as LineManager ,\r\n" +
+				" j.fname_l2 as LineManagerName ,b.feffdt as StartTime , b.fleffdt as EndTime , k.FEnterDate as HireDate , k.FTryoutMonth as ProbationPeriod ,\r\n" +
+				" 'months' as ProbationPeriodUnit , k.FPlanFormalDate as ProbationEndDate , l.FOfficePhone as WorkPhone , l.FMobile as CellPhone , l.FEmail as PrimaryEmail\r\n" +
+				" , l.CFPrivateemail as Email , m.fname_l1 as Nationality ,v.FIssueDate as WorkPermitIssueDate, v.CFExpirationDate as WorkPermitExpirationDate,w.FIssueDate \r\n" +
+				"as ResidencePermitIssueDate, w.CFExpirationDate as ResidencePermitExpirationDate,\r\n" +
+				" case when a.FIDCardNO is  not null then a.FIDCardNO when a.FPassportNO is not null then a.FPassportNO  end as IDcardnoorPassportno, a.FIdCardBeginDate as IDcardcommencingdate,a.FIdCardEndDate as IDcardexpireddate,\r\n" +
+				" a.FIDCardAddress,\r\n" +
+				"l.FWORKPLACE as CurrentAddress , case when a.FGender = 1 then 'male' when  a.FGender = 2 then 'female' else '' end as Sex , a.FBirthday as BirthDate ,\r\n" +
+				"mz.FName_L1 as Ethnicity , hj.FName_L1 as HukouType , a.cfhrd as HouseholdRegisteredDate , a.FNativePlace_L2 as Nativeplace ,\r\n" +
+				"zm.FName_L1 as PoliticaStatus , hy.FName_L1 as MaritalStatus , l.FPostalcode as Zipcode,\r\n" +
+				"qrz.CFSchool as GraduatedSchoolofHighestAcademicDegree , qxl.FName_L1 as  HighestAcademicDegree , qxw.FName_L1 as HighestQualificationOfFulltimeEducation ,\r\n" +
+				" qrz.CFMajor as Majoroffulltimeeducation , qrz.CFGraduation as GraduatedDate ,\r\n" +
+				"fqrz.CFSchool as GraduateSchoolofHighestDegreeofParttimeEducation  ,\r\n" +
+				" fqxl.FName_L1  as  HighestDegreeofParttimeEducation ,  fqxw.FName_L1 as HighestQualificationofParttimeeducation , fqrz.CFMajor as MajorofParttimeeducation ,\r\n" +
+				"l.FLinkName as emergencyContact , l.FLinkTelNum as telephoneofemergency , l.CFRelationship as relationship,\r\n" +
+				" case when tui.fbizdate is not null then tui.fbizdate  when depart.fbizdate is not  null then depart.fbizdate else ygls.feffdt  end as TerminationDate,\r\n" +
+				"case when tt.FName_L1 is  not  null then tt.FName_L1 else  a.CFReason end as TerminationReason\r\n" +
+				" FROM t_bd_person a \r\n" +
+				"left join ( SELECT * FROM T_HR_EMPORGRELATION where FASSIGNTYPE  = 1 and FIsLatestInAday = 1  ) b on a.fid = b.FPERSONID\r\n" +
+				"left join T_BD_HRFolk mz on mz.fid=a.FFOLKID\r\n" +
+				"left join T_BD_HRPolitical zm on zm.fid=a.FPoliticalFaceID\r\n" +
+				"left join T_BD_HRWed hy on hy.fid=a.FWedID\r\n" +
+				"left join T_BD_Regpermresidence hj on hj.fid=a.FREGRESIDENCEID\r\n" +
+				"left join t_org_admin c on b.FAdminOrgID = c.FID \r\n" +
+				"left join t_org_position d on b.fpositionid = d.FID \r\n" +
 				"left join t_org_job e on d.FJOBID = e.fid");
-		sql.append(" left join ( SELECT a.FPERSONID ,b.FNAME_l1 as Level FROM T_HR_EmpPostRank a left join t_hr_jobgrade b on a.FJOBGRADEID  = b.FID  " );
-				if(StringUtils.isNotBlank(deadline)) {
-					sql.append(" where a.feffdt<=" + "'" + deadline + "'" + " and a.fleffdt >=" + "'" + deadline + "'  ");
-				}
-		sql.append(" ) f on a.fid = f.FPERSONID ");
-		sql.append(" left join CT_MP_WorkerCategory g on b.CFWorkercategoryID = g.fid \r\n" + 
-				"left join CT_MP_Fullorpart h on a.CFFtorptID = h.fid\r\n" + 
-				"left join T_HR_EmployeeClassify i on a.CFPersontypeID = i.FID \r\n" + 
-				"left join t_bd_person j on b.CFLineManagerNameI = j.fid\r\n" + 
-				"left join (select * from T_HR_EmpLaborRelationHis where FIsLatestInAday = 1  ) k on  a.fid = k.FPERSONID\r\n" + 
-				"left join T_HR_PersonContactMethod l on a.fid = l.FPERSONID \r\n" + 
-				"left join T_BD_Nationality m on a.FNationalityID = m.fid\r\n" + 
-				"left join CT_MP_Fullperson qrz on qrz.FPersonID=a.fid\r\n" + 
-				"left join  T_BD_HRDiploma qxl on qrz.CFBackgroundID= qxl.fid\r\n" + 
-				"left join  T_BD_HRDegree qxw on qxw.fid=qrz.CFDegreeID\r\n" + 
-				"left join CT_MP_Partperson fqrz on fqrz.FPersonID =a.fid\r\n" + 
-				"left join T_BD_HRDiploma fqxl on fqrz.CFBackgroundID= fqxl.fid\r\n" + 
-				"left join T_BD_HRDegree fqxw on fqxw.fid=fqrz.CFDegreeID\r\n" + 
-				"left join T_HR_BDEmployeeType p on k.FLABORRELATIONSTATEID=p.fid\r\n" + 
-				"left join  (select a.FCredentialsTypeNO,a.fid,a.fpersonid from T_HR_PersonCredentialsType a left join T_HR_CredentialsType b on a.FCredentialsTypeID=b.fid where b.FNUMBER ='CN01' )r on a.fid=r.fpersonid\r\n" + 
-				"left join(SELECT a.fname_l1,c.fpersonid FROM T_HR_VariationReason a left join (\r\n" + 
-				"SELECT a.* FROM T_HR_ResignBizBillEntry a right join \r\n" + 
-				"(SELECT max(fbizdate)as fbizdate,fpersonid FROM T_HR_ResignBizBillEntry group by fpersonid)b on a.fpersonid=b.fpersonid and a.fbizdate=b.fbizdate ) c\r\n" + 
-				"on a.fid=c.FVariationReasonID \r\n" + 
-				" )tt on a.fid=tt.fpersonid\r\n" + 
-				"\r\n" + 
-				"\r\n" + 
-				"left join ( SELECT DATEADD(DAY, -1,  max(a.feffdt)) as bizdate,a.fpersonid FROM T_HR_EmpOrgRelation  a left join T_HR_BDEmployeeType b on a.FEmployeeType=b.fid where  b.FinService in('2') group by a.fpersonid) lzrq on\r\n" + 
-				"a.fid=lzrq.fpersonid\r\n" + 
-				"\r\n" + 
-				"left join( SELECT  a.CFExpirationDate,a.FCredentialsTypeNO,a.fpersonid ,a.FIssueDate FROM T_HR_PersonCredentialsType a \r\n" + 
-				"INNER join( select max(CFExpirationDate)CFExpirationDate,a.fpersonid from T_HR_PersonCredentialsType a left join T_HR_CredentialsType b on a.FCredentialsTypeID=b.fid where b.FNUMBER ='CWP'  group by a.fpersonid \r\n" + 
-				")  b on a.fpersonid=b.fpersonid and a.CFExpirationDate =b.CFExpirationDate inner join T_HR_CredentialsType c  on a.FCredentialsTypeID=c.fid  where  c.FNUMBER ='CWP'\r\n" + 
-				" )v on a.fid=v.FPersonID\r\n" + 
-				"\r\n" + 
-				"left join(SELECT  a.CFExpirationDate,a.FCredentialsTypeNO,a.fpersonid ,a.FIssueDate FROM T_HR_PersonCredentialsType a \r\n" + 
-				"INNER join( select max(CFExpirationDate)CFExpirationDate,a.fpersonid from T_HR_PersonCredentialsType a left join T_HR_CredentialsType b on a.FCredentialsTypeID=b.fid where b.FNUMBER ='CFRP'  group by a.fpersonid \r\n" + 
-				")  b on a.fpersonid=b.fpersonid and a.CFExpirationDate =b.CFExpirationDate inner join T_HR_CredentialsType c  on a.FCredentialsTypeID=c.fid  where  c.FNUMBER ='CFRP'\r\n" + 
-				")w on a.fid=w.FPersonID\r\n" + 
-				"left join (SELECT max(fbizdate)as fbizdate,FPERSONID  FROM T_HR_RetireBizBillEntry where fbizdate is not null  group by FPERSONID )tui on a.fid=tui.FPERSONID\r\n" + 
-				"left join(SELECT max(fbizdate)as fbizdate,fpersonid FROM T_HR_ResignBizBillEntry  group by fpersonid)depart on a.fid=depart.fpersonid \r\n" + 
-				"left join(\r\n" + 
-				"SELECT DATEADD(DAY, -1,  max(feffdt)) as feffdt,fpersonid FROM  t_hr_emplaborrelationhis  where flaborrelationstateid=(\r\n" + 
+		sql.append(" left join ( SELECT a.FPERSONID ,b.FNAME_l1 as Level FROM T_HR_EmpPostRank a left join t_hr_jobgrade b on a.FJOBGRADEID  = b.FID  where a.feffdt<="+"'"+deadline+"'"+" and a.fleffdt >="+"'"+deadline+"' ) f on a.fid = f.FPERSONID");
+		sql.append(" left join CT_MP_WorkerCategory g on b.CFWorkercategoryID = g.fid \r\n" +
+				"left join CT_MP_Fullorpart h on a.CFFtorptID = h.fid\r\n" +
+				"left join T_HR_EmployeeClassify i on a.CFPersontypeID = i.FID \r\n" +
+				"left join t_bd_person j on b.CFLineManagerNameI = j.fid\r\n" +
+				"left join (select * from T_HR_EmpLaborRelationHis where FIsLatestInAday = 1  ) k on  a.fid = k.FPERSONID\r\n" +
+				"left join T_HR_PersonContactMethod l on a.fid = l.FPERSONID \r\n" +
+				"left join T_BD_Nationality m on a.FNationalityID = m.fid\r\n" +
+				"left join CT_MP_Fullperson qrz on qrz.FPersonID=a.fid\r\n" +
+				"left join  T_BD_HRDiploma qxl on qrz.CFBackgroundID= qxl.fid\r\n" +
+				"left join  T_BD_HRDegree qxw on qxw.fid=qrz.CFDegreeID\r\n" +
+				"left join CT_MP_Partperson fqrz on fqrz.FPersonID =a.fid\r\n" +
+				"left join T_BD_HRDiploma fqxl on fqrz.CFBackgroundID= fqxl.fid\r\n" +
+				"left join T_BD_HRDegree fqxw on fqxw.fid=fqrz.CFDegreeID\r\n" +
+				"left join T_HR_BDEmployeeType p on k.FLABORRELATIONSTATEID=p.fid\r\n" +
+				"left join  (select a.FCredentialsTypeNO,a.fid,a.fpersonid from T_HR_PersonCredentialsType a left join T_HR_CredentialsType b on a.FCredentialsTypeID=b.fid where b.FNUMBER ='CN01' )r on a.fid=r.fpersonid\r\n" +
+				"left join(SELECT a.fname_l1,c.fpersonid FROM T_HR_VariationReason a left join (\r\n" +
+				"SELECT a.* FROM T_HR_ResignBizBillEntry a right join \r\n" +
+				"(SELECT max(fbizdate)as fbizdate,fpersonid FROM T_HR_ResignBizBillEntry group by fpersonid)b on a.fpersonid=b.fpersonid and a.fbizdate=b.fbizdate ) c\r\n" +
+				"on a.fid=c.FVariationReasonID \r\n" +
+				" )tt on a.fid=tt.fpersonid\r\n" +
+				"\r\n" +
+				"\r\n" +
+				"left join ( SELECT DATEADD(DAY, -1,  max(a.feffdt)) as bizdate,a.fpersonid FROM T_HR_EmpOrgRelation  a left join T_HR_BDEmployeeType b on a.FEmployeeType=b.fid where  b.FinService in('2') group by a.fpersonid) lzrq on\r\n" +
+				"a.fid=lzrq.fpersonid\r\n" +
+				"\r\n" +
+				"left join( SELECT  a.CFExpirationDate,a.FCredentialsTypeNO,a.fpersonid ,a.FIssueDate FROM T_HR_PersonCredentialsType a \r\n" +
+				"INNER join( select max(CFExpirationDate)CFExpirationDate,a.fpersonid from T_HR_PersonCredentialsType a left join T_HR_CredentialsType b on a.FCredentialsTypeID=b.fid where b.FNUMBER ='CWP'  group by a.fpersonid \r\n" +
+				")  b on a.fpersonid=b.fpersonid and a.CFExpirationDate =b.CFExpirationDate inner join T_HR_CredentialsType c  on a.FCredentialsTypeID=c.fid  where  c.FNUMBER ='CWP'\r\n" +
+				" )v on a.fid=v.FPersonID\r\n" +
+				"\r\n" +
+				"left join(SELECT  a.CFExpirationDate,a.FCredentialsTypeNO,a.fpersonid ,a.FIssueDate FROM T_HR_PersonCredentialsType a \r\n" +
+				"INNER join( select max(CFExpirationDate)CFExpirationDate,a.fpersonid from T_HR_PersonCredentialsType a left join T_HR_CredentialsType b on a.FCredentialsTypeID=b.fid where b.FNUMBER ='CFRP'  group by a.fpersonid \r\n" +
+				")  b on a.fpersonid=b.fpersonid and a.CFExpirationDate =b.CFExpirationDate inner join T_HR_CredentialsType c  on a.FCredentialsTypeID=c.fid  where  c.FNUMBER ='CFRP'\r\n" +
+				")w on a.fid=w.FPersonID\r\n" +
+				"left join (SELECT max(fbizdate)as fbizdate,FPERSONID  FROM T_HR_RetireBizBillEntry where fbizdate is not null  group by FPERSONID )tui on a.fid=tui.FPERSONID\r\n" +
+				"left join(SELECT max(fbizdate)as fbizdate,fpersonid FROM T_HR_ResignBizBillEntry  group by fpersonid)depart on a.fid=depart.fpersonid \r\n" +
+				"left join(\r\n" +
+				"SELECT DATEADD(DAY, -1,  max(feffdt)) as feffdt,fpersonid FROM  t_hr_emplaborrelationhis  where flaborrelationstateid=(\r\n" +
 				"SELECT fid FROM T_HR_BDEmployeeType where FNUMBER ='S09')  group by fpersonid )ygls on a.fid=ygls.fpersonid");
-		sql.append(" left join T_HR_EmployeeClassify blx on b.CFPersontypeID=blx.fid\r\n" + 
-				"left join (SELECT * FROM T_BD_PersonHis ");
-		if(StringUtils.isNotBlank(deadline)) {
-			sql.append(" where FEFFDT<="+"'"+deadline+"'"+" and FLEFFDT >="+"'"+deadline+"'");
-		}
-		sql.append(" ) ryls on ryls.FHistoryRelateID=a.fid\r\n  ");
-		sql.append(" left join  T_HR_EmployeeClassify lsx on lsx.fid=ryls.CFPersontypeID "
-				+ "left join CT_MP_Fullorpart qzjz on b.CFFtorptID=qzjz.fid\r\n" + 
+		sql.append(" left join T_HR_EmployeeClassify blx on b.CFPersontypeID=blx.fid\r\n" +
+				"left join (SELECT * FROM T_BD_PersonHis where FEFFDT<="+"'"+deadline+"'"+" and FLEFFDT >="+"'"+deadline+"')ryls on ryls.FHistoryRelateID=a.fid\r\n" +
+				"left join  T_HR_EmployeeClassify lsx on lsx.fid=ryls.CFPersontypeID "
+				+ "left join CT_MP_Fullorpart qzjz on b.CFFtorptID=qzjz.fid\r\n" +
 				" left join CT_MP_Fullorpart lsqzjz on lsqzjz.fid= ryls.CFFtorptID");
 		// 传了多个人员需要拆开拼接sql
 		StringBuffer personsql = new StringBuffer();
@@ -556,16 +548,8 @@ public class PersonRosterListHandler extends ListHandler {
 		StringBuffer typesql = new StringBuffer();
 		String[] typeArry = new String[0];
 
-		// 状态的sql  20250311 状态取值改变
+		// 状态的sql
 		StringBuffer statussql = new StringBuffer();
-		if(StringUtils.equals(status, "1")) {
-			statussql.append(" and p.FINSERVICE in ( ");
-			statussql.append(" '1','4' ) ");
-			 
-		}else if(StringUtils.equals(status, "2")) {
-			statussql.append(" and p.FINSERVICE in ( ");
-			statussql.append(" '0','2','3' ) ");
-		}
 		statussql.append(" and p.FINSERVICE = ");
 		statussql.append("'");
 		statussql.append(status);
@@ -777,7 +761,7 @@ public class PersonRosterListHandler extends ListHandler {
 
 	// 导出数据
 	public String toExcelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
-			throws BOSException, SQLException, SHRWebException, JSONException {
+            throws BOSException, SQLException, SHRWebException, JSONException {
 
 		// 获取过滤条件
 		String fastFilterItems = request.getParameter("fastFilterItems");
@@ -825,7 +809,7 @@ public class PersonRosterListHandler extends ListHandler {
 		int num = 0;
 		IRowSet rs = DbUtil.executeQuery(this.ctx,
 				this.getSql(personid, personTypeId, status, startDate, endDate, resStartDate, resEndDate, dataeTime));
-		
+
 		LinkedHashMap<String, String> selectFieldsTypeMap = new LinkedHashMap<String, String>();
 		String stringType = "String_@";
 		String dateType = "Date_yyyy/MM/dd";
@@ -891,7 +875,7 @@ public class PersonRosterListHandler extends ListHandler {
 		selectFieldsTypeMap.put("RELATIONSHIP", stringType);
 		selectFieldsTypeMap.put("TERMINATIONDATE", dateType);
 		selectFieldsTypeMap.put("TERMINATIONREASON", stringType);
-		
+
 		//列名要设置成中文+英文
 		LinkedHashMap<String, String> selectChineseMap = new LinkedHashMap<String, String>();
 		selectChineseMap.put("NO.序号", numberType);
@@ -957,7 +941,7 @@ public class PersonRosterListHandler extends ListHandler {
 		selectChineseMap.put("Termination Reason 离职原因", stringType);
 
 
-		
+
 		PersonRosterListHandler.exportData(response, rs, "EmployeeListReport.xlsx", selectFieldsTypeMap,selectChineseMap);
 
 		return null;
@@ -965,7 +949,7 @@ public class PersonRosterListHandler extends ListHandler {
 	}
 
 	/**
-	 * 
+	 *
 	 * @param response
 	 *            response
 	 * @param resource
@@ -1012,10 +996,10 @@ public class PersonRosterListHandler extends ListHandler {
 				// 创建一个新的单元格样式,并将字体样式应用于该样式
 				CellStyle cellStyle = workBook.createCellStyle();
 				cellStyle.setFont(font);
-					
-				
+
+
 				if (i == 0) {
-					
+
 					for (int j = 0; j < numColumns; j++) {
 						// 创建列
 						XSSFCell cell = titleRow.createCell(j);
@@ -1025,12 +1009,12 @@ public class PersonRosterListHandler extends ListHandler {
 						sheet.setColumnWidth(j+1, 6000);
 						// 应用字体样式
 						titleRow.getCell(j).setCellStyle(cellStyle);
-						
+
 					}
 				}
 
 				i++;
-				// 序列号 
+				// 序列号
 				int sertize=0;
 				// 创建数据
 				while (rs.next()) {

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott