| @@ -1710,7 +1710,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| @Override | @Override | ||||
| public Map<String, Object> getOweBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize) { | public Map<String, Object> getOweBillAsPage(WxBillAll record, Integer pageNum, Integer pageSize) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||||
| //WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||||
| PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxBillAllMapper.getOweBillAsPage(record)); | PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxBillAllMapper.getOweBillAsPage(record)); | ||||
| List<Map<String, Object>> list = pageInfo.getList(); | List<Map<String, Object>> list = pageInfo.getList(); | ||||
| for (Map<String, Object> map : list) { | for (Map<String, Object> map : list) { | ||||
| @@ -1722,7 +1722,7 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| //加上手续费 | //加上手续费 | ||||
| //todo:把手续费率传进sql,在sql中算,汇总到max,直接出结果 | //todo:把手续费率传进sql,在sql中算,汇总到max,直接出结果 | ||||
| map.put("totalReceivePay", subZeroAndDot(map.get("totalOwe").toString())); | |||||
| //map.put("totalReceivePay", subZeroAndDot(map.get("totalOwe").toString())); | |||||
| } | } | ||||
| pageInfo.setList(list); | pageInfo.setList(list); | ||||
| @@ -146,10 +146,10 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(WxBillDaily record, MallUserInfo user) { | public ResultData saveOrUpdate(WxBillDaily record, MallUserInfo user) { | ||||
| int receivepay = record.getReceivePay()==null?0:record.getReceivePay().intValue(); | |||||
| int receivepay = record.getRealReceivePay() == null ? 0 : record.getRealReceivePay().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) { | ||||
| @@ -170,7 +170,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setExpiredDay(0L); | record.setExpiredDay(0L); | ||||
| record.setOwe(record.getReceivePay()-record.getPay()); | |||||
| record.setOwe(record.getRealReceivePay() - record.getPay()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillDailyMapper.insert(record); | wxBillDailyMapper.insert(record); | ||||
| @@ -197,7 +197,7 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| wxBillDaily.setPay(record.getPay()); | wxBillDaily.setPay(record.getPay()); | ||||
| wxBillDaily.setReceivePay(record.getReceivePay()); | wxBillDaily.setReceivePay(record.getReceivePay()); | ||||
| wxBillDaily.setOwe(record.getRealReceivePay() - record.getPay()); | wxBillDaily.setOwe(record.getRealReceivePay() - record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | |||||
| wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); | wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode()); | ||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| Date receiveDate = wxBillDaily.getReceiveDate(); | Date receiveDate = wxBillDaily.getReceiveDate(); | ||||
| @@ -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.getReceivePay()==null?0:record.getReceivePay().intValue(); | |||||
| int receivepay = record.getRealReceivePay() == null ? 0 : record.getRealReceivePay().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.getReceivePay()-record.getPay()); | |||||
| record.setOwe(record.getRealReceivePay() - 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.getReceivePay()-record.getPay()); | |||||
| if (record.getPay().equals(record.getReceivePay())) { | |||||
| wxBillDeposit.setOwe(record.getRealReceivePay() - record.getPay()); | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | |||||
| wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | ||||
| Date receiveDate = wxBillDeposit.getReceiveDate(); | Date receiveDate = wxBillDeposit.getReceiveDate(); | ||||
| wxBillDeposit.setExpiredDay(0L); | wxBillDeposit.setExpiredDay(0L); | ||||
| @@ -141,10 +141,10 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(WxBillOtherDeposit record, MallUserInfo user) { | public ResultData saveOrUpdate(WxBillOtherDeposit record, MallUserInfo user) { | ||||
| int receivepay = record.getReceivePay()==null?0:record.getReceivePay().intValue(); | |||||
| int receivepay = record.getRealReceivePay() == null ? 0 : record.getRealReceivePay().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) { | ||||
| @@ -167,7 +167,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setExpiredDay(0L); | record.setExpiredDay(0L); | ||||
| record.setOwe(record.getReceivePay() - record.getPay()); | |||||
| record.setOwe(record.getRealReceivePay() - record.getPay()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillOtherDepositMapper.insert(record); | wxBillOtherDepositMapper.insert(record); | ||||
| @@ -193,7 +193,7 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| wxBillOtherDeposit.setPay(record.getPay()); | wxBillOtherDeposit.setPay(record.getPay()); | ||||
| wxBillOtherDeposit.setReceivePay(record.getReceivePay()); | wxBillOtherDeposit.setReceivePay(record.getReceivePay()); | ||||
| wxBillOtherDeposit.setOwe(record.getRealReceivePay() - record.getPay()); | wxBillOtherDeposit.setOwe(record.getRealReceivePay() - record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | |||||
| wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | ||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| Date receiveDate = wxBillOtherDeposit.getReceiveDate(); | Date receiveDate = wxBillOtherDeposit.getReceiveDate(); | ||||
| @@ -193,7 +193,7 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| wxBillOther.setPay(record.getPay()); | wxBillOther.setPay(record.getPay()); | ||||
| wxBillOther.setReceivePay(record.getReceivePay()); | wxBillOther.setReceivePay(record.getReceivePay()); | ||||
| wxBillOther.setOwe(record.getRealReceivePay() - record.getPay()); | wxBillOther.setOwe(record.getRealReceivePay() - record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | |||||
| wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); | wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode()); | ||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| Date receiveDate = wxBillOther.getReceiveDate(); | Date receiveDate = wxBillOther.getReceiveDate(); | ||||
| @@ -142,10 +142,10 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(WxBillProperty record, MallUserInfo user) { | public ResultData saveOrUpdate(WxBillProperty record, MallUserInfo user) { | ||||
| int receivepay = record.getReceivePay() == null ? 0 : record.getReceivePay().intValue(); | |||||
| int receivepay = record.getRealReceivePay() == 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, "实收金额不能大于实际应收金额"); | |||||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收总金额"); | |||||
| } | } | ||||
| Date date = new Date(); | Date date = new Date(); | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| @@ -154,7 +154,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| record.setCreatetime(date); | record.setCreatetime(date); | ||||
| record.setUpdatetime(date); | record.setUpdatetime(date); | ||||
| record.setOwe(record.getReceivePay() - record.getPay()); | |||||
| record.setOwe(record.getRealReceivePay() - record.getPay()); | |||||
| record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | record.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | ||||
| try { | try { | ||||
| wxBillPropertyMapper.insert(record); | wxBillPropertyMapper.insert(record); | ||||
| @@ -185,7 +185,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| property.setPay(record.getPay()); | property.setPay(record.getPay()); | ||||
| property.setReceivePay(record.getReceivePay()); | property.setReceivePay(record.getReceivePay()); | ||||
| property.setOwe(record.getRealReceivePay() - record.getPay()); | property.setOwe(record.getRealReceivePay() - record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | |||||
| property.setStatus(EnumBillRentStatus.PAID.getCode()); | property.setStatus(EnumBillRentStatus.PAID.getCode()); | ||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| Date receiveDate = property.getReceiveDate(); | Date receiveDate = property.getReceiveDate(); | ||||
| @@ -144,10 +144,10 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| @Override | @Override | ||||
| public ResultData saveOrUpdate(WxBillRent record, MallUserInfo user) { | public ResultData saveOrUpdate(WxBillRent record, MallUserInfo user) { | ||||
| int receivepay = record.getReceivePay()==null?0:record.getReceivePay().intValue(); | |||||
| int receivepay = record.getRealReceivePay() == null ? 0 : record.getRealReceivePay().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,"实收金额不能大于实际应收金额"); | |||||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收总金额"); | |||||
| } | } | ||||
| Date date = new Date(); | Date date = new Date(); | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| @@ -186,7 +186,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| wxBillRent.setPay(record.getPay()); | wxBillRent.setPay(record.getPay()); | ||||
| wxBillRent.setReceivePay(record.getReceivePay()); | wxBillRent.setReceivePay(record.getReceivePay()); | ||||
| wxBillRent.setOwe(record.getRealReceivePay() - record.getPay()); | wxBillRent.setOwe(record.getRealReceivePay() - record.getPay()); | ||||
| if (record.getPay().equals(record.getReceivePay())) { | |||||
| if (record.getPay().equals(record.getRealReceivePay())) { | |||||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | ||||
| Date payDate = record.getPayDate(); | Date payDate = record.getPayDate(); | ||||
| Date receiveDate = wxBillRent.getReceiveDate(); | Date receiveDate = wxBillRent.getReceiveDate(); | ||||