|
|
|
@@ -58,6 +58,9 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
private WxMerchantSubsidyMapper wxMerchantSubsidyMapper; |
|
|
|
@Autowired |
|
|
|
private ExcelService excelService; |
|
|
|
@Autowired |
|
|
|
private WxBillActionMapper wxBillActionMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<WxBillSettle> listAsPage(WxBillSettle record, Integer pageIndex, Integer pageSize) { |
|
|
|
@@ -136,6 +139,21 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
return billSettle; |
|
|
|
} |
|
|
|
|
|
|
|
public void addBillAction(Long billId,Long money){ |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
WxBillAction billAction = new WxBillAction(); |
|
|
|
billAction.setId(idWorker.nextId()); |
|
|
|
billAction.setCreatetime(new Date()); |
|
|
|
billAction.setUserName("系统端"); |
|
|
|
billAction.setAction(EnumBillAction.UPDATE_SETTLE_MONEY.getCode()); |
|
|
|
billAction.setBillId(billId); |
|
|
|
BigDecimal newmoney = new BigDecimal(money).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP); |
|
|
|
billAction.setDetails("通过结算单清算"+newmoney.toString()+"元"); |
|
|
|
billAction.setUpdatetime(new Date()); |
|
|
|
billAction.setPayDate(new Date()); |
|
|
|
wxBillActionMapper.insertSelective(billAction); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void updateFreezeOrStatus(List<WxBillSettleBill> billList,Integer freezeStatus,Integer status){ |
|
|
|
//1租金2押金3物业4日常费用6其他8补贴 |
|
|
|
@@ -148,6 +166,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
wxBillRent.setStatus(status); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
} |
|
|
|
if(EnumBillRentStatus.PAID.getCode().equals(status)){ |
|
|
|
WxBillRent dbBill = wxBillRentMapper.selectByPrimaryKey(wxBillRent.getId()); |
|
|
|
if(dbBill!=null) { |
|
|
|
wxBillRent.setPay(dbBill.getOwe()); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
addBillAction(bill.getBillId(), dbBill.getOwe()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillRentMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
}else if(EnumBillType.DEPOSIT.getCode().equals(bill.getBillType())) { |
|
|
|
WxBillDeposit wxBillRent = new WxBillDeposit(); |
|
|
|
@@ -157,6 +183,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
wxBillRent.setStatus(status); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
} |
|
|
|
if(EnumBillRentStatus.PAID.getCode().equals(status)){ |
|
|
|
WxBillDeposit dbBill = wxBillDepositMapper.selectByPrimaryKey(wxBillRent.getId()); |
|
|
|
if(dbBill!=null) { |
|
|
|
wxBillRent.setPay(dbBill.getOwe()); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
addBillAction(bill.getBillId(), dbBill.getOwe()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillDepositMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
|
|
|
|
WxBillOtherDeposit wxBillOtherDeposit = new WxBillOtherDeposit(); |
|
|
|
@@ -166,6 +200,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
wxBillOtherDeposit.setStatus(status); |
|
|
|
wxBillOtherDeposit.setPayDate(new Date()); |
|
|
|
} |
|
|
|
if(EnumBillRentStatus.PAID.getCode().equals(status)){ |
|
|
|
WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); |
|
|
|
if(dbBill!=null) { |
|
|
|
wxBillOtherDeposit.setPay(dbBill.getOwe()); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
addBillAction(bill.getBillId(), dbBill.getOwe()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillOtherDeposit); |
|
|
|
|
|
|
|
WxBillPropertyDeposit propertyDeposit = new WxBillPropertyDeposit(); |
|
|
|
@@ -175,6 +217,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
wxBillRent.setStatus(status); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
} |
|
|
|
if(EnumBillRentStatus.PAID.getCode().equals(status)){ |
|
|
|
WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId()); |
|
|
|
if(dbBill!=null) { |
|
|
|
propertyDeposit.setPay(dbBill.getOwe()); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
addBillAction(bill.getBillId(), dbBill.getOwe()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillPropertyDepositMapper.updateByPrimaryKeySelective(propertyDeposit); |
|
|
|
|
|
|
|
}else if(EnumBillType.PROPERTY.getCode().equals(bill.getBillType())) { |
|
|
|
@@ -185,6 +235,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
wxBillRent.setStatus(status); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
} |
|
|
|
if(EnumBillRentStatus.PAID.getCode().equals(status)){ |
|
|
|
WxBillProperty dbBill = wxBillPropertyMapper.selectByPrimaryKey(wxBillRent.getId()); |
|
|
|
if(dbBill!=null) { |
|
|
|
wxBillRent.setPay(dbBill.getOwe()); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
addBillAction(bill.getBillId(), dbBill.getOwe()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillPropertyMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
|
|
|
|
WxBillPropertyDeposit propertyDeposit = new WxBillPropertyDeposit(); |
|
|
|
@@ -194,6 +252,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
wxBillRent.setStatus(status); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
} |
|
|
|
if(EnumBillRentStatus.PAID.getCode().equals(status)){ |
|
|
|
WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId()); |
|
|
|
if(dbBill!=null) { |
|
|
|
propertyDeposit.setPay(dbBill.getOwe()); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
addBillAction(bill.getBillId(), dbBill.getOwe()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillPropertyDepositMapper.updateByPrimaryKeySelective(propertyDeposit); |
|
|
|
}else if(EnumBillType.ROUTINE.getCode().equals(bill.getBillType())) { |
|
|
|
WxBillOther wxBillRent = new WxBillOther(); |
|
|
|
@@ -203,6 +269,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
wxBillRent.setStatus(status); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
} |
|
|
|
if(EnumBillRentStatus.PAID.getCode().equals(status)){ |
|
|
|
WxBillOther dbBill = wxBillOtherMapper.selectByPrimaryKey(wxBillRent.getId()); |
|
|
|
if(dbBill!=null) { |
|
|
|
wxBillRent.setPay(dbBill.getOwe()); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
addBillAction(bill.getBillId(), dbBill.getOwe()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillOtherMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
}else if(EnumBillType.OTHER_DEPOSIT.getCode().equals(bill.getBillType())) { |
|
|
|
WxBillOtherDeposit wxBillRent = new WxBillOtherDeposit(); |
|
|
|
@@ -212,6 +286,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
wxBillRent.setStatus(status); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
} |
|
|
|
if(EnumBillRentStatus.PAID.getCode().equals(status)){ |
|
|
|
WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); |
|
|
|
if(dbBill!=null) { |
|
|
|
wxBillRent.setPay(dbBill.getOwe()); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
addBillAction(bill.getBillId(), dbBill.getOwe()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
|
|
|
|
WxMerchantSubsidy wxMerchantSubsidy = new WxMerchantSubsidy(); |
|
|
|
@@ -229,6 +311,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
wxBillRent.setStatus(status); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
} |
|
|
|
if(EnumBillRentStatus.PAID.getCode().equals(status)){ |
|
|
|
WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); |
|
|
|
if(dbBill!=null) { |
|
|
|
wxBillRent.setPay(dbBill.getOwe()); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
addBillAction(bill.getBillId(), dbBill.getOwe()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillOtherDepositMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
}else{ |
|
|
|
WxBillDaily wxBillRent = new WxBillDaily(); |
|
|
|
@@ -238,6 +328,14 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { |
|
|
|
wxBillRent.setStatus(status); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
} |
|
|
|
if(EnumBillRentStatus.PAID.getCode().equals(status)){ |
|
|
|
WxBillDaily dbBill = wxBillDailyMapper.selectByPrimaryKey(wxBillRent.getId()); |
|
|
|
if(dbBill!=null) { |
|
|
|
wxBillRent.setPay(dbBill.getOwe()); |
|
|
|
wxBillRent.setPayDate(new Date()); |
|
|
|
addBillAction(bill.getBillId(), dbBill.getOwe()); |
|
|
|
} |
|
|
|
} |
|
|
|
wxBillDailyMapper.updateByPrimaryKeySelective(wxBillRent); |
|
|
|
} |
|
|
|
} |
|
|
|
|