| @@ -126,10 +126,10 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(WxBillDeposit record, MallUserInfo user) { | public ResultData saveOrUpdate(WxBillDeposit record, MallUserInfo user) { | ||||
| int receivepay = record.getRealReceivePay() == null ? 0 : record.getRealReceivePay().intValue(); | |||||
| int receivepay = record.getReceivePay() == null ? 0 : record.getReceivePay().intValue(); | |||||
| int pay = record.getPay()==null?0:record.getPay().intValue(); | int pay = record.getPay()==null?0:record.getPay().intValue(); | ||||
| if(pay>receivepay){ | if(pay>receivepay){ | ||||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收总金额"); | |||||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收金额"); | |||||
| } | } | ||||
| Date date = new Date(); | Date date = new Date(); | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| @@ -138,7 +138,7 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setOwe(record.getRealReceivePay() - record.getPay()); | |||||
| record.setOwe(record.getReceivePay() - record.getPay()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillDepositMapper.insert(record); | wxBillDepositMapper.insert(record); | ||||
| @@ -156,8 +156,8 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| Long addpay = wxBillDeposit.getPay(); | Long addpay = wxBillDeposit.getPay(); | ||||
| wxBillDeposit.setPay(record.getPay()); | wxBillDeposit.setPay(record.getPay()); | ||||
| wxBillDeposit.setReceivePay(record.getReceivePay()); | wxBillDeposit.setReceivePay(record.getReceivePay()); | ||||
| wxBillDeposit.setOwe(record.getRealReceivePay() - record.getPay()); | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | |||||
| wxBillDeposit.setOwe(record.getReceivePay() - record.getPay()); | |||||
| if (record.getPay().equals(record.getReceivePay())) { | |||||
| wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | ||||
| Date receiveDate = wxBillDeposit.getReceiveDate(); | Date receiveDate = wxBillDeposit.getReceiveDate(); | ||||
| wxBillDeposit.setExpiredDay(0L); | wxBillDeposit.setExpiredDay(0L); | ||||