From a711c2f5578c3bd61fb101ba49d105a3ba9eefc9 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Fri, 16 May 2025 11:13:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E7=89=B9=E5=B7=A5=E8=B5=84=E5=8D=95?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E6=A0=A1=E9=AA=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SalaryBillServiceImpl.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java b/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java index cc92ff0cf..078c1d015 100644 --- a/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryBillServiceImpl.java @@ -190,16 +190,32 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService } // 校验cbs是否已经推送 + List checkIds = new ArrayList<>(); + if (CollectionUtils.isEmpty(ids)) { + SalarySendInfoQueryParam queryParam = new SalarySendInfoQueryParam(); + queryParam.setSalarySendId(salarySend.getId()); + queryParam.setSendStatuss(Arrays.asList(SalarySendStatusEnum.UNSEND.getValue(), SalarySendStatusEnum.WITHDRAW.getValue())); + List list = getSalarySendInfoMapper().list(queryParam); + if (CollectionUtils.isNotEmpty(list)) { + checkIds.addAll(list.stream().map(SalarySendInfoListDTO::getId).collect(Collectors.toList())); + } + } else { + checkIds.addAll(ids); + } List salaryCbsIdList = getSalaryCbsService(user).listBySalaryAcctRecordId(salarySend.getSalaryAccountingId()).stream().map(SalaryCbsPO::getId).collect(Collectors.toList()); List salaryCbsInfoList = getSalaryCbsInfoService(user).listByCbsIds(salaryCbsIdList); if (CollectionUtils.isEmpty(salaryCbsInfoList)) { throw new SalaryRunTimeException("cbs数据暂不存在"); } List pushedEmpIds = salaryCbsInfoList.stream() - .filter(salaryCbsInfoPO -> salaryCbsInfoPO.getPushStatus() != null && salaryCbsInfoPO.getPushStatus().equals(NumberUtils.INTEGER_ONE)) + .filter(salaryCbsInfoPO ->{ + return (salaryCbsInfoPO.getPushStatus() != null && salaryCbsInfoPO.getPushStatus().equals(NumberUtils.INTEGER_ONE)) + || (!NumberUtils.isCreatable(salaryCbsInfoPO.getPushValue())) + || (NumberUtils.isCreatable(salaryCbsInfoPO.getPushValue()) && new BigDecimal(salaryCbsInfoPO.getPushValue()).compareTo(new BigDecimal("0")) == 0); + }) .map(SalaryCbsInfoPO::getEmployeeId) .collect(Collectors.toList()); - List> partition = Lists.partition(ids, 500); + List> partition = Lists.partition(checkIds, 500); List sendInfoList = new ArrayList<>(); for (List idsPart : partition) { sendInfoList.addAll(getSalarySendInfoMapper().list(SalarySendInfoQueryParam.builder().ids(idsPart).build()));