|
|
|
@ -1,23 +1,18 @@
|
|
|
|
|
package com.engine.organization.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.api.browser.bean.SearchConditionItem;
|
|
|
|
|
import com.api.browser.bean.SearchConditionOption;
|
|
|
|
|
import com.api.browser.util.ConditionFactory;
|
|
|
|
|
import com.api.browser.util.ConditionType;
|
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.hrm.entity.FieldSelectOptionBean;
|
|
|
|
|
import com.engine.organization.component.OrganizationWeaTable;
|
|
|
|
|
import com.engine.organization.entity.SelectOptionParam;
|
|
|
|
|
import com.engine.organization.entity.commom.RecordInfo;
|
|
|
|
|
import com.engine.organization.entity.extend.ExtendInfoOperateType;
|
|
|
|
|
import com.engine.organization.entity.extend.param.ExtendInfoParams;
|
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
|
|
|
|
import com.engine.organization.entity.fieldset.param.FieldTransferParam;
|
|
|
|
|
import com.engine.organization.entity.jclimport.po.JclImportHistoryDetailPO;
|
|
|
|
|
import com.engine.organization.entity.jclimport.po.JclImportHistoryPO;
|
|
|
|
|
import com.engine.organization.entity.jclimport.vo.JclImportHistoryDetailVO;
|
|
|
|
|
import com.engine.organization.entity.job.po.JobPO;
|
|
|
|
|
import com.engine.organization.entity.scheme.po.GradePO;
|
|
|
|
@ -34,7 +29,6 @@ import com.engine.organization.mapper.extend.ExtMapper;
|
|
|
|
|
import com.engine.organization.mapper.extend.ExtendInfoMapper;
|
|
|
|
|
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
|
|
|
|
import com.engine.organization.mapper.jclimport.JclImportHistoryDetailMapper;
|
|
|
|
|
import com.engine.organization.mapper.jclimport.JclImportHistoryMapper;
|
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
|
import com.engine.organization.mapper.resource.ResourceMapper;
|
|
|
|
|
import com.engine.organization.mapper.scheme.GradeMapper;
|
|
|
|
@ -47,6 +41,7 @@ import com.engine.organization.util.OrganizationAssert;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.organization.util.excel.ExcelUtil;
|
|
|
|
|
import com.engine.organization.util.relation.EcHrmRelationUtil;
|
|
|
|
|
import com.engine.organization.util.saveimport.OrgImportUtil;
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
|
|
@ -54,19 +49,16 @@ import org.apache.poi.xssf.usermodel.XSSFCell;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFRow;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
|
import weaver.common.DateUtil;
|
|
|
|
|
import weaver.file.ImageFileManager;
|
|
|
|
|
import weaver.general.BaseBean;
|
|
|
|
|
import weaver.general.GCONST;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.definedfield.HrmFieldManager;
|
|
|
|
|
import weaver.systeminfo.SystemEnv;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
@ -662,7 +654,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
* 导入分部
|
|
|
|
|
*/
|
|
|
|
|
private Long companyImport(String operateType, String excelFile) {
|
|
|
|
|
Long importHistoryId = saveImportLog("company", operateType);
|
|
|
|
|
Long importHistoryId = OrgImportUtil.saveImportLog("company", operateType, user);
|
|
|
|
|
JclImportHistoryDetailPO historyDetailPO;
|
|
|
|
|
|
|
|
|
|
ImageFileManager manager = new ImageFileManager();
|
|
|
|
@ -714,23 +706,23 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue) && !"comp_no".equalsIgnoreCase(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "为必填项");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Object reallyValue;
|
|
|
|
|
try {
|
|
|
|
|
reallyValue = getReallyValue(infoPO, cellValue);
|
|
|
|
|
reallyValue = OrgImportUtil.getReallyValue(infoPO, cellValue);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "转换失败");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue))) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "数据转换失败,未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
map.put(infoPO.getFieldName(), reallyValue);
|
|
|
|
@ -741,7 +733,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (split.length > 8) {
|
|
|
|
|
historyDetailPO.setOperateDetail("分部层级不能大于10");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
for (int index = 0; index < split.length - 1; index++) {
|
|
|
|
@ -749,7 +741,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentCompanyId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(split[index] + "分部未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -780,7 +772,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (companyId != null) {
|
|
|
|
|
historyDetailPO.setOperateDetail("数据已存在");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 自动编号
|
|
|
|
@ -789,7 +781,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
} catch (OrganizationRunTimeException e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(e.getMessage());
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
map.put("comp_no", compNo);
|
|
|
|
@ -825,14 +817,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
}
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
} else if ("update".equals(operateType)) {
|
|
|
|
|
// 查询对应ID
|
|
|
|
|
if (StringUtils.isNotBlank(compNo)) {
|
|
|
|
|
if (companyId == null) {
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (checkRepeatNo(compNo, COMPANY_TYPE, companyId)) {
|
|
|
|
@ -850,16 +842,16 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
}
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
} else {
|
|
|
|
|
historyDetailPO.setOperateDetail(compNo + "编号已存在");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
historyDetailPO.setOperateDetail("编号为空,更新失败");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -870,7 +862,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
* 导入部门
|
|
|
|
|
*/
|
|
|
|
|
private Long departmentImport(String operateType, String excelFile) {
|
|
|
|
|
Long importHistoryId = saveImportLog("department", operateType);
|
|
|
|
|
Long importHistoryId = OrgImportUtil.saveImportLog("department", operateType, user);
|
|
|
|
|
JclImportHistoryDetailPO historyDetailPO;
|
|
|
|
|
|
|
|
|
|
ImageFileManager manager = new ImageFileManager();
|
|
|
|
@ -923,23 +915,23 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue) && !"dept_no".equalsIgnoreCase(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "为必填项");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Object reallyValue;
|
|
|
|
|
try {
|
|
|
|
|
reallyValue = getReallyValue(infoPO, cellValue);
|
|
|
|
|
reallyValue = OrgImportUtil.getReallyValue(infoPO, cellValue);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "转换失败");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue)) && !"ec_company".equals(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "数据转换失败,未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
map.put(infoPO.getFieldName(), reallyValue);
|
|
|
|
@ -950,7 +942,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (split.length > 8) {
|
|
|
|
|
historyDetailPO.setOperateDetail("分部层级不能大于10");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
for (String s : split) {
|
|
|
|
@ -958,7 +950,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentCompanyId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "分部未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -969,7 +961,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentCompanyId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "所属分部未找到");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
historyDetailPO.setRelatedName(cellValue);
|
|
|
|
@ -978,7 +970,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (split.length > 8) {
|
|
|
|
|
historyDetailPO.setOperateDetail("部门层级不能大于10");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
for (int index = 0; index < split.length - 1; index++) {
|
|
|
|
@ -986,7 +978,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentDepartmentId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(split[index] + "部门未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1018,7 +1010,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (departmentId != null) {
|
|
|
|
|
historyDetailPO.setOperateDetail("数据已存在");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 自动编号
|
|
|
|
@ -1027,7 +1019,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
} catch (OrganizationRunTimeException e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(e.getMessage());
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
map.put("dept_no", deptNo);
|
|
|
|
@ -1063,14 +1055,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
}
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
} else if ("update".equals(operateType)) {
|
|
|
|
|
// 查询对应ID
|
|
|
|
|
if (StringUtils.isNotBlank(deptNo)) {
|
|
|
|
|
if (departmentId == null) {
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (checkRepeatNo(deptNo, DEPARTMENT_TYPE, departmentId)) {
|
|
|
|
@ -1088,16 +1080,16 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
}
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
} else {
|
|
|
|
|
historyDetailPO.setOperateDetail(deptNo + "编号已存在");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
historyDetailPO.setOperateDetail("编号为空,更新失败");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1108,7 +1100,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
* 岗位导入
|
|
|
|
|
*/
|
|
|
|
|
private Long jobImport(String operateType, String excelFile) {
|
|
|
|
|
Long importHistoryId = saveImportLog("jobtitle", operateType);
|
|
|
|
|
Long importHistoryId = OrgImportUtil.saveImportLog("jobtitle", operateType, user);
|
|
|
|
|
JclImportHistoryDetailPO historyDetailPO;
|
|
|
|
|
|
|
|
|
|
ImageFileManager manager = new ImageFileManager();
|
|
|
|
@ -1161,23 +1153,23 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue) && !"job_no".equalsIgnoreCase(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "为必填项");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Object reallyValue;
|
|
|
|
|
try {
|
|
|
|
|
reallyValue = getReallyValue(infoPO, cellValue);
|
|
|
|
|
reallyValue = OrgImportUtil.getReallyValue(infoPO, cellValue);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "转换失败");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue)) && !"ec_company".equals(infoPO.getFieldName()) && !"ec_department".equals(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "数据转换失败,未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
map.put(infoPO.getFieldName(), reallyValue);
|
|
|
|
@ -1188,7 +1180,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (split.length > 8) {
|
|
|
|
|
historyDetailPO.setOperateDetail("分部层级不能大于10");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
for (String s : split) {
|
|
|
|
@ -1196,7 +1188,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentCompanyId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "分部未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1210,7 +1202,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (split.length > 8) {
|
|
|
|
|
historyDetailPO.setOperateDetail("部门层级不能大于10");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
for (String s : split) {
|
|
|
|
@ -1218,7 +1210,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentDepartmentId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "部门未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1229,7 +1221,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentCompanyId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "所属分部未找到");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
historyDetailPO.setRelatedName(cellValue);
|
|
|
|
@ -1238,7 +1230,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (split.length > 8) {
|
|
|
|
|
historyDetailPO.setOperateDetail("岗位层级不能大于10");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
for (int index = 0; index < split.length - 1; index++) {
|
|
|
|
@ -1246,7 +1238,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentJobId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(split[index] + "岗位未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1274,7 +1266,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (jobId != null) {
|
|
|
|
|
historyDetailPO.setOperateDetail("数据已存在");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// 自动编号
|
|
|
|
@ -1283,7 +1275,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
} catch (OrganizationRunTimeException e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(e.getMessage());
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
map.put("job_no", jobNo);
|
|
|
|
@ -1323,14 +1315,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
}
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
} else if ("update".equals(operateType)) {
|
|
|
|
|
// 查询对应ID
|
|
|
|
|
if (StringUtils.isNotBlank(jobNo)) {
|
|
|
|
|
if (jobId == null) {
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (checkRepeatNo(jobNo, JOB_TYPE, jobId)) {
|
|
|
|
@ -1356,16 +1348,16 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
}
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
} else {
|
|
|
|
|
historyDetailPO.setOperateDetail(jobNo + "编号已存在");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
historyDetailPO.setOperateDetail("编号为空,更新失败");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1373,7 +1365,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Long hrmResourceImport(String operateType, String excelFile, String keyField) {
|
|
|
|
|
Long importHistoryId = saveImportLog("resource", operateType);
|
|
|
|
|
Long importHistoryId = OrgImportUtil.saveImportLog("resource", operateType, user);
|
|
|
|
|
JclImportHistoryDetailPO historyDetailPO;
|
|
|
|
|
|
|
|
|
|
ImageFileManager manager = new ImageFileManager();
|
|
|
|
@ -1425,23 +1417,23 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue) && !"work_code".equalsIgnoreCase(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "为必填项");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Object reallyValue;
|
|
|
|
|
try {
|
|
|
|
|
reallyValue = getReallyValue(infoPO, cellValue);
|
|
|
|
|
reallyValue = OrgImportUtil.getReallyValue(infoPO, cellValue);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "转换失败");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue)) && !"ec_company".equals(infoPO.getFieldName()) && !"ec_department".equals(infoPO.getFieldName()) && !"job_title".equals(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "数据转换失败,未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
map.put(infoPO.getFieldName(), reallyValue);
|
|
|
|
@ -1452,7 +1444,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (split.length > 8) {
|
|
|
|
|
historyDetailPO.setOperateDetail("分部层级不能大于10");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
for (String s : split) {
|
|
|
|
@ -1460,7 +1452,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentCompanyId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "分部未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1474,7 +1466,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (split.length > 8) {
|
|
|
|
|
historyDetailPO.setOperateDetail("部门层级不能大于10");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
for (String s : split) {
|
|
|
|
@ -1482,7 +1474,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentDepartmentId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "部门未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1493,7 +1485,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentCompanyId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "所属分部未找到");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
String[] split = cellValue.split(">");
|
|
|
|
@ -1501,7 +1493,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (split.length > 8) {
|
|
|
|
|
historyDetailPO.setOperateDetail("岗位层级不能大于10");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
for (String s : split) {
|
|
|
|
@ -1509,7 +1501,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (null == parentJobId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(s + "岗位未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1541,7 +1533,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (StringUtils.isBlank(keyFieldValue)) {
|
|
|
|
|
historyDetailPO.setOperateDetail("所选重复验证字段为空");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
historyDetailPO.setRelatedName(keyFieldValue);
|
|
|
|
@ -1552,7 +1544,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (resourceId != null) {
|
|
|
|
|
historyDetailPO.setOperateDetail(keyFieldValue + "已存在");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1565,14 +1557,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
} catch (OrganizationRunTimeException e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(e.getMessage());
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
map.put("work_code", workCode);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
historyDetailPO.setOperateDetail(Util.null2String(e.getMessage()));
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
}
|
|
|
|
|
map.put("creator", user.getUID());
|
|
|
|
|
map.put("delete_type", 0);
|
|
|
|
@ -1603,13 +1595,13 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
}
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
} else if ("update".equals(operateType)) {
|
|
|
|
|
// 查询对应ID
|
|
|
|
|
if (resourceId == null) {
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
map.put("update_time", new Date());
|
|
|
|
@ -1627,7 +1619,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setOperateDetail(Util.null2String(syncMap.get("message")));
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
}
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return importHistoryId;
|
|
|
|
@ -1638,7 +1630,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
*/
|
|
|
|
|
private Long jobLevelImport(String operateType, String excelFile) {
|
|
|
|
|
|
|
|
|
|
Long importHistoryId = saveImportLog("joblevel", operateType);
|
|
|
|
|
Long importHistoryId = OrgImportUtil.saveImportLog("joblevel", operateType, user);
|
|
|
|
|
JclImportHistoryDetailPO historyDetailPO;
|
|
|
|
|
|
|
|
|
|
ImageFileManager manager = new ImageFileManager();
|
|
|
|
@ -1704,25 +1696,25 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "为必填项");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Object reallyValue;
|
|
|
|
|
try {
|
|
|
|
|
// 数据格式转换
|
|
|
|
|
reallyValue = getReallyValue(infoPO, cellValue);
|
|
|
|
|
reallyValue = OrgImportUtil.getReallyValue(infoPO, cellValue);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "转换失败");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue)) && !"ec_company".equals(infoPO.getFieldName()) && !"ec_department".equals(infoPO.getFieldName())) {
|
|
|
|
|
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "数据转换失败,未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
map.put(infoPO.getFieldName(), reallyValue);
|
|
|
|
@ -1733,7 +1725,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("方案编号[" + reallyValue + "]与原有编号重复");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1744,7 +1736,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号为[" + reallyValue + "]的方案");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1755,7 +1747,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号为[" + reallyValue + "]的方案");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1769,7 +1761,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号为[" + split[index] + "]的职等");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1814,7 +1806,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName("职等编号");
|
|
|
|
|
historyDetailPO.setOperateDetail("职等页导入:同一方案" + schemeNo + "下,职等编号不可重复");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
} else {
|
|
|
|
|
levelPO.setLevelNo(levelNo);
|
|
|
|
@ -1834,7 +1826,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号为[" + schemeNo + "]的方案");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -1848,7 +1840,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号为[" + schemeNo2 + "]的方案");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1872,7 +1864,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号为[" + split[index] + "]的职等");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
if (levelIds != null) {
|
|
|
|
@ -1887,7 +1879,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("同一方案[" + schemeNo2 + "]下,职级编号不可重复");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
} else {
|
|
|
|
|
// 关联职等id
|
|
|
|
@ -1900,7 +1892,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
}
|
|
|
|
|
historyDetailPO.setOperateDetail("添加成功");
|
|
|
|
|
historyDetailPO.setStatus("1");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
} else if ("update".equals(operateType)) {
|
|
|
|
|
switch (s) {
|
|
|
|
|
case 0:
|
|
|
|
@ -1914,7 +1906,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号为[" + map.get("scheme_no") + "]的方案");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -1935,14 +1927,14 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号为[" + schemeNo + "]的方案");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号为[" + schemeNo + "]的方案,无法更新");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
@ -1954,7 +1946,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号为[" + schemeNo2 + "]的方案");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
// 处理职级编号
|
|
|
|
@ -1967,7 +1959,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号为[" + split[index] + "]的职等");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
if (levelIds != null) {
|
|
|
|
@ -1990,7 +1982,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
historyDetailPO.setRelatedName(relatedName);
|
|
|
|
|
historyDetailPO.setOperateDetail("未找到编号[" + schemeNo2 + "]的职级,无法更新");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2000,7 +1992,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
}
|
|
|
|
|
historyDetailPO.setOperateDetail("更新成功");
|
|
|
|
|
historyDetailPO.setStatus("1");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -2039,68 +2031,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
cellValue = Util.toHtmlForHrm(cellValue);
|
|
|
|
|
return cellValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 转换存入数据库的值
|
|
|
|
|
*/
|
|
|
|
|
private Object getReallyValue(ExtendInfoPO extendInfo, String cellValue) throws Exception {
|
|
|
|
|
if (StringUtils.isBlank(cellValue)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
Object object = null;
|
|
|
|
|
JSONArray jsonArray = JSONObject.parseArray(extendInfo.getCustomValue());
|
|
|
|
|
switch (extendInfo.getControlType()) {
|
|
|
|
|
case 1:
|
|
|
|
|
String valueType = (String) jsonArray.get(1);
|
|
|
|
|
// INPUT
|
|
|
|
|
if ("int".equals(valueType)) {
|
|
|
|
|
object = Integer.parseInt(cellValue);
|
|
|
|
|
} else if ("float".equals(valueType)) {
|
|
|
|
|
object = Float.parseFloat(cellValue);
|
|
|
|
|
} else if ("text".equals(valueType)) {
|
|
|
|
|
object = cellValue;
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
|
object = new BigDecimal(cellValue).toPlainString();
|
|
|
|
|
} catch (NumberFormatException ignore) {
|
|
|
|
|
object = cellValue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
// BROWSER
|
|
|
|
|
org.json.JSONObject jsonObject = new org.json.JSONObject();
|
|
|
|
|
jsonObject.put("fieldhtmltype", extendInfo.getControlType());
|
|
|
|
|
jsonObject.put("type", extendInfo.getBrowserType());
|
|
|
|
|
jsonObject.put("fieldvalue", cellValue);
|
|
|
|
|
if ("161".equals(extendInfo.getBrowserType()) || "162".equals(extendInfo.getBrowserType())) {
|
|
|
|
|
jsonObject.put("dmlurl", SelectOptionParam.getCustomBrowserId(extendInfo.getCustomValue()));
|
|
|
|
|
} else {
|
|
|
|
|
jsonObject.put("dmlurl", extendInfo.getBrowserType());
|
|
|
|
|
}
|
|
|
|
|
jsonObject.put("fieldid", 0);
|
|
|
|
|
object = HrmFieldManager.getReallyFieldvalue(jsonObject);
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
// SELECT
|
|
|
|
|
JSONObject o = (JSONObject) jsonArray.get(2);
|
|
|
|
|
JSONArray datas = o.getJSONArray("datas");
|
|
|
|
|
List<FieldSelectOptionBean> options = datas.toJavaList(FieldSelectOptionBean.class);
|
|
|
|
|
Map<String, String> optionMap = options.stream().collect(Collectors.toMap(FieldSelectOptionBean::getOption, FieldSelectOptionBean::getId, (k1, k2) -> k1));
|
|
|
|
|
object = optionMap.get(cellValue);
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
// FILEUPLOAD
|
|
|
|
|
break;
|
|
|
|
|
case 4:// CHECKBOX
|
|
|
|
|
case 7:// TEXT
|
|
|
|
|
case 2:// TEXTAREA
|
|
|
|
|
default:
|
|
|
|
|
object = cellValue;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return object;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 校验重复编号
|
|
|
|
@ -2124,28 +2055,6 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生成记录日志
|
|
|
|
|
*/
|
|
|
|
|
private Long saveImportLog(String importType, String operateType) {
|
|
|
|
|
JclImportHistoryPO historyPO = JclImportHistoryPO.builder().operator((long) user.getUID()).operateTime(DateUtil.getFullDate()).clientAddress(user.getLoginip()).importType(importType).sourceFrom("excel").operateType(operateType).status("importing").build();
|
|
|
|
|
MapperProxyFactory.getProxy(JclImportHistoryMapper.class).insertHistory(historyPO);
|
|
|
|
|
return historyPO.getId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 日志导入详细信息日志
|
|
|
|
|
*/
|
|
|
|
|
private void saveImportDetailLog(JclImportHistoryDetailPO historyDetailPO) {
|
|
|
|
|
String relatedName = "";
|
|
|
|
|
if (StringUtils.isNotBlank(historyDetailPO.getRelatedName())) {
|
|
|
|
|
relatedName = "[" + historyDetailPO.getRelatedName() + "]";
|
|
|
|
|
}
|
|
|
|
|
String detailMsg = "导入第" + historyDetailPO.getRowNums() + "行数据," + relatedName + historyDetailPO.getOperateDetail();
|
|
|
|
|
historyDetailPO.setOperateDetail(detailMsg);
|
|
|
|
|
MapperProxyFactory.getProxy(JclImportHistoryDetailMapper.class).insertHistoryDetail(historyDetailPO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生成导入模板文件
|
|
|
|
|
*/
|
|
|
|
@ -2273,7 +2182,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (StringUtils.isNotBlank(operateDetail)) {
|
|
|
|
|
historyDetailPO.setOperateDetail(operateDetail);
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
@ -2301,7 +2210,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
|
|
|
|
|
if (StringUtils.isNotBlank(operateDetail)) {
|
|
|
|
|
historyDetailPO.setOperateDetail(operateDetail);
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
saveImportDetailLog(historyDetailPO);
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|