Przeglądaj źródła

场景列表平台数据隔离

lyhzzz 9 miesięcy temu
rodzic
commit
847ca84e73

+ 11 - 5
src/main/java/com/fdkankan/manage/service/impl/JyUserPlatformServiceImpl.java

@@ -6,14 +6,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fdkankan.manage.common.PageInfo;
 import com.fdkankan.manage.common.ResultCode;
 import com.fdkankan.manage.entity.JyUser;
+import com.fdkankan.manage.entity.SysUser;
+import com.fdkankan.manage.service.*;
 import com.fdkankan.manage.vo.JyUserPlatform;
 import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.mapper.IJyUserPlatformMapper;
-import com.fdkankan.manage.service.IExcelService;
-import com.fdkankan.manage.service.IJyPlatformService;
-import com.fdkankan.manage.service.IJyUserPlatformService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.manage.service.IJyUserService;
 import com.fdkankan.manage.vo.request.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -40,6 +38,8 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
     IJyPlatformService platformService;
     @Autowired
     IJyUserService jyUserService;
+    @Autowired
+    ISysUserService sysUserService;
 
 
     @Override
@@ -83,7 +83,13 @@ public class JyUserPlatformServiceImpl extends ServiceImpl<IJyUserPlatformMapper
 
     @Override
     public Object pageList(JyUserPlatformParam param) {
-        param.setPlatformId(getLoginPlatformId());
+        SysUser byId = sysUserService.getById(Long.valueOf(StpUtil.getLoginId().toString()));
+        if(byId.getRoleId() != 1L || byId.getRoleId() !=45L){
+            param.setPlatformId(getLoginPlatformId());
+        }
+        if(byId.getRoleId() == 45L){
+            param.setIsJm(1);
+        }
         Page<JyUserPlatformVo> page = this.getBaseMapper().pageList(new Page<>(param.getPageNum(),param.getPageSize()),param);
         return PageInfo.PageInfo(page);
     }

+ 2 - 0
src/main/java/com/fdkankan/manage/vo/request/JyUserPlatformParam.java

@@ -17,4 +17,6 @@ public class JyUserPlatformParam extends RequestBase{
     private String ryNo;
 
     private Integer platformId;
+
+    private Integer isJm= 0;
 }

+ 4 - 2
src/main/resources/mapper/manage/JyUserPlatformMapper.xml

@@ -4,8 +4,10 @@
 
     <select id="pageList" resultType="com.fdkankan.manage.vo.request.JyUserPlatformVo">
         select up.id,up.id_card,up.ry_nick_name as name ,up.phone,up.platform_id,up.status,up.create_time,jp.platform_address from jy_user up
-                           left join jy_platform jp on up.platform_id = jp.id
-        where up.rec_status = 'A'  and jp.rec_status = 'A' and jp.status !=0 and up.id_card != jp.id_card
+        <if test="param.isJm != null and param.isJM == 0">
+            left join jy_platform jp on up.platform_id = jp.id
+        </if>
+        where up.rec_status = 'A'
         <if test="param.name != null and param.name !=''">
             and up.ry_nick_name like concat ('%',#{param.name},'%')
         </if>