From dabe275d9d26acd9f2535e8d8fec07a1e90d2f53 Mon Sep 17 00:00:00 2001 From: linfso Date: Tue, 13 Aug 2024 15:27:41 +0800 Subject: [PATCH] md --- .../impl/EmisSettlePayRecordServiceImpl.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSettlePayRecordServiceImpl.java b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSettlePayRecordServiceImpl.java index 600506e87..552628606 100644 --- a/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSettlePayRecordServiceImpl.java +++ b/emis-biz/src/main/java/com/xdadan/erp/emis/service/impl/EmisSettlePayRecordServiceImpl.java @@ -22,6 +22,7 @@ import com.xdadan.erp.emis.mapper.EmisSettleBillMapper; import com.xdadan.erp.emis.mapper.EmisSettleSubBillMapper; import com.xdadan.erp.emis.service.EmisBaseService; import com.xdadan.erp.emis.utils.WaybillHelper; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -35,6 +36,7 @@ import com.xdadan.erp.emis.service.IEmisSettlePayRecordService; * @author linfso * @date 2024-07-21 13:31:24 */ +@Slf4j @Service public class EmisSettlePayRecordServiceImpl extends EmisBaseService implements IEmisSettlePayRecordService { @@ -148,20 +150,27 @@ public class EmisSettlePayRecordServiceImpl extends EmisBaseService implements I /* other_money */ BigDecimal otherMoney = BigDecimal.ZERO; + log.debug("收款状态更新===>应收:{}",oldBill.getRecMoney()); + for(EmisSettlePayRecord item:payRecordList){ totalPayMoney=totalPayMoney.add(item.getPayMoney()); satisfyMoney=satisfyMoney.add(item.getSatisfyMoney()==null?BigDecimal.ZERO:item.getSatisfyMoney()); allowanceMoney=allowanceMoney.add(item.getAllowanceMoney()==null?BigDecimal.ZERO:item.getAllowanceMoney()); deductionMoney=deductionMoney.add(item.getDeductionMoney()==null?BigDecimal.ZERO:item.getDeductionMoney()); otherMoney=otherMoney.add(item.getOtherMoney()==null?BigDecimal.ZERO:item.getOtherMoney()); - - totalAllPayMoney=totalAllPayMoney.add(totalPayMoney); - totalAllPayMoney=totalAllPayMoney.add(satisfyMoney); - totalAllPayMoney=totalAllPayMoney.add(allowanceMoney); - totalAllPayMoney=totalAllPayMoney.add(deductionMoney); - totalAllPayMoney=totalAllPayMoney.add(otherMoney); } + // 总应收金额 + log.debug("收款状态更新===>totalPayMoney:{},satisfyMoney:{},allowanceMoney:{},deductionMoney:{},otherMoney:{}" + ,totalPayMoney,satisfyMoney,allowanceMoney,allowanceMoney,deductionMoney,otherMoney); + + totalAllPayMoney=totalAllPayMoney + .add(totalPayMoney) + .add(satisfyMoney) + .add(allowanceMoney) + .add(deductionMoney) + .add(otherMoney); + EmisSettleBill newBill = new EmisSettleBill(); newBill.setId(oldBill.getId()); newBill.setRecedMoney(totalPayMoney); @@ -171,6 +180,7 @@ public class EmisSettlePayRecordServiceImpl extends EmisBaseService implements I // 判断收款状态 收款金额 int rstDif=totalAllPayMoney.compareTo(oldBill.getRecMoney()); + log.debug("收款状态更新===>收款总金额:{},应收:{},rsDif:{}",totalAllPayMoney,oldBill.getRecMoney(),rstDif); if( rstDif >= 0 ){ // 已收款 newBill.setPaymentStatus("1");