winter пре 1 година
родитељ
комит
ac73ff35fa
3 измењених фајлова са 24 додато и 22 уклоњено
  1. +0
    -2
      mallinkService/src/main/java/com/iformall/mapper/WxAllBillMapper.java
  2. +12
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  3. +12
    -19
      mallinkService/src/main/resources/mapper/WxAllBillMapper.xml

+ 0
- 2
mallinkService/src/main/java/com/iformall/mapper/WxAllBillMapper.java Прегледај датотеку

@@ -45,7 +45,5 @@ public interface WxAllBillMapper extends CommonMapper<WxAllBill, Long> {
void deleteById(@Param("id")Long id,@Param("tenantId")String tenantId);
void deleteEnergyReadingBills(@Param("energyReadingCalcuteId")Long energyReadingCalcuteId,@Param("tenantId")String tenantId);
void updatePropertyBillInvalidStatusByRent(WxRentContract wxRentContract);

}

+ 12
- 1
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<WxPropertyContract> 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);


+ 12
- 19
mallinkService/src/main/resources/mapper/WxAllBillMapper.xml Прегледај датотеку

@@ -81,30 +81,30 @@
</if>
<if test=" null == nearBillLastTime and null != oweBillLastTime">
and (
(`starttime` &lt;= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 0 and status not in (3,6,7,9) and bill_type not in (13,21,5))
(`starttime` &lt;= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 0 and bill_type not in (13,21,5))
or
(`starttime` &lt;= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and status not in (3,6,7,9) and bill_type in (13,21,5))
(`starttime` &lt;= #{oweBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and bill_type in (13,21,5))
)
</if>
<if test=" null != nearBillLastTime and null != oweBillLastTime">
and (
(`starttime` &gt; #{oweBillLastTime} and `starttime` &lt;= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 0 and status not in (3,6,7,9) and bill_type not in (13,21,5))
(`starttime` &gt; #{oweBillLastTime} and `starttime` &lt;= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 0 and bill_type not in (13,21,5))
or
(`starttime` &gt; #{oweBillLastTime} and `starttime` &lt;= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and status not in (3,6,7,9) and bill_type in (13,21,5))
(`starttime` &gt; #{oweBillLastTime} and `starttime` &lt;= #{nearBillLastTime} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and bill_type in (13,21,5))
)
</if>
<if test=" null != needPayStartDay">
and (
(`starttime` &lt;= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 0 and status not in (3,6,7,9) and bill_type not in (13,21,5))
(`starttime` &lt;= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 0 and bill_type not in (13,21,5))
or
(`starttime` &lt;= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and status not in (3,6,7,9) and bill_type in (13,21,5))
(`starttime` &lt;= #{needPayStartDay} and `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and bill_type in (13,21,5))
)
</if>
<if test=" null != needPayNoDays">
and (
( `receive_pay` - `pay` - IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 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') &gt; 0 and bill_type not in (13,21,5))
or
( `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and status not in (3,6,7,9) and bill_type in (13,21,5))
( `receive_pay` - `pay` - IFNULL(`set_off`,'0') &gt; 0 and bill_type in (13,21,5))
)
</if>
<if test=" null != toPayMerchant">
@@ -116,9 +116,9 @@
</if>
<if test=" 1 == notifyed ">
and (
(`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') + IFNULL(`return_pay`,'0') &gt; 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') &gt; 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') &gt; 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') &gt; 0 and bill_type in (13,21,5))
)
</if>
<if test=" null != hasMerchant ">and `merchant_id` is not null</if>
@@ -289,8 +289,7 @@
</delete>
<delete id="deleteNoNeedPayBill" parameterType="com.iformall.domain.po.WxAllBill">
delete from wx_all_bill where status = 2
and starttime &gt;= #{shopEndtime} and IFNULL(`pay`,'0') &lt;= 0 AND IFNULL(`set_off`,'0') &lt;= 0 and IFNULL(`return_pay`,'0') &lt;= 0
delete from wx_all_bill where starttime &gt;= #{shopEndtime} and IFNULL(`pay`,'0') &lt;= 0 AND IFNULL(`set_off`,'0') &lt;= 0 and IFNULL(`return_pay`,'0') &lt;= 0
<if test=" null != rentContractId">
and rent_contract_id = #{rentContractId}
</if>
@@ -354,14 +353,8 @@
</delete>
<delete id = "deleteEnergyReadingBills" parameterType="HashMap">
delete from wx_all_bill where energy_reading_calcuteId = #{energyReadingCalcuteId} and tenant_id = #{tenantId} and status = 2 and pay &lt;= 0 and IFNULL(`set_off`,'0') &lt;= 0 and IFNULL(`return_pay`,'0') &lt;= 0
delete from wx_all_bill where energy_reading_calcuteId = #{energyReadingCalcuteId} and tenant_id = #{tenantId} and pay &lt;= 0 and IFNULL(`set_off`,'0') &lt;= 0 and IFNULL(`return_pay`,'0') &lt;= 0
</delete>
<update id="updatePropertyBillInvalidStatusByRent" parameterType="com.iformall.domain.po.WxRentContract">
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
</update>

</mapper>


Loading…
Откажи
Сачувај