Просмотр исходного кода

[数据权限][修改][查看合同数据]

release_toaliyun_real
gongbiao 6 лет назад
Родитель
Сommit
18702eda52
5 измененных файлов: 63 добавлений и 40 удалений
  1. +11
    -0
      mallinkAdmin/src/main/java/com/iformall/log/UserDataRuleAspect.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/BaseEntity.java
  3. +3
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java
  4. +13
    -13
      mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml
  5. +34
    -27
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml

+ 11
- 0
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);
}
}

}
}



+ 2
- 0
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)){


+ 3
- 0
mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java Просмотреть файл

@@ -64,4 +64,7 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>
List<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record);

WxRentContract getByBill(WxBillRent billRent);

int getShopCountMax();

}

+ 13
- 13
mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml Просмотреть файл

@@ -143,19 +143,19 @@
<if test=" null != building and ''!= building">and b.id = #{building}</if>
<if test=" null != floor and ''!= floor">and f.id = #{floor}</if>
<if test=" null != operationType ">and `operation_type` = #{operationType}</if>
<if test="(null != floorForRule and '' != floorForRule) or (null != businessForRule and '' != 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
<if test=" null != businessForRule and '' != businessForRule ">
and m.business_id in (${businessForRule})
</if>
<if test=" null != floorForRule and '' != floorForRule ">
and s.`floor` in (${floorForRule})
</if>
)
<if test=" null != businessForRule and '' != businessForRule ">
and rc.business_id in (${businessForRule})
</if>
<if test="null != rentShopType and 1 == rentShopType and null != floorForRule and '' != floorForRule ">
and rc.`id` in
<foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")">
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}))
</foreach>
</if>
<if test="null != rentShopType and 2 == rentShopType and null != floorForRule and '' != floorForRule ">
and rc.shop_id in (select id from wx_shop where tenant_id=#{tenantId} and floor in (${floorForRule}))
</if>
</where>



+ 34
- 27
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml Просмотреть файл

@@ -171,19 +171,19 @@
<if test=" null != building and ''!= building">and b.id = #{building}</if>
<if test=" null != floor and ''!= floor">and f.id = #{floor}</if>
<if test=" null != operationType ">and `operation_type` = #{operationType}</if>
<if test="(null != floorForRule and '' != floorForRule) or (null != businessForRule and '' != 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
<if test=" null != businessForRule and '' != businessForRule ">
and m.business_id in (${businessForRule})
</if>
<if test=" null != floorForRule and '' != floorForRule ">
and s.`floor` in (${floorForRule})
</if>
)
<if test=" null != businessForRule and '' != businessForRule ">
and rc.business_id in (${businessForRule})
</if>
<if test="null != rentShopType and 1 == rentShopType and null != floorForRule and '' != floorForRule ">
and rc.`id` in
<foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")">
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}))
</foreach>
</if>
<if test="null != rentShopType and 2 == rentShopType and null != floorForRule and '' != floorForRule ">
and rc.shop_id in (select id from wx_shop where tenant_id=#{tenantId} and floor in (${floorForRule}))
</if>
</where>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
@@ -379,23 +379,25 @@
</if>
<if test=" null != status ">and rc.`status` = #{status}</if>
<if test=" null != type ">and rc.`type` = #{type}</if>
<if test=" null != rentShopType ">and rc.`rent_shop_type` = #{rentShopType}</if>
<if test=" null != rentShopType ">
and rc.`rent_shop_type` = #{rentShopType}
</if>
<if test=" null != applyStatus ">and rc.`apply_status` = #{applyStatus}</if>
<if test=" null != operationType ">and rc.`operation_type` = #{operationType}</if>
<if test=" null != businessForRule and '' != businessForRule ">
and rc.business_id in (${businessForRule})
</if>
<if test="(null != floorForRule and '' != floorForRule) or (null != businessForRule and '' != 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
<if test=" null != businessForRule and '' != businessForRule ">
and m.business_id in (${businessForRule})
</if>
<if test=" null != floorForRule and '' != floorForRule ">
and s.`floor` in (${floorForRule})
</if>
)
<if test="null != rentShopType and 1 == rentShopType and null != floorForRule and '' != floorForRule ">
and rc.`id` in
<foreach collection="tempShop" index="idx" separator=" union all " open="(" close=")">
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}))
</foreach>
</if>
<if test="null != rentShopType and 2 == rentShopType and null != floorForRule and '' != floorForRule ">
and rc.shop_id in (select id from wx_shop where tenant_id=#{tenantId} and floor in (${floorForRule}))
</if>
</where>
@@ -408,5 +410,10 @@
select rent_contract_id from wx_bill_rent id = #{id}
)
</select>
<select id="getShopCountMax" resultType="int">
select max(json_length(rent_info)) from wx_rent_contract
</select>

</mapper>


Загрузка…
Отмена
Сохранить