From bc151f7648069b760e1eaf7d41ead3aac1d84bd4 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Wed, 27 Jul 2022 11:41:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ImportCommonServiceImpl.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java b/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java index 73a99421..e0ab12c6 100644 --- a/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java +++ b/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java @@ -541,7 +541,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ saveImportDetailLog(historyDetailPO); continue nextRow; } - for (int index = split.length - 2; index >= 0; index--) { + for (int index = 0; index < split.length - 1; index++) { parentCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(split[index], parentCompanyId == null ? 0 : parentCompanyId); if (null == parentCompanyId) { historyDetailPO.setOperateDetail(split[index] + "分部未找到对应数据"); @@ -576,6 +576,10 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ map.put("creator", user.getUID()); map.put("delete_type", 0); map.put("create_time", new Date()); + // 禁用表示为空,默认启用 + if (StringUtils.isBlank(Util.null2String(map.get("forbidden_tag")))) { + map.put("forbidden_tag", 0); + } MapperProxyFactory.getProxy(ExtMapper.class).insertExt(ExtendInfoParams.builder().tableName("JCL_ORG_COMP").params(map).build()); historyDetailPO.setOperateDetail("添加成功"); historyDetailPO.setStatus("1"); @@ -679,7 +683,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ saveImportDetailLog(historyDetailPO); continue nextRow; } - if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue))) { + if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue)) && !"parent_comp".equals(infoPO.getFieldName())) { // TODO 记录日志 historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "数据转换失败,未找到对应数据"); historyDetailPO.setStatus("0"); @@ -697,9 +701,9 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ saveImportDetailLog(historyDetailPO); continue nextRow; } - for (int index = split.length - 1; index >= 0; index--) { - parentCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(split[index], parentDepartmentId == null ? 0 : parentDepartmentId); - if (null == parentDepartmentId) { + for (int index = 0; index < split.length; index++) { + parentCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(split[index], parentCompanyId == null ? 0 : parentCompanyId); + if (null == parentCompanyId) { historyDetailPO.setOperateDetail(cellValue + "分部未找到对应数据"); historyDetailPO.setStatus("0"); saveImportDetailLog(historyDetailPO); @@ -726,7 +730,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ saveImportDetailLog(historyDetailPO); continue nextRow; } - for (int index = split.length - 2; index >= 0; index--) { + for (int index = 0; index < split.length - 1; index++) { parentDepartmentId = MapperProxyFactory.getProxy(DepartmentMapper.class).getIdByNameAndPid(split[index], parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId); if (null == parentDepartmentId) { historyDetailPO.setOperateDetail(split[index] + "部门未找到对应数据"); @@ -763,6 +767,10 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ map.put("creator", user.getUID()); map.put("delete_type", 0); map.put("create_time", new Date()); + // 禁用表示为空,默认启用 + if (StringUtils.isBlank(Util.null2String(map.get("forbidden_tag")))) { + map.put("forbidden_tag", 0); + } MapperProxyFactory.getProxy(ExtMapper.class).insertExt(ExtendInfoParams.builder().tableName("JCL_ORG_DEPT").params(map).build()); historyDetailPO.setOperateDetail("添加成功"); historyDetailPO.setStatus("1"); From d5447c8e5907e32401f75443746f78eb6527f3d2 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Wed, 27 Jul 2022 16:47:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B2=97=E4=BD=8D=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/entity/job/bo/JobBO.java | 10 +- .../mapper/extend/ExtendInfoMapper.java | 2 +- .../mapper/extend/ExtendInfoMapper.xml | 9 +- .../organization/mapper/job/JobMapper.xml | 22 +- .../service/impl/ExtServiceImpl.java | 14 +- .../service/impl/FieldDefinedServiceImpl.java | 4 +- .../service/impl/ImportCommonServiceImpl.java | 283 ++++++++++++++++-- .../service/impl/JobServiceImpl.java | 15 +- .../HrmResourceImportAdaptUtil.java | 2 +- 9 files changed, 310 insertions(+), 51 deletions(-) diff --git a/src/com/engine/organization/entity/job/bo/JobBO.java b/src/com/engine/organization/entity/job/bo/JobBO.java index ee51624a..7e85404f 100644 --- a/src/com/engine/organization/entity/job/bo/JobBO.java +++ b/src/com/engine/organization/entity/job/bo/JobBO.java @@ -30,16 +30,16 @@ public class JobBO { return null; } CompPO jclCompany = EcHrmRelationUtil.getJclCompanyId(null == param.getEcCompany() ? Util.null2String(param.getSubcompanyid1()) : param.getEcCompany().toString()); - DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(null == param.getEcDepartment() ? Util.null2String(param.getDepartmentid()): param.getEcDepartment().toString()); + DepartmentPO jclDepartment = EcHrmRelationUtil.getJclDepartmentId(null == param.getEcDepartment() ? Util.null2String(param.getDepartmentid()) : param.getEcDepartment().toString()); return JobPO .builder() .id(param.getId() == null ? 0 : param.getId()) .jobNo(param.getJobNo()) .jobName(param.getJobName()) - .ecCompany(null == param.getEcCompany() ? param.getSubcompanyid1() : param.getEcCompany()) - .ecDepartment(null == param.getEcDepartment() ? param.getDepartmentid() : param.getEcDepartment()) - .parentComp(null == jclCompany ? null : jclCompany.getId()) - .parentDept(null == jclDepartment ? null : jclDepartment.getId()) + .ecCompany(param.getEcCompany()) + .ecDepartment(param.getEcDepartment()) + .parentComp(null == jclCompany ? param.getSubcompanyid1() : jclCompany.getId()) + .parentDept(null == jclDepartment ? param.getDepartmentid() : jclDepartment.getId()) .sequenceId(param.getSequenceId()) .schemeId(param.getSchemeId()) .parentJob(param.getParentJob()) diff --git a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.java b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.java index f4545f35..48dfee3f 100644 --- a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.java +++ b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.java @@ -14,7 +14,7 @@ import java.util.List; */ public interface ExtendInfoMapper { - List listFields(@Param("extendType") String extendType, @Param("extendGroupId") String extendGroupId, @Param("tableName") String tableName, @Param("operateType") String operateType); + List listFields(@Param("extendType") String extendType, @Param("extendGroupId") String extendGroupId, @Param("tableName") String tableName, @Param("operateType") String operateType, @Param("isEnable") String isEnable); int countFieldsByGroupId(@Param("tableName") String tableName, @Param("groupId") Long groupId); diff --git a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml index 0fb7bcbf..c97d9b0a 100644 --- a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml +++ b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml @@ -244,7 +244,7 @@ FROM jcl_field_extendinfo t - WHERE t.delete_type = 0 + WHERE t.delete_type = 0 and t.isenable = 1 and extend_type = #{extendType} @@ -257,7 +257,10 @@ and ${operateType}_show = 1 - order by show_order + + and isenable = #{isEnable} + + order by extend_group_id,show_order diff --git a/src/com/engine/organization/mapper/job/JobMapper.xml b/src/com/engine/organization/mapper/job/JobMapper.xml index f6c19367..5d29c141 100644 --- a/src/com/engine/organization/mapper/job/JobMapper.xml +++ b/src/com/engine/organization/mapper/job/JobMapper.xml @@ -225,6 +225,12 @@ and t.parent_dept = #{jobPO.parentDept} + + and t.ec_company = #{jobPO.ecCompany} + + + and t.ec_department = #{jobPO.ecDepartment} + and t.sequence_id = #{jobPO.sequenceId} @@ -342,7 +348,7 @@ from jcl_org_job where delete_type = 0 and job_name = #{jobName} and parent_comp = #{parentCompany} - and parent_dept = #{parentDepartment} +