|
|
@ -693,9 +693,7 @@ public class HrmResourceImportProcessUtil {
|
|
|
|
boolean flag = true;
|
|
|
|
boolean flag = true;
|
|
|
|
|
|
|
|
|
|
|
|
/*添加人员信息*/
|
|
|
|
/*添加人员信息*/
|
|
|
|
String insertStr = "insert into jcl_org_hrmresource(";
|
|
|
|
Map<String, Object> resourceParams = new HashMap<>();
|
|
|
|
StringBuilder insertFields = new StringBuilder();
|
|
|
|
|
|
|
|
StringBuilder insertValues = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String workCode = hrmResourceImportParam.getWork_code();
|
|
|
|
String workCode = hrmResourceImportParam.getWork_code();
|
|
|
|
workCode = CodeRuleManager.getCodeRuleManager().generateRuleCode(RuleCodeType.USER, workCode);
|
|
|
|
workCode = CodeRuleManager.getCodeRuleManager().generateRuleCode(RuleCodeType.USER, workCode);
|
|
|
@ -715,40 +713,40 @@ public class HrmResourceImportProcessUtil {
|
|
|
|
boolean isNumber = hrmFieldType.endsWith("Long") || hrmFieldType.endsWith("Integer") || hrmFieldType.endsWith("Short") || hrmFieldType.endsWith("Float");
|
|
|
|
boolean isNumber = hrmFieldType.endsWith("Long") || hrmFieldType.endsWith("Integer") || hrmFieldType.endsWith("Short") || hrmFieldType.endsWith("Float");
|
|
|
|
if (resourcePOClassField.get(hrmResourcePO) != null) {
|
|
|
|
if (resourcePOClassField.get(hrmResourcePO) != null) {
|
|
|
|
if (hrmFieldType.endsWith("String")) {
|
|
|
|
if (hrmFieldType.endsWith("String")) {
|
|
|
|
insertFields.append(s).append(",");
|
|
|
|
resourceParams.put(s, resourcePOClassField.get(hrmResourcePO));
|
|
|
|
insertValues.append("'").append(resourcePOClassField.get(hrmResourcePO)).append("',");
|
|
|
|
|
|
|
|
} else if (isNumber) {
|
|
|
|
} else if (isNumber) {
|
|
|
|
insertFields.append(s).append(",");
|
|
|
|
|
|
|
|
String insertValueStr = Util.null2String(resourcePOClassField.get(hrmResourcePO));
|
|
|
|
String insertValueStr = Util.null2String(resourcePOClassField.get(hrmResourcePO));
|
|
|
|
if ("".equals(insertValueStr) && recordSet.getDBType().equalsIgnoreCase("postgresql")) {
|
|
|
|
if ("".equals(insertValueStr) && recordSet.getDBType().equalsIgnoreCase("postgresql")) {
|
|
|
|
insertValues.append("null,");
|
|
|
|
resourceParams.put(s, null);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
insertValues.append(resourcePOClassField.get(hrmResourcePO)).append(",");
|
|
|
|
resourceParams.put(s, resourcePOClassField.get(hrmResourcePO));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (paramClassDeclaredField.get(hrmResourceImportParam) != null) {
|
|
|
|
} else if (paramClassDeclaredField.get(hrmResourceImportParam) != null) {
|
|
|
|
if (voFieldType.endsWith("String")) {
|
|
|
|
if (voFieldType.endsWith("String")) {
|
|
|
|
if (Util.null2String(paramClassDeclaredField.get(hrmResourceImportParam)).equals("")) {
|
|
|
|
if (Util.null2String(paramClassDeclaredField.get(hrmResourceImportParam)).equals("")) {
|
|
|
|
insertFields.append(s).append(",");
|
|
|
|
resourceParams.put(s, null);
|
|
|
|
insertValues.append("null,");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
insertFields.append(s).append(",");
|
|
|
|
resourceParams.put(s, paramClassDeclaredField.get(hrmResourceImportParam));
|
|
|
|
insertValues.append("'").append(paramClassDeclaredField.get(hrmResourceImportParam)).append("',");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (isNumber) {
|
|
|
|
} else if (isNumber) {
|
|
|
|
insertFields.append(s).append(",");
|
|
|
|
|
|
|
|
String insertValueStr = Util.null2String(paramClassDeclaredField.get(hrmResourceImportParam));
|
|
|
|
String insertValueStr = Util.null2String(paramClassDeclaredField.get(hrmResourceImportParam));
|
|
|
|
if ("".equals(insertValueStr) && recordSet.getDBType().equalsIgnoreCase("postgresql")) {
|
|
|
|
if ("".equals(insertValueStr) && recordSet.getDBType().equalsIgnoreCase("postgresql")) {
|
|
|
|
insertValues.append("null,");
|
|
|
|
resourceParams.put(s, null);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
insertValues.append(paramClassDeclaredField.get(hrmResourceImportParam)).append(",");
|
|
|
|
resourceParams.put(s, paramClassDeclaredField.get(hrmResourceImportParam));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
insertStr = insertStr + insertFields + "creator,delete_type,create_time) values(" + insertValues + createrid + ",'" + 0 + "','" + date + "')";
|
|
|
|
resourceParams.put("creator", createrid);
|
|
|
|
if (!execSql(insertStr)) {//添加人员信息
|
|
|
|
resourceParams.put("delete_type", 0);
|
|
|
|
|
|
|
|
resourceParams.put("create_time", date);
|
|
|
|
|
|
|
|
ExtendInfoParams infoParams = ExtendInfoParams.builder().tableName("jcl_org_hrmresource").params(resourceParams).build();
|
|
|
|
|
|
|
|
int insertCount = getExtMapper().insertExt(infoParams);
|
|
|
|
|
|
|
|
//添加人员信息
|
|
|
|
|
|
|
|
if (insertCount != 1) {
|
|
|
|
flag = false;
|
|
|
|
flag = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -887,8 +885,9 @@ public class HrmResourceImportProcessUtil {
|
|
|
|
String jobNames = hrmResourceImportParam.getJob_title();
|
|
|
|
String jobNames = hrmResourceImportParam.getJob_title();
|
|
|
|
hrmResourcePO.setJobTitle(getJobTitles(companyId, departmentId, jobNames));
|
|
|
|
hrmResourcePO.setJobTitle(getJobTitles(companyId, departmentId, jobNames));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (Util.getIntValue(hrmId) < 0) continue;
|
|
|
|
if (Util.getIntValue(hrmId) < 0) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 级序列
|
|
|
|
// 级序列
|
|
|
|
if (!"".equals(Util.null2String(hrmResourceImportParam.getManager_id()))) {
|
|
|
|
if (!"".equals(Util.null2String(hrmResourceImportParam.getManager_id()))) {
|
|
|
@ -1140,7 +1139,7 @@ public class HrmResourceImportProcessUtil {
|
|
|
|
HrmFaceCheckManager.setUserPassowrd(keyMap.get(key) + "", orgPwd);
|
|
|
|
HrmFaceCheckManager.setUserPassowrd(keyMap.get(key) + "", orgPwd);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
StringBuilder updateStr = new StringBuilder("update jcl_org_hrmresource set ");
|
|
|
|
Map<String, Object> resourceParams = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
for (int k = 1; k < fields.length; k++) {
|
|
|
|
for (int k = 1; k < fields.length; k++) {
|
|
|
|
Field hrmField = resourcePOClass.getDeclaredField(PageInfoSortUtil.underlineToHump(fields[k]));
|
|
|
|
Field hrmField = resourcePOClass.getDeclaredField(PageInfoSortUtil.underlineToHump(fields[k]));
|
|
|
@ -1154,29 +1153,29 @@ public class HrmResourceImportProcessUtil {
|
|
|
|
|
|
|
|
|
|
|
|
if (Util.null2String(hrmField.get(hrmResourcePO)).trim().length() > 0) {
|
|
|
|
if (Util.null2String(hrmField.get(hrmResourcePO)).trim().length() > 0) {
|
|
|
|
if (hrmFieldType.endsWith("String")) {
|
|
|
|
if (hrmFieldType.endsWith("String")) {
|
|
|
|
updateStr.append(fields[k]).append("='").append(hrmField.get(hrmResourcePO)).append("',");
|
|
|
|
resourceParams.put(fields[k], hrmField.get(hrmResourcePO));
|
|
|
|
} else if (hrmFieldType.endsWith("Long") || hrmFieldType.endsWith("Integer") || hrmFieldType.endsWith("Short") || hrmFieldType.endsWith("Float")) {
|
|
|
|
} else if (hrmFieldType.endsWith("Long") || hrmFieldType.endsWith("Integer") || hrmFieldType.endsWith("Short") || hrmFieldType.endsWith("Float")) {
|
|
|
|
updateStr.append(fields[k]).append("=").append(hrmField.get(hrmResourcePO)).append(",");
|
|
|
|
resourceParams.put(fields[k], hrmField.get(hrmResourcePO));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (Util.null2String(paramClassDeclaredField.get(hrmResourceImportParam)).trim().length() > 0) {
|
|
|
|
} else if (Util.null2String(paramClassDeclaredField.get(hrmResourceImportParam)).trim().length() > 0) {
|
|
|
|
if (voFieldType.endsWith("String")) {
|
|
|
|
if (voFieldType.endsWith("String")) {
|
|
|
|
if (Util.null2String(paramClassDeclaredField.get(hrmResourceImportParam)).equals("")) {
|
|
|
|
if (Util.null2String(paramClassDeclaredField.get(hrmResourceImportParam)).equals("")) {
|
|
|
|
updateStr.append(fields[k]).append("=null,");
|
|
|
|
resourceParams.put(fields[k], null);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
updateStr.append(fields[k]).append("='").append(paramClassDeclaredField.get(hrmResourceImportParam)).append("',");
|
|
|
|
resourceParams.put(fields[k], paramClassDeclaredField.get(hrmResourceImportParam));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (voFieldType.endsWith("Long") || voFieldType.endsWith("Integer") || voFieldType.endsWith("Short") || voFieldType.endsWith("Float")) {
|
|
|
|
} else if (voFieldType.endsWith("Long") || voFieldType.endsWith("Integer") || voFieldType.endsWith("Short") || voFieldType.endsWith("Float")) {
|
|
|
|
if (voFieldType.endsWith("Integer") && (paramClassDeclaredField.get(hrmResourceImportParam).equals(0x7fffffff))) {
|
|
|
|
if (voFieldType.endsWith("Integer") && (paramClassDeclaredField.get(hrmResourceImportParam).equals(0x7fffffff))) {
|
|
|
|
updateStr.append(fields[k]).append("=null,");
|
|
|
|
resourceParams.put(fields[k], null);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
updateStr.append(fields[k]).append("=").append(paramClassDeclaredField.get(hrmResourceImportParam)).append(",");
|
|
|
|
resourceParams.put(fields[k], paramClassDeclaredField.get(hrmResourceImportParam));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resourceParams.put("update_time", DateUtil.getCurrentDate());
|
|
|
|
updateStr.append(" update_time ='").append(DateUtil.getCurrentDate()).append("' where id=").append(keyMap.get(key));
|
|
|
|
ExtendInfoParams infoParams = ExtendInfoParams.builder().id((long) keyMap.get(key)).tableName("jcl_org_hrmresource").params(resourceParams).build();
|
|
|
|
execSql(updateStr.toString());
|
|
|
|
getExtMapper().updateExt(infoParams);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
//数据异常
|
|
|
|
//数据异常
|
|
|
@ -1408,7 +1407,7 @@ public class HrmResourceImportProcessUtil {
|
|
|
|
hrmLocationsMap.put("locationname", locationName);
|
|
|
|
hrmLocationsMap.put("locationname", locationName);
|
|
|
|
hrmLocationsMap.put("locationdesc", locationName);
|
|
|
|
hrmLocationsMap.put("locationdesc", locationName);
|
|
|
|
hrmLocationsMap.put("countryid", 1);
|
|
|
|
hrmLocationsMap.put("countryid", 1);
|
|
|
|
ExtendInfoParams extendInfoParams = ExtendInfoParams.builder().params(hrmLocationsMap).build();
|
|
|
|
ExtendInfoParams extendInfoParams = ExtendInfoParams.builder().params(hrmLocationsMap).tableName("HrmLocations").build();
|
|
|
|
getExtMapper().insertExt(extendInfoParams);
|
|
|
|
getExtMapper().insertExt(extendInfoParams);
|
|
|
|
locationId = extendInfoParams.getId().intValue();
|
|
|
|
locationId = extendInfoParams.getId().intValue();
|
|
|
|
locationMap.put(locationName, locationId);
|
|
|
|
locationMap.put(locationName, locationId);
|
|
|
@ -1430,7 +1429,7 @@ public class HrmResourceImportProcessUtil {
|
|
|
|
Map<String, Object> hrmUseKindMap = new HashMap<>();
|
|
|
|
Map<String, Object> hrmUseKindMap = new HashMap<>();
|
|
|
|
hrmUseKindMap.put("name", useKindName);
|
|
|
|
hrmUseKindMap.put("name", useKindName);
|
|
|
|
hrmUseKindMap.put("description", useKindName);
|
|
|
|
hrmUseKindMap.put("description", useKindName);
|
|
|
|
ExtendInfoParams extendInfoParams = ExtendInfoParams.builder().params(hrmUseKindMap).build();
|
|
|
|
ExtendInfoParams extendInfoParams = ExtendInfoParams.builder().params(hrmUseKindMap).tableName("HrmUseKind").build();
|
|
|
|
getExtMapper().insertExt(extendInfoParams);
|
|
|
|
getExtMapper().insertExt(extendInfoParams);
|
|
|
|
usekindid = extendInfoParams.getId().intValue();
|
|
|
|
usekindid = extendInfoParams.getId().intValue();
|
|
|
|
usekindMap.put(useKindName, usekindid);
|
|
|
|
usekindMap.put(useKindName, usekindid);
|
|
|
@ -1451,7 +1450,7 @@ public class HrmResourceImportProcessUtil {
|
|
|
|
if (jobCallId == 0) {
|
|
|
|
if (jobCallId == 0) {
|
|
|
|
Map<String, Object> hrmJobCallMap = new HashMap<>();
|
|
|
|
Map<String, Object> hrmJobCallMap = new HashMap<>();
|
|
|
|
hrmJobCallMap.put("name", jobCall);
|
|
|
|
hrmJobCallMap.put("name", jobCall);
|
|
|
|
ExtendInfoParams extendInfoParams = ExtendInfoParams.builder().params(hrmJobCallMap).build();
|
|
|
|
ExtendInfoParams extendInfoParams = ExtendInfoParams.builder().params(hrmJobCallMap).tableName("HrmJobCall").build();
|
|
|
|
getExtMapper().insertExt(extendInfoParams);
|
|
|
|
getExtMapper().insertExt(extendInfoParams);
|
|
|
|
jobCallId = extendInfoParams.getId().intValue();
|
|
|
|
jobCallId = extendInfoParams.getId().intValue();
|
|
|
|
jobcallMap.put(jobCall, jobCallId);
|
|
|
|
jobcallMap.put(jobCall, jobCallId);
|
|
|
@ -1492,7 +1491,7 @@ public class HrmResourceImportProcessUtil {
|
|
|
|
Map<String, Object> hrmBankMap = new HashMap<>();
|
|
|
|
Map<String, Object> hrmBankMap = new HashMap<>();
|
|
|
|
hrmBankMap.put("bankname", bank);
|
|
|
|
hrmBankMap.put("bankname", bank);
|
|
|
|
hrmBankMap.put("bankdesc", bank);
|
|
|
|
hrmBankMap.put("bankdesc", bank);
|
|
|
|
ExtendInfoParams extendInfoParams = ExtendInfoParams.builder().params(hrmBankMap).build();
|
|
|
|
ExtendInfoParams extendInfoParams = ExtendInfoParams.builder().params(hrmBankMap).tableName("hrmbank").build();
|
|
|
|
getExtMapper().insertExt(extendInfoParams);
|
|
|
|
getExtMapper().insertExt(extendInfoParams);
|
|
|
|
id = extendInfoParams.getId().intValue();
|
|
|
|
id = extendInfoParams.getId().intValue();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1571,7 +1570,7 @@ public class HrmResourceImportProcessUtil {
|
|
|
|
Map<String, Object> hrmEducationLevelMap = new HashMap<>();
|
|
|
|
Map<String, Object> hrmEducationLevelMap = new HashMap<>();
|
|
|
|
hrmEducationLevelMap.put("name", educationLevel);
|
|
|
|
hrmEducationLevelMap.put("name", educationLevel);
|
|
|
|
hrmEducationLevelMap.put("description", educationLevel);
|
|
|
|
hrmEducationLevelMap.put("description", educationLevel);
|
|
|
|
ExtendInfoParams extendInfoParams = ExtendInfoParams.builder().params(hrmEducationLevelMap).build();
|
|
|
|
ExtendInfoParams extendInfoParams = ExtendInfoParams.builder().params(hrmEducationLevelMap).tableName("HrmEducationLevel").build();
|
|
|
|
getExtMapper().insertExt(extendInfoParams);
|
|
|
|
getExtMapper().insertExt(extendInfoParams);
|
|
|
|
educationLevelId = extendInfoParams.getId().intValue();
|
|
|
|
educationLevelId = extendInfoParams.getId().intValue();
|
|
|
|
educationlevelMap.put(educationLevel, educationLevelId);
|
|
|
|
educationlevelMap.put(educationLevel, educationLevelId);
|
|
|
|