| @@ -164,7 +164,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| if (record.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | if (record.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | ||||
| BigDecimal hundred = new BigDecimal(100); | BigDecimal hundred = new BigDecimal(100); | ||||
| BigDecimal revenue = new BigDecimal(record.getRevenue() == null ? 0 : record.getRevenue()).divide(hundred); | BigDecimal revenue = new BigDecimal(record.getRevenue() == null ? 0 : record.getRevenue()).divide(hundred); | ||||
| BigDecimal payRatio = new BigDecimal(record.getPayRatio() == null ? 0 : record.getPayRatio()).divide(hundred); | |||||
| BigDecimal payRatio = new BigDecimal(record.getPayRatio() == null ? 0 : record.getPayRatio()).divide(new BigDecimal(10000)); | |||||
| BigDecimal price = revenue.multiply(payRatio).setScale(2, RoundingMode.HALF_EVEN); | BigDecimal price = revenue.multiply(payRatio).setScale(2, RoundingMode.HALF_EVEN); | ||||
| record.setPrice(price.multiply(hundred).intValue()); | record.setPrice(price.multiply(hundred).intValue()); | ||||
| } | } | ||||
| @@ -134,13 +134,13 @@ | |||||
| <select id="queryRentContractEndSoonStatus" resultType="int" | <select id="queryRentContractEndSoonStatus" resultType="int" | ||||
| parameterType="com.iformall.domain.po.WxPropertyContract"> | parameterType="com.iformall.domain.po.WxPropertyContract"> | ||||
| select count(id) from wx_property_contract where tenant_id=#{tenantId} and status!=1 | |||||
| and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now() | |||||
| select count(id) from wx_property_contract where tenant_id=#{tenantId} and status=4 | |||||
| and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now() | |||||
| <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if> | <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if> | ||||
| </select> | </select> | ||||
| <select id="queryRentContractPaidStatus" resultType="int" parameterType="com.iformall.domain.po.WxPropertyContract"> | <select id="queryRentContractPaidStatus" resultType="int" parameterType="com.iformall.domain.po.WxPropertyContract"> | ||||
| select count(id) from wx_property_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 | |||||
| select count(id) from wx_property_contract where tenant_id=#{tenantId} and status in (2,3,4) | |||||
| and rental_start_date <= now() and rental_end_date >= now() | and rental_start_date <= now() and rental_end_date >= now() | ||||
| <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if> | <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if> | ||||
| </select> | </select> | ||||
| @@ -152,15 +152,15 @@ | |||||
| </select> | </select> | ||||
| <update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | <update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | ||||
| update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now() | |||||
| update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=5 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now() | |||||
| </update> | </update> | ||||
| <update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | <update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | ||||
| update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_start_date <= now() and rental_end_date >= now() | |||||
| update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=5 and status!=6 and status!=7 and rental_start_date <= now() and rental_end_date >= now() | |||||
| </update> | </update> | ||||
| <update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | <update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | ||||
| update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_end_date <now() | |||||
| update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=5 and status!=6 and status!=7 and rental_end_date <now() | |||||
| </update> | </update> | ||||
| <update id="updateRentWaitSignStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | <update id="updateRentWaitSignStatus" parameterType="com.iformall.domain.po.WxPropertyContract"> | ||||
| @@ -129,15 +129,13 @@ | |||||
| </select> | </select> | ||||
| <select id="queryRentContractEndSoonStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> | <select id="queryRentContractEndSoonStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> | ||||
| select count(id) from wx_rent_contract where tenant_id=#{tenantId} and status!=0 and status!=1 and status!=6 | |||||
| and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now() | |||||
| select count(id) from wx_rent_contract where tenant_id=#{tenantId} and status=4 | |||||
| and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now() | |||||
| <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if> | <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if> | ||||
| </select> | </select> | ||||
| <select id="queryRentContractPaidStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> | <select id="queryRentContractPaidStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> | ||||
| select count(id) from wx_rent_contract where tenant_id=#{tenantId} and status!=0 and status!=1 and status!=6 and | |||||
| status!=7 | |||||
| and rental_start_date <= now() and rental_end_date >= now() | |||||
| select count(id) from wx_rent_contract where tenant_id=#{tenantId} and status in (2,3,4) | |||||
| <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if> | <if test=" null != rentShopType ">and rent_shop_type = #{rentShopType}</if> | ||||
| </select> | </select> | ||||
| @@ -150,19 +148,19 @@ | |||||
| </select> | </select> | ||||
| <update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxRentContract"> | <update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxRentContract"> | ||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=1 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now() | |||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=5 and status!=1 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 and rental_end_date > now() | |||||
| </update> | </update> | ||||
| <update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxRentContract"> | <update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxRentContract"> | ||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=1 and status!=6 and status!=7 and rental_start_date <= now() and rental_end_date >= now() | |||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=1 and status!=5 and status!=6 and status!=7 and rental_start_date <= now() and rental_end_date >= now() | |||||
| </update> | </update> | ||||
| <update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxRentContract"> | <update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxRentContract"> | ||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=1 and status!=6 and status!=7 and rental_end_date <now() | |||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=1 and status!=5 and status!=6 and status!=7 and rental_end_date <now() | |||||
| </update> | </update> | ||||
| <update id="updateRentWaitSignStatus" parameterType="com.iformall.domain.po.WxRentContract"> | <update id="updateRentWaitSignStatus" parameterType="com.iformall.domain.po.WxRentContract"> | ||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=7 and merchant_id is null | |||||
| update wx_rent_contract set status=#{status} where tenant_id=#{tenantId} and status!=0 and status!=5 and status!=6 and status!=7 and merchant_id is null | |||||
| </update> | </update> | ||||
| <update id="updateApplyStatus" parameterType="com.iformall.domain.po.WxRentContract"> | <update id="updateApplyStatus" parameterType="com.iformall.domain.po.WxRentContract"> | ||||