|
@@ -24,6 +24,7 @@ import org.jeecg.modules.bytedance.common.entity.CtopOauthToken;
|
|
|
import org.jeecg.modules.bytedance.common.entity.MaterialImageInfo;
|
|
|
import org.jeecg.modules.bytedance.common.service.ICtopOauthTokenService;
|
|
|
import org.jeecg.modules.bytedance.common.service.IMaterialImageInfoService;
|
|
|
+import org.jeecg.modules.bytedance.common.service.IUserAllocationService;
|
|
|
import org.jeecg.modules.bytedance.common.utils.*;
|
|
|
import org.jeecg.modules.system.service.ISysRoleService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -63,6 +64,8 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
|
@Autowired
|
|
|
private ICtopOauthTokenService tokenService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IUserAllocationService userAllocationService;
|
|
|
|
|
|
/**
|
|
|
* 分页列表查询
|
|
@@ -82,8 +85,13 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
|
QueryWrapper<AiBytedanceAdvertiserStrategy> queryWrapper = QueryGenerator.initQueryWrapper(aiBytedanceAdvertiserStrategy, req.getParameterMap());
|
|
|
//获取用户角色code
|
|
|
String roleCode = sysRoleService.getRoleCodeByUserId(aiBytedanceAdvertiserStrategy.getLoginUserId());
|
|
|
- if(null != roleCode && !BytedanceConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)){
|
|
|
- queryWrapper.eq("user_id", aiBytedanceAdvertiserStrategy.getLoginUserId());
|
|
|
+ if (Check.isNull(roleCode)){
|
|
|
+ return Result.errorMsg("无法查询到该用户角色信息。");
|
|
|
+ }
|
|
|
+ if(!BytedanceConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode)){
|
|
|
+ //查询所有包含自己的下级
|
|
|
+ Set<String> operatorUserIds= userAllocationService.recursiveQuerySubordinate(aiBytedanceAdvertiserStrategy.getLoginUserId());
|
|
|
+ queryWrapper.in("user_id", operatorUserIds);
|
|
|
}
|
|
|
queryWrapper.orderByDesc("create_time");
|
|
|
Page<AiBytedanceAdvertiserStrategy> page = new Page<AiBytedanceAdvertiserStrategy>(pageNo, pageSize);
|