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