组织编制信息导入bug修复
This commit is contained in:
parent
1705857817
commit
53afce795a
|
|
@ -122,7 +122,7 @@
|
|||
<select id="getIdByNameAndPid" resultType="java.lang.Integer">
|
||||
select id
|
||||
from hrmdepartment
|
||||
where departmentName = #{departmentName}
|
||||
where departmentmark = #{departmentName}
|
||||
and subCompanyId1 = #{subCompanyId1}
|
||||
and supDepId = #{supDepId}
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -141,7 +141,8 @@ public interface JobMapper {
|
|||
* @param parentJob
|
||||
* @return
|
||||
*/
|
||||
Long getIdByNameAndPid(@Param("jobName") String jobName, @Param("parentCompany") Integer parentCompany, @Param("parentDepartment") Integer parentDepartment, @Param("parentJob") Long parentJob);
|
||||
Long getIdByNameAndPid(@Param("jobName") String jobName, @Param("parentCompany") Integer parentCompany, @Param("parentDepartment") Integer parentDepartment, @Param("parentJob") Long parentJob,
|
||||
@Param("jobactivitymark") String jobactivitymark,@Param("jobgroupremark") String jobgroupremark);
|
||||
|
||||
int updateJobCompany(@Param("ids") Collection<Long> ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") Integer ecCompany);
|
||||
|
||||
|
|
|
|||
|
|
@ -483,13 +483,13 @@
|
|||
</select>
|
||||
|
||||
<select id="getIdByNameAndPid" resultType="java.lang.Long">
|
||||
select
|
||||
t.id
|
||||
from
|
||||
jcl_org_job t
|
||||
select t.id from jcl_org_job t
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
where
|
||||
delete_type = 0
|
||||
left join hrmjobactivities j on h.jobactivityid = j.id
|
||||
left join hrmjobgroups f on j.jobgroupid = f.id
|
||||
where delete_type = 0
|
||||
and j.jobactivitymark = #{jobactivitymark}
|
||||
and f.jobgroupremark = #{jobgroupremark}
|
||||
and h.JOBTITLENAME = #{jobName}
|
||||
and ec_company = #{parentCompany}
|
||||
<include refid="nullparentDept"/>
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
String outPutPath = GCONST.getRootPath() + File.separator + "hrm" + File.separator + "import" + File.separator + "template" + File.separator + "staff.xls";
|
||||
File excelPathFile = new File(outPutPath);
|
||||
if (!excelPathFile.exists()) {
|
||||
String columns = "方案编号,方案名称,分部,部门,岗位,编制数";
|
||||
String columns = "方案编号,方案名称,分部,部门,职务类型,职务,岗位,编制数";
|
||||
String[] split = columns.split(",");
|
||||
List<Object> columnList = new ArrayList<>(Arrays.asList(split));
|
||||
// 创建导入模板
|
||||
|
|
|
|||
|
|
@ -24,9 +24,11 @@ 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.conn.RecordSet;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.job.JobGroupsComInfo;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -49,6 +51,8 @@ public class StaffInfoImportUtil {
|
|||
importFieldsMap.put("方案名称", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("plan_name").fieldNameDesc("方案名称").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("分部", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("comp_id").fieldNameDesc("分部").isrequired(1).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("部门", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("dept_id").fieldNameDesc("部门").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("职务类型", ExtendInfoPO.builder().tableName("hrmjobgroups").fieldName("jobgroupname").fieldNameDesc("职务类型").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("职务", ExtendInfoPO.builder().tableName("hrmjobactivities").fieldName("jobactivityname").fieldNameDesc("职务").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("岗位", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("job_id").fieldNameDesc("岗位").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("编制数", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("staff_num").fieldNameDesc("编制数").isrequired(1).controlType(1).browserType("2").customValue("[\"input\",\"int\"]").build());
|
||||
|
||||
|
|
@ -88,6 +92,9 @@ public class StaffInfoImportUtil {
|
|||
Long parentJobId = null;
|
||||
StaffPlanPO staffPlanPO = null;
|
||||
|
||||
String jobactivitymark = "";
|
||||
String jobgroupremark = "";
|
||||
|
||||
historyDetailPO.setRowNums(String.valueOf(i + 1));
|
||||
for (int cellIndex = 0; cellIndex < lastCellNum; cellIndex++) {
|
||||
XSSFCell cell = row.getCell((short) cellIndex);
|
||||
|
|
@ -188,6 +195,16 @@ public class StaffInfoImportUtil {
|
|||
map.put("ec_department", parentDepartmentId);
|
||||
}
|
||||
|
||||
//职务类型
|
||||
if ("jobgroupname".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||
jobgroupremark = cellValue;
|
||||
}
|
||||
|
||||
//职务
|
||||
if ("jobactivityname".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||
jobactivitymark = cellValue;
|
||||
}
|
||||
|
||||
// 岗位
|
||||
if ("job_id".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||
if (null == parentCompanyId) {
|
||||
|
|
@ -205,7 +222,8 @@ public class StaffInfoImportUtil {
|
|||
continue nextRow;
|
||||
}
|
||||
for (String s : split) {
|
||||
parentJobId = MapperProxyFactory.getProxy(JobMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId, parentJobId == null ? 0 : parentJobId);
|
||||
parentJobId = MapperProxyFactory.getProxy(JobMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId, parentJobId == null ? 0 : parentJobId
|
||||
,jobactivitymark,jobgroupremark);
|
||||
if (null == parentJobId) {
|
||||
historyDetailPO.setOperateDetail(s + "岗位未找到对应数据");
|
||||
historyDetailPO.setStatus("0");
|
||||
|
|
@ -335,8 +353,14 @@ public class StaffInfoImportUtil {
|
|||
item.put("value", value);
|
||||
itemList.add(item);
|
||||
}
|
||||
Map<String, Object> other = new HashMap<>();
|
||||
other.put("index", (lsPromptLabel.size() + 1));
|
||||
other.put("value", "注意:岗位维度编制信息导入时引入职务类型和职务判断,导入时请先去除多语言,否则无法找到对应岗位");
|
||||
itemList.add(other);
|
||||
groupItem.put("items", itemList);
|
||||
lsGroup.add(groupItem);
|
||||
return lsGroup;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue