|
|
|
@@ -772,22 +772,30 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
Integer billType = wxBillAll.getBillTypeValue(); |
|
|
|
Long oldPrice = wxBillAll.getOldPrice(); |
|
|
|
Long newPrice = wxBillAll.getNewPrice(); |
|
|
|
Long oldLatePrice = wxBillAll.getOldLatePrice(); |
|
|
|
Long newLatePrice = wxBillAll.getNewLatePrice(); |
|
|
|
Long id = wxBillAll.getId(); |
|
|
|
Date updateDate = new Date(); |
|
|
|
if (billType.equals(EnumBillTypeParam.RENT.getCode())) { |
|
|
|
WxBillRent dbBill = wxBillRentMapper.selectByPrimaryKey(id); |
|
|
|
//租赁账单更新 |
|
|
|
WxBillRent wxBillRent = new WxBillRent(); |
|
|
|
wxBillRent.setId(id); |
|
|
|
wxBillRent.setReceivePay(newPrice); |
|
|
|
wxBillRent.setOwe(newPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
wxBillRent.setUpdatetime(updateDate); |
|
|
|
wxBillRentMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
//账单日志 |
|
|
|
addBillAction(id, oldPrice, newPrice, user); |
|
|
|
if(oldLatePrice != null){ |
|
|
|
wxBillRent.setLatePayPrice(newLatePrice); |
|
|
|
wxBillRentMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY,id, oldPrice, newPrice, user); |
|
|
|
}else{ |
|
|
|
//租赁账单更新 |
|
|
|
wxBillRent.setReceivePay(newPrice); |
|
|
|
wxBillRent.setOwe(newPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
wxBillRentMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL,id, oldPrice, newPrice, user); |
|
|
|
} |
|
|
|
} else if (billType.equals(EnumBillTypeParam.RENT_DEPOSIT.getCode())) { |
|
|
|
WxBillDeposit dbBill = wxBillDepositMapper.selectByPrimaryKey(id); |
|
|
|
//租赁押金账单更新 |
|
|
|
@@ -801,21 +809,27 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
wxBillDeposit.setUpdatetime(updateDate); |
|
|
|
wxBillDepositMapper.updateByPrimaryKeySelective(wxBillDeposit); |
|
|
|
//账单日志 |
|
|
|
addBillAction(id, oldPrice, newPrice, user); |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL,id, oldPrice, newPrice, user); |
|
|
|
} else if (billType.equals(EnumBillTypeParam.PROPERTY.getCode())) { |
|
|
|
WxBillProperty dbBill = wxBillPropertyMapper.selectByPrimaryKey(id); |
|
|
|
//物业账单更新 |
|
|
|
WxBillProperty wxBillProperty = new WxBillProperty(); |
|
|
|
wxBillProperty.setId(id); |
|
|
|
wxBillProperty.setReceivePay(newPrice); |
|
|
|
wxBillProperty.setOwe(newPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillProperty.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
wxBillProperty.setUpdatetime(updateDate); |
|
|
|
wxBillPropertyMapper.updateByPrimaryKeySelective(wxBillProperty); |
|
|
|
//账单日志 |
|
|
|
addBillAction(id, oldPrice, newPrice, user); |
|
|
|
if(oldLatePrice != null){ |
|
|
|
wxBillProperty.setLatePayPrice(newLatePrice); |
|
|
|
wxBillPropertyMapper.updateByPrimaryKeySelective(wxBillProperty); |
|
|
|
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY,id, oldPrice, newPrice, user); |
|
|
|
}else{ |
|
|
|
wxBillProperty.setReceivePay(newPrice); |
|
|
|
wxBillProperty.setOwe(newPrice - dbBill.getPay()); |
|
|
|
if (newPrice.equals(dbBill.getPay())) { |
|
|
|
wxBillProperty.setStatus(EnumBillRentStatus.PAID.getCode()); |
|
|
|
} |
|
|
|
wxBillPropertyMapper.updateByPrimaryKeySelective(wxBillProperty); |
|
|
|
//账单日志 |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL,id, oldPrice, newPrice, user); |
|
|
|
} |
|
|
|
} else if (billType.equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode())) { |
|
|
|
WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(id); |
|
|
|
//物业押金账单更新 |
|
|
|
@@ -829,22 +843,22 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
wxBillPropertyDeposit.setUpdatetime(updateDate); |
|
|
|
wxBillPropertyDepositMapper.updateByPrimaryKeySelective(wxBillPropertyDeposit); |
|
|
|
//账单日志 |
|
|
|
addBillAction(id, oldPrice, newPrice, user); |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL,id, oldPrice, newPrice, user); |
|
|
|
} else if (billType.equals(EnumBillTypeParam.WATER.getCode())) { |
|
|
|
//水费账单更新 |
|
|
|
updateDailyBill(id, newPrice, updateDate); |
|
|
|
//账单日志 |
|
|
|
addBillAction(id, oldPrice, newPrice, user); |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL,id, oldPrice, newPrice, user); |
|
|
|
} else if (billType.equals(EnumBillTypeParam.POWER.getCode())) { |
|
|
|
//电费账单更新 |
|
|
|
updateDailyBill(id, newPrice, updateDate); |
|
|
|
//账单日志 |
|
|
|
addBillAction(id, oldPrice, newPrice, user); |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL,id, oldPrice, newPrice, user); |
|
|
|
} else if (billType.equals(EnumBillTypeParam.AIR_CONDITIONING.getCode())) { |
|
|
|
//空调费账单更新 |
|
|
|
updateDailyBill(id, newPrice, updateDate); |
|
|
|
//账单日志 |
|
|
|
addBillAction(id, oldPrice, newPrice, user); |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL,id, oldPrice, newPrice, user); |
|
|
|
} else if (billType.equals(EnumBillTypeParam.ROUTINE.getCode())) { |
|
|
|
WxBillOther dbBill = wxBillOtherMapper.selectByPrimaryKey(id); |
|
|
|
//其他费用账单更新 |
|
|
|
@@ -858,7 +872,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
wxBillOther.setUpdatetime(updateDate); |
|
|
|
wxBillOtherMapper.updateByPrimaryKeySelective(wxBillOther); |
|
|
|
//账单日志 |
|
|
|
addBillAction(id, oldPrice, newPrice, user); |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL,id, oldPrice, newPrice, user); |
|
|
|
} else if (billType.equals(EnumBillTypeParam.ATHER_DEPOSIT.getCode())) { |
|
|
|
WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(id); |
|
|
|
//其他押金账单更新 |
|
|
|
@@ -872,7 +886,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
wxBillOtherDeposit.setUpdatetime(updateDate); |
|
|
|
wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillOtherDeposit); |
|
|
|
//账单日志 |
|
|
|
addBillAction(id, oldPrice, newPrice, user); |
|
|
|
addBillAction(EnumBillAction.UPDATE_BILL,id, oldPrice, newPrice, user); |
|
|
|
} else { |
|
|
|
logger.info("未找到账单类型"); |
|
|
|
} |
|
|
|
@@ -880,16 +894,17 @@ public class WxBillAllServiceImpl implements WxBillAllService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void addBillAction(Long billId, Long oldPrice, Long newPrice, MallUserInfo mallUserInfo) { |
|
|
|
public void addBillAction(EnumBillAction billAction,Long billId, Long oldPrice, Long newPrice, MallUserInfo mallUserInfo) { |
|
|
|
WxBillAction wxBillAction = new WxBillAction(); |
|
|
|
wxBillAction.setBillId(billId); |
|
|
|
String oldPriceStr = new BigDecimal(oldPrice).divide(new BigDecimal(100)).toPlainString(); |
|
|
|
String newPriceStr = new BigDecimal(newPrice).divide(new BigDecimal(100)).toPlainString(); |
|
|
|
wxBillAction.setDetails(oldPriceStr + "元变更成" + newPriceStr + "元"); |
|
|
|
wxBillAction.setAction(EnumBillAction.UPDATE_BILL.getCode()); |
|
|
|
wxBillAction.setAction(billAction.getCode()); |
|
|
|
wxBillActionService.modifyBill(wxBillAction, mallUserInfo); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void exportTemplate(WxBillExcelTemplate WxBillExcelTemplate, HttpServletRequest request, HttpServletResponse response) { |
|
|
|
List<WxBillExcelTemplateOther> datalist = new ArrayList<>(); |
|
|
|
|