|
@@ -30,10 +30,7 @@ import com.kingdee.eas.custom.synctask.entity.PersonEntity;
|
|
|
import com.kingdee.eas.custom.synctask.entity.PositionEntity;
|
|
|
import com.kingdee.eas.hr.ats.AtsUtil;
|
|
|
import com.kingdee.eas.hr.base.EmployeeTypeInfo;
|
|
|
-import com.kingdee.eas.hr.emp.IPersonPosition;
|
|
|
-import com.kingdee.eas.hr.emp.PersonPositionCollection;
|
|
|
-import com.kingdee.eas.hr.emp.PersonPositionFactory;
|
|
|
-import com.kingdee.eas.hr.emp.PersonPositionInfo;
|
|
|
+import com.kingdee.eas.hr.emp.*;
|
|
|
import com.kingdee.eas.hr.org.JobLevelInfo;
|
|
|
import com.kingdee.eas.util.app.DbUtil;
|
|
|
import com.kingdee.jdbc.rowset.IRowSet;
|
|
@@ -225,8 +222,9 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
Response response = client.newCall(request).execute();
|
|
|
//处理响应结果,写入日志
|
|
|
return handlerResponse(ctx, response, syncLogInfo);
|
|
|
+ } else {
|
|
|
+ throw new BOSException("同步数据不能为空!");
|
|
|
}
|
|
|
- return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -464,6 +462,8 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
sic.add("person.number");
|
|
|
sic.add("person.name");
|
|
|
sic.add("person.id");
|
|
|
+ sic.add("person.hireDate");
|
|
|
+ sic.add("person.nCell");
|
|
|
sic.add("person.securityLe.id");
|
|
|
sic.add("person.securityLe.name");
|
|
|
sic.add("person.securityLe.number");
|
|
@@ -483,10 +483,22 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
sic.add("primaryPosition.number");
|
|
|
EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, sic, null);
|
|
|
PersonPositionCollection personPositionCollection = iPersonPosition.getPersonPositionCollection(entityViewInfo);
|
|
|
+ //参加工作日期
|
|
|
+ Map<String, Date> personOtherInfoMap = new HashMap();
|
|
|
+ IPersonOtherInfo iPersonOtherInfo = PersonOtherInfoFactory.getLocalInstance(ctx);
|
|
|
+ //PersonOtherInfoCollection personOtherInfoCollection = iPersonOtherInfo.getPersonOtherInfoCollection("where person = '" + personInfo.getId() + "'");
|
|
|
+ PersonOtherInfoCollection personOtherInfoCollection = iPersonOtherInfo
|
|
|
+ .getPersonOtherInfoCollection("select * , person.id");
|
|
|
+ for (int i = 0; i < personOtherInfoCollection.size(); i++) {
|
|
|
+ PersonOtherInfoInfo personOtherInfoInfo = personOtherInfoCollection.get(i);
|
|
|
+ logger.error("personOtherInfoInfo.getPerson().getId------------" + personOtherInfoInfo.getPerson().getId());
|
|
|
+ personOtherInfoMap.put(personOtherInfoInfo.getPerson().getId().toString()
|
|
|
+ , personOtherInfoInfo.getJobStartDate());
|
|
|
+ }
|
|
|
for (int i = 0; i < personPositionCollection.size(); i++) {
|
|
|
//职业信息
|
|
|
PersonPositionInfo personPositionInfo = personPositionCollection.get(i);
|
|
|
- PersonEntity person = packagingPerson(ctx, personPositionInfo);
|
|
|
+ PersonEntity person = packagingPerson(ctx, personPositionInfo, personOtherInfoMap);
|
|
|
dataList.add(person);
|
|
|
}
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
@@ -538,8 +550,9 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
Response response = client.newCall(request).execute();
|
|
|
//处理响应结果,写入日志
|
|
|
return handlerResponse(ctx, response, syncLogInfo);
|
|
|
+ } else {
|
|
|
+ throw new BOSException("同步数据不能为空!");
|
|
|
}
|
|
|
- return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -548,7 +561,7 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
* @param personPositionInfo
|
|
|
* @return
|
|
|
*/
|
|
|
- public PersonEntity packagingPerson(Context ctx, PersonPositionInfo personPositionInfo) throws
|
|
|
+ public PersonEntity packagingPerson(Context ctx, PersonPositionInfo personPositionInfo, Map<String, Date> personOtherInfoMap) throws
|
|
|
BOSException, EASBizException {
|
|
|
SimpleDateFormat originalFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
//人员
|
|
@@ -592,14 +605,17 @@ public class SyncTranForOAFacadeControllerBean extends AbstractSyncTranForOAFaca
|
|
|
//电子邮件
|
|
|
person.setEmail(personInfo.getEmail());
|
|
|
//入职日期
|
|
|
- Date enterDate = personPositionInfo.getEnterDate();
|
|
|
- if (enterDate != null) {
|
|
|
- person.setCompanystartdate(originalFormat.format(enterDate));
|
|
|
+ //Date enterDate = personPositionInfo.getEnterDate();
|
|
|
+ Date hireDate = personInfo.getHireDate();
|
|
|
+ logger.error("personInfo.getHireDate------------" + personInfo.getHireDate());
|
|
|
+ if (hireDate != null) {
|
|
|
+ person.setCompanystartdate(originalFormat.format(hireDate));
|
|
|
} else {
|
|
|
- throw new BOSException("同步人员【" + personInfo.getName() + "】 入职日期不可为空!");
|
|
|
+ //throw new BOSException("同步人员【" + personInfo.getName() + "】 入职日期不可为空!");
|
|
|
+ person.setCompanystartdate("");
|
|
|
}
|
|
|
//参加工作日期
|
|
|
- Date jobStartDate = personPositionInfo.getJobStartDate();
|
|
|
+ Date jobStartDate = personOtherInfoMap.get(personInfo.getId().toString());
|
|
|
if (jobStartDate != null) {
|
|
|
person.setWorkstartdate(originalFormat.format(jobStartDate));
|
|
|
}
|