From 6333891457fe6cf0f5281489413d8791667a8611 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Tue, 19 Nov 2024 14:15:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B1=87=E6=80=BB=EF=BC=8C=E7=A4=BE=E4=BF=9D?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E6=B5=81=E7=A8=8B=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=BA=E6=95=B0=E3=80=81=E5=87=8F=E5=B0=91=E4=BA=BA=E6=95=B0?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SIAccountServiceImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 1048fe4ed..969f0ceb5 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -1310,12 +1310,18 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // 获取上期人数 List lastEmpList = lastEmpMap.getOrDefault(dto.getInsuranceId().toString(), Collections.emptyList()); lastEmpList = lastEmpList.stream().distinct().collect(Collectors.toList()); + // 本月新增人数 + List finalLastEmpList = lastEmpList; + Long increaseNum = empList.stream().filter(empId -> !finalLastEmpList.contains(empId)).count(); + // 本月减少人员 + List finalEmpList = empList; + Long decreaseNum = lastEmpList.stream().filter(empId -> !finalEmpList.contains(empId)).count(); HtSbqsListDTO build = HtSbqsListDTO.builder() .insuranceId(dto.getInsuranceId()) .bxlx(dto.getInsuranceName()) .sqjnrs(lastEmpList.size()) - .zjrs(lastEmpList.size() < empList.size() ? empList.size() - lastEmpList.size() : 0) - .jsrs(lastEmpList.size() > empList.size() ? lastEmpList.size() - empList.size() : 0) + .zjrs(increaseNum.intValue()) + .jsrs(decreaseNum.intValue()) .bqrs(empList.size()) .grjnje(perPayment.doubleValue()) .dwjnje(comPayment.doubleValue())