From c997c888be527a805d467ccc682961cdfacc456a Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Fri, 29 Aug 2025 17:54:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E3=80=81=E6=8A=A5=E5=BA=9F?= =?UTF-8?q?=E3=80=81=E7=BB=B4=E4=BF=AE=E8=B4=B9=E7=94=A8=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SltAgreementInfoController.java | 33 +++++++++ .../mapper/SltAgreementInfoMapper.java | 3 + .../service/ISltAgreementInfoService.java | 15 +++++ .../impl/SltAgreementInfoServiceImpl.java | 67 +++++++++++++++++-- .../settlement/SltAgreementInfoMapper.xml | 39 ++++++++++- 5 files changed, 150 insertions(+), 7 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 8edfb6dc..141f2686 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 @@ -1428,6 +1428,39 @@ public class SltAgreementInfoController extends BaseController { return getDataTable(list); } + /** + * 丢失报表--列表 + */ + @ApiOperation(value = "丢失报表list查询") + @GetMapping("/getLostReportList") + public TableDataInfo getLostReportList(SltAgreementInfo bean) { + startPage(); + List list = sltAgreementInfoService.getLostReportList(bean); + return getDataTable(list); + } + + /** + * 维修报表--列表 + */ + @ApiOperation(value = "维修报表list查询") + @GetMapping("/getRepairReportList") + public TableDataInfo getRepairReportList(SltAgreementInfo bean) { + startPage(); + List list = sltAgreementInfoService.getRepairReportList(bean); + return getDataTable(list); + } + + /** + * 报废报表--列表 + */ + @ApiOperation(value = "报废报表list查询") + @GetMapping("/getScrapReportList") + public TableDataInfo getScrapReportList(SltAgreementInfo bean) { + startPage(); + List list = sltAgreementInfoService.getScrapReportList(bean); + return getDataTable(list); + } + /** * 已结算报表--列表 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java index 08eb5000..efde9af7 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java @@ -115,6 +115,9 @@ public interface SltAgreementInfoMapper { // 获取多个协议号的丢失详情 List getLoseListBatch(SltAgreementInfo bean); + // 获取丢失报表 + List getLostReportList(SltAgreementInfo bean); + int updateRelation(SltAgreementApply apply); int updateApply(SltAgreementApply apply); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java index afb840da..481e3ce4 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java @@ -114,6 +114,21 @@ public interface ISltAgreementInfoService { */ List getSltReportList(SltAgreementInfo bean); + /** + * 查询丢失报表 + */ + List getLostReportList(SltAgreementInfo info); + + /** + * 维修报表list + */ + List getRepairReportList(SltAgreementInfo bean); + + /** + * 报废报表list + */ + List getScrapReportList(SltAgreementInfo bean); + /** * 进行结算审批 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 a3584d32..23d15675 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 @@ -263,22 +263,22 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { } } for (SltAgreementInfo repair : repairList) { - if(repair.getCosts() != null && (repair.getPartType().equals("收费"))) { + if (repair.getCosts() != null && (repair.getPartType().equals("收费"))) { repairCost = repairCost.add(repair.getCosts()); } } for (SltAgreementInfo scrap : scrapList) { - if(scrap.getCosts() != null && (scrap.getPartType().equals("收费"))) { + if (scrap.getCosts() != null && (scrap.getPartType().equals("收费"))) { scrapCost = scrapCost.add(scrap.getCosts()); } } for (SltAgreementInfo lose : loseList) { - if(lose.getCosts()!=null){ + if (lose.getCosts() != null) { loseCost = loseCost.add(lose.getCosts()); } } for (SltAgreementReduce reduction : reductionList) { - if(reduction.getLeaseMoney()!=null){ + if (reduction.getLeaseMoney() != null) { reducCost = reducCost.add(reduction.getLeaseMoney()); } } @@ -774,7 +774,21 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { */ @Override public List getSltReportedList(SltAgreementInfo bean) { - return sltAgreementInfoMapper.getSltReportedList(bean); + List sltReportedList = sltAgreementInfoMapper.getSltReportedList(bean); + if (sltReportedList != null) { + sltReportedList.removeIf(Objects::isNull); + sltReportedList.forEach(sltAgreementInfo -> { + if (sltAgreementInfo.getCosts() == null || sltAgreementInfo.getCosts().equals(BigDecimal.ZERO)) { + sltAgreementInfo.setCosts( + sltAgreementInfo.getLeaseCost() + .add(sltAgreementInfo.getRepairCost()) + .add(sltAgreementInfo.getScrapCost()) + .add(sltAgreementInfo.getLoseCost()) + ); + } + }); + } + return sltReportedList; } /** @@ -797,6 +811,47 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { return list; } + /** + * 查询丢失报表 + */ + @Override + public List getLostReportList(SltAgreementInfo info) { + List loseList = sltAgreementInfoMapper.getLostReportList(info); + + loseList.removeIf(Objects::isNull); + + for (SltAgreementInfo bean : loseList) { + if (null == bean.getBuyPrice()) { + bean.setBuyPrice(BigDecimal.ZERO); + } + if (null == bean.getNum()) { + bean.setNum(BigDecimal.ZERO); + } + } + return loseList; + } + + /** + * 维修报表list + * + * @param bean + */ + @Override + public List getRepairReportList(SltAgreementInfo bean) { + return sltAgreementInfoMapper.getRepairDetailsListBatch(bean, null); + } + + /** + * 报废报表list + * + * @param bean + */ + @Override + public List getScrapReportList(SltAgreementInfo bean) { + List scrapList = sltAgreementInfoMapper.getScrapDetailsListBatch(bean); + return scrapList; + } + /** * 判断以逗号分隔的字符串是否包含指定的值(严格判断) * @param strings 以逗号分隔的字符串 @@ -947,7 +1002,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { Map map = new HashMap<>(); for (int i = 0; i < bmProject.getUnitIds().length; i++) { int[] projectIds= sltAgreementInfoMapper.getProjectListByUnitIds(bmProject.getUnitIds()[i]); - Map mapTemp=new HashMap<>(); + Map mapTemp = new HashMap<>(); for (int projectId : projectIds) { mapTemp.put(projectId, 1); } 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 5e90f0b0..f239521c 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 @@ -845,7 +845,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id 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 bai.is_slt = '0' + where bai.status = '1' AND bui.type_id != '1731' AND (bai.is_slt = '0' OR bai.is_slt is null) and bui.unit_id in @@ -973,6 +973,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select tta.agreement_id as agreementId, + bai.agreement_code as agreementCode, bui.unit_name as unitName, bp.pro_name as projectName, rc.id as costId, @@ -1045,4 +1047,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + +