From 1f3c3bc46073604c9a59119030d0622460da393b Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Wed, 21 Jan 2026 13:49:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E4=B9=A6=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/SltAgreementInfoMapper.java | 5 ++ .../impl/SltAgreementInfoServiceImpl.java | 49 ++++++++++++++++--- .../settlement/SltAgreementInfoMapper.xml | 12 +++-- 3 files changed, 57 insertions(+), 9 deletions(-) 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 e14fd7bb..334c2158 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 @@ -89,6 +89,11 @@ public interface SltAgreementInfoMapper { */ int updateSltBookCodeById(SltAgreementInfo sltAgreementInfo); + /** + * 查询协议书编号是否存在 + */ + int countSltBookCodeByCode(String bookCode); + /** * 修改结算信息 * 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 a9c68229..2f4922aa 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 @@ -8,6 +8,7 @@ import java.util.stream.Collectors; import com.bonus.common.biz.constant.GlobalConstants; import com.bonus.common.biz.domain.ProjectTreeBuild; import com.bonus.common.biz.domain.ProjectTreeNode; +import com.bonus.common.biz.enums.HttpCodeEnum; import com.bonus.common.biz.utils.RequestContext; import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.utils.DateUtils; @@ -949,9 +950,21 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { */ @Override public List getSltList(SltAgreementInfo bean) { + if (Objects.isNull(bean)) { + bean = new SltAgreementInfo(); + } + + Integer settlementType = bean.getSettlementType(); Boolean enableQuerySltData = bean.getEnableQuerySltData(); List list = sltAgreementInfoMapper.getSltList(bean); + if (CollectionUtils.isNotEmpty(list)) { + if (settlementType != null) { + list = list.stream() + .filter(Objects::nonNull) + .filter(item -> settlementType.equals(item.getSettlementType())) + .collect(Collectors.toList()); + } for (SltAgreementInfo row : list) { SltInfoVo sltInfoVo; row.setEnableQuerySltData(enableQuerySltData); @@ -972,9 +985,20 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { */ @Override public List getSltReportedList(SltAgreementInfo bean) { + if (bean == null) { + bean = new SltAgreementInfo(); + } List sltReportedList = sltAgreementInfoMapper.getSltReportedList(bean); if (sltReportedList != null) { sltReportedList.removeIf(Objects::isNull); + + if (bean.getSettlementType() != null) { + Integer querySltType = bean.getSettlementType(); + sltReportedList = sltReportedList.stream() + .filter(item -> querySltType.equals(item.getSettlementType())) + .collect(Collectors.toList()); + } + // 去掉没有审核的or审核不通过的 sltReportedList.removeIf(obj -> Objects.isNull(obj.getSltStatus()) || !Objects.equals("2", obj.getSltStatus())); sltReportedList.forEach(sltAgreementInfo -> sltAgreementInfo.setCosts( @@ -1152,12 +1176,13 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { @Override @Transactional(rollbackFor = Exception.class) public AjaxResult costExamine(SltAgreementApply sltAgreementApply) { - Long deptId = typeService.getUserDeptId(); - sltAgreementApply.setCompanyId(deptId); - if (Objects.isNull(sltAgreementApply) || Objects.isNull(sltAgreementApply.getStatus())) { return AjaxResult.error("结算信息为空,请刷新后重试!"); } + + Long deptId = typeService.getUserDeptId(); + sltAgreementApply.setCompanyId(deptId); + Integer settlementType = sltAgreementApply.getSettlementType(); String sltTask = sltAgreementApply.getSltTask(); try { @@ -1174,7 +1199,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { Integer checkSettlementType = checkSltPer.getSettlementType(); - if(GlobalConstants.LONG_JJ == deptId){ + if(GlobalConstants.LONG_JJ.equals(deptId)){ if(checkSettlementType == 1 && "73".equals(userId)){ sltSwitch = true; } @@ -1182,7 +1207,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { if(checkSettlementType == 2 && "1549".equals(userId)){ sltSwitch = true; } - }else if(GlobalConstants.LONG_HY == deptId){ + }else if(GlobalConstants.LONG_HY.equals(deptId)){ //顾国强 if("193".equals(userId)){ sltSwitch = true; @@ -1887,10 +1912,22 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { /** * 修改结算协议书编号 * - * @param sltAgreementInfo ID及协议书编号 + * @param sltAgreementInfo 主键id及协议书编号 */ @Override public int updateSltBookCodeById(SltAgreementInfo sltAgreementInfo) { + if (sltAgreementInfo == null) { + throw new ServiceException("非法参数,请检查后重试!"); + } + if (sltAgreementInfo.getBookCode() == null || sltAgreementInfo.getBookCode().trim().isEmpty()) { + throw new ServiceException("协议书编号为空,请检查后重试!"); + } + if (sltAgreementInfo.getId() == null) { + throw new ServiceException("参数缺失,请刷新页面后重试!"); + } + if (sltAgreementInfoMapper.countSltBookCodeByCode(sltAgreementInfo.getBookCode()) > 0) { + throw new ServiceException("此编码已存在,请修改后重新录入!", HttpCodeEnum.NICKNAME_EXIST.getCode()); + } return sltAgreementInfoMapper.updateSltBookCodeById(sltAgreementInfo); } 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 9d4480b5..bd6c33a1 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 @@ -680,11 +680,13 @@ WHERE bai.STATUS = '1' AND sas.slt_status IN ( '1', '2', '3' ) - + + and saa.audit_time >= #{startTime} + and saa.audit_time DATE_ADD(#{endTime}, INTERVAL 1 DAY) + and bui.unit_id = #{unitId} - and bai.agreement_code = #{agreementCode} @@ -909,7 +911,7 @@ saa.id as id, bai.agreement_id as agreementId, bai.agreement_code as agreementCode, saa.settlement_type as settlementType, bui.unit_id as unitId,bui.unit_name as unitName, bp.pro_id as projectId , bp.pro_name as projectName, saa.remark,saa.cost as costs,su.nick_name as auditor,saa.audit_time as auditTime, - saa.create_time as createTime, + saa.create_time as createTime, saa.book_code, SUM(IF(sad.slt_type = '1',sad.money,0)) AS leaseCost, SUM(IF(sad.slt_type = '2',sad.money,0)) AS loseCost, SUM(IF(sad.slt_type = '3' AND sad.is_charge = '1',sad.money,0)) AS repairCost, @@ -2613,4 +2615,8 @@ id = #{id} and book_code is null + +