From f6094cbc7a64790aecaca4f0b9de9be082269ce2 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 6 Sep 2023 10:04:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E9=9D=9E=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=BA=BA=E5=91=98tab=E9=A1=B5=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 4 + src/com/engine/salary/biz/SIArchivesBiz.java | 36 +++++- .../sischeme/param/SISchemaImportParam.java | 9 +- .../salary/mapper/InsuranceExportMapper.java | 4 + .../salary/mapper/InsuranceExportMapper.xml | 98 +++++++++++++++++ .../mapper/datacollection/EmployMapper.xml | 3 +- .../mapper/extemp/ExternalEmployeeMapper.xml | 3 +- .../InsuranceAccountDetailMapper.java | 8 ++ .../InsuranceAccountDetailMapper.xml | 104 ++++++++++++++++++ .../impl/SIAComparisonResultServiceImpl.java | 8 ++ .../service/impl/SIAccountServiceImpl.java | 30 ++++- .../service/impl/SIArchivesServiceImpl.java | 28 +++-- .../service/impl/SISchemeServiceImpl.java | 7 +- .../impl/TaxAgentManageRangeServiceImpl.java | 8 +- 14 files changed, 327 insertions(+), 23 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 47e0741f7..13f887998 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -163,7 +163,11 @@ public class SIAccountBiz extends Service { OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); queryParam.setOrderRule(orderRule); + //系统人员福利台账明细 List list = getInsuranceAccountDetailMapper().list(queryParam); + //非系统各人员台账明细 + List extList = getInsuranceAccountDetailMapper().extList(queryParam); + list.addAll(extList); PageInfo pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, InsuranceAccountDetailPO.class); diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index a3d3f10ab..07a965ef7 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -29,6 +29,7 @@ import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; import com.engine.salary.entity.sischeme.po.InsuranceSchemePO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.enums.siaccount.EmployeeStatusEnum; import com.engine.salary.enums.sicategory.*; import com.engine.salary.exception.SalaryRunTimeException; @@ -691,6 +692,13 @@ public class SIArchivesBiz { } encryptUtil.encrypt(updateOtherInfo, InsuranceArchivesOtherSchemePO.class); otherSchemeMapper.updateById(updateOtherInfo); + //更新base_info表状态 + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + //对于非系统人员,编辑后状态切换为正在缴纳 + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + } sqlSession.commit(); } else { otherSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesOtherSchemePO.builder() @@ -729,6 +737,10 @@ public class SIArchivesBiz { .paymentOrganization(param.getPaymentOrganization()) .build()); baseInfoPO.setOtherArchivesId(otherInfos.get(0).getId()); + //对于非系统人员,编辑后状态切换为正在缴纳 + if (baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + } getInsuranceBaseInfoMapper().updateById(baseInfoPO); } else { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "档案不存在!")); @@ -790,7 +802,13 @@ public class SIArchivesBiz { } encryptUtil.encrypt(updateFundInfo, InsuranceArchivesFundSchemePO.class); fundSchemeMapper.updateById(updateFundInfo); - + //更新base_info表状态 + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + //对于非系统人员,编辑后状态切换为正在缴纳 + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + } sqlSession.commit(); } else { fundSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesFundSchemePO.builder() @@ -831,6 +849,10 @@ public class SIArchivesBiz { .paymentOrganization(param.getPaymentOrganization()) .build()); baseInfoPO.setFundArchivesId(fundInfos.get(0).getId()); + //对于非系统人员,编辑后状态切换为正在缴纳 + if (baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + } getInsuranceBaseInfoMapper().updateById(baseInfoPO); } else { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "档案不存在!")); @@ -899,7 +921,13 @@ public class SIArchivesBiz { } encryptUtil.encrypt(updateSocialInfo, InsuranceArchivesSocialSchemePO.class); socialSchemeMapper.updateById(updateSocialInfo); - + //更新base_info表状态 + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + //对于非系统人员,编辑后状态切换为正在缴纳 + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + } sqlSession.commit(); } else { socialSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesSocialSchemePO.builder() @@ -940,6 +968,10 @@ public class SIArchivesBiz { .paymentOrganization(param.getPaymentOrganization()) .build()); baseInfoPO.setSocialArchivesId(socialInfos.get(0).getId()); + //对于非系统人员,编辑后状态切换为正在缴纳 + if (baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { + baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); + } getInsuranceBaseInfoMapper().updateById(baseInfoPO); } else { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "档案不存在!")); diff --git a/src/com/engine/salary/entity/sischeme/param/SISchemaImportParam.java b/src/com/engine/salary/entity/sischeme/param/SISchemaImportParam.java index 0581b2c5f..7e49621c2 100644 --- a/src/com/engine/salary/entity/sischeme/param/SISchemaImportParam.java +++ b/src/com/engine/salary/entity/sischeme/param/SISchemaImportParam.java @@ -18,6 +18,13 @@ public class SISchemaImportParam { @DataCheck(require = true,message = "imageId为空") String imageId; - //福利执行状态 + /** + * 福利执行状态 + */ String runStatus; + + /** + * 是否是外部人员 + */ + boolean isExtEmp; } diff --git a/src/com/engine/salary/mapper/InsuranceExportMapper.java b/src/com/engine/salary/mapper/InsuranceExportMapper.java index ffed6713f..2464c49de 100644 --- a/src/com/engine/salary/mapper/InsuranceExportMapper.java +++ b/src/com/engine/salary/mapper/InsuranceExportMapper.java @@ -21,4 +21,8 @@ public interface InsuranceExportMapper { List exportAccount(@Param("paymentStatus") Integer paymentStatus, @Param("param") InsuranceExportParam param); List exportRecessionAccount(@Param("paymentStatus") Integer paymentStatus, @Param("param") InsuranceExportParam param); + + List exportExtAccount(@Param("paymentStatus") Integer paymentStatus, @Param("param") InsuranceExportParam param); + + List exportExtExcelAccount(@Param("param") InsuranceComparisonResultQueryParam param); } diff --git a/src/com/engine/salary/mapper/InsuranceExportMapper.xml b/src/com/engine/salary/mapper/InsuranceExportMapper.xml index 517eb1672..481c44a30 100644 --- a/src/com/engine/salary/mapper/InsuranceExportMapper.xml +++ b/src/com/engine/salary/mapper/InsuranceExportMapper.xml @@ -193,4 +193,102 @@ ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc} + + + + + + + + diff --git a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml index b54ee6cba..d71cdcc23 100644 --- a/src/com/engine/salary/mapper/datacollection/EmployMapper.xml +++ b/src/com/engine/salary/mapper/datacollection/EmployMapper.xml @@ -8,7 +8,8 @@ d.DEPARTMENTNAME as departmentName, e.status, e.mobile, - e.workcode + e.workcode, + 'false' as extEmp from hrmresource e left join hrmdepartment d on e.departmentid = d.id where e.status not in (7) diff --git a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml index 0a8ac06b9..e04017e35 100644 --- a/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/extemp/ExternalEmployeeMapper.xml @@ -239,7 +239,8 @@ d.DEPARTMENTNAME as departmentName, e.status, e.mobile, - e.workcode + e.workcode, + 'true' as extEmp from hrsa_external_employee e left join hrmdepartment d on e.department_id = d.id diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java index 94843ff71..2dec937ca 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java @@ -24,6 +24,14 @@ public interface InsuranceAccountDetailMapper { */ List list(@Param("param") InsuranceAccountDetailParam queryParam); + /** + * 查询正常缴纳列表_非系统人员 + * + * @param queryParam + * @return + */ + List extList(@Param("param") InsuranceAccountDetailParam queryParam); + /** * 通过id查询 */ diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index 6535e2f0b..6540a705d 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -254,6 +254,94 @@ + + + AND + ( + e.userName like CONCAT('%',#{param.userName},'%') + ) + + + AND e.workcode like CONCAT('%',#{param.workcode},'%') + + + AND t.employee_id IN + + #{employeeId} + + + + AND t.bill_month IN + + #{recessionMonth} + + + + AND t.payment_organization IN + + #{taxAgent} + + + + + + AND + ( + e.userName like '%'||#{param.userName}||'%' + ) + + + AND e.workcode like '%'||#{param.workcode}||'%' + + + AND t.employee_id IN + + #{employeeId} + + + + AND t.bill_month IN + + #{recessionMonth} + + + + AND t.payment_organization IN + + #{taxAgent} + + + + + + AND + ( + e.userName like '%'+#{param.userName}+'%' + ) + + + AND e.workcode like '%'+#{param.workcode}+'%' + + + AND t.employee_id IN + + #{employeeId} + + + + AND t.bill_month IN + + #{recessionMonth} + + + + AND t.payment_organization IN + + #{taxAgent} + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java index 1b550bb71..dcb3b5f1f 100644 --- a/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java +++ b/src/com/engine/salary/service/impl/ExtEmpServiceImpl.java @@ -38,6 +38,7 @@ import org.springframework.beans.BeanUtils; import weaver.file.ImageFileManager; import weaver.general.Util; import weaver.hrm.User; +import weaver.hrm.company.DepartmentComInfo; import java.io.InputStream; import java.util.*; @@ -323,7 +324,10 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { Long employeeId = 0L; String username = (String) map.getOrDefault(SalaryI18nUtil.getI18nLabel(25034, "姓名"), ""); - String departmentName = (String) map.getOrDefault(SalaryI18nUtil.getI18nLabel(27511, "部门"), ""); + String departmentFullName = (String) map.getOrDefault(SalaryI18nUtil.getI18nLabel(27511, "部门"), ""); + String[] split = departmentFullName.split(">"); + String departmentName = split[split.length - 1]; + String subcompanyName = (String) map.getOrDefault(SalaryI18nUtil.getI18nLabel(33553, "分部"), ""); String companystartdate = (String) map.getOrDefault(SalaryI18nUtil.getI18nLabel(1516, "入职日期"), ""); @@ -346,6 +350,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { //校验部门、分部 List subCompanyInfos = new ArrayList<>(); List deptInfos = new ArrayList<>(); + List targetDeptRange = new ArrayList<>(); if (StringUtils.isNotBlank(subcompanyName)) { subCompanyInfos = getEmployMapper().getSubCompanyInfosByName(subcompanyName); if (subCompanyInfos.size() == 0) { @@ -356,7 +361,18 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { } } if (StringUtils.isNotBlank(departmentName)) { - deptInfos = getEmployMapper().getDeptInfosByName(departmentName); + List toDealDeptInfos = getEmployMapper().getDeptInfosByName(departmentName); + //筛选出匹配导入部门全路径的部门信息 + DepartmentComInfo dci = new DepartmentComInfo(); + deptInfos = toDealDeptInfos.stream().filter(f -> { + try { + String departmentRealPath = dci.getDepartmentRealPath(f.getId().toString()); + return departmentRealPath.contains(departmentFullName); + } catch (Exception e) { + throw new SalaryRunTimeException(e.getMessage()); + } + }).collect(Collectors.toList()); + if (deptInfos.size() == 0) { isError = true; Map errorMessageMap = Maps.newHashMap(); @@ -392,7 +408,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { if(subCompanyInfos.size() == 0 && deptInfos.size() > 1) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "系统中存在重复部门信息,无法指定当前人员关联的唯一部门,请通过填写部门所属的分部信息来缩小部门筛选范围")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "系统中存在重复部门信息,无法指定当前人员关联的唯一部门,请细化部门上级部门或填写部门所属的分部信息来缩小部门筛选范围")); excelComments.add(errorMessageMap); } else if (subCompanyInfos.size() > 1 && deptInfos.size() == 0) { //部门结果数为0,分部结果数大于1,则无法匹配 @@ -415,7 +431,7 @@ public class ExtEmpServiceImpl extends Service implements ExtEmpService { } else if (targetDeptInfos.size() > 1) { isError = true; Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "该组数据中的部门和分部信息在系统中出现多组匹配的部门和分布组合,无法指定唯一的部门和分部组合")); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "该组数据中的部门和分部信息在系统中出现多组匹配的部门和分部组合,无法指定唯一的部门和分部组合")); excelComments.add(errorMessageMap); } else { targetSubCompanyInfos = subCompanyInfos.stream().filter(f -> f.getId().equals(targetDeptInfos.get(0).getSubcompanyid1())).collect(Collectors.toList()); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 4f39d1eac..95042d4c6 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -1536,7 +1536,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getName, TaxAgentPO::getId); // 获取租户下所有的人员 - List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ORG); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); // 失败的数量 int failCount = 0; diff --git a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java index e237ea7f4..f677966d2 100644 --- a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java @@ -104,6 +104,7 @@ public class SICompensationServiceImpl extends Service implements SICompensation partition.forEach(p -> { param.setIds(p); resultData.addAll(getEmployMapper().listHrmInfoByIdAndName(param)); + resultData.addAll(getEmployMapper().listExtHrmInfoByIdAndName(param)); }); } diff --git a/src/com/engine/salary/service/impl/SIExportServiceImpl.java b/src/com/engine/salary/service/impl/SIExportServiceImpl.java index e66059a96..adcdbc8f7 100644 --- a/src/com/engine/salary/service/impl/SIExportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIExportServiceImpl.java @@ -158,6 +158,9 @@ public class SIExportServiceImpl extends Service implements SIExportService { List accountExportPOS = new ArrayList<>(); if (paymentStatus.equals(PaymentStatusEnum.RECESSION.getValue())) { accountExportPOS = getInsuranceExportMapper().exportRecessionAccount(paymentStatus, param); + //非系统人员核算明细 + List extAccountExportPOS = getInsuranceExportMapper().exportExtAccount(paymentStatus, param); + accountExportPOS.addAll(extAccountExportPOS); // 分权逻辑 Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); if (needAuth) { @@ -174,6 +177,9 @@ public class SIExportServiceImpl extends Service implements SIExportService { } } else { accountExportPOS = getInsuranceExportMapper().exportAccount(paymentStatus, param); + //非系统人员核算明细 + List extAccountExportPOS = getInsuranceExportMapper().exportExtAccount(paymentStatus, param); + accountExportPOS.addAll(extAccountExportPOS); } // //过滤出福利档案基础信息表中runStatus为正在缴纳和待减员的人员