|
@@ -1,6 +1,7 @@
|
|
package cn.com.ctop.kuaishou.modules.channel.controller;
|
|
package cn.com.ctop.kuaishou.modules.channel.controller;
|
|
|
|
|
|
import cn.com.ctop.common.module.service.ISysRoleExtService;
|
|
import cn.com.ctop.common.module.service.ISysRoleExtService;
|
|
|
|
+import cn.com.ctop.common.module.service.ISysUserService;
|
|
import cn.com.ctop.common.module.utils.Check;
|
|
import cn.com.ctop.common.module.utils.Check;
|
|
import cn.com.ctop.common.module.utils.ExportExcelUtils;
|
|
import cn.com.ctop.common.module.utils.ExportExcelUtils;
|
|
import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel;
|
|
import cn.com.ctop.kuaishou.modules.channel.entity.KuaishouChannel;
|
|
@@ -63,6 +64,8 @@ public class KuaishouChannelController {
|
|
private IKuaishouChannelService kuaishouChannelService;
|
|
private IKuaishouChannelService kuaishouChannelService;
|
|
@Autowired
|
|
@Autowired
|
|
private ISysRoleExtService sysRoleService;
|
|
private ISysRoleExtService sysRoleService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ISysUserService sysUserService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询渠道号管理首页数据
|
|
* 查询渠道号管理首页数据
|
|
@@ -70,12 +73,15 @@ public class KuaishouChannelController {
|
|
@GetMapping(value = "/channelManagementHome")
|
|
@GetMapping(value = "/channelManagementHome")
|
|
public Result<Object> channelManagementHome(KuaishouChannel kuaishouChannel, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
public Result<Object> channelManagementHome(KuaishouChannel kuaishouChannel, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
try {
|
|
try {
|
|
|
|
+
|
|
String roleCode = sysRoleService.getRoleCodeByUserId(kuaishouChannel.getUserId());
|
|
String roleCode = sysRoleService.getRoleCodeByUserId(kuaishouChannel.getUserId());
|
|
- if (Check.isNull(roleCode)) {
|
|
|
|
- return Result.error("缺失 人员信息");
|
|
|
|
- }
|
|
|
|
- if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
|
|
|
|
- kuaishouChannel.setUserId(null);
|
|
|
|
|
|
+
|
|
|
|
+ if (!Check.isNull(roleCode) && ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode))) {
|
|
|
|
+ kuaishouChannel.setRids(null);
|
|
|
|
+ } else {
|
|
|
|
+ List<String> rids = new ArrayList<>();
|
|
|
|
+ sysUserService.getItsPersonnelIds(rids, kuaishouChannel.getUserId());
|
|
|
|
+ kuaishouChannel.setRids(rids);
|
|
}
|
|
}
|
|
PageHelper.startPage(pageNo, pageSize);
|
|
PageHelper.startPage(pageNo, pageSize);
|
|
return kuaishouChannelService.channelManagementHome(kuaishouChannel);
|
|
return kuaishouChannelService.channelManagementHome(kuaishouChannel);
|
|
@@ -98,8 +104,6 @@ public class KuaishouChannelController {
|
|
return kuaishouChannelService.channelNumberDetails(kuaishouChannel, pageNo, pageSize);
|
|
return kuaishouChannelService.channelNumberDetails(kuaishouChannel, pageNo, pageSize);
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
return Result.error("查询渠道号详情异常");
|
|
return Result.error("查询渠道号详情异常");
|
|
@@ -189,7 +193,7 @@ public class KuaishouChannelController {
|
|
@GetMapping(value = "/updateChannels")
|
|
@GetMapping(value = "/updateChannels")
|
|
public Result<Object> updateChannels(KuaishouChannel channel) {
|
|
public Result<Object> updateChannels(KuaishouChannel channel) {
|
|
try {
|
|
try {
|
|
- if (Check.isNull(channel.getAccountId())||Check.isNull(channel.getUserId())) {
|
|
|
|
|
|
+ if (Check.isNull(channel.getAccountId()) || Check.isNull(channel.getUserId())) {
|
|
return Result.error("缺失参数");
|
|
return Result.error("缺失参数");
|
|
}
|
|
}
|
|
return kuaishouChannelService.updateChannels(channel);
|
|
return kuaishouChannelService.updateChannels(channel);
|
|
@@ -247,9 +251,9 @@ public class KuaishouChannelController {
|
|
ids.add("hcst");//应用标记
|
|
ids.add("hcst");//应用标记
|
|
ids.add("http://test123.com.cn");//隐私政策链接
|
|
ids.add("http://test123.com.cn");//隐私政策链接
|
|
ids.add("http://test123456.com.cn");//第三方点击监测链接
|
|
ids.add("http://test123456.com.cn");//第三方点击监测链接
|
|
- ids.add(1);//是否关联单品(0否,1是)
|
|
|
|
- ids.add("剑来");//关联单品名称
|
|
|
|
- ids.add("account");//使用层级(账户:account,计划:plan,组:group)
|
|
|
|
|
|
+ ids.add(0);//是否关联单品(0否,1是)
|
|
|
|
+ ids.add("");//关联单品名称
|
|
|
|
+ ids.add("plan");//使用层级(账户:account,计划:plan,组:group)
|
|
ids.add(1);//是否循环(0否,1是)
|
|
ids.add(1);//是否循环(0否,1是)
|
|
list.add(ids);
|
|
list.add(ids);
|
|
eeu.exportExcelForAttendance(workbook, 0, "Sheet1", titles, list);
|
|
eeu.exportExcelForAttendance(workbook, 0, "Sheet1", titles, list);
|