From b9cfe839e7086e618e181ea24f98079607ec2bb4 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Fri, 16 Dec 2022 16:21:54 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/entity/job/bo/JobBO.java | 9 + .../organization/mapper/job/JobMapper.java | 2 + .../organization/mapper/job/JobMapper.xml | 13 +- .../service/impl/CompServiceImpl.java | 16 +- .../service/impl/DepartmentServiceImpl.java | 20 +- .../impl/HrmPersonnelCardServiceImpl.java | 5 +- .../service/impl/JobServiceImpl.java | 5 +- .../service/impl/StaffServiceImpl.java | 11 +- .../thread/StaffTriggerRunnable.java | 376 +++++++++--------- .../util/saveimport/ResourceImport.java | 8 +- 10 files changed, 243 insertions(+), 222 deletions(-) diff --git a/src/com/engine/organization/entity/job/bo/JobBO.java b/src/com/engine/organization/entity/job/bo/JobBO.java index 8ccf2a27..9b31a888 100644 --- a/src/com/engine/organization/entity/job/bo/JobBO.java +++ b/src/com/engine/organization/entity/job/bo/JobBO.java @@ -9,6 +9,7 @@ import com.engine.organization.mapper.job.JobMapper; import com.engine.organization.transmethod.JobTransMethod; import com.engine.organization.util.db.MapperProxyFactory; import org.apache.commons.collections.CollectionUtils; +import weaver.general.Util; import weaver.hrm.job.JobTitlesComInfo; import java.util.*; @@ -93,11 +94,19 @@ public class JobBO { //.forbiddenTag(e.getForbiddenTag()) .isUsed(0) .build()).collect(Collectors.toList()); + List usedIds = MapperProxyFactory.getProxy(JobMapper.class).listUsedId(); Map> collects = dtoList.stream().filter(item -> null != item.getParentJob() && 0 != item.getParentJob()).collect(Collectors.groupingBy(JobListDTO::getParentJob)); return dtoList.stream().peek(e -> { List childList = collects.get(e.getId()); if (CollectionUtils.isNotEmpty(childList)) { e.setChildren(childList); + e.setIsUsed(1); + }else{ + if (usedIds.contains(Util.null2String(e.getId()))) { + e.setIsUsed(1); + } else { + e.setIsUsed(0); + } } }).filter(item -> null == item.getParentJob() || 0 == item.getParentJob()).collect(Collectors.toList()); } diff --git a/src/com/engine/organization/mapper/job/JobMapper.java b/src/com/engine/organization/mapper/job/JobMapper.java index cb45b39e..18d36ee3 100644 --- a/src/com/engine/organization/mapper/job/JobMapper.java +++ b/src/com/engine/organization/mapper/job/JobMapper.java @@ -143,4 +143,6 @@ public interface JobMapper { int updateJobCompany(@Param("ids") Collection ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") Integer ecCompany); int selectByConditions(@Param("resourcePO") ResourcePO resourcePO); + + List listUsedId(); } diff --git a/src/com/engine/organization/mapper/job/JobMapper.xml b/src/com/engine/organization/mapper/job/JobMapper.xml index 6e268409..58ac4e88 100644 --- a/src/com/engine/organization/mapper/job/JobMapper.xml +++ b/src/com/engine/organization/mapper/job/JobMapper.xml @@ -467,8 +467,10 @@ - + diff --git a/src/com/engine/organization/service/impl/CompServiceImpl.java b/src/com/engine/organization/service/impl/CompServiceImpl.java index ea7013fb..ad00de37 100644 --- a/src/com/engine/organization/service/impl/CompServiceImpl.java +++ b/src/com/engine/organization/service/impl/CompServiceImpl.java @@ -135,14 +135,16 @@ public class CompServiceImpl extends Service implements CompService { public Long updateComp(Map params) { HasRightUtil.hasRight(user, RIGHT_NAME, false); Integer ecCompanyId = Integer.parseInt(Util.null2String(params.get("id"))); - Integer supSubComId = Integer.parseInt(Util.null2String(params.get("supsubcomid"))); - Set disableIds = new HashSet<>(); - disableIds.add(ecCompanyId); - List compPOS = getCompMapper().listChild(Collections.singletonList(ecCompanyId)); - if (CollectionUtils.isNotEmpty(compPOS)) { - addDisableIds(disableIds, compPOS); + String supSubComId = Util.null2String(params.get("supsubcomid")); + if (StringUtils.isNotBlank(supSubComId)) { + Set disableIds = new HashSet<>(); + disableIds.add(ecCompanyId); + List compPOS = getCompMapper().listChild(Collections.singletonList(ecCompanyId)); + if (CollectionUtils.isNotEmpty(compPOS)) { + addDisableIds(disableIds, compPOS); + } + OrganizationAssert.isFalse(disableIds.contains(Integer.parseInt(supSubComId)), "上级分部不能选择分部本身及其下级分部"); } - OrganizationAssert.isFalse(disableIds.contains(supSubComId), "上级分部不能选择分部本身及其下级分部"); new OrganizationSyncEc(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.UPDATE, params).sync(); return (long) ecCompanyId; diff --git a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java index aa09aad6..0e80e7ff 100644 --- a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java +++ b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java @@ -194,16 +194,18 @@ public class DepartmentServiceImpl extends Service implements DepartmentService public Long updateForm(Map params) { HasRightUtil.hasRight(user, RIGHT_NAME, false); Integer ecDepartmentId = Integer.parseInt(Util.null2String(params.get("id"))); - Integer supDepId = Integer.parseInt(Util.null2String(params.get("supdepid"))); - // 不可选择合并的数据,本身及子部门 - Set disableIds = new HashSet<>(); - // 添加选择部门本身 - disableIds.add(ecDepartmentId); - List deptListByPId = getDepartmentMapper().getDeptListByPId(ecDepartmentId); - if (CollectionUtils.isNotEmpty(deptListByPId)) { - addDisableIds(disableIds, deptListByPId); + String supDepId = Util.null2String(params.get("supdepid")); + if (StringUtils.isNotBlank(supDepId)) { + // 不可选择合并的数据,本身及子部门 + Set disableIds = new HashSet<>(); + // 添加选择部门本身 + disableIds.add(ecDepartmentId); + List deptListByPId = getDepartmentMapper().getDeptListByPId(ecDepartmentId); + if (CollectionUtils.isNotEmpty(deptListByPId)) { + addDisableIds(disableIds, deptListByPId); + } + OrganizationAssert.isFalse(disableIds.contains(Integer.parseInt(supDepId)), "上级部门不能选择部门本身及其下级部门"); } - OrganizationAssert.isFalse(disableIds.contains(supDepId), "上级部门不能选择部门本身及其下级部门"); new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.UPDATE, params).sync(); return (long) ecDepartmentId; diff --git a/src/com/engine/organization/service/impl/HrmPersonnelCardServiceImpl.java b/src/com/engine/organization/service/impl/HrmPersonnelCardServiceImpl.java index 20f566af..404ffc05 100644 --- a/src/com/engine/organization/service/impl/HrmPersonnelCardServiceImpl.java +++ b/src/com/engine/organization/service/impl/HrmPersonnelCardServiceImpl.java @@ -183,6 +183,9 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel String fieldName = hfm.getFieldname(); JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName); String fieldLabel = Util.toScreen(SystemEnv.getHtmlLabelName(hrmFieldConf.getInt("fieldlabel"), user.getLanguage()), user.getLanguage()); + if ("resourceimageid".equals(fieldName) || "messagerurl".equals(fieldName) || "职等职级".equals(fieldLabel)) { + continue; + } String hrmData = ""; if (hfm.isBaseField(fieldName)) { hrmData = hfm.getHrmData(fieldName); @@ -193,7 +196,7 @@ public class HrmPersonnelCardServiceImpl extends Service implements HrmPersonnel hrmData = recordSet.getString(fieldName); } } - String fieldValue = hfm.getFieldvalue(null, user, null, hrmFieldConf.getString("dmlurl"), hrmFieldConf.getInt("id"), hrmFieldConf.getInt("fieldhtmltype"), hrmFieldConf.getInt("type"), hrmData, 0, fieldName); + String fieldValue = hfm.getFieldvalue(null, user, null, hrmFieldConf.getString("dmlurl"), hrmFieldConf.getInt("id"), hrmFieldConf.getInt("fieldhtmltype"), hrmFieldConf.getInt("type"), hrmData, 0, fieldName); itemList.add(Item.builder().fieldId(fieldLabel).fieldValue(fieldValue).build()); } formItem.setItems(itemList); diff --git a/src/com/engine/organization/service/impl/JobServiceImpl.java b/src/com/engine/organization/service/impl/JobServiceImpl.java index e06337d5..dd8db962 100644 --- a/src/com/engine/organization/service/impl/JobServiceImpl.java +++ b/src/com/engine/organization/service/impl/JobServiceImpl.java @@ -39,7 +39,6 @@ import com.engine.organization.mapper.extend.ExtMapper; import com.engine.organization.mapper.extend.ExtendTitleMapper; import com.engine.organization.mapper.job.JobMapper; import com.engine.organization.mapper.resource.HrmResourceMapper; -import com.engine.organization.mapper.resource.ResourceMapper; import com.engine.organization.mapper.scheme.GradeMapper; import com.engine.organization.service.ExtService; import com.engine.organization.service.JobService; @@ -130,8 +129,6 @@ public class JobServiceImpl extends Service implements JobService { } - - @Override public Map getSearchTree(SearchTreeParams params) { String keyword = params.getKeyword(); @@ -482,7 +479,7 @@ public class JobServiceImpl extends Service implements JobService { OrganizationAssert.notEmpty(ids, "请选择要删除的数据"); List jobsByIds = getJobMapper().getJobsByIds(ids); for (JobPO jobsById : jobsByIds) { - jobsById.setForbiddenTag(1); + // jobsById.setForbiddenTag(1); //new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobsById).sync(); // 删除拓展表、明细表 MapperProxyFactory.getProxy(ExtMapper.class).deleteByID("jcl_org_jobext", jobsById.getId()); diff --git a/src/com/engine/organization/service/impl/StaffServiceImpl.java b/src/com/engine/organization/service/impl/StaffServiceImpl.java index b440f983..4e31de95 100644 --- a/src/com/engine/organization/service/impl/StaffServiceImpl.java +++ b/src/com/engine/organization/service/impl/StaffServiceImpl.java @@ -24,7 +24,6 @@ import com.engine.organization.mapper.staff.StaffMapper; import com.engine.organization.mapper.staff.StaffPlanMapper; import com.engine.organization.mapper.staff.StaffsMapper; import com.engine.organization.service.StaffService; -import com.engine.organization.thread.StaffTriggerRunnable; import com.engine.organization.util.*; import com.engine.organization.util.browser.OrganizationBrowserUtil; import com.engine.organization.util.db.DBType; @@ -134,7 +133,7 @@ public class StaffServiceImpl extends Service implements StaffService { int ignoreNull = getStaffMapper().insertIgnoreNull(staffPO); // 同步组织架构图编制信息 - new StaffTriggerRunnable(staffPO).run(); + //new StaffTriggerRunnable(staffPO).run(); return ignoreNull; } @@ -166,7 +165,7 @@ public class StaffServiceImpl extends Service implements StaffService { // 更新主表 int updateStaff = getStaffMapper().updateStaff(staffPO); // 同步组织架构图编制信息 - new StaffTriggerRunnable(staffPO).run(); + //new StaffTriggerRunnable(staffPO).run(); return updateStaff; } @@ -177,9 +176,9 @@ public class StaffServiceImpl extends Service implements StaffService { OrganizationAssert.notEmpty(ids, "请选择要删除的数据"); List staffsByIds = getStaffMapper().getStaffsByIds(ids); int deleteByIds = getStaffMapper().deleteByIds(ids); - for (StaffPO staffsById : staffsByIds) { - new StaffTriggerRunnable(staffsById).run(); - } + //for (StaffPO staffsById : staffsByIds) { + // new StaffTriggerRunnable(staffsById).run(); + //} return deleteByIds; } diff --git a/src/com/engine/organization/thread/StaffTriggerRunnable.java b/src/com/engine/organization/thread/StaffTriggerRunnable.java index a4ff15f6..076ebed0 100644 --- a/src/com/engine/organization/thread/StaffTriggerRunnable.java +++ b/src/com/engine/organization/thread/StaffTriggerRunnable.java @@ -1,188 +1,188 @@ -package com.engine.organization.thread; - -import com.engine.organization.entity.company.po.CompPO; -import com.engine.organization.entity.department.po.DepartmentPO; -import com.engine.organization.entity.job.po.JobPO; -import com.engine.organization.entity.map.JclOrgMap; -import com.engine.organization.entity.staff.po.StaffPO; -import com.engine.organization.entity.staff.po.StaffPlanPO; -import com.engine.organization.enums.ModuleTypeEnum; -import com.engine.organization.mapper.comp.CompMapper; -import com.engine.organization.mapper.department.DepartmentMapper; -import com.engine.organization.mapper.jclorgmap.JclOrgMapper; -import com.engine.organization.mapper.job.JobMapper; -import com.engine.organization.mapper.staff.StaffPlanMapper; -import com.engine.organization.mapper.trigger.StaffTriggerMapper; -import com.engine.organization.util.OrganizationDateUtil; -import com.engine.organization.util.db.MapperProxyFactory; -import org.apache.commons.lang3.StringUtils; -import weaver.common.DateUtil; - -import java.sql.Date; - -/** - * @author:dxfeng - * @createTime: 2022/09/21 - * @version: 1.0 - */ -public class StaffTriggerRunnable implements Runnable { - StaffPO staffPO; - StaffPlanPO staffPlanByID; - - private StaffPlanMapper getStaffPlanMapper() { - return MapperProxyFactory.getProxy(StaffPlanMapper.class); - } - - private StaffTriggerMapper getStaffTriggerMapper() { - return MapperProxyFactory.getProxy(StaffTriggerMapper.class); - } - - private CompMapper getCompMapper() { - return MapperProxyFactory.getProxy(CompMapper.class); - } - - private DepartmentMapper getDepartmentMapper() { - return MapperProxyFactory.getProxy(DepartmentMapper.class); - } - - private JobMapper getJobMapper() { - return MapperProxyFactory.getProxy(JobMapper.class); - } - - private JclOrgMapper getJclOrgMapper() { - return MapperProxyFactory.getProxy(JclOrgMapper.class); - } - - private final Date currentDate; - private final Date yesterday; - - public StaffTriggerRunnable(StaffPO staffPO) { - this.staffPO = staffPO; - this.staffPlanByID = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId()); - - currentDate = new Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new java.util.Date())).getTime()); - yesterday = new Date(OrganizationDateUtil.stringToDate(DateUtil.addDate(currentDate.toString(), -1)).getTime()); - } - - public StaffTriggerRunnable(Integer jclJobId) { - if (null != jclJobId) { - JobPO jobById = getJobMapper().getJobById((long) jclJobId); - if (null != jobById) { - this.staffPO = StaffPO.builder().compId(jobById.getEcCompany()).deptId(jobById.getEcDepartment()).jobId(jobById.getId()).build(); - this.staffPlanByID = StaffPlanPO.builder().controlDimension("3").build(); - } - } - currentDate = new Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new java.util.Date())).getTime()); - yesterday = new Date(OrganizationDateUtil.stringToDate(DateUtil.addDate(currentDate.toString(), -1)).getTime()); - } - - @Override - public void run() { - if (null != staffPO) { - if (null != staffPlanByID && StringUtils.isNotBlank(staffPlanByID.getControlDimension())) { - String fType = staffPlanByID.getControlDimension(); - switch (fType) { - case "1": - // 更新分部编制 - refreshCompanyStaff(staffPO.getCompId().intValue()); - break; - case "2": - // 更新部门编制 - refreshDepartmentStaff(staffPO.getDeptId()); - refreshCompanyStaff(staffPO.getCompId().intValue()); - break; - case "3": - // 更新岗位编制 - refreshJobStaff(staffPO.getJobId()); - refreshDepartmentStaff(staffPO.getDeptId()); - refreshCompanyStaff(staffPO.getCompId().intValue()); - break; - default: - break; - } - } - } - } - - private void refreshCompanyStaff(Integer companyId) { - if (null == companyId) { - return; - } - CompPO compPO = getCompMapper().listById(companyId); - if (null != compPO) { - updateOrgMap(ModuleTypeEnum.subcompanyfielddefined.getValue().toString(), companyId.toString()); - if (null != compPO.getSupSubComId() && 0 != compPO.getSupSubComId()) { - refreshCompanyStaff(compPO.getSupSubComId()); - } else { - // 刷新集团数据 - refreshGroupStaff(); - } - } - } - - private void refreshDepartmentStaff(Integer departmentId) { - if (null == departmentId) { - return; - } - DepartmentPO deptById = getDepartmentMapper().getDeptById(departmentId); - if (null != deptById) { - updateOrgMap(ModuleTypeEnum.departmentfielddefined.getValue().toString(), departmentId.toString()); - if (null != deptById.getSupDepId() && 0 != deptById.getSupDepId()) { - refreshDepartmentStaff(deptById.getSupDepId()); - } - } - } - - private void refreshJobStaff(Long jobId) { - if (null == jobId) { - return; - } - JobPO jobById = getJobMapper().getJobById(jobId); - if (null != jobById) { - updateOrgMap(ModuleTypeEnum.jobfielddefined.getValue().toString(), jobId.toString()); - if (null != jobById.getParentJob() && 0 != jobById.getParentJob()) { - refreshJobStaff(jobById.getParentJob()); - } - } - } - - private void refreshGroupStaff() { - updateOrgMap("0", "0"); - } - - - private void updateOrgMap(String type, String objId) { - Integer planSum = 0; - Integer onJobSum = 0; - switch (type) { - case "1": - planSum = getStaffTriggerMapper().countCompanyStaffNum(currentDate, objId); - break; - case "2": - planSum = getStaffTriggerMapper().countDepartmentStaffNum(currentDate, objId); - break; - case "3": - planSum = getStaffTriggerMapper().countJobStaffNum(currentDate, objId); - onJobSum = getStaffTriggerMapper().countOnJobByJObId(objId); - default: - break; - } - - JclOrgMap jclOrgMapByObjID = getJclOrgMapper().getJclOrgMapByObjID(currentDate, type, objId); - String mapInfoId = getStaffTriggerMapper().getIdByObjIdAndType(currentDate, objId, type); - Integer childPlanSum = getStaffTriggerMapper().sumPlanByParentId(currentDate, mapInfoId); - Integer childOnJobSum = getStaffTriggerMapper().sumOnJobByParentId(currentDate, mapInfoId); - getJclOrgMapper().deleteMap(type, objId, currentDate); - getJclOrgMapper().updateMap(type, objId, currentDate, yesterday); - jclOrgMapByObjID.setFPlan(addInteger(planSum, childPlanSum)); - jclOrgMapByObjID.setFOnJob(addInteger(onJobSum, childOnJobSum)); - jclOrgMapByObjID.setFDateBegin(currentDate); - getJclOrgMapper().insertMap(jclOrgMapByObjID); - } - - private Integer addInteger(Integer num1, Integer num2) { - num1 = num1 == null ? 0 : num1; - num2 = num2 == null ? 0 : num2; - return num1 + num2; - } -} +//package com.engine.organization.thread; +// +//import com.engine.organization.entity.company.po.CompPO; +//import com.engine.organization.entity.department.po.DepartmentPO; +//import com.engine.organization.entity.job.po.JobPO; +//import com.engine.organization.entity.map.JclOrgMap; +//import com.engine.organization.entity.staff.po.StaffPO; +//import com.engine.organization.entity.staff.po.StaffPlanPO; +//import com.engine.organization.enums.ModuleTypeEnum; +//import com.engine.organization.mapper.comp.CompMapper; +//import com.engine.organization.mapper.department.DepartmentMapper; +//import com.engine.organization.mapper.jclorgmap.JclOrgMapper; +//import com.engine.organization.mapper.job.JobMapper; +//import com.engine.organization.mapper.staff.StaffPlanMapper; +//import com.engine.organization.mapper.trigger.StaffTriggerMapper; +//import com.engine.organization.util.OrganizationDateUtil; +//import com.engine.organization.util.db.MapperProxyFactory; +//import org.apache.commons.lang3.StringUtils; +//import weaver.common.DateUtil; +// +//import java.sql.Date; +// +///** +// * @author:dxfeng +// * @createTime: 2022/09/21 +// * @version: 1.0 +// */ +//public class StaffTriggerRunnable implements Runnable { +// StaffPO staffPO; +// StaffPlanPO staffPlanByID; +// +// private StaffPlanMapper getStaffPlanMapper() { +// return MapperProxyFactory.getProxy(StaffPlanMapper.class); +// } +// +// private StaffTriggerMapper getStaffTriggerMapper() { +// return MapperProxyFactory.getProxy(StaffTriggerMapper.class); +// } +// +// private CompMapper getCompMapper() { +// return MapperProxyFactory.getProxy(CompMapper.class); +// } +// +// private DepartmentMapper getDepartmentMapper() { +// return MapperProxyFactory.getProxy(DepartmentMapper.class); +// } +// +// private JobMapper getJobMapper() { +// return MapperProxyFactory.getProxy(JobMapper.class); +// } +// +// private JclOrgMapper getJclOrgMapper() { +// return MapperProxyFactory.getProxy(JclOrgMapper.class); +// } +// +// private final Date currentDate; +// private final Date yesterday; +// +// public StaffTriggerRunnable(StaffPO staffPO) { +// this.staffPO = staffPO; +// this.staffPlanByID = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId()); +// +// currentDate = new Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new java.util.Date())).getTime()); +// yesterday = new Date(OrganizationDateUtil.stringToDate(DateUtil.addDate(currentDate.toString(), -1)).getTime()); +// } +// +// public StaffTriggerRunnable(Integer jclJobId) { +// if (null != jclJobId) { +// JobPO jobById = getJobMapper().getJobById((long) jclJobId); +// if (null != jobById) { +// this.staffPO = StaffPO.builder().compId(jobById.getEcCompany()).deptId(jobById.getEcDepartment()).jobId(jobById.getId()).build(); +// this.staffPlanByID = StaffPlanPO.builder().controlDimension("3").build(); +// } +// } +// currentDate = new Date(OrganizationDateUtil.stringToDate(OrganizationDateUtil.getFormatLocalDate(new java.util.Date())).getTime()); +// yesterday = new Date(OrganizationDateUtil.stringToDate(DateUtil.addDate(currentDate.toString(), -1)).getTime()); +// } +// +// @Override +// public void run() { +// if (null != staffPO) { +// if (null != staffPlanByID && StringUtils.isNotBlank(staffPlanByID.getControlDimension())) { +// String fType = staffPlanByID.getControlDimension(); +// switch (fType) { +// case "1": +// // 更新分部编制 +// refreshCompanyStaff(staffPO.getCompId().intValue()); +// break; +// case "2": +// // 更新部门编制 +// refreshDepartmentStaff(staffPO.getDeptId()); +// refreshCompanyStaff(staffPO.getCompId().intValue()); +// break; +// case "3": +// // 更新岗位编制 +// refreshJobStaff(staffPO.getJobId()); +// refreshDepartmentStaff(staffPO.getDeptId()); +// refreshCompanyStaff(staffPO.getCompId().intValue()); +// break; +// default: +// break; +// } +// } +// } +// } +// +// private void refreshCompanyStaff(Integer companyId) { +// if (null == companyId) { +// return; +// } +// CompPO compPO = getCompMapper().listById(companyId); +// if (null != compPO) { +// updateOrgMap(ModuleTypeEnum.subcompanyfielddefined.getValue().toString(), companyId.toString()); +// if (null != compPO.getSupSubComId() && 0 != compPO.getSupSubComId()) { +// refreshCompanyStaff(compPO.getSupSubComId()); +// } else { +// // 刷新集团数据 +// refreshGroupStaff(); +// } +// } +// } +// +// private void refreshDepartmentStaff(Integer departmentId) { +// if (null == departmentId) { +// return; +// } +// DepartmentPO deptById = getDepartmentMapper().getDeptById(departmentId); +// if (null != deptById) { +// updateOrgMap(ModuleTypeEnum.departmentfielddefined.getValue().toString(), departmentId.toString()); +// if (null != deptById.getSupDepId() && 0 != deptById.getSupDepId()) { +// refreshDepartmentStaff(deptById.getSupDepId()); +// } +// } +// } +// +// private void refreshJobStaff(Long jobId) { +// if (null == jobId) { +// return; +// } +// JobPO jobById = getJobMapper().getJobById(jobId); +// if (null != jobById) { +// updateOrgMap(ModuleTypeEnum.jobfielddefined.getValue().toString(), jobId.toString()); +// if (null != jobById.getParentJob() && 0 != jobById.getParentJob()) { +// refreshJobStaff(jobById.getParentJob()); +// } +// } +// } +// +// private void refreshGroupStaff() { +// updateOrgMap("0", "0"); +// } +// +// +// private void updateOrgMap(String type, String objId) { +// Integer planSum = 0; +// Integer onJobSum = 0; +// switch (type) { +// case "1": +// planSum = getStaffTriggerMapper().countCompanyStaffNum(currentDate, objId); +// break; +// case "2": +// planSum = getStaffTriggerMapper().countDepartmentStaffNum(currentDate, objId); +// break; +// case "3": +// planSum = getStaffTriggerMapper().countJobStaffNum(currentDate, objId); +// onJobSum = getStaffTriggerMapper().countOnJobByJObId(objId); +// default: +// break; +// } +// +// JclOrgMap jclOrgMapByObjID = getJclOrgMapper().getJclOrgMapByObjID(currentDate, type, objId); +// String mapInfoId = getStaffTriggerMapper().getIdByObjIdAndType(currentDate, objId, type); +// Integer childPlanSum = getStaffTriggerMapper().sumPlanByParentId(currentDate, mapInfoId); +// Integer childOnJobSum = getStaffTriggerMapper().sumOnJobByParentId(currentDate, mapInfoId); +// getJclOrgMapper().deleteMap(type, objId, currentDate); +// getJclOrgMapper().updateMap(type, objId, currentDate, yesterday); +// jclOrgMapByObjID.setFPlan(addInteger(planSum, childPlanSum)); +// jclOrgMapByObjID.setFOnJob(addInteger(onJobSum, childOnJobSum)); +// jclOrgMapByObjID.setFDateBegin(currentDate); +// getJclOrgMapper().insertMap(jclOrgMapByObjID); +// } +// +// private Integer addInteger(Integer num1, Integer num2) { +// num1 = num1 == null ? 0 : num1; +// num2 = num2 == null ? 0 : num2; +// return num1 + num2; +// } +//} diff --git a/src/com/engine/organization/util/saveimport/ResourceImport.java b/src/com/engine/organization/util/saveimport/ResourceImport.java index 7c167a65..be8adda4 100644 --- a/src/com/engine/organization/util/saveimport/ResourceImport.java +++ b/src/com/engine/organization/util/saveimport/ResourceImport.java @@ -108,11 +108,11 @@ public class ResourceImport { //重复验证字段 List statusOptions = new ArrayList<>(); - statusOptions.add(new SearchConditionOption("last_name", SystemEnv.getHtmlLabelName(413, user.getLanguage()))); - statusOptions.add(new SearchConditionOption("work_code", SystemEnv.getHtmlLabelName(714, user.getLanguage()), true)); - //statusOptions.add(new SearchConditionOption("loginid", SystemEnv.getHtmlLabelName(412, user.getLanguage()))); + statusOptions.add(new SearchConditionOption("lastname", SystemEnv.getHtmlLabelName(413, user.getLanguage()))); + statusOptions.add(new SearchConditionOption("workcode", SystemEnv.getHtmlLabelName(714, user.getLanguage()), true)); + statusOptions.add(new SearchConditionOption("loginid", SystemEnv.getHtmlLabelName(412, user.getLanguage()))); searchConditionItem = conditionFactory.createCondition(ConditionType.SELECT, 24638, "keyField", statusOptions); - searchConditionItem.setValue("last_name"); + searchConditionItem.setValue("lastname"); itemList.add(searchConditionItem); //导入类型