|
@@ -0,0 +1,100 @@
|
|
|
+package com.kingdee.shr.custom.calcdailypay.imp;
|
|
|
+
|
|
|
+import com.kingdee.bos.BOSException;
|
|
|
+import com.kingdee.bos.Context;
|
|
|
+import com.kingdee.bos.dao.IObjectValue;
|
|
|
+import com.kingdee.eas.basedata.person.IPerson;
|
|
|
+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.AffairBizCheckFacadeFactory;
|
|
|
+import com.kingdee.eas.hr.affair.IAffairBizCheckFacade;
|
|
|
+import com.kingdee.eas.hr.base.app.EmpPostExperienceHisHelper;
|
|
|
+import com.kingdee.eas.hr.emp.BankFactory;
|
|
|
+import com.kingdee.eas.hr.emp.EmpBatchAffairBizException;
|
|
|
+import com.kingdee.eas.hr.emp.IBank;
|
|
|
+import com.kingdee.eas.hr.emp.IPersonDataSourceOptFacade;
|
|
|
+import com.kingdee.eas.hr.emp.IPersonOtherInfo;
|
|
|
+import com.kingdee.eas.hr.emp.PersonDataSourceOptFacadeFactory;
|
|
|
+import com.kingdee.eas.hr.emp.PersonOtherInfoFactory;
|
|
|
+import com.kingdee.eas.hr.emp.app.util.SHREmpImportTool;
|
|
|
+import com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo;
|
|
|
+import com.kingdee.shr.base.syssetting.app.io.fileImport.BaseImportService;
|
|
|
+import com.kingdee.shr.base.syssetting.app.io.fileImport.BaseRowInfo;
|
|
|
+import com.kingdee.shr.base.syssetting.app.io.fileImport.DynamicModelHelper;
|
|
|
+import com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException;
|
|
|
+import com.kingdee.shr.base.syssetting.app.io.impl.PersonDataSourceImportUtils;
|
|
|
+import com.kingdee.shr.base.syssetting.web.dynamic.model.DynamicModelInfo;
|
|
|
+import com.kingdee.util.DateTimeUtils;
|
|
|
+import com.kingdee.util.StringUtils;
|
|
|
+
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Locale;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+public class MESCheckImportService extends BaseImportService {
|
|
|
+
|
|
|
+ private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+
|
|
|
+
|
|
|
+ protected void importNew(BaseRowInfo row) throws ImportException {
|
|
|
+ CoreBaseInfo coreBaseInfo = this.transRowToObejct(row);
|
|
|
+ this.setOtherFieldInfo(coreBaseInfo, row);
|
|
|
+ String personNum = row.getValueOfString("personNum");
|
|
|
+ Context ctx = this.getContext();
|
|
|
+
|
|
|
+ try {
|
|
|
+ IPerson personIns = PersonFactory.getLocalInstance(ctx);
|
|
|
+ PersonCollection personCol = personIns.getPersonCollection("where number = '"+personNum+"'");
|
|
|
+ if(null != personCol && personCol.size()!=0) {
|
|
|
+ PersonInfo pInfo = personCol.get(0);
|
|
|
+ String personId = pInfo.getId().toString();
|
|
|
+ String bizDateStr = row.getValueOfString("bizDate");
|
|
|
+ Date effect = sdf.parse(bizDateStr);
|
|
|
+ Map pmap = EmpPostExperienceHisHelper.getPersonAllRelationHisMap(ctx, personId, effect);
|
|
|
+ coreBaseInfo.put("position", pmap.get("position"));
|
|
|
+ coreBaseInfo.put("company", pmap.get("company"));
|
|
|
+ coreBaseInfo.put("depart", pmap.get("department"));
|
|
|
+ coreBaseInfo.put("person", pInfo);
|
|
|
+
|
|
|
+// result.put("person", personInfo);
|
|
|
+// result.put("personHis", personHisInfo);
|
|
|
+// /* 976 */ result.put("position", positionInfo);
|
|
|
+// /* 977 */ result.put("adminOrg", adminOrgUnitInfo);
|
|
|
+// /* 978 */ result.put("company", adminOrgCompany);
|
|
|
+// /* 979 */ result.put("department", department);
|
|
|
+// /* 980 */ result.put("empType", employeeTypeInfo);
|
|
|
+// /* 981 */ result.put("action", actionInfo);
|
|
|
+// /* 982 */ result.put("job", jobInfo);
|
|
|
+// /* 983 */ result.put("jobGrade", jobGradeInfo);
|
|
|
+// /* 984 */ result.put("jobLevel", jobLevelInfo);
|
|
|
+// /* 985 */ result.put("empOrgRelation", empOrgRelationInfo);
|
|
|
+
|
|
|
+ }else {
|
|
|
+ throw new ImportException("没有找到编码为:"+personNum+"的员工,请输入正确编码!");
|
|
|
+// e1 = new EmpBatchAffairBizException(EmpBatchAffairBizException.CANNOT_IMPORT_LINE, var8, new Object[]{var8.getMessage()});
|
|
|
+//
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (BOSException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (ParseException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (EASBizException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ this.submitData(coreBaseInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|