| @@ -196,6 +196,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| if(record.getServiceChargePayUpdate() != null){ | if(record.getServiceChargePayUpdate() != null){ | ||||
| Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; | Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; | ||||
| wxBillDaily.setServiceChargePay(l.intValue()); | wxBillDaily.setServiceChargePay(l.intValue()); | ||||
| wxBillDaily.setOwe(wxBillDaily.getReceivePay() + wxBillDaily.getServiceChargePay() - wxBillDaily.getPay()); | |||||
| }else{ | }else{ | ||||
| Long addpay = wxBillDaily.getPay(); | Long addpay = wxBillDaily.getPay(); | ||||
| wxBillDaily.setPayDate(record.getPayDate()); | wxBillDaily.setPayDate(record.getPayDate()); | ||||
| @@ -192,6 +192,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| if(record.getServiceChargePayUpdate() != null){ | if(record.getServiceChargePayUpdate() != null){ | ||||
| Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; | Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; | ||||
| wxBillOtherDeposit.setServiceChargePay(l.intValue()); | wxBillOtherDeposit.setServiceChargePay(l.intValue()); | ||||
| wxBillOtherDeposit.setOwe(wxBillOtherDeposit.getReceivePay() + wxBillOtherDeposit.getServiceChargePay() - wxBillOtherDeposit.getPay()); | |||||
| }else{ | }else{ | ||||
| Long addpay = wxBillOtherDeposit.getPay(); | Long addpay = wxBillOtherDeposit.getPay(); | ||||
| wxBillOtherDeposit.setPayDate(record.getPayDate()); | wxBillOtherDeposit.setPayDate(record.getPayDate()); | ||||
| @@ -154,7 +154,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| } | } | ||||
| Date date = new Date(); | Date date = new Date(); | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| logger.info("新增其他账单"); | |||||
| logger.info("新增其他押金账单"); | |||||
| WxBillOther otherQuery = new WxBillOther(); | WxBillOther otherQuery = new WxBillOther(); | ||||
| otherQuery.setTenantId(record.getTenantId()); | otherQuery.setTenantId(record.getTenantId()); | ||||
| otherQuery.setMerchantId(record.getMerchantId()); | otherQuery.setMerchantId(record.getMerchantId()); | ||||
| @@ -176,10 +176,10 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| try { | try { | ||||
| wxBillOtherMapper.insert(record); | wxBillOtherMapper.insert(record); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("保存其他账单失败,e:" + e.getMessage()); | |||||
| logger.error("保存其他押金账单失败,e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | ||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "保存其他账单成功"); | |||||
| return new ResultData(Result.SUCCESS, "保存其他押金账单成功"); | |||||
| } else { | } else { | ||||
| logger.info("更新其他押金账单"); | logger.info("更新其他押金账单"); | ||||
| WxBillOther wxBillOther = wxBillOtherMapper.selectById(record.getId()); | WxBillOther wxBillOther = wxBillOtherMapper.selectById(record.getId()); | ||||
| @@ -192,6 +192,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| if(record.getServiceChargePayUpdate() != null){ | if(record.getServiceChargePayUpdate() != null){ | ||||
| Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; | Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; | ||||
| wxBillOther.setServiceChargePay(l.intValue()); | wxBillOther.setServiceChargePay(l.intValue()); | ||||
| wxBillOther.setOwe(wxBillOther.getReceivePay() + wxBillOther.getServiceChargePay() - wxBillOther.getPay()); | |||||
| }else{ | }else{ | ||||
| Long addpay = wxBillOther.getPay(); | Long addpay = wxBillOther.getPay(); | ||||
| wxBillOther.setPayDate(record.getPayDate()); | wxBillOther.setPayDate(record.getPayDate()); | ||||
| @@ -220,7 +221,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| try { | try { | ||||
| wxBillOtherMapper.updateById(wxBillOther); | wxBillOtherMapper.updateById(wxBillOther); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("更新其他账单失败,e:" + e.getMessage()); | |||||
| logger.error("更新其他押金账单失败,e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | ||||
| } | } | ||||
| //日志 | //日志 | ||||
| @@ -241,10 +242,10 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| try { | try { | ||||
| wxBillActionService.save(wxBillAction); | wxBillActionService.save(wxBillAction); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("添加其他账单行为日志,e:" + e.getMessage()); | |||||
| logger.error("添加其他押金账单行为日志,e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | ||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "更新其他账单成功"); | |||||
| return new ResultData(Result.SUCCESS, "更新其他押金账单成功"); | |||||
| } | } | ||||
| } | } | ||||
| @@ -180,6 +180,8 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| if (record.getServiceChargePayUpdate() != null) { | if (record.getServiceChargePayUpdate() != null) { | ||||
| Double l = Double.valueOf(record.getServiceChargePayUpdate()) * 100; | Double l = Double.valueOf(record.getServiceChargePayUpdate()) * 100; | ||||
| property.setServiceChargePay(l.intValue()); | property.setServiceChargePay(l.intValue()); | ||||
| long latePayPrice = property.getLatePayPrice() == null ? 0 : property.getLatePayPrice(); | |||||
| property.setOwe(property.getReceivePay() + latePayPrice + property.getServiceChargePay() - property.getPay()); | |||||
| } else { | } else { | ||||
| Long addpay = property.getPay(); | Long addpay = property.getPay(); | ||||
| property.setRevenue(record.getRevenue()); | property.setRevenue(record.getRevenue()); | ||||
| @@ -357,12 +359,13 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| @Override | @Override | ||||
| public ResultData updateLatePayMoney(WxBillProperty record, MallUserInfo user) { | public ResultData updateLatePayMoney(WxBillProperty record, MallUserInfo user) { | ||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| WxBillAction billAction = new WxBillAction(); | |||||
| WxBillProperty property = wxBillPropertyMapper.selectById(record.getId()); | |||||
| if (record.getLatePayMoneyUpdate() != null) { | if (record.getLatePayMoneyUpdate() != null) { | ||||
| record.setLatePayPrice(Long.parseLong(record.getLatePayMoneyUpdate()) * 100); | |||||
| property.setLatePayPrice(Long.parseLong(record.getLatePayMoneyUpdate()) * 100); | |||||
| property.setOwe(property.getReceivePay() + property.getLatePayPrice() + property.getServiceChargePay() - property.getPay()); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| WxBillAction billAction = new WxBillAction(); | |||||
| billAction.setId(idWorker.nextId()); | billAction.setId(idWorker.nextId()); | ||||
| billAction.setCreatetime(new Date()); | billAction.setCreatetime(new Date()); | ||||
| billAction.setUserName("系统端"); | billAction.setUserName("系统端"); | ||||
| @@ -372,7 +375,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| billAction.setUpdatetime(new Date()); | billAction.setUpdatetime(new Date()); | ||||
| wxBillActionMapper.insert(billAction); | wxBillActionMapper.insert(billAction); | ||||
| } | } | ||||
| wxBillPropertyMapper.updateById(record); | |||||
| wxBillPropertyMapper.updateById(property); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -182,6 +182,8 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| if(record.getServiceChargePayUpdate() != null){ | if(record.getServiceChargePayUpdate() != null){ | ||||
| Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; | Double l = Double.valueOf(record.getServiceChargePayUpdate())*100; | ||||
| wxBillRent.setServiceChargePay(l.intValue()); | wxBillRent.setServiceChargePay(l.intValue()); | ||||
| long latePayPrice = wxBillRent.getLatePayPrice() == null ? 0 : wxBillRent.getLatePayPrice(); | |||||
| wxBillRent.setOwe(wxBillRent.getReceivePay() + latePayPrice + wxBillRent.getServiceChargePay() - wxBillRent.getPay()); | |||||
| }else{ | }else{ | ||||
| Long addpay = wxBillRent.getPay(); | Long addpay = wxBillRent.getPay(); | ||||
| wxBillRent.setRevenue(record.getRevenue()); | wxBillRent.setRevenue(record.getRevenue()); | ||||
| @@ -468,12 +470,12 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| @Override | @Override | ||||
| public ResultData updateLatePayMoney(WxBillRent record, MallUserInfo user) { | public ResultData updateLatePayMoney(WxBillRent record, MallUserInfo user) { | ||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| WxBillAction billAction = new WxBillAction(); | |||||
| WxBillRent rent = wxBillRentMapper.selectById(record.getId()); | |||||
| if(record.getLatePayMoneyUpdate() != null) { | if(record.getLatePayMoneyUpdate() != null) { | ||||
| record.setLatePayPrice(Long.parseLong(record.getLatePayMoneyUpdate()) * 100); | |||||
| rent.setLatePayPrice(Long.parseLong(record.getLatePayMoneyUpdate()) * 100); | |||||
| rent.setOwe(rent.getReceivePay() + rent.getLatePayPrice() + rent.getServiceChargePay() - rent.getPay()); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| WxBillAction billAction = new WxBillAction(); | |||||
| billAction.setId(idWorker.nextId()); | billAction.setId(idWorker.nextId()); | ||||
| billAction.setCreatetime(new Date()); | billAction.setCreatetime(new Date()); | ||||
| billAction.setUserName("系统端"); | billAction.setUserName("系统端"); | ||||
| @@ -483,7 +485,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| billAction.setUpdatetime(new Date()); | billAction.setUpdatetime(new Date()); | ||||
| wxBillActionMapper.insert(billAction); | wxBillActionMapper.insert(billAction); | ||||
| } | } | ||||
| wxBillRentMapper.updateById(record); | |||||
| wxBillRentMapper.updateById(rent); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| } | } | ||||