From add7904eb9c6f62f91715c7378c7c3a0df10705e Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Sat, 23 Aug 2025 16:11:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=8D=8F=E8=AE=AE=E5=8F=B7?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SltAgreementInfoController.java | 9 ++++----- .../material/settlement/SltAgreementInfoMapper.xml | 14 ++++++++++---- 2 files changed, 14 insertions(+), 9 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 99bb2f61..8edfb6dc 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 @@ -1445,9 +1445,6 @@ public class SltAgreementInfoController extends BaseController { @ApiOperation(value = "未结算报表list查询") @GetMapping("/getSltReportList") public TableDataInfo getSltReportList(SltAgreementInfo query) { - // ----------- 定义返回集合 ------------ - List resultList = new ArrayList<>(); - try { // ----------- 查询列表 --------------- List list = sltAgreementInfoService.getSltReportList(query); @@ -1457,12 +1454,14 @@ public class SltAgreementInfoController extends BaseController { // 设置结算权限,控制展示 list.forEach(info -> info.setSettlementType(settlementType)); + // --------- 定义返回集合 ------------------ List dataList = new ArrayList<>(); - SltInfoVo bean = new SltInfoVo(); + // --------- 拿到list中所有的agreementId存成集合,给每个info赋值 ------------------ + List AgreementIdsArray = list.stream().map(SltAgreementInfo::getAgreementId).collect(Collectors.toList()); // 把每个对象的agreementId设置成集合,避免重复查询 list.forEach(info -> { - info.setAgreementIds(list.stream().map(SltAgreementInfo::getAgreementId).collect(Collectors.toList())); + 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/resources/mapper/material/settlement/SltAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml index 0bd6bb37..81476536 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 @@ -197,11 +197,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id LEFT JOIN slt_agreement_apply saa on saa.agreement_id = bai.agreement_id where bai.status = '1' AND bui.type_id != '1731' - + and bui.unit_id in - - #{item} - + + #{item} + and bp.pro_id = #{projectId} @@ -209,6 +209,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and bai.is_slt = #{sltStatus} + + and bai.agreement_code like concat('%',#{agreementCode},'%') + GROUP BY bai.agreement_id ORDER BY bai.create_time desc @@ -855,6 +858,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and bai.is_slt = #{sltStatus} + + and bai.agreement_code = #{agreementCode} + GROUP BY bai.agreement_id ORDER BY bai.create_time desc