From f1bd47f8b7cf6c7ae6b97419db0b460d22798868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 27 Oct 2025 11:22:51 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=B8=E7=AE=97?= =?UTF-8?q?=E5=A4=9A=E6=9D=A1=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalaryAcctResultServiceImpl.java | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 26433f489..7f39ec784 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -327,14 +327,25 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe if (CollectionUtils.isNotEmpty(otherConditions)) { List items = SalaryEntityUtil.properties(otherConditions, SalaryAcctResultQueryParam.OtherCondition::getItemId, Collectors.toList()); List list = listBySalaryAcctRecordIdsAndSalaryItemIds(Collections.singletonList(queryParam.getSalaryAcctRecordId()), items); - for (int i = 0; i < otherConditions.size(); i++) { - SalaryAcctResultQueryParam.OtherCondition otherCondition = otherConditions.get(i); - Long itemId = otherCondition.getItemId(); - FilterEnum filter = otherCondition.getFilter(); - List params = otherCondition.getParams(); - list = list.stream().filter(a -> Objects.equals(a.getSalaryItemId(), itemId)).filter(a -> filter.filter(params).test(a.getResultValue())).collect(Collectors.toList()); + Map> acctEmpResultsMap = SalaryEntityUtil.group2Map(list, SalaryAcctResultPO::getSalaryAcctEmpId); + Set removeAcctEmpIds = new HashSet<>(); + for (Long acctEmpId : acctEmpResultsMap.keySet()) { + List acctEmpResults = acctEmpResultsMap.get(acctEmpId); + //如果有一个条件不成立就删除 + for (int i = 0; i < otherConditions.size(); i++) { + SalaryAcctResultQueryParam.OtherCondition otherCondition = otherConditions.get(i); + Long itemId = otherCondition.getItemId(); + FilterEnum filter = otherCondition.getFilter(); + List params = otherCondition.getParams(); + for (SalaryAcctResultPO po : acctEmpResults) { + if(Objects.equals(po.getSalaryItemId(), itemId) && !filter.filter(params).test(po.getResultValue())){ + removeAcctEmpIds.add(po.getSalaryAcctEmpId()); + } + } + } } - List salaryAcctEmpId = SalaryEntityUtil.properties(list, SalaryAcctResultPO::getSalaryAcctEmpId, Collectors.toList()); + acctEmpResultsMap.keySet().removeAll(removeAcctEmpIds); + List salaryAcctEmpId = Lists.newArrayList(acctEmpResultsMap.keySet()); if (CollectionUtils.isEmpty(salaryAcctEmpId)) { //条件不满足直接返回空列表 From b4994dab3f4f77a3caf271592724596e8d470f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 29 Oct 2025 15:46:24 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=B8=B8=E7=94=A8sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/wiki/删除档案.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/resource/wiki/删除档案.txt b/resource/wiki/删除档案.txt index 22d1976b0..a9aab191b 100644 --- a/resource/wiki/删除档案.txt +++ b/resource/wiki/删除档案.txt @@ -46,11 +46,13 @@ update hrsa_other_archives set delete_type=3; update hrsa_tax_agent_emp set delete_type=3; --- 删除核算记录和工资单信息 -update hrsa_salary_acct_record set delete_type=3 where delete_type=0; -update hrsa_salary_acct_emp set delete_type=3 where delete_type=0; -update hrsa_salary_acct_result set delete_type=3 where delete_type=0; -update hrsa_salary_send set delete_type=3 where delete_type=0; -update hrsa_salary_send_info set delete_type=3 where delete_type=0; +-- 删除核算记录 +update hrsa_salary_acct_record set delete_type=3 where delete_type=0 and id= 核算记录id; +update hrsa_salary_acct_emp set delete_type=3 where delete_type=0 and salary_acct_record_id=核算记录id; +update hrsa_salary_acct_result set delete_type=3 where delete_type=0 and salary_acct_record_id = 核算记录id; + +--删除工资单信息 +update hrsa_salary_send set delete_type=3 where delete_type=0 and salary_accounting_id = 核算记录id; +update hrsa_salary_send_info set delete_type=3 where delete_type=0 and salary_acct_record_id = 核算记录id; From 3dd8db37dc12fea3d0d955ea3e18f5f9f54b3e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Mon, 3 Nov 2025 13:35:06 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=B4=A6=E5=A5=97sql=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=9A=84=E4=BA=BA=E5=91=98=E8=8C=83=E5=9B=B4=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SalaryEmployeeServiceImpl.java | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index cf04d1e76..7c0d23b2d 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.NumberUtil; import com.alibaba.fastjson.JSON; import com.api.formmode.mybatis.util.SqlProxyHandle; @@ -174,7 +175,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } //外部人员 - if(hasExtEmp){ + if (hasExtEmp) { List salarySobExtRangePOS = getSalarySobExtRangeService(user).listBySalarySobId(salarySobId); if (CollectionUtils.isNotEmpty(salarySobExtRangePOS)) { List ids = SalaryEntityUtil.properties(salarySobExtRangePOS, SalarySobExtRangePO::getTargetId, Collectors.toList()); @@ -418,20 +419,24 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee result.addAll(employBiz.listByVirtualParams(virtualParams)); - List empIds = new ArrayList<>(); - includeQueryParams.stream() - .filter(param -> param.getTargetType().equals(TargetTypeEnum.SQL.name())) - .forEach(param -> { - String sql = param.getTarget(); - RecordSet rs = new RecordSet(); - if (rs.execute(sql)) { - while (rs.next()) { - empIds.add((long) rs.getInt("id")); - } + for (SalarySobRangeEmpQueryParam param:includeQueryParams) { + if(param.getTargetType().equals(TargetTypeEnum.SQL.name())){ + List empIds = new ArrayList<>(); + String sql = param.getTarget(); + RecordSet rs = new RecordSet(); + if (rs.execute(sql)) { + while (rs.next()) { + empIds.add((long) rs.getInt("id")); } - }); - List employees = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds); - result.addAll(employees); + } + if(CollUtil.isNotEmpty(empIds)){ + Collection employeeStatus = param.getEmployeeStatus(); + List employeeByIdsAll = getSalaryEmployeeService(user).getEmployeeByIdsAll(empIds); + List collect = employeeByIdsAll.stream().filter(e -> employeeStatus.contains(e.getStatus())).collect(Collectors.toList()); + result.addAll(collect); + } + } + } // 从hrmresource和hrmresourcevirtual可能获取到重复人员数据,需要根据人员id去重 result = result.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparingLong(DataCollectionEmployee::getEmployeeId))), ArrayList::new)); From e6a474261c1dca37fd01ceb7a5552bc8eb9fb51d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 6 Nov 2025 11:27:41 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=A1=A5=E7=BC=B4=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SIAccountServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 4725c5790..62012d45c 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -1736,7 +1736,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // Long taxAgentId = 0L; List list = new ArrayList<>(); - + String username = (String) map.getOrDefault("姓名", ""); String billMonth = (String) map.getOrDefault("账单月份", ""); String taxAgentName = (String) map.getOrDefault("个税扣缴义务人", ""); String supplementaryMonth = (String) map.getOrDefault("补缴月份", ""); @@ -1840,11 +1840,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //校验补缴人员是否存在福利档案基础信息,并且runStatus处于正在缴纳或者待减员 InsuranceArchivesBaseInfoPO insuranceBaseInfo = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(paymentOrganization, employeeId); if (insuranceBaseInfo == null || !(insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.STAY_DEL.getValue()) || insuranceBaseInfo.getRunStatus().equals(EmployeeStatusEnum.PAYING.getValue())) ) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "补缴人员中存在未设置福利档案人员或相关人员不在福利在缴人员中,不可新建补缴信息!")); + throw new SalaryRunTimeException(username + SalaryI18nUtil.getI18nLabel(0, "补缴未设置福利档案人员或不在福利在缴人员中,不可新建补缴信息!")); } List empIdsInPayMonthRange = listCanPayEmpIds(paymentOrganization, billMonth.substring(0, 7)); if (!empIdsInPayMonthRange.contains(employeeId)) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(99920, "无核算人员")); + throw new SalaryRunTimeException(username + SalaryI18nUtil.getI18nLabel(99920, "无核算人员")); } DataCollectionEmployee employee = getSalaryEmployeeService(user).getEmployeeById(employeeId); // 封装InsuranceAccountDetailPO