Przeglądaj źródła

修改bug:
开票金额和实收金额无法输入大于应收金额的数据;输好开票金额后,实收金额无法输入大于开票金额的数值

jiakai 3 miesięcy temu
rodzic
commit
8213129fd6

+ 2 - 1
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/aop/aspect/QuoteVerificationAspect.java

@@ -1,5 +1,6 @@
 package com.jzg.quotation.summary.aop.aspect;
 
+import cn.hutool.core.collection.CollUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.jzg.commons.constants.quote.enums.quote.EnergyTypeCode;
@@ -99,7 +100,7 @@ public class QuoteVerificationAspect {
             // 设置默认的优先级
             agreementProductCosts = this.setPriorities(agreementProductCosts);
             log.info("过滤的费用列表:{}",JSONObject.toJSONString(agreementProductCosts));
-            if (!agreementProductCosts.isEmpty()) {
+            if (CollUtil.isNotEmpty(agreementProductCosts)) {
                 //遍历费用因子
                 String costId = verificationCosts(agreementProductCosts, logs, insOrdersOther, insOrdersCarInfo, insOrdersRisks,
                         insOrdersCarUserInfos, kindList, insOrdersCosts, insOrdersAccidentalDriving, insOrders);

+ 7 - 16
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -1055,17 +1055,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             result.setSumPrice(null != invoicingVo.getReceivablePremium() ? invoicingVo.getReceivablePremium().toString() : null);
 
             // ============================结算逻辑============================
-            // 实际已经收了的金额
-            BigDecimal actualReceivedAmount = this.getInvoicingAmount(settlementVo.getInvoicingId());
-
-            // 所有需要结算的金额
-            BigDecimal allToSettlement = invoice.getReceivableSupervisePremium().add(invoice.getOverinflatedAmount());
-            // 剩余的金额
-            BigDecimal surplusPremium = allToSettlement.subtract(actualReceivedAmount);
-            log.info("invoiceId=[{}],一共需要结算的金额[{}],实际已经结算的金额[{}],本次计划结算的金额[{}]",
-                    settlementVo.getInvoicingId(), allToSettlement,actualReceivedAmount,settlementVo.getActualReceivedAmount());
             // 校验是否超出了剩余的金额
-            AssertionUtils.isFail(surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) < 0, "已超出应收金额,请核对!");
+//            AssertionUtils.isFail(surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) < 0, "已超出应收金额,请核对!");
 
             // 处理结算数据
             // 未完全结算完成
@@ -1507,7 +1498,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             log.info("invoiceId=[{}],一共需要结算的金额[{}],实际已经结算的金额[{}],本次计划结算的金额[{}]",
                     settlementVo.getInvoicingId(), allToSettlement,actualReceivedAmount,settlementVo.getActualReceivedAmount());
             // 校验是否超出了剩余的金额
-            AssertionUtils.isFail(surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) < 0, "已超出应收金额,请核对!");
+//            AssertionUtils.isFail(surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) < 0, "已超出应收金额,请核对!");
 
             // 处理结算数据
             // 未完全结算完成
@@ -1529,8 +1520,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                 insPlyIncomeInvoiceSettlementFileMapper.insert(files);
             }
 
-            // 判断是否已经结算完成
-            if (surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) == 0) {
+            // 判断是否已经结算完成,剩余金额小于等于实收金额就算完成结算了
+            if (surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) <= 0) {
                 log.info("序号为[{}]的发票已经结算完成",insPlyIncomeInvoice.getId());
                 // 更新发票状态
                 insPlyIncomeInvoice.setStatus("1");
@@ -2482,7 +2473,7 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
             log.info("invoiceId=[{}],一共需要结算的金额[{}],实际已经结算的金额[{}],本次计划结算的金额[{}]",
                     settlementVo.getInvoicingId(), allToSettlement,actualReceivedAmount,settlementVo.getActualReceivedAmount());
             // 校验是否超出了剩余的金额,判断 surplusPremium 是否 小于 实际到账金额
-            AssertionUtils.isFail(surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) < 0, "已超出应收金额,请核对!");
+//            AssertionUtils.isFail(surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) < 0, "已超出应收金额,请核对!");
 
             // 处理结算数据
             // 未完全结算完成
@@ -2504,8 +2495,8 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
                 insPlyIncomeInvoiceSettlementFileMapper.insert(files);
             }
 
-            // 判断是否已经结算完成
-            if (surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) == 0) {
+            // 判断是否已经结算完成,剩余金额小于等于实收金额就算完成结算了
+            if (surplusPremium.compareTo(settlementVo.getActualReceivedAmount()) <= 0) {
                 log.info("序号为[{}]的发票已经结算完成",insPlyIncomeInvoice.getId());
                 // 更新发票状态
                 insPlyIncomeInvoice.setStatus("1");