From d8dead113a3db8cc3de34e22acdfedd3aaec3cc6 Mon Sep 17 00:00:00 2001 From: "liang.chao" <1360241448@qq.com> Date: Fri, 13 Sep 2024 14:30:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=BA=86=E7=BB=93=E7=AE=97=E9=A9=B3?= =?UTF-8?q?=E5=9B=9E=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/material/domain/AgreementInfo.java | 2 + .../mapper/SltAgreementInfoMapper.java | 1 + .../impl/SltAgreementInfoServiceImpl.java | 46 +++++++++++-------- .../material/SltAgreementInfoMapper.xml | 12 ++++- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java index bf75bae8..2cda14d2 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java @@ -135,4 +135,6 @@ public class AgreementInfo extends BaseEntity { @ApiModelProperty(value = "导出选中列表") private List dataCondition; + private Integer isCommit; + } 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 fa540eb0..dbdc9098 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 @@ -34,6 +34,7 @@ public interface SltAgreementInfoMapper { int insApply(SltAgreementApply apply); int insRelation(SltAgreementRelation relation); + int upRelation(SltAgreementRelation relation); int insDetails(SltAgreementInfo info); 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 3f7ba614..2686fe89 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 @@ -88,27 +88,34 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { public int settlementReview(SltAgreementApply apply) { Long userid = SecurityUtils.getLoginUser().getUserid(); apply.setAuditor(String.valueOf(userid)); - int i = sltAgreementInfoMapper.updateRelation(apply); - int j = 0; - if (i > 0) { - List relations = sltAgreementInfoMapper.getRelations(apply); - List infos = new ArrayList<>(); - for (SltAgreementRelation bean : relations) { - AgreementInfo info = new AgreementInfo(); - info.setAgreementId(Long.valueOf(bean.getAgreementId())); - infos.add(info); - } - List loseList = getLoseList(infos); - for (SltAgreementInfo agreementInfo : loseList) { - if (agreementInfo.getMaId() != null && agreementInfo.getMaId().isEmpty()) { - agreementInfo.setStatus("103"); - sltAgreementInfoMapper.updateMaStatus(agreementInfo); - } - } + int j; + if ("2".equals(apply.getStatus())) { + // 驳回 + int i = sltAgreementInfoMapper.updateRelation(apply); j = sltAgreementInfoMapper.updateApply(apply); } else { - throw new ServiceException("结算审核失败"); - //throw new ServiceException(ExceptionDict.SETTLEMENT_REVIEW_ERROR_MSG,ExceptionDict.SETTLEMENT_REVIEW_ERROR); + // 通过 + int i = sltAgreementInfoMapper.updateRelation(apply); + if (i > 0) { + List relations = sltAgreementInfoMapper.getRelations(apply); + List infos = new ArrayList<>(); + for (SltAgreementRelation bean : relations) { + AgreementInfo info = new AgreementInfo(); + info.setAgreementId(Long.valueOf(bean.getAgreementId())); + infos.add(info); + } + List loseList = getLoseList(infos); + for (SltAgreementInfo agreementInfo : loseList) { + if (agreementInfo.getMaId() != null && agreementInfo.getMaId().isEmpty()) { + agreementInfo.setStatus("103"); + sltAgreementInfoMapper.updateMaStatus(agreementInfo); + } + } + j = sltAgreementInfoMapper.updateApply(apply); + } else { + throw new ServiceException("结算审核失败"); + //throw new ServiceException(ExceptionDict.SETTLEMENT_REVIEW_ERROR_MSG,ExceptionDict.SETTLEMENT_REVIEW_ERROR); + } } return j; } @@ -181,6 +188,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { list.add(info); relation.setApplyId(String.valueOf(apply.getId())); sltAgreementInfoMapper.updateInfoStatus(relation.getAgreementId()); + sltAgreementInfoMapper.upRelation(relation); int j = sltAgreementInfoMapper.insRelation(relation); if (j < 0) { throw new ServiceException("新增协议结算记录失败"); 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 ef30d645..f19f535c 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 @@ -91,11 +91,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where agreement_id = #{agreementId} and type_id = #{typeId} + + update slt_agreement_relation + set is_commit = 1 + where agreement_id = #{agreementId} +