|
|
|
@@ -1094,7 +1094,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData updateReceivePay(WxBillAll wxBillAll, MallUserInfo user) { |
|
|
|
public ResultData updateReceivePay(WxBillAll wxBillAll, MallUserInfo user,boolean forcePaid) { |
|
|
|
Integer billType = wxBillAll.getBillTypeValue(); |
|
|
|
Long oldPrice = wxBillAll.getOldPrice(); |
|
|
|
Long newPrice = wxBillAll.getNewPrice(); |
|
|
|
@@ -1107,38 +1107,56 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
WxBillRent wxBillRent = new WxBillRent(); |
|
|
|
wxBillRent.setId(id); |
|
|
|
wxBillRent.setUpdatetime(updateDate); |
|
|
|
if (oldLatePrice != null) { |
|
|
|
wxBillRent.setLatePayPrice(newLatePrice); |
|
|
|
wxBillRent.setOwe(dbBill.getReceivePay() + dbBill.getServiceChargePay() + newLatePrice - dbBill.getPay()); |
|
|
|
wxBillRentMapper.updateById(wxBillRent); |
|
|
|
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, id, oldLatePrice, newLatePrice, user); |
|
|
|
} else { |
|
|
|
//租赁账单更新 |
|
|
|
wxBillRent.setReceivePay(newPrice); |
|
|
|
long latePayPrice = dbBill.getLatePayPrice() == null ? 0 : dbBill.getLatePayPrice(); |
|
|
|
wxBillRent.setOwe(newPrice + dbBill.getServiceChargePay() + latePayPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
wxBillRentMapper.updateById(wxBillRent); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, oldPrice, newPrice, user); |
|
|
|
if (forcePaid) { |
|
|
|
wxBillRent.setReceivePay(dbBill.getPay()); |
|
|
|
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
wxBillRent.setOwe(0L); |
|
|
|
wxBillRentMapper.updateById(wxBillRent); |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, dbBill.getPay(), dbBill.getPay(), user); |
|
|
|
}else { |
|
|
|
if (oldLatePrice != null) { |
|
|
|
wxBillRent.setLatePayPrice(newLatePrice); |
|
|
|
wxBillRent.setOwe(dbBill.getReceivePay() + dbBill.getServiceChargePay() + newLatePrice - dbBill.getPay()); |
|
|
|
wxBillRentMapper.updateById(wxBillRent); |
|
|
|
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, id, oldLatePrice, newLatePrice, user); |
|
|
|
} else { |
|
|
|
//租赁账单更新 |
|
|
|
wxBillRent.setReceivePay(newPrice); |
|
|
|
long latePayPrice = dbBill.getLatePayPrice() == null ? 0 : dbBill.getLatePayPrice(); |
|
|
|
wxBillRent.setOwe(newPrice + dbBill.getServiceChargePay() + latePayPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
wxBillRentMapper.updateById(wxBillRent); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, oldPrice, newPrice, user); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (billType.equals(EnumBillTypeParam.RENT_DEPOSIT.getCode())) { |
|
|
|
WxBillDeposit dbBill = wxBillDepositMapper.selectById(id); |
|
|
|
if (dbBill != null) { |
|
|
|
//租赁押金账单更新 |
|
|
|
WxBillDeposit wxBillDeposit = new WxBillDeposit(); |
|
|
|
wxBillDeposit.setId(id); |
|
|
|
wxBillDeposit.setReceivePay(newPrice); |
|
|
|
wxBillDeposit.setOwe(newPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
wxBillDeposit.setUpdatetime(updateDate); |
|
|
|
wxBillDepositMapper.updateById(wxBillDeposit); |
|
|
|
WxBillDeposit wxBillDeposit = new WxBillDeposit(); |
|
|
|
wxBillDeposit.setId(id); |
|
|
|
Long billDepositOldPrce = oldPrice; |
|
|
|
Long billDepositNewPrce = newPrice; |
|
|
|
//租赁押金账单更新 |
|
|
|
if (forcePaid) { |
|
|
|
wxBillDeposit.setReceivePay(dbBill.getPay()); |
|
|
|
wxBillDeposit.setOwe(0L); |
|
|
|
wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
billDepositOldPrce = dbBill.getPay(); |
|
|
|
billDepositNewPrce = dbBill.getPay(); |
|
|
|
}else { |
|
|
|
wxBillDeposit.setReceivePay(newPrice); |
|
|
|
wxBillDeposit.setOwe(newPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
wxBillDeposit.setUpdatetime(updateDate); |
|
|
|
} |
|
|
|
wxBillDepositMapper.updateById(wxBillDeposit); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.DEPOSIT_MODIFY, id, oldPrice, newPrice, user); |
|
|
|
addBillAction(EnumBillAction.DEPOSIT_MODIFY, id, billDepositOldPrce, billDepositNewPrce, user); |
|
|
|
} |
|
|
|
|
|
|
|
WxBillPropertyDeposit propertyDeposit = wxBillPropertyDepositMapper.selectById(id); |
|
|
|
@@ -1146,15 +1164,25 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
//物业押金账单更新 |
|
|
|
WxBillPropertyDeposit wxBillPropertyDeposit = new WxBillPropertyDeposit(); |
|
|
|
wxBillPropertyDeposit.setId(id); |
|
|
|
wxBillPropertyDeposit.setReceivePay(newPrice); |
|
|
|
wxBillPropertyDeposit.setOwe(newPrice - propertyDeposit.getPay()); |
|
|
|
if (newPrice.equals(propertyDeposit.getPay())) { |
|
|
|
wxBillPropertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
Long billPropertyDepositOldPrce = oldPrice; |
|
|
|
Long billPropertyDepositNewPrce = newPrice; |
|
|
|
if (forcePaid) { |
|
|
|
wxBillPropertyDeposit.setReceivePay(propertyDeposit.getPay()); |
|
|
|
wxBillPropertyDeposit.setOwe(0L); |
|
|
|
wxBillPropertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
billPropertyDepositOldPrce = propertyDeposit.getPay(); |
|
|
|
billPropertyDepositNewPrce = propertyDeposit.getPay(); |
|
|
|
}else { |
|
|
|
wxBillPropertyDeposit.setReceivePay(newPrice); |
|
|
|
wxBillPropertyDeposit.setOwe(newPrice - propertyDeposit.getPay()); |
|
|
|
if (newPrice.equals(propertyDeposit.getPay())) { |
|
|
|
wxBillPropertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillPropertyDeposit.setUpdatetime(updateDate); |
|
|
|
wxBillPropertyDepositMapper.updateById(wxBillPropertyDeposit); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, oldPrice, newPrice, user); |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, billPropertyDepositOldPrce, billPropertyDepositNewPrce, user); |
|
|
|
} |
|
|
|
} else if (billType.equals(EnumBillTypeParam.PROPERTY.getCode())) { |
|
|
|
WxBillProperty dbBill = wxBillPropertyMapper.selectById(id); |
|
|
|
@@ -1162,49 +1190,68 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
WxBillProperty wxBillProperty = new WxBillProperty(); |
|
|
|
wxBillProperty.setId(id); |
|
|
|
wxBillProperty.setUpdatetime(updateDate); |
|
|
|
if (oldLatePrice != null) { |
|
|
|
wxBillProperty.setLatePayPrice(newLatePrice); |
|
|
|
wxBillProperty.setOwe(dbBill.getReceivePay() + dbBill.getServiceChargePay() + newLatePrice - dbBill.getPay()); |
|
|
|
wxBillPropertyMapper.updateById(wxBillProperty); |
|
|
|
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, id, oldLatePrice, newLatePrice, user); |
|
|
|
} else { |
|
|
|
wxBillProperty.setReceivePay(newPrice); |
|
|
|
long latePayPrice = dbBill.getLatePayPrice() == null ? 0 : dbBill.getLatePayPrice(); |
|
|
|
wxBillProperty.setOwe(newPrice + dbBill.getServiceChargePay() + latePayPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillProperty.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
wxBillPropertyMapper.updateById(wxBillProperty); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, oldPrice, newPrice, user); |
|
|
|
if (forcePaid) { |
|
|
|
wxBillProperty.setReceivePay(dbBill.getPay()); |
|
|
|
wxBillProperty.setOwe(0L); |
|
|
|
wxBillProperty.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
wxBillPropertyMapper.updateById(wxBillProperty); |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, dbBill.getPay(), dbBill.getPay(), user); |
|
|
|
}else { |
|
|
|
if (oldLatePrice != null) { |
|
|
|
wxBillProperty.setLatePayPrice(newLatePrice); |
|
|
|
wxBillProperty.setOwe(dbBill.getReceivePay() + dbBill.getServiceChargePay() + newLatePrice - dbBill.getPay()); |
|
|
|
wxBillPropertyMapper.updateById(wxBillProperty); |
|
|
|
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, id, oldLatePrice, newLatePrice, user); |
|
|
|
} else { |
|
|
|
wxBillProperty.setReceivePay(newPrice); |
|
|
|
long latePayPrice = dbBill.getLatePayPrice() == null ? 0 : dbBill.getLatePayPrice(); |
|
|
|
wxBillProperty.setOwe(newPrice + dbBill.getServiceChargePay() + latePayPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillProperty.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
wxBillPropertyMapper.updateById(wxBillProperty); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, oldPrice, newPrice, user); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (billType.equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode())) { |
|
|
|
WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectById(id); |
|
|
|
//物业押金账单更新 |
|
|
|
WxBillPropertyDeposit wxBillPropertyDeposit = new WxBillPropertyDeposit(); |
|
|
|
wxBillPropertyDeposit.setId(id); |
|
|
|
wxBillPropertyDeposit.setReceivePay(newPrice); |
|
|
|
wxBillPropertyDeposit.setOwe(newPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillPropertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
Long billPropertyDepositOldPrce = oldPrice; |
|
|
|
Long billPropertyDepositNewPrce = newPrice; |
|
|
|
if (forcePaid) { |
|
|
|
wxBillPropertyDeposit.setReceivePay(dbBill.getPay()); |
|
|
|
wxBillPropertyDeposit.setOwe(0L); |
|
|
|
wxBillPropertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
billPropertyDepositOldPrce = dbBill.getPay(); |
|
|
|
billPropertyDepositNewPrce = dbBill.getPay(); |
|
|
|
}else { |
|
|
|
wxBillPropertyDeposit.setReceivePay(newPrice); |
|
|
|
wxBillPropertyDeposit.setOwe(newPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillPropertyDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillPropertyDeposit.setUpdatetime(updateDate); |
|
|
|
wxBillPropertyDepositMapper.updateById(wxBillPropertyDeposit); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, oldPrice, newPrice, user); |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, billPropertyDepositOldPrce, billPropertyDepositNewPrce, user); |
|
|
|
|
|
|
|
} else if (billType.equals(EnumBillTypeParam.WATER.getCode())) { |
|
|
|
//水费账单更新 |
|
|
|
updateDailyBill(id, newPrice, updateDate); |
|
|
|
updateDailyBill(id, newPrice, updateDate,forcePaid); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, oldPrice, newPrice, user); |
|
|
|
} else if (billType.equals(EnumBillTypeParam.POWER.getCode())) { |
|
|
|
//电费账单更新 |
|
|
|
updateDailyBill(id, newPrice, updateDate); |
|
|
|
updateDailyBill(id, newPrice, updateDate,forcePaid); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, oldPrice, newPrice, user); |
|
|
|
} else if (billType.equals(EnumBillTypeParam.AIR_CONDITIONING.getCode())) { |
|
|
|
//空调费账单更新 |
|
|
|
updateDailyBill(id, newPrice, updateDate); |
|
|
|
updateDailyBill(id, newPrice, updateDate,forcePaid); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL, id, oldPrice, newPrice, user); |
|
|
|
} else if (billType.equals(EnumBillTypeParam.ROUTINE.getCode())) { |
|
|
|
@@ -1212,10 +1259,16 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
//其他费用账单更新 |
|
|
|
WxBillOther wxBillOther = new WxBillOther(); |
|
|
|
wxBillOther.setId(id); |
|
|
|
wxBillOther.setReceivePay(newPrice); |
|
|
|
wxBillOther.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
if (forcePaid) { |
|
|
|
wxBillOther.setReceivePay(dbBill.getPay()); |
|
|
|
wxBillOther.setOwe(0L); |
|
|
|
wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
}else { |
|
|
|
wxBillOther.setReceivePay(newPrice); |
|
|
|
wxBillOther.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillOther.setUpdatetime(updateDate); |
|
|
|
wxBillOtherMapper.updateById(wxBillOther); |
|
|
|
@@ -1226,10 +1279,16 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
//其他押金账单更新 |
|
|
|
WxBillOtherDeposit wxBillOtherDeposit = new WxBillOtherDeposit(); |
|
|
|
wxBillOtherDeposit.setId(id); |
|
|
|
wxBillOtherDeposit.setReceivePay(newPrice); |
|
|
|
wxBillOtherDeposit.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
if (forcePaid) { |
|
|
|
wxBillOtherDeposit.setReceivePay(dbBill.getPay()); |
|
|
|
wxBillOtherDeposit.setOwe(0L); |
|
|
|
wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
}else { |
|
|
|
wxBillOtherDeposit.setReceivePay(newPrice); |
|
|
|
wxBillOtherDeposit.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillOtherDeposit.setUpdatetime(updateDate); |
|
|
|
wxBillOtherDepositMapper.updateById(wxBillOtherDeposit); |
|
|
|
@@ -1702,14 +1761,20 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
wxBillActionService.modifyBill(wxBillAction, user); |
|
|
|
} |
|
|
|
|
|
|
|
public void updateDailyBill(Long businessId, Long newPrice, Date updateDate) { |
|
|
|
public void updateDailyBill(Long businessId, Long newPrice, Date updateDate,boolean forcePaid) { |
|
|
|
WxBillDaily dbBill = wxBillDailyMapper.selectById(businessId); |
|
|
|
WxBillDaily wxBillDaily = new WxBillDaily(); |
|
|
|
wxBillDaily.setId(businessId); |
|
|
|
wxBillDaily.setReceivePay(newPrice); |
|
|
|
wxBillDaily.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
if (forcePaid) { |
|
|
|
wxBillDaily.setReceivePay(dbBill.getPay()); |
|
|
|
wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
wxBillDaily.setOwe(0L); |
|
|
|
}else { |
|
|
|
wxBillDaily.setReceivePay(newPrice); |
|
|
|
wxBillDaily.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillDaily.setUpdatetime(updateDate); |
|
|
|
wxBillDailyMapper.updateById(wxBillDaily); |
|
|
|
|