diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxAllBillMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxAllBillMapper.java index b2d9955aa..bd73ee129 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxAllBillMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxAllBillMapper.java @@ -45,7 +45,5 @@ public interface WxAllBillMapper extends CommonMapper { void deleteById(@Param("id")Long id,@Param("tenantId")String tenantId); void deleteEnergyReadingBills(@Param("energyReadingCalcuteId")Long energyReadingCalcuteId,@Param("tenantId")String tenantId); - - void updatePropertyBillInvalidStatusByRent(WxRentContract wxRentContract); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index d772da5d8..bc3977cdf 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -1552,6 +1552,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { WxPropertyContract wxPropertyContract = new WxPropertyContract(); wxRentContract.updateTenantInfo(wxRentContract); wxPropertyContract.setRentContractId(wxRentContract.getId()); + //终止有效的合同 wxPropertyContract.setStatuss(EnumRentContractStatus.getValidStatus()); wxPropertyContract.setUpdatetime(new Date()); @@ -1567,7 +1568,17 @@ public class WxRentContractServiceImpl implements WxRentContractService { wxPropertyContractMapper.endContract(wxPropertyContract); //物业账单失效 - wxAllBillMapper.updatePropertyBillInvalidStatusByRent(wxRentContract); + WxPropertyContract pq = new WxPropertyContract(); + pq.updateTenantInfo(wxRentContract); + pq.setRentContractId(wxRentContract.getId()); + List plist = wxPropertyContractMapper.findList(pq); + if (null != plist && plist.size() > 0 ) { + WxPropertyContract pc = plist.get(0); + pc.setEndContractTime(wxRentContract.getEndContractTime()); + wxBillAllHelper.propertyContractStop(pc, userInfo); + wxPropertyContractMapper.updateById(pc); + } + } //租赁账单失效 wxBillAllHelper.rentContractStop(wxRentContract,userInfo); diff --git a/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml b/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml index 1f39e93c9..26c66bb36 100644 --- a/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxAllBillMapper.xml @@ -81,30 +81,30 @@ and ( - (`starttime` <= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7,9) and bill_type not in (13,21,5)) + (`starttime` <= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5)) or - (`starttime` <= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and status not in (3,6,7,9) and bill_type in (13,21,5)) + (`starttime` <= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5)) ) and ( - (`starttime` > #{oweBillLastTime} and `starttime` <= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7,9) and bill_type not in (13,21,5)) + (`starttime` > #{oweBillLastTime} and `starttime` <= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5)) or - (`starttime` > #{oweBillLastTime} and `starttime` <= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and status not in (3,6,7,9) and bill_type in (13,21,5)) + (`starttime` > #{oweBillLastTime} and `starttime` <= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5)) ) and ( - (`starttime` <= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7,9) and bill_type not in (13,21,5)) + (`starttime` <= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5)) or - (`starttime` <= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and status not in (3,6,7,9) and bill_type in (13,21,5)) + (`starttime` <= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5)) ) and ( - ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7) and bill_type not in (13,21,5)) + ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5)) or - ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and status not in (3,6,7,9) and bill_type in (13,21,5)) + ( `receive_pay` - `pay` - IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5)) ) @@ -116,9 +116,9 @@ and ( - (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and status not in (3,6,7,9) and bill_type not in (13,21,5)) + (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') > 0 and bill_type not in (13,21,5)) or - (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') > 0 and status not in (3,6,7,9) and bill_type in (13,21,5)) + (`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') > 0 and bill_type in (13,21,5)) ) and `merchant_id` is not null @@ -289,8 +289,7 @@ - delete from wx_all_bill where status = 2 - and starttime >= #{shopEndtime} and IFNULL(`pay`,'0') <= 0 AND IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 + delete from wx_all_bill where starttime >= #{shopEndtime} and IFNULL(`pay`,'0') <= 0 AND IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 and rent_contract_id = #{rentContractId} @@ -354,14 +353,8 @@ - delete from wx_all_bill where energy_reading_calcuteId = #{energyReadingCalcuteId} and tenant_id = #{tenantId} and status = 2 and pay <= 0 and IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 + delete from wx_all_bill where energy_reading_calcuteId = #{energyReadingCalcuteId} and tenant_id = #{tenantId} and pay <= 0 and IFNULL(`set_off`,'0') <= 0 and IFNULL(`return_pay`,'0') <= 0 - - update wx_all_bill set status = 6 where property_contract_id in - (select id from wx_property_contract where rent_contract_id = #{id}) - and status != 3 - -