From b9c5fe133cef325e52d1b87eccdf18e2be8c53f1 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Tue, 25 Mar 2025 18:35:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E7=AE=A1=E7=90=86=E5=88=86?= =?UTF-8?q?=E5=BC=80=E7=BB=93=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/SltAgreementInfoMapper.java | 4 +++- .../impl/SltAgreementInfoServiceImpl.java | 15 +++++++++++---- .../material/SltAgreementInfoMapper.xml | 19 +++++++++++++++---- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java index c3e1e98..e0059b7 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java @@ -56,7 +56,9 @@ public interface SltAgreementInfoMapper { int updateTrimDay(SltAgreementInfo sltAgreementInfo); - int updateInfoOneStatus(SltAgreementInfo apply); + int updateInfoOneStatus(@Param("agreementIds") List agreementIds,@Param("costBearingParty") String costBearingParty); + + int updateAgreementStatus(SltAgreementInfo apply); List getLeaseListOneMonth(@Param("bean") AgreementInfo bean, @Param("ids") List idList); diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java index 1637151..e480a89 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java @@ -293,14 +293,14 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { } } // 判断是否已经结算(01承担方) - boolean b = leaseListOne.stream().allMatch(t -> "1".equals(t.getIsSlt())); + boolean b = leaseListOne.stream().allMatch(t -> "1".equals(t.getIsSlt()) || "2".equals(t.getIsSlt())); if (b) { relation.setIsSltOne("1"); } else { relation.setIsSltOne("0"); } // 判断是否已经结算(03承担方) - boolean f = leaseListThree.stream().allMatch(t -> "1".equals(t.getIsSlt())); + boolean f = leaseListThree.stream().allMatch(t -> "1".equals(t.getIsSlt()) || "2".equals(t.getIsSlt())); if (f) { relation.setIsSltThree("1"); } else { @@ -350,9 +350,16 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { @Override public AjaxResult submitFeeOne(SltAgreementInfo apply) { - int i = sltAgreementInfoMapper.updateInfoOneStatus(apply); + int i = sltAgreementInfoMapper.updateInfoOneStatus(apply.getAgreementIds(),apply.getCostBearingParty()); + if (i > 0) { - return AjaxResult.success("结算成功"); + i = sltAgreementInfoMapper.updateAgreementStatus(apply); + if(i>0){ + return AjaxResult.success("结算成功"); + }else{ + return AjaxResult.error("结算失败"); + } + } else { return AjaxResult.error("结算失败"); } diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml index 65c4095..7759557 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml @@ -108,11 +108,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" UPDATE slt_agreement_info sai LEFT JOIN lease_apply_info lai ON lai.id = sai.lease_id - SET sai.is_slt = '1' + SET sai.is_slt = '2' WHERE - sai.agreement_id = #{agreementId} - AND sai.lease_type = 0 - AND lai.cost_bearing_party = #{costBearingParty} + sai.agreement_id in + + #{agreementId} + + AND sai.lease_type = 0 + AND lai.cost_bearing_party = #{costBearingParty,jdbcType=VARCHAR} update repair_cost set out_source_costs = #{outSourceCosts} where id = #{id} @@ -123,6 +126,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update repair_apply_record set is_slt = 1,update_time = now() where id = #{id} + + update bm_agreement_info bai set is_slt = 2 + WHERE + bai.agreement_id in + + #{agreementId} + +