From b0fb2b38667bf78183eb310316ced9d8090ccf63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 15 Apr 2025 17:49:38 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=83=A8=E5=88=86=E5=8F=91=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/biz/SalarySendRangeObjBiz.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/biz/SalarySendRangeObjBiz.java b/src/com/engine/salary/biz/SalarySendRangeObjBiz.java index 05ccaaadb..53633dce6 100644 --- a/src/com/engine/salary/biz/SalarySendRangeObjBiz.java +++ b/src/com/engine/salary/biz/SalarySendRangeObjBiz.java @@ -7,6 +7,8 @@ import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeTaxAgentDTO; import com.engine.salary.mapper.salarybill.SalarySendRangeObjMapper; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.impl.TaxAgentServiceImpl; +import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.ibatis.session.SqlSession; import weaver.conn.mybatis.MyBatisFactory; @@ -23,6 +25,10 @@ public class SalarySendRangeObjBiz { return ServiceUtil.getService(TaxAgentServiceImpl.class); } + private SalarySendRangeObjMapper getSalarySendRangeObjMapper() { + return MapperProxyFactory.getProxy(SalarySendRangeObjMapper.class); + } + public R applyMapper(Function mapper) { try (SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession()) { final SalarySendRangeObjMapper salarySendRangeObjMapper = sqlSession.getMapper(SalarySendRangeObjMapper.class); @@ -41,7 +47,13 @@ public class SalarySendRangeObjBiz { } public List getSalarySendUserInfoDTOs(List employees) { - List userDTOs = applyMapper(mapper -> mapper.getUserInfoByEmployeeIds(employees)); + List userDTOs = new ArrayList<>(); + List> partition = Lists.partition(employees, 500); + partition.forEach(l->{ + List userInfos = getSalarySendRangeObjMapper().getUserInfoByEmployeeIds(l); + userDTOs.addAll(userInfos); + }); + Map userMap = userDTOs.stream() .collect(Collectors.toMap(SalarySendUserInfoDTO::getResourceId, Function.identity())); From 99a0c3facce654427123788bdadb565879e05481 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Wed, 16 Apr 2025 13:26:36 +0800 Subject: [PATCH 2/4] =?UTF-8?q?2100bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SalaryArchiveServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index 538160d20..ceab506eb 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -1425,7 +1425,12 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe if (CollectionUtils.isEmpty(employeeIds)) { return Collections.emptyList(); } - return getSalaryArchiveMapper().listPayEndDateIsNull(employeeIds); + List> partition = Lists.partition(employeeIds, 500); + List resultList = new ArrayList<>(); + partition.forEach(part -> { + resultList.addAll(getSalaryArchiveMapper().listPayEndDateIsNull(part)); + }); + return resultList; } @Override From 37445cdd58665f38ba718f1dd9a659db5c6b2e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Wed, 16 Apr 2025 14:06:46 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix=E9=83=A8=E5=88=86=E5=8F=91=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SalaryBillServiceImpl.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java b/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java index 4df8aa8f2..8928680cb 100644 --- a/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java @@ -169,16 +169,6 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService && Optional.ofNullable(salaryBillProgress.getProgress()).orElse(BigDecimal.ZERO).compareTo(BigDecimal.ONE) < 0) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(136104, "有其他人员正在发送中,请等待其他人员发送结束后再操作")); } - // 初始化进度 - ProgressDTO initProgress = ProgressDTO.builder() - .title(SalaryI18nUtil.getI18nLabel(136097, "发送中")) - .totalQuantity(NumberUtils.INTEGER_ZERO) - .calculatedQuantity(NumberUtils.INTEGER_ZERO) - .progress(BigDecimal.ZERO) - .status(true) - .message("") - .build(); - getProgressService(user).initProgress(SalaryCacheKey.SALARY_GRANT_PROGRESS + "_" + salarySend.getId(), initProgress); List ids = param.getIds(); @@ -190,6 +180,17 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService throw new SalaryRunTimeException("工资发放范围内没有匹配员工"); } } + // 初始化进度 + ProgressDTO initProgress = ProgressDTO.builder() + .title(SalaryI18nUtil.getI18nLabel(136097, "发送中")) + .totalQuantity(NumberUtils.INTEGER_ZERO) + .calculatedQuantity(NumberUtils.INTEGER_ZERO) + .progress(BigDecimal.ZERO) + .status(true) + .message("") + .build(); + getProgressService(user).initProgress(SalaryCacheKey.SALARY_GRANT_PROGRESS + "_" + salarySend.getId(), initProgress); + // 异步执行 List finalIds = ids; LocalRunnable localRunnable = new LocalRunnable() { From d01c9bf06fcffd26a350bfa97f68f0c455d437cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Thu, 17 Apr 2025 11:06:02 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=A3=E7=BC=B4?= =?UTF-8?q?=E4=B9=89=E5=8A=A1=E4=BA=BA=E6=90=9C=E7=B4=A2=E6=A0=B8=E7=AE=97?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/SalaryAcctRecordQueryParam.java | 6 ++++++ .../impl/SalaryAcctRecordServiceImpl.java | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordQueryParam.java b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordQueryParam.java index b737f857e..8424aa765 100644 --- a/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordQueryParam.java +++ b/src/com/engine/salary/entity/salaryacct/param/SalaryAcctRecordQueryParam.java @@ -7,6 +7,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.time.YearMonth; +import java.util.List; /** * 薪资核算列表查询参数 @@ -31,6 +32,11 @@ public class SalaryAcctRecordQueryParam extends BaseQueryParam { //账套名称") private String name; + /** + * 扣缴义务人id集合 + */ + private List taxAgentIds; + private String startMonthStr; private String endMonthStr; } diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 2a75368dc..9958f8d27 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -1,5 +1,6 @@ package com.engine.salary.service.impl; +import cn.hutool.core.collection.CollUtil; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; @@ -177,6 +178,21 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe Set salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId); po.setSalarySobIds(salarySobIds); } + if (CollUtil.isNotEmpty(queryParam.getTaxAgentIds())) { + List salarySobPOS = getSalarySobService(user).listByTaxAgentIds(queryParam.getTaxAgentIds()); + if (CollectionUtils.isEmpty(salarySobPOS)) { + return page; + } + Set salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId); + + Collection existIds = po.getSalarySobIds(); + if (CollectionUtils.isNotEmpty(existIds)) { + existIds = SalaryEntityUtil.intersectionForList(existIds, salarySobIds); + po.setSalarySobIds(existIds); + } else { + po.setSalarySobIds(salarySobIds); + } + } LocalDateRange localDateRange = new LocalDateRange(); if (Objects.nonNull(queryParam.getStartMonth())) { localDateRange.setFromDate(SalaryDateUtil.localDateToDate(queryParam.getStartMonth().atDay(1))); @@ -827,6 +843,6 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe @Override public void updateDate(Long id, Date updateTime) { - getSalaryAcctRecordMapper().updateDate(id,updateTime); + getSalaryAcctRecordMapper().updateDate(id, updateTime); } }