diff --git a/mallinkAdmin/src/main/java/com/iformall/log/UserDataRuleAspect.java b/mallinkAdmin/src/main/java/com/iformall/log/UserDataRuleAspect.java index f7c889c7a..971ac5e76 100644 --- a/mallinkAdmin/src/main/java/com/iformall/log/UserDataRuleAspect.java +++ b/mallinkAdmin/src/main/java/com/iformall/log/UserDataRuleAspect.java @@ -7,6 +7,7 @@ import com.iformall.annotation.UserDataRuleAnnotation; import com.iformall.domain.po.BaseEntity; import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.WxUserDataRule; +import com.iformall.mapper.WxRentContractMapper; import com.iformall.service.WxUserDataRuleService; import com.iformall.shiro.UserSession; import org.apache.commons.lang3.StringUtils; @@ -37,6 +38,9 @@ public class UserDataRuleAspect { @Autowired private WxUserDataRuleService wxUserDataRuleService; + @Autowired + private WxRentContractMapper wxRentContractMapper; + @Pointcut("@annotation(com.iformall.annotation.UserDataRuleAnnotation)") public void userDataRulePointcut() { } @@ -90,7 +94,14 @@ public class UserDataRuleAspect { BaseEntity baseEntity = (BaseEntity) args[0]; baseEntity.setFloorForRule(buildingFloor); baseEntity.setBusinessForRule(businessForRule); + String contract = "contract"; + if (StringUtils.isNotEmpty(buildingFloor) && value.contains(contract)) { + int count = wxRentContractMapper.getShopCountMax(); + String[] tempShop = new String[count]; + baseEntity.setTempShop(tempShop); + } } + } } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/BaseEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/BaseEntity.java index 2a54ec3f0..1a3e2ce7b 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/BaseEntity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/BaseEntity.java @@ -36,6 +36,8 @@ public class BaseEntity implements Serializable { @Transient protected String businessForRule; + @Transient + protected String[] tempShop; public String getSortColumns() { if(StringUtils.isBlank(sortColumn)){ diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java index d248615da..b6cbc38a0 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java @@ -64,4 +64,7 @@ public interface WxRentContractMapper extends CommonMapper List listContractVo(WxRentPropertyContractVo record); WxRentContract getByBill(WxBillRent billRent); + + int getShopCountMax(); + } diff --git a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml index 8dec54644..39ec448e1 100644 --- a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml @@ -143,19 +143,19 @@ and b.id = #{building} and f.id = #{floor} and `operation_type` = #{operationType} - - and rc.merchant_id in( - select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms - inner join wx_merchant m on ms.merchant_id = m.id - inner join wx_shop s on s.id=ms.shop_id - where m.tenant_id=#{tenantId} and s.is_del=0 - - and m.business_id in (${businessForRule}) - - - and s.`floor` in (${floorForRule}) - - ) + + and rc.business_id in (${businessForRule}) + + + and rc.`id` in + + select id from wx_rent_contract where tenant_id=#{tenantId} and + json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select + id from wx_shop where tenant_id=#{tenantId} and floor in (${floorForRule})) + + + + and rc.shop_id in (select id from wx_shop where tenant_id=#{tenantId} and floor in (${floorForRule})) diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index 04d155c0f..89fc3a452 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -171,19 +171,19 @@ and b.id = #{building} and f.id = #{floor} and `operation_type` = #{operationType} - - and rc.merchant_id in( - select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms - inner join wx_merchant m on ms.merchant_id = m.id - inner join wx_shop s on s.id=ms.shop_id - where m.tenant_id=#{tenantId} and s.is_del=0 - - and m.business_id in (${businessForRule}) - - - and s.`floor` in (${floorForRule}) - - ) + + and rc.business_id in (${businessForRule}) + + + and rc.`id` in + + select id from wx_rent_contract where tenant_id=#{tenantId} and + json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select + id from wx_shop where tenant_id=#{tenantId} and floor in (${floorForRule})) + + + + and rc.shop_id in (select id from wx_shop where tenant_id=#{tenantId} and floor in (${floorForRule})) order by ${sortColumns} @@ -379,23 +379,25 @@ and rc.`status` = #{status} and rc.`type` = #{type} - and rc.`rent_shop_type` = #{rentShopType} + + and rc.`rent_shop_type` = #{rentShopType} + and rc.`apply_status` = #{applyStatus} and rc.`operation_type` = #{operationType} + + and rc.business_id in (${businessForRule}) + - - and rc.merchant_id in( - select ms.merchant_id from (select merchant_id,shop_id from wx_merchant_shop where is_del=0) ms - inner join wx_merchant m on ms.merchant_id = m.id - inner join wx_shop s on s.id=ms.shop_id - where m.tenant_id=#{tenantId} and s.is_del=0 - - and m.business_id in (${businessForRule}) - - - and s.`floor` in (${floorForRule}) - - ) + + and rc.`id` in + + select id from wx_rent_contract where tenant_id=#{tenantId} and + json_unquote(json_extract(json_extract(rent_info,'$[*].shopId'),concat('$[',#{idx},']'))) in(select + id from wx_shop where tenant_id=#{tenantId} and floor in (${floorForRule})) + + + + and rc.shop_id in (select id from wx_shop where tenant_id=#{tenantId} and floor in (${floorForRule})) @@ -408,5 +410,10 @@ select rent_contract_id from wx_bill_rent id = #{id} ) + + +