|
|
|
@@ -338,12 +338,19 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
BigDecimal remainSetoff = new BigDecimal(dto.getSetOff()); |
|
|
|
if (latePayLastMoney.compareTo(new BigDecimal(0)) > 0 ) { |
|
|
|
opay = opay.add(latePayLastMoney); |
|
|
|
wxBillRent.setPay(opay.toPlainString()); |
|
|
|
//如果付款金额做了扣除手续费/滞纳金,则需要将本金抵扣写到备注 |
|
|
|
if (new BigDecimal(dto.getAddpay()).compareTo(latePayLastMoney) > 0 ) { |
|
|
|
sb.append(";已付金额增加").append(latePayLastMoney.toPlainString()); |
|
|
|
//如果手续费+滞纳金未消耗到实际收款 |
|
|
|
if (latePayLastMoney.compareTo(new BigDecimal(dto.getAddpay())) >= 0 ) { |
|
|
|
wxBillRent.setPay(dto.getAddpay()); |
|
|
|
sb.append(";已付金额增加").append(new BigDecimal(dto.getAddpay()).toPlainString()); |
|
|
|
//实际应收的抵扣 |
|
|
|
//remainSetoff = remainSetoff.subtract(latePayLastMoney.subtract(new BigDecimal(dto.getAddpay()))); |
|
|
|
}else { |
|
|
|
BigDecimal remainPay = new BigDecimal(dto.getAddpay()).subtract(latePayLastMoney); |
|
|
|
wxBillRent.setPay(remainPay.toPlainString()); |
|
|
|
sb.append(";已付金额增加").append(remainPay.toPlainString()); |
|
|
|
} |
|
|
|
if (opay.compareTo(new BigDecimal(dbBill.getOwe())) >= 0 ) { |
|
|
|
wxBillRent.setStatus(EnumBillStatus.PAID.getCode()); |
|
|
|
@@ -354,7 +361,7 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill |
|
|
|
if (StringUtils.isBlank(oldSetOff)) { |
|
|
|
oldSetOff = "0"; |
|
|
|
} |
|
|
|
wxBillRent.setSetOff(new BigDecimal(oldSetOff).add(new BigDecimal(dto.getSetOff())).toPlainString()); |
|
|
|
wxBillRent.setSetOff(new BigDecimal(oldSetOff).add(remainSetoff).toPlainString()); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
wxBillRent.setPayWay(dto.getPayWayObject().getId()); |
|
|
|
wxAllBillMapper.updateById(wxBillRent); |
|
|
|
|