|
|
@@ -156,28 +156,25 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void cmputeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillAllVo e) { |
|
|
public void cmputeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillAllVo e) { |
|
|
if (!e.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode()) |
|
|
|
|
|
&& !e.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode())) { |
|
|
|
|
|
if (e.getReceivePay() != null) { |
|
|
|
|
|
if (e.getLatePayPrice() == null) { |
|
|
|
|
|
e.setLatePayPrice(0L); |
|
|
|
|
|
} |
|
|
|
|
|
BigDecimal servicePay; |
|
|
|
|
|
if (e.getServiceChargePay() != null) { |
|
|
|
|
|
servicePay = new BigDecimal(e.getServiceChargePay()); |
|
|
|
|
|
} else { |
|
|
|
|
|
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); |
|
|
|
|
|
} |
|
|
|
|
|
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay(); |
|
|
|
|
|
e.setRealReceivePay(realReceivePay); |
|
|
|
|
|
e.setServiceChargePay(servicePay.intValue()); |
|
|
|
|
|
if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode()) && |
|
|
|
|
|
!e.getStatus().equals(EnumBillRentStatus.WAIT_PAY.getCode())) { |
|
|
|
|
|
e.setOwe(0L); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (e.getReceivePay() != null) { |
|
|
|
|
|
if (e.getLatePayPrice() == null) { |
|
|
|
|
|
e.setLatePayPrice(0L); |
|
|
|
|
|
} |
|
|
|
|
|
BigDecimal servicePay; |
|
|
|
|
|
if (e.getServiceChargePay() != null) { |
|
|
|
|
|
servicePay = new BigDecimal(e.getServiceChargePay()); |
|
|
|
|
|
} else { |
|
|
|
|
|
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); |
|
|
|
|
|
} |
|
|
|
|
|
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay(); |
|
|
|
|
|
e.setRealReceivePay(realReceivePay); |
|
|
|
|
|
e.setServiceChargePay(servicePay.intValue()); |
|
|
|
|
|
if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode()) && |
|
|
|
|
|
!e.getStatus().equals(EnumBillRentStatus.WAIT_PAY.getCode())) { |
|
|
|
|
|
e.setOwe(0L); |
|
|
|
|
|
} else { |
|
|
|
|
|
e.setOwe(realReceivePay - e.getPay()); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
|
|
|
e.setRealReceivePay(e.getReceivePay()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@@ -970,12 +967,14 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
wxBillRent.setUpdatetime(updateDate); |
|
|
wxBillRent.setUpdatetime(updateDate); |
|
|
if (oldLatePrice != null) { |
|
|
if (oldLatePrice != null) { |
|
|
wxBillRent.setLatePayPrice(newLatePrice); |
|
|
wxBillRent.setLatePayPrice(newLatePrice); |
|
|
|
|
|
wxBillRent.setOwe(newPrice + wxBillRent.getServiceChargePay() + newLatePrice - wxBillRent.getPay()); |
|
|
wxBillRentMapper.updateById(wxBillRent); |
|
|
wxBillRentMapper.updateById(wxBillRent); |
|
|
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, id, oldLatePrice, newLatePrice, user); |
|
|
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, id, oldLatePrice, newLatePrice, user); |
|
|
} else { |
|
|
} else { |
|
|
//租赁账单更新 |
|
|
//租赁账单更新 |
|
|
wxBillRent.setReceivePay(newPrice); |
|
|
wxBillRent.setReceivePay(newPrice); |
|
|
wxBillRent.setOwe(newPrice - dbBill.getPay()); |
|
|
|
|
|
|
|
|
long latePayPrice = wxBillRent.getLatePayPrice() == null ? 0 : wxBillRent.getLatePayPrice(); |
|
|
|
|
|
wxBillRent.setOwe(newPrice + wxBillRent.getServiceChargePay() + latePayPrice - dbBill.getPay()); |
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
} |
|
|
} |
|
|
@@ -1023,11 +1022,13 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
wxBillProperty.setUpdatetime(updateDate); |
|
|
wxBillProperty.setUpdatetime(updateDate); |
|
|
if (oldLatePrice != null) { |
|
|
if (oldLatePrice != null) { |
|
|
wxBillProperty.setLatePayPrice(newLatePrice); |
|
|
wxBillProperty.setLatePayPrice(newLatePrice); |
|
|
|
|
|
wxBillProperty.setOwe(newPrice + wxBillProperty.getServiceChargePay() + newLatePrice - wxBillProperty.getPay()); |
|
|
wxBillPropertyMapper.updateById(wxBillProperty); |
|
|
wxBillPropertyMapper.updateById(wxBillProperty); |
|
|
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, id, oldLatePrice, newLatePrice, user); |
|
|
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, id, oldLatePrice, newLatePrice, user); |
|
|
} else { |
|
|
} else { |
|
|
wxBillProperty.setReceivePay(newPrice); |
|
|
wxBillProperty.setReceivePay(newPrice); |
|
|
wxBillProperty.setOwe(newPrice - dbBill.getPay()); |
|
|
|
|
|
|
|
|
long latePayPrice = wxBillProperty.getLatePayPrice() == null ? 0 : wxBillProperty.getLatePayPrice(); |
|
|
|
|
|
wxBillProperty.setOwe(newPrice + wxBillProperty.getServiceChargePay() + latePayPrice - dbBill.getPay()); |
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
wxBillProperty.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
wxBillProperty.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
} |
|
|
} |
|
|
@@ -1070,7 +1071,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
WxBillOther wxBillOther = new WxBillOther(); |
|
|
WxBillOther wxBillOther = new WxBillOther(); |
|
|
wxBillOther.setId(id); |
|
|
wxBillOther.setId(id); |
|
|
wxBillOther.setReceivePay(newPrice); |
|
|
wxBillOther.setReceivePay(newPrice); |
|
|
wxBillOther.setOwe(newPrice - dbBill.getPay()); |
|
|
|
|
|
|
|
|
wxBillOther.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay()); |
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
} |
|
|
} |
|
|
@@ -1084,7 +1085,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
WxBillOtherDeposit wxBillOtherDeposit = new WxBillOtherDeposit(); |
|
|
WxBillOtherDeposit wxBillOtherDeposit = new WxBillOtherDeposit(); |
|
|
wxBillOtherDeposit.setId(id); |
|
|
wxBillOtherDeposit.setId(id); |
|
|
wxBillOtherDeposit.setReceivePay(newPrice); |
|
|
wxBillOtherDeposit.setReceivePay(newPrice); |
|
|
wxBillOtherDeposit.setOwe(newPrice - dbBill.getPay()); |
|
|
|
|
|
|
|
|
wxBillOtherDeposit.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay()); |
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
} |
|
|
} |
|
|
@@ -1550,7 +1551,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
WxBillDaily wxBillDaily = new WxBillDaily(); |
|
|
WxBillDaily wxBillDaily = new WxBillDaily(); |
|
|
wxBillDaily.setId(businessId); |
|
|
wxBillDaily.setId(businessId); |
|
|
wxBillDaily.setReceivePay(newPrice); |
|
|
wxBillDaily.setReceivePay(newPrice); |
|
|
wxBillDaily.setOwe(newPrice - dbBill.getPay()); |
|
|
|
|
|
|
|
|
wxBillDaily.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay()); |
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
} |
|
|
} |
|
|
|