|
@@ -2,6 +2,7 @@ package org.jeecg.modules.ctop.controller;
|
|
|
|
|
|
import cn.com.ctop.common.module.annotation.AutoLog;
|
|
|
import cn.com.ctop.common.module.constant.CtopRoleCodeConstant;
|
|
|
+import cn.com.ctop.common.module.entity.Advertiser;
|
|
|
import cn.com.ctop.common.module.entity.Project;
|
|
|
import cn.com.ctop.common.module.entity.UserAllocation;
|
|
|
import cn.com.ctop.common.module.mapper.ProjectMapper;
|
|
@@ -28,7 +29,6 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
|
-import org.jeecg.modules.ctop.entity.Advertiser;
|
|
|
import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
|
|
|
import org.jeecg.modules.ctop.service.IAdvertiserService;
|
|
|
import org.jeecg.modules.excelutil.entity.*;
|
|
@@ -116,14 +116,14 @@ public class AdvertiserController {
|
|
|
@RequestParam(name = "pageSize", defaultValue = "1000") Integer pageSize,
|
|
|
HttpServletRequest req) {
|
|
|
Result<IPage<Advertiser>> result = new Result<>();
|
|
|
- String roleCode = sysRoleService.getRoleCodeByUserId(advertiser.getUserId());
|
|
|
- String userId = advertiser.getUserId();
|
|
|
+ // String roleCode = sysRoleService.getRoleCodeByUserId(advertiser.getUserId());
|
|
|
+ /* String userId = advertiser.getUserId();
|
|
|
if (CtopRoleCodeConstant.COMMON_ROLE_CODE_ADMIN.equals(roleCode) || "kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
|
|
|
advertiser.setUserId(null);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
QueryWrapper<Advertiser> queryWrapper = QueryGenerator.initQueryWrapper(advertiser, req.getParameterMap());
|
|
|
- if ("kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
|
|
|
+ /* if ("kuaishouOperationManager".equals(roleCode) || "touTiaoOperationManager".equals(roleCode)) {
|
|
|
QueryWrapper<UserCompany> userCompanyQueryWrapper = new QueryWrapper<>();
|
|
|
userCompanyQueryWrapper.eq("user_id", userId);
|
|
|
userCompanyQueryWrapper.orderByDesc("create_time");
|
|
@@ -132,7 +132,7 @@ public class AdvertiserController {
|
|
|
if (!Check.isNull(userCompany)) {
|
|
|
queryWrapper.eq("company_id", userCompany.getCompanyId());
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
Page<Advertiser> page = new Page<>(pageNo, pageSize);
|
|
|
IPage<Advertiser> pageList = advertiserService.page(page, queryWrapper);
|
|
|
result.setSuccess(true);
|
|
@@ -201,15 +201,6 @@ public class AdvertiserController {
|
|
|
result.error500("未找到对应实体");
|
|
|
} else {
|
|
|
boolean ok = advertiserService.updateById(advertiser);
|
|
|
- QueryWrapper<Project> projectQueryWrapper = new QueryWrapper<>();
|
|
|
- projectQueryWrapper.eq("advertiser_id", advertiser.getId());
|
|
|
- Project updateProject = new Project();
|
|
|
- projectService.update(updateProject, projectQueryWrapper);
|
|
|
- QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
|
|
|
- userAllocationQueryWrapper.eq("advertiser_id", advertiser.getId());
|
|
|
- UserAllocation updateUserAllocation = new UserAllocation();
|
|
|
- updateUserAllocation.setAdvertiserName(advertiser.getName());
|
|
|
- userAllocationService.update(updateUserAllocation, userAllocationQueryWrapper);
|
|
|
if (ok) {
|
|
|
result.success("修改成功!");
|
|
|
}
|