From 8d79e7c9315d650b9075ec459d1edc68434c38f0 Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Mon, 1 Sep 2025 22:17:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E7=BB=93=E7=AE=97=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SltAgreementInfoController.java | 7 +- .../impl/SltAgreementInfoServiceImpl.java | 6 +- .../settlement/SltAgreementInfoMapper.xml | 100 +++++++++--------- 3 files changed, 57 insertions(+), 56 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java index 12d6e12a..0fcbdceb 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java @@ -1492,12 +1492,12 @@ public class SltAgreementInfoController extends BaseController { @GetMapping("/getSltReportList") public TableDataInfo getSltReportList(SltAgreementInfo query) { try { - // ----------- 查询列表 --------------- + startPage(); + // ----------- 查询未结算的全部协议 --------------- List list = sltAgreementInfoService.getSltReportList(query); - // ----------- 遍历列表,设置默认值 --------------- + // ----------- 给查询出来的协议设置权限控制(例如只查询工器具) --------------- Byte settlementType = sltAgreementInfoService.checkLoginUserHasSettlementPermission(); - // 设置结算权限,控制展示 list.forEach(info -> info.setSettlementType(settlementType)); // --------- 定义返回集合 ------------------ @@ -1508,6 +1508,7 @@ public class SltAgreementInfoController extends BaseController { // 把每个对象的agreementId设置成集合,避免重复查询 list.forEach(info -> { info.setAgreementIds(AgreementIdsArray); + // 查询每个协议的各项费用明细📉 SltInfoVo vo = sltAgreementInfoService.getSltInfoReportBatch(info); if (vo != null && !ObjectUtil.isEmpty(vo)) { vo.setAgreementId(info.getAgreementId()); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java index e43dec68..757246b9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java @@ -253,6 +253,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { //费用减免列表 List reductionList = getReductionListBatch(info); + // 删除掉各项费用都为空的数据 if (CollectionUtils.isEmpty(leaseList) && CollectionUtils.isEmpty(repairList) && CollectionUtils.isEmpty(scrapList) && CollectionUtils.isEmpty(loseList) && CollectionUtils.isEmpty(reductionList)) @@ -1138,6 +1139,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { Date leaseStartTime = result.getStartTime(); // 领料时间 Date returnTime = result.getEndTime(); // 退料时间 Date settlementTime = result.getSettlementTime(); // 结算时间 + String status = result.getStatus(); // 状态 // 如果是已结算协议 boolean leaseInRange = isDateInRange(leaseStartTime, inputStartDate, inputEndDate); @@ -1148,8 +1150,8 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { return leaseInRange || returnInRange || settlementInRange; } else { // 如果是未结算协议 - // 检查领料时间、退料时间是否有任何一个在查询范围内 - return leaseInRange || returnInRange; + // 检查领料时间、退料时间是否有任何一个在查询范围内、或者是在用状态的设备(未退还) + return leaseInRange || returnInRange || ("0").equals(status); } } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml index 647dbc1f..9169e0aa 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml @@ -856,46 +856,53 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - and saa.status = '1' - - - and saa.status = '2' - - - and saa.status = '3' - - - GROUP BY bai.agreement_id + + + + and saa.status = '1' + + + and saa.status = '2' + + + and saa.status = '3' + + + + GROUP BY bai.agreement_id, saa.settlement_type ORDER BY saa.create_time desc @@ -955,19 +962,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"