|
|
|
@ -1,35 +1,23 @@
|
|
|
|
|
package com.engine.organization.util.saveimport;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
|
|
|
|
|
|
|
|
|
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
|
|
|
|
import com.engine.organization.entity.hrmresource.po.ResourcePO;
|
|
|
|
|
import com.engine.organization.entity.jclimport.po.JclImportHistoryDetailPO;
|
|
|
|
|
import com.engine.organization.entity.job.po.JobPO;
|
|
|
|
|
import com.engine.organization.entity.staff.bo.StaffBO;
|
|
|
|
|
import com.engine.organization.entity.staff.param.StaffParams;
|
|
|
|
|
import com.engine.organization.entity.staff.po.StaffPO;
|
|
|
|
|
import com.engine.organization.entity.staff.po.StaffPlanPO;
|
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
|
import com.engine.organization.mapper.staff.StaffMapper;
|
|
|
|
|
import com.engine.organization.mapper.staff.StaffPlanMapper;
|
|
|
|
|
import com.engine.organization.service.impl.StaffServiceImpl;
|
|
|
|
|
import com.engine.organization.util.OrganizationAssert;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
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.file.ImageFileManager;
|
|
|
|
|
import weaver.general.TimeUtil;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
import weaver.hrm.company.DepartmentComInfo;
|
|
|
|
|
import weaver.hrm.job.JobTitlesComInfo;
|
|
|
|
|
import weaver.systeminfo.SystemEnv;
|
|
|
|
|
|
|
|
|
@ -86,6 +74,7 @@ public class JobInfoImportUtil {
|
|
|
|
|
// 组装待处理数据
|
|
|
|
|
Integer subCompanyId = null;
|
|
|
|
|
Integer departmentId = null;
|
|
|
|
|
String departmentname = "";
|
|
|
|
|
Integer jobTitleId = null;
|
|
|
|
|
Integer isKey = null;
|
|
|
|
|
|
|
|
|
@ -161,7 +150,8 @@ public class JobInfoImportUtil {
|
|
|
|
|
continue nextRow;
|
|
|
|
|
}
|
|
|
|
|
for (String s : split) {
|
|
|
|
|
departmentId = MapperProxyFactory.getProxy(DepartmentMapper.class).getIdByNameAndPid(s, departmentId, departmentId == null ? 0 : departmentId);
|
|
|
|
|
departmentId = MapperProxyFactory.getProxy(DepartmentMapper.class).getIdByNameAndPid(s, subCompanyId, departmentId == null ? 0 : departmentId);
|
|
|
|
|
departmentname = s;
|
|
|
|
|
if (null == departmentId) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "部门未找到对应数据");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
@ -185,7 +175,7 @@ public class JobInfoImportUtil {
|
|
|
|
|
|
|
|
|
|
//是否关键岗
|
|
|
|
|
if ("is_key".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
|
|
|
|
isKey = Integer.parseInt(cellValue);
|
|
|
|
|
isKey = "是".equals(cellValue) ? 1 : 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 岗位
|
|
|
|
@ -204,7 +194,7 @@ public class JobInfoImportUtil {
|
|
|
|
|
ResourcePO build = ResourcePO.builder().subcompanyid1(subCompanyId).departmentid(departmentId).jobtitle(jobTitleId).build();
|
|
|
|
|
int count = MapperProxyFactory.getProxy(JobMapper.class).selectByConditions(build);
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
historyDetailPO.setOperateDetail(cellValue + "在聚才林岗位管理中已存在,请勿重复导入");
|
|
|
|
|
historyDetailPO.setOperateDetail(departmentname +"下 <"+ cellValue + ">岗位在聚才林岗位管理中已存在,请勿重复导入");
|
|
|
|
|
historyDetailPO.setStatus("0");
|
|
|
|
|
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
|
|
|
|
continue nextRow;
|
|
|
|
|