| @@ -1023,15 +1023,17 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| dailyQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| WxBillDaily daily = wxBillDailyMapper.selectOne(dailyQuery); | |||
| long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); | |||
| if (daily != null && !daily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||
| if (daily.getOwe() <= pay) { | |||
| daily.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| if (daily != null) { | |||
| if (!daily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||
| if (daily.getOwe() <= pay) { | |||
| daily.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| } | |||
| daily.setPay(daily.getPay() + pay); | |||
| daily.setOwe(daily.getOwe() - pay); | |||
| daily.setPayDate(bill.getPayDate()); | |||
| daily.setReceiveDate(bill.getReceiveDate()); | |||
| wxBillDailyMapper.updateByPrimaryKey(daily); | |||
| } | |||
| daily.setPay(daily.getPay() + pay); | |||
| daily.setOwe(daily.getOwe() - pay); | |||
| daily.setPayDate(bill.getPayDate()); | |||
| daily.setReceiveDate(bill.getReceiveDate()); | |||
| wxBillDailyMapper.updateByPrimaryKey(daily); | |||
| } else { | |||
| WxMerchantShop wxMerchantShop = new WxMerchantShop(); | |||
| wxMerchantShop.setTenantId(tenantId); | |||
| @@ -1070,17 +1072,19 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| otherQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| WxBillOther other = wxBillOtherMapper.selectOne(otherQuery); | |||
| long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); | |||
| if (other != null && !other.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||
| if (other.getOwe() <= pay) { | |||
| other.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| if (other != null) { | |||
| if (!other.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||
| if (other.getOwe() <= pay) { | |||
| other.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| } | |||
| other.setName(bill.getBillAttr()); | |||
| other.setComments(bill.getBillAttr()); | |||
| other.setPay(other.getPay() + pay); | |||
| other.setOwe(other.getOwe() - pay); | |||
| other.setPayDate(bill.getPayDate()); | |||
| other.setReceiveDate(bill.getReceiveDate()); | |||
| wxBillOtherMapper.updateByPrimaryKey(other); | |||
| } | |||
| other.setName(bill.getBillAttr()); | |||
| other.setComments(bill.getBillAttr()); | |||
| other.setPay(other.getPay() + pay); | |||
| other.setOwe(other.getOwe() - pay); | |||
| other.setPayDate(bill.getPayDate()); | |||
| other.setReceiveDate(bill.getReceiveDate()); | |||
| wxBillOtherMapper.updateByPrimaryKey(other); | |||
| } else { | |||
| WxMerchantShop wxMerchantShop = new WxMerchantShop(); | |||
| wxMerchantShop.setTenantId(tenantId); | |||
| @@ -1120,15 +1124,17 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||
| otherDepositQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||
| WxBillOtherDeposit otherDeposit = wxBillOtherDepositMapper.selectOne(otherDepositQuery); | |||
| long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); | |||
| if (otherDeposit != null && !otherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||
| if (otherDeposit.getOwe() <= pay) { | |||
| otherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| if (otherDeposit != null) { | |||
| if (!otherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) { | |||
| if (otherDeposit.getOwe() <= pay) { | |||
| otherDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| } | |||
| otherDeposit.setPay(otherDeposit.getPay() + pay); | |||
| otherDeposit.setOwe(otherDeposit.getOwe() - pay); | |||
| otherDeposit.setPayDate(bill.getPayDate()); | |||
| otherDeposit.setReceiveDate(bill.getReceiveDate()); | |||
| wxBillOtherDepositMapper.updateByPrimaryKey(otherDeposit); | |||
| } | |||
| otherDeposit.setPay(otherDeposit.getPay() + pay); | |||
| otherDeposit.setOwe(otherDeposit.getOwe() - pay); | |||
| otherDeposit.setPayDate(bill.getPayDate()); | |||
| otherDeposit.setReceiveDate(bill.getReceiveDate()); | |||
| wxBillOtherDepositMapper.updateByPrimaryKey(otherDeposit); | |||
| } else { | |||
| WxMerchantShop wxMerchantShop = new WxMerchantShop(); | |||
| wxMerchantShop.setTenantId(tenantId); | |||