|
@@ -7,9 +7,6 @@ import com.kingdee.bos.Context;
|
|
|
import com.kingdee.bos.metadata.entity.*;
|
|
import com.kingdee.bos.metadata.entity.*;
|
|
|
import com.kingdee.bos.metadata.query.util.CompareType;
|
|
import com.kingdee.bos.metadata.query.util.CompareType;
|
|
|
import com.kingdee.eas.basedata.org.*;
|
|
import com.kingdee.eas.basedata.org.*;
|
|
|
-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.basedata.person.PersonInfo;
|
|
|
import com.kingdee.eas.common.EASBizException;
|
|
import com.kingdee.eas.common.EASBizException;
|
|
|
import com.kingdee.eas.custom.log.ISyncLog;
|
|
import com.kingdee.eas.custom.log.ISyncLog;
|
|
@@ -19,6 +16,7 @@ import com.kingdee.eas.custom.log.app.DataDirectionEnum;
|
|
|
import com.kingdee.eas.custom.log.app.DockingSystemEnum;
|
|
import com.kingdee.eas.custom.log.app.DockingSystemEnum;
|
|
|
import com.kingdee.eas.custom.log.app.SyncEntityNameEnum;
|
|
import com.kingdee.eas.custom.log.app.SyncEntityNameEnum;
|
|
|
import com.kingdee.eas.custom.log.app.SyncStatusEnum;
|
|
import com.kingdee.eas.custom.log.app.SyncStatusEnum;
|
|
|
|
|
+import com.kingdee.eas.custom.synctask.utils.GeneralUtils;
|
|
|
import com.kingdee.eas.hr.ats.AtsUtil;
|
|
import com.kingdee.eas.hr.ats.AtsUtil;
|
|
|
import com.kingdee.eas.hr.base.EmployeeTypeInfo;
|
|
import com.kingdee.eas.hr.base.EmployeeTypeInfo;
|
|
|
import com.kingdee.eas.hr.emp.IPersonPosition;
|
|
import com.kingdee.eas.hr.emp.IPersonPosition;
|
|
@@ -26,6 +24,7 @@ import com.kingdee.eas.hr.emp.PersonPositionCollection;
|
|
|
import com.kingdee.eas.hr.emp.PersonPositionFactory;
|
|
import com.kingdee.eas.hr.emp.PersonPositionFactory;
|
|
|
import com.kingdee.eas.hr.emp.PersonPositionInfo;
|
|
import com.kingdee.eas.hr.emp.PersonPositionInfo;
|
|
|
import com.kingdee.eas.utils.ExpiringMapCache;
|
|
import com.kingdee.eas.utils.ExpiringMapCache;
|
|
|
|
|
+import com.kingdee.util.DateTimeUtils;
|
|
|
import okhttp3.*;
|
|
import okhttp3.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.log4j.Logger;
|
|
import org.apache.log4j.Logger;
|
|
@@ -236,6 +235,13 @@ public class SyncTranForIOTFacadeControllerBean extends AbstractSyncTranForIOTFa
|
|
|
EmployeeTypeInfo employeeType = person.getEmployeeType();
|
|
EmployeeTypeInfo employeeType = person.getEmployeeType();
|
|
|
String number = employeeType.getNumber();
|
|
String number = employeeType.getNumber();
|
|
|
String personStatus = personStatusMap.get(number);
|
|
String personStatus = personStatusMap.get(number);
|
|
|
|
|
+ //调用新增接口---禁用系统用户账号 状态等于3属于离职人员
|
|
|
|
|
+ if ("3".equals(personStatus)) {
|
|
|
|
|
+ logger.error("personStatus=3" + person.getName());
|
|
|
|
|
+ //调用禁用用户接口
|
|
|
|
|
+ GeneralUtils generalUtils = new GeneralUtils();
|
|
|
|
|
+ generalUtils.disableUserAccount(ctx, person);
|
|
|
|
|
+ }
|
|
|
personMap.put("status", personStatus);//状态
|
|
personMap.put("status", personStatus);//状态
|
|
|
AdminOrgUnitInfo personDep = personPositionInfo.getPersonDep();
|
|
AdminOrgUnitInfo personDep = personPositionInfo.getPersonDep();
|
|
|
List orgIds = new ArrayList();
|
|
List orgIds = new ArrayList();
|
|
@@ -245,6 +251,11 @@ public class SyncTranForIOTFacadeControllerBean extends AbstractSyncTranForIOTFa
|
|
|
//员工编码
|
|
//员工编码
|
|
|
Map paramsMap = new HashMap();
|
|
Map paramsMap = new HashMap();
|
|
|
paramsMap.put("employeeNo", person.getNumber());
|
|
paramsMap.put("employeeNo", person.getNumber());
|
|
|
|
|
+ Date hireDate = person.getHireDate();
|
|
|
|
|
+ if (hireDate != null) {
|
|
|
|
|
+ String entryDate = DateTimeUtils.format(hireDate, "yyyy-MM-dd");
|
|
|
|
|
+ paramsMap.put("entryDate", entryDate);
|
|
|
|
|
+ }
|
|
|
personMap.put("params", paramsMap);
|
|
personMap.put("params", paramsMap);
|
|
|
personMap.put("areaCode", "+86");
|
|
personMap.put("areaCode", "+86");
|
|
|
}
|
|
}
|
|
@@ -252,7 +263,9 @@ public class SyncTranForIOTFacadeControllerBean extends AbstractSyncTranForIOTFa
|
|
|
syncLogInfo.setRequestParams(jsonObject.toString());
|
|
syncLogInfo.setRequestParams(jsonObject.toString());
|
|
|
//执行同步人员到Iot
|
|
//执行同步人员到Iot
|
|
|
syncLogInfo.setSyncCount(personIds.size());
|
|
syncLogInfo.setSyncCount(personIds.size());
|
|
|
|
|
+ //部署需要替换 syncPerson(ctx, jsonObject.toString(), syncLogInfo);
|
|
|
return syncPerson(ctx, jsonObject.toString(), syncLogInfo);
|
|
return syncPerson(ctx, jsonObject.toString(), syncLogInfo);
|
|
|
|
|
+ //return new HashMap();
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
syncLogInfo.setSyncStatus(SyncStatusEnum.ERROR);
|
|
syncLogInfo.setSyncStatus(SyncStatusEnum.ERROR);
|
|
@@ -387,6 +400,8 @@ public class SyncTranForIOTFacadeControllerBean extends AbstractSyncTranForIOTFa
|
|
|
.build();
|
|
.build();
|
|
|
response = client.newCall(request).execute();
|
|
response = client.newCall(request).execute();
|
|
|
String string = response.body().string();
|
|
String string = response.body().string();
|
|
|
|
|
+ logger.error("string--" + string);
|
|
|
|
|
+ syncLogInfo.setSyncResult(string);
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
result = objectMapper.readValue(string, Map.class);
|
|
result = objectMapper.readValue(string, Map.class);
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
@@ -412,7 +427,7 @@ public class SyncTranForIOTFacadeControllerBean extends AbstractSyncTranForIOTFa
|
|
|
//syncLogInfo.setSyncCount(total);
|
|
//syncLogInfo.setSyncCount(total);
|
|
|
syncLogInfo.setSuccessNum(success);
|
|
syncLogInfo.setSuccessNum(success);
|
|
|
syncLogInfo.setFailNum(fail);
|
|
syncLogInfo.setFailNum(fail);
|
|
|
- syncLogInfo.setSyncResult(result.toString());
|
|
|
|
|
|
|
+
|
|
|
SyncLogFactory.getLocalInstance(ctx).save(syncLogInfo);
|
|
SyncLogFactory.getLocalInstance(ctx).save(syncLogInfo);
|
|
|
} else {
|
|
} else {
|
|
|
syncLogInfo.setSyncStatus(SyncStatusEnum.ERROR);
|
|
syncLogInfo.setSyncStatus(SyncStatusEnum.ERROR);
|
|
@@ -496,4 +511,6 @@ public class SyncTranForIOTFacadeControllerBean extends AbstractSyncTranForIOTFa
|
|
|
}
|
|
}
|
|
|
return paramStr.toString();
|
|
return paramStr.toString();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|