From fab03a0f3ddb356cfd45b53a0bda971765cc4d0a Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Thu, 15 Jan 2026 17:34:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SltAgreementReduceController.java | 10 ++++++++-- .../settlement/domain/vo/PeriodCostResultVo.java | 2 ++ .../material/settlement/SltAgreementInfoMapper.xml | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementReduceController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementReduceController.java index 659401ea..800dbe7b 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementReduceController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementReduceController.java @@ -80,13 +80,19 @@ public class SltAgreementReduceController extends BaseController { Date currentDate = new Date(); PeriodCostQueryDto periodCostQueryDto = new PeriodCostQueryDto(); periodCostQueryDto.setAgreementId(sltAgreement.getAgreementId()); - + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); if (null == sltAgreement.getStartTime()) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + periodCostQueryDto.setStartDate(sdf.parse("2018-01-01 01:00:00")); + }else{ + String formattedStartTime = sdf.format(sltAgreement.getStartTime()); + periodCostQueryDto.setStartDate(sdf.parse(formattedStartTime)); } if (null == sltAgreement.getEndTime()) { periodCostQueryDto.setEndDate(currentDate); + }else{ + String formattedEndTime = sdf.format(sltAgreement.getEndTime()); + periodCostQueryDto.setEndDate(sdf.parse(formattedEndTime)); } List resultVos = sltAgreementInfoService.selectPeriodCostList(periodCostQueryDto); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostResultVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostResultVo.java index 0014c802..32d4a24b 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostResultVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/PeriodCostResultVo.java @@ -18,6 +18,8 @@ import java.util.Date; @ApiModel("区间费用计算结果VO") public class PeriodCostResultVo { + private Long id; + @ApiModelProperty(value = "协议ID") private Long agreementId; 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 05c1fe5e..e07c118d 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 @@ -1667,6 +1667,7 @@ SELECT + case + WHEN bp.actual_end_date is not null THEN '1' + WHEN bp.actual_end_date is null and bp.external_id is null THEN '2' + ELSE '0' + END as isFinish, + bp.actual_end_date as actualEndDate, shr.id, shr.agreement_id as agreementId, shr.agreement_code as agreementCode, @@ -2188,13 +2194,18 @@ shr.reduction_cost as reductionCost, shr.`year_month` as yearMonth, shr.create_time as createTime - FROM slt_history_report shr - left join bm_agreement_info bai on shr.agreement_id =bai.agreement_id + FROM + slt_history_report shr + left join bm_agreement_info bai on shr.agreement_id = bai.agreement_id + LEFT JOIN slt_agreement_apply saa ON saa.agreement_id = shr.agreement_id AND saa.settlement_type = #{settlementType} + LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id WHERE shr.`year_month` = #{yearMonth} - and shr.settlement_type = #{settlementType} - and bai.company_id =#{companyId} - ORDER BY shr.create_time DESC + and shr.settlement_type = #{settlementType} + AND saa.id IS NULL + and bai.company_id =#{companyId} + ORDER BY + shr.create_time DESC SELECT - agreementId, + agreementId, res.bookCode, bai.agreement_code as agreementCode, LEFT(createTime,10) as applyTime, bui.unit_name AS unitName, @@ -2364,20 +2375,21 @@ FROM ( SELECT - saa.agreement_id AS agreementId, - saa.create_time AS createTime, - IF - ( sad.slt_type = 1, sad.money, 0 ) AS leaseCost, - IF - ( sad.slt_type = 2, sad.money, 0 ) AS loseCost, - IF(sad.slt_type = 3 AND (sad.is_charge = 1 ), sad.money, 0) AS repairCost, - IF(sad.slt_type = 4 AND (sad.is_charge = 1 ), sad.money, 0) AS scrapCost, - 0 AS aqLeaseCost, - 0 AS aqLoseCost, - 0 AS aqRepairCost, - 0 AS aqScrapCost + saa.book_code as bookCode, + saa.agreement_id AS agreementId, + saa.create_time AS createTime, + IF + ( sad.slt_type = 1, sad.money, 0 ) AS leaseCost, + IF + ( sad.slt_type = 2, sad.money, 0 ) AS loseCost, + IF(sad.slt_type = 3 AND (sad.is_charge = 1 ), sad.money, 0) AS repairCost, + IF(sad.slt_type = 4 AND (sad.is_charge = 1 ), sad.money, 0) AS scrapCost, + 0 AS aqLeaseCost, + 0 AS aqLoseCost, + 0 AS aqRepairCost, + 0 AS aqScrapCost FROM - slt_agreement_apply saa + slt_agreement_apply saa LEFT JOIN slt_agreement_details sad ON saa.id = sad.apply_id WHERE saa.agreement_id = #{agreementId} @@ -2385,21 +2397,22 @@ GROUP BY sad.id UNION ALL SELECT - saa.agreement_id AS agreementId, - saa.create_time AS createTime, - 0 AS leaseCost, - 0 AS loseCost, - 0 AS repairCost, - 0 AS scrapCost, - IF - ( sad.slt_type = 1, sad.money, 0 ) AS aqLeaseCost, - IF - ( sad.slt_type = 2, sad.money, 0 ) AS aqLoseCost, - IF(sad.slt_type = 3 AND (sad.is_charge = 1 ), sad.money, 0) AS aqRepairCost, - IF(sad.slt_type = 4 AND (sad.is_charge = 1 ), sad.money, 0) AS aqScrapCost + saa.book_code as bookCode, + saa.agreement_id AS agreementId, + saa.create_time AS createTime, + 0 AS leaseCost, + 0 AS loseCost, + 0 AS repairCost, + 0 AS scrapCost, + IF + ( sad.slt_type = 1, sad.money, 0 ) AS aqLeaseCost, + IF + ( sad.slt_type = 2, sad.money, 0 ) AS aqLoseCost, + IF(sad.slt_type = 3 AND (sad.is_charge = 1 ), sad.money, 0) AS aqRepairCost, + IF(sad.slt_type = 4 AND (sad.is_charge = 1 ), sad.money, 0) AS aqScrapCost FROM - slt_agreement_apply saa - LEFT JOIN slt_agreement_details sad ON saa.id = sad.apply_id + slt_agreement_apply saa + LEFT JOIN slt_agreement_details sad ON saa.id = sad.apply_id WHERE saa.agreement_id = #{agreementId} AND saa.settlement_type = 2 @@ -2590,4 +2603,14 @@ + + + update + slt_agreement_apply + set + book_code = #{bookCode} + where + id = #{id} + and book_code is null + From 13df76c18c82520e94f21dfa3404d84fa78c0344 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Fri, 16 Jan 2026 14:58:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=A2=84=E8=AD=A6=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/push/ProDataUseInfoMapper.xml | 16 ++++++++++------ .../UseMaintenanceWarningMapper.xml | 12 +++++++++++- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ProDataUseInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ProDataUseInfoMapper.xml index 72276bca..528a8d59 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ProDataUseInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/ProDataUseInfoMapper.xml @@ -235,9 +235,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ma_type mt ON sai.type_id = mt.type_id LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id left join sys_dept sd ON sd.dept_id = bp.imp_unit - where mm.next_check_time is not null and mt.`level` = '4' - and sai.`status`='0' and sai.end_time is null - + where mm.next_check_time is not null + AND mm.this_check_time is not null + AND bp.pro_name is not null + and sai.`status`='0' + and sai.is_slt = 0 and mm.ma_status = 2 and mt2.type_id not in (6032,6008,6270) and mt.jiju_type =2 @@ -275,9 +277,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN sys_dept sd on bp.imp_unit = sd.dept_id LEFT JOIN ma_type mt ON sai.type_id = mt.type_id LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id - WHERE mm.next_check_time is not null AND mt.`level`=4 - - and sai.`status`='0' and sai.end_time is null + WHERE mm.next_check_time is not null + AND mm.this_check_time is not null + AND bp.pro_name is not null + and sai.`status`='0' + and sai.is_slt = 0 and mm.ma_status = 2 and mt2.type_id not in (6032,6008,6270) and mt.jiju_type =2 diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/warningAnalysis/UseMaintenanceWarningMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/warningAnalysis/UseMaintenanceWarningMapper.xml index a300a0c3..61759c9f 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/warningAnalysis/UseMaintenanceWarningMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/warningAnalysis/UseMaintenanceWarningMapper.xml @@ -248,17 +248,27 @@ AND mm.this_check_time is not null AND mm.next_check_time is not null AND mt.jiju_type = 2 + and sai.`status`='0' AND mt2.type_id not in (6032,6008,6270) AND sd.dept_id=#{companyId} /*AND DATEDIFF(mm.next_check_time, CURDATE()) <= 30*/ - AND mm.next_check_time >= NOW() + AND mm.next_check_time >= NOW() AND mm.next_check_time < NOW() + + AND mm.next_check_time < NOW() AND DATEDIFF(NOW(), mm.next_check_time) <= 7 + + + AND mm.next_check_time < NOW() AND DATEDIFF(NOW(), mm.next_check_time) <=15 + + + AND mm.next_check_time < NOW() AND DATEDIFF(NOW(), mm.next_check_time) <= 30 + and ( mt4.type_name like concat('%', #{keyWord}, '%') or