Pārlūkot izejas kodu

渠道列表增加用户ID筛选
用户列表增加用户ID筛选

marxjaw 3 mēneši atpakaļ
vecāks
revīzija
86c0ea76d6

+ 1 - 0
yt-agent/agent-service/src/main/java/com/ytpm/controller/AgentDitchController.java

@@ -31,6 +31,7 @@ public class AgentDitchController {
     @ApiOperation("获取渠道类型列表")
     @PostMapping("/list")
     public ResultTable<AgentDitchView> list(@RequestBody DitchListParam param, @ApiIgnore @AuthenticationPrincipal AgentUserInfo userInfo) {
+        param.setUserId(userInfo.getUserId());
         return agentDitchService.ditchList(param);
     }
 

+ 3 - 0
yt-agent/agent-service/src/main/java/com/ytpm/service/impl/YtAppUserServiceImpl.java

@@ -77,6 +77,9 @@ public class YtAppUserServiceImpl implements YtAppUserService {
     public ResultTable<YtAppUserListView> selectAppUserList(YtAppUserListParam param, AgentUserInfo userInfo) {
         //查询当前用户的所有应用
         List<YtApp> ytApps = appMapper.queryAll(userInfo.getUserId());
+        if(CollUtil.isEmpty(ytApps)) {
+            return ResultTable.resultTableOk(new PageInfo<>(Collections.emptyList()));
+        }
         String appIds = ytApps.stream().map(YtApp::getAppId).collect(Collectors.joining(","));
         Map<String, YtApp> appMap = ytApps.stream().collect(Collectors.toMap(YtApp::getAppId, o->o));
         param.setAppIds(appIds);

+ 1 - 0
yt-agent/agent-service/src/main/resources/mapper/AgentDitchMapper.xml

@@ -38,6 +38,7 @@
         ditch_id, ditch_name, create_time
         from yt_ditch
         <where>
+            user_id = #{userId}
             <if test="ditchName != null and ditchName != ''">
                 AND ditch_name LIKE CONCAT('%', #{ditchName}, '%')
             </if>

+ 1 - 0
yt-common/src/main/java/com/ytpm/agent/param/DitchListParam.java

@@ -14,4 +14,5 @@ import lombok.NoArgsConstructor;
 @ApiModel("渠道类型管理列表入参")
 public class DitchListParam extends PageMeta {
     private String ditchName;
+    private String userId;
 }