|
@@ -20,10 +20,13 @@ import org.jeecg.modules.bytedance.advertise.vo.AdConvertQueryVo;
|
|
|
import org.jeecg.modules.bytedance.advertise.vo.AdGroupSearchVo;
|
|
|
import org.jeecg.modules.bytedance.advertise.vo.PlanSearchVo;
|
|
|
import org.jeecg.modules.bytedance.common.constant.BytedanceConstant;
|
|
|
+import org.jeecg.modules.bytedance.common.entity.BytedanceOperationLog;
|
|
|
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.service.impl.BytedanceOperationLogServiceImpl;
|
|
|
import org.jeecg.modules.bytedance.common.utils.*;
|
|
|
import org.jeecg.modules.system.service.ISysRoleService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -63,6 +66,11 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
|
@Autowired
|
|
|
private ICtopOauthTokenService tokenService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IUserAllocationService userAllocationService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private BytedanceOperationLogServiceImpl bytedanceOperationLogService;
|
|
|
|
|
|
/**
|
|
|
* 分页列表查询
|
|
@@ -82,8 +90,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);
|
|
@@ -173,6 +186,9 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //当前修改用户id -添加操作日志使用
|
|
|
+ String operationUserId = aiBytedanceAdvertiserStrategy.getUserId();
|
|
|
+
|
|
|
//不修改用户id
|
|
|
aiBytedanceAdvertiserStrategy.setUserId(null);
|
|
|
//商品卖点
|
|
@@ -199,6 +215,15 @@ public class AiBytedanceAdvertiserStrategyController {
|
|
|
return Result.errorMsg(resultBudget.getMessage());
|
|
|
}*/
|
|
|
|
|
|
+ //添加修改记录
|
|
|
+ BytedanceOperationLog bytedanceOperationLog = new BytedanceOperationLog();
|
|
|
+ bytedanceOperationLog.setOldData(aiBytedanceAdvertiserStrategyEntity.toString());
|
|
|
+ bytedanceOperationLog.setNewData(aiBytedanceAdvertiserStrategy.toString());
|
|
|
+ bytedanceOperationLog.setOperationType("头条账户配置-修改");
|
|
|
+ bytedanceOperationLog.setOperationContent("修改账户配置:"+aiBytedanceAdvertiserStrategy.getAccountId());
|
|
|
+ bytedanceOperationLog.setCreateById(operationUserId);
|
|
|
+ bytedanceOperationLog.setCreateTime(new Date());
|
|
|
+ bytedanceOperationLogService.save(bytedanceOperationLog);
|
|
|
}
|
|
|
return Result.successMsg("修改成功!", null);
|
|
|
|