diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index 0f4370806..704f06dce 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -196,8 +196,9 @@ public class WxBillAllServiceImpl implements WxBillAllService { if(EnumBillType.SETTLE.getCode().equals(billType)){ Long id = (Long)map.get("id"); WxBillSettle settle = wxBillSettleService.getById(id,EnumFilterSettle.YES.getCode()); - BigDecimal money = new BigDecimal(settle.getBalance()).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP); - map.put("owe",money); + map.put("owe",settle.getBalance()); + settle = wxBillSettleService.getById(id,EnumFilterSettle.NO.getCode()); + map.put("receivePay",settle.getBalance()); } } PageInfo> pageInfo = new PageInfo<>(maps); @@ -209,8 +210,9 @@ public class WxBillAllServiceImpl implements WxBillAllService { if(EnumBillType.SETTLE.getCode().equals(billType)){ Long id = (Long)map.get("id"); WxBillSettle settle = wxBillSettleService.getById(id,EnumFilterSettle.YES.getCode()); - BigDecimal money = new BigDecimal(settle.getBalance()).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP); - map.put("owe",money); + map.put("owe",settle.getBalance()); + settle = wxBillSettleService.getById(id,EnumFilterSettle.NO.getCode()); + map.put("receivePay",settle.getBalance()); } } return new ResultData(maps); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java index 17ffefac5..e458926d0 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java @@ -169,6 +169,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillRent dbBill = wxBillRentMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { + if(dbBill.getPay() == null) dbBill.setPay(0l); + if(dbBill.getOwe() == null) dbBill.setOwe(0l); wxBillRent.setPay(dbBill.getPay()+ dbBill.getOwe()); wxBillRent.setPayDate(new Date()); addBillAction(bill.getBillId(), dbBill.getOwe()); @@ -186,6 +188,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillDeposit dbBill = wxBillDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { + if(dbBill.getPay() == null) dbBill.setPay(0l); + if(dbBill.getReceivePay() == null) dbBill.setReceivePay(0l); wxBillRent.setPay(dbBill.getPay()+dbBill.getReceivePay() ); //押金是ReceivePay wxBillRent.setPayDate(new Date()); if(EnumSettleBillType.R.getCode().equals(bill.getType())){ @@ -208,6 +212,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { + if(dbBill.getPay() == null) dbBill.setPay(0l); + if(dbBill.getReceivePay() == null) dbBill.setReceivePay(0l); wxBillOtherDeposit.setPay(dbBill.getPay()+ dbBill.getReceivePay()); wxBillOtherDeposit.setPayDate(new Date()); if(EnumSettleBillType.R.getCode().equals(bill.getType())){ @@ -230,6 +236,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { + if(dbBill.getPay() == null) dbBill.setPay(0l); + if(dbBill.getReceivePay() == null) dbBill.setReceivePay(0l); propertyDeposit.setPay(dbBill.getPay()+ dbBill.getReceivePay()); propertyDeposit.setPayDate(new Date()); if(EnumSettleBillType.R.getCode().equals(bill.getType())){ @@ -253,6 +261,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillProperty dbBill = wxBillPropertyMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { + if(dbBill.getPay() == null) dbBill.setPay(0l); + if(dbBill.getOwe() == null) dbBill.setOwe(0l); wxBillRent.setPay(dbBill.getPay()+dbBill.getOwe()); wxBillRent.setPayDate(new Date()); addBillAction(bill.getBillId(), dbBill.getOwe()); @@ -270,6 +280,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillPropertyDeposit dbBill = wxBillPropertyDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { + if(dbBill.getPay() == null) dbBill.setPay(0l); + if(dbBill.getReceivePay() == null) dbBill.setReceivePay(0l); propertyDeposit.setPay(dbBill.getPay()+dbBill.getReceivePay()); propertyDeposit.setPayDate(new Date()); if(EnumSettleBillType.R.getCode().equals(bill.getType())){ @@ -292,6 +304,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillOther dbBill = wxBillOtherMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { + if(dbBill.getPay() == null) dbBill.setPay(0l); + if(dbBill.getOwe() == null) dbBill.setOwe(0l); wxBillRent.setPay(dbBill.getPay()+dbBill.getOwe()); wxBillRent.setPayDate(new Date()); addBillAction(bill.getBillId(), dbBill.getOwe()); @@ -309,6 +323,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { + if(dbBill.getPay() == null) dbBill.setPay(0l); + if(dbBill.getReceivePay() == null) dbBill.setReceivePay(0l); wxBillRent.setPay(dbBill.getPay()+dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); if(EnumSettleBillType.R.getCode().equals(bill.getType())){ @@ -339,6 +355,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillOtherDeposit dbBill = wxBillOtherDepositMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { + if(dbBill.getPay() == null) dbBill.setPay(0l); + if(dbBill.getReceivePay() == null) dbBill.setReceivePay(0l); wxBillRent.setPay(dbBill.getPay()+dbBill.getReceivePay()); wxBillRent.setPayDate(new Date()); if(EnumSettleBillType.R.getCode().equals(bill.getType())){ @@ -361,6 +379,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillDaily dbBill = wxBillDailyMapper.selectByPrimaryKey(wxBillDaily.getId()); if(dbBill!=null) { + if(dbBill.getPay() == null) dbBill.setPay(0l); + if(dbBill.getOwe() == null) dbBill.setOwe(0l); wxBillDaily.setPay(dbBill.getPay()+dbBill.getOwe()); wxBillDaily.setPayDate(new Date()); addBillAction(bill.getBillId(), dbBill.getOwe()); @@ -378,6 +398,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { if(EnumBillRentStatus.PAID.getCode().equals(status)){ WxBillOther dbBill = wxBillOtherMapper.selectByPrimaryKey(wxBillRent.getId()); if(dbBill!=null) { + if(dbBill.getPay() == null) dbBill.setPay(0l); + if(dbBill.getOwe() == null) dbBill.setOwe(0l); wxBillRent.setPay(dbBill.getPay()+dbBill.getOwe()); wxBillRent.setPayDate(new Date()); addBillAction(bill.getBillId(), dbBill.getOwe()); diff --git a/mallinkService/src/main/resources/mapper/WxBillSettleBillMapper.xml b/mallinkService/src/main/resources/mapper/WxBillSettleBillMapper.xml index 40b9abb20..b68eaa467 100644 --- a/mallinkService/src/main/resources/mapper/WxBillSettleBillMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillSettleBillMapper.xml @@ -38,13 +38,6 @@ order by ${sortColumns} - -