|
@@ -73,16 +73,22 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
|
|
|
* @return 快手达人 信息
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<KuaishouPromoter> selectKuaishouPromoterList(Long userId, String promoterId, String promoterNickName, String mediaId, String parameter, String orderBy) {
|
|
|
+ public List<KuaishouPromoter> selectKuaishouPromoterList(Long userId, String promoterId, String promoterNickName, String mediaId, String parameter, String orderBy, Long bdUserId) {
|
|
|
String roleKey = sysUserService.getRoleKeyByUserId(userId);
|
|
|
- List<Long> userList = null;
|
|
|
+ List<Long> userList = new ArrayList<>();
|
|
|
//角色:供应链管理员、招商、招商经理可以看到所有的达人信息
|
|
|
if (roleKey.contains("courtship") || "supplyChainAdmin".equals(roleKey) || "admin".equals(roleKey)) {
|
|
|
-
|
|
|
- } else if ("bdManager".equals(roleKey) || "associationManager".equals(roleKey)) {
|
|
|
+ if (!Check.isNull(bdUserId)) {
|
|
|
+ userList.add(bdUserId);
|
|
|
+ }
|
|
|
+ } else if ("bdManager".equals(roleKey) || "z".equals(roleKey)) {
|
|
|
// 渠道经理、社群经理 可以看到自己创建的以及自己部门人员的达人信息
|
|
|
- Long deptId = deptService.getDeptIdByUserId(userId);
|
|
|
- userList = deptService.getDeptUserListByDeptId(deptId);
|
|
|
+ if (!Check.isNull(bdUserId)) {
|
|
|
+ userList.add(bdUserId);
|
|
|
+ } else {
|
|
|
+ Long deptId = deptService.getDeptIdByUserId(userId);
|
|
|
+ userList = deptService.getDeptUserListByDeptId(deptId);
|
|
|
+ }
|
|
|
} else if ("bd".equals(roleKey)) {
|
|
|
// 渠道可以看到自己创建的达人信息
|
|
|
userList = Arrays.asList(userId);
|
|
@@ -111,7 +117,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
|
|
|
orderBy = "desc";
|
|
|
}
|
|
|
PageUtils.startPage();
|
|
|
- List<KuaishouPromoter> list = kuaishouPromoterMapper.selectKuaishouPromoterList(userList, promoterId, promoterNickName, mediaId, parameter, orderBy);
|
|
|
+ List<KuaishouPromoter> list = kuaishouPromoterMapper.selectKuaishouPromoterList(userList, promoterId, promoterNickName, mediaId, parameter, orderBy, bdUserId);
|
|
|
list.forEach(ent -> {
|
|
|
JSONObject follow = kuaishouPromoterMapper.getFollowUpRecordsByUserId(ent.getPromoterId(), ent.getUserId());
|
|
|
ent.setFollowUpRecord(Check.isNull(follow) ? "-" : follow.getString("txt"));
|
|
@@ -257,21 +263,21 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
|
|
|
}
|
|
|
|
|
|
// if ("2".equals(promoter.getMediaId())) {
|
|
|
- // 快手、抖音 同一达人ID 不能绑定到多个渠道角色用户上
|
|
|
- String roleKey = sysUserService.getRoleKeyByUserId(promoter.getUserId());
|
|
|
- if (roleKey.contains("bd")) {
|
|
|
- List<JSONObject> keys = kuaishouPromoterMapper.getBoundPromoterRoleKey(promoter.getPromoterId());
|
|
|
- if (Check.isNotNull(keys)) {
|
|
|
- for (JSONObject key : keys) {
|
|
|
- String rKey = key.getString("role_key");
|
|
|
- if ("bd".equals(rKey) || "bdManager".equals(rKey)) {
|
|
|
- result.put("code", 500);
|
|
|
- result.put("msg", "该达人已被其他渠道人员绑定,绑定人:" + key.getString("user_name"));
|
|
|
- return result;
|
|
|
- }
|
|
|
+ // 快手、抖音 同一达人ID 不能绑定到多个渠道角色用户上
|
|
|
+ String roleKey = sysUserService.getRoleKeyByUserId(promoter.getUserId());
|
|
|
+ if (roleKey.contains("bd")) {
|
|
|
+ List<JSONObject> keys = kuaishouPromoterMapper.getBoundPromoterRoleKey(promoter.getPromoterId());
|
|
|
+ if (Check.isNotNull(keys)) {
|
|
|
+ for (JSONObject key : keys) {
|
|
|
+ String rKey = key.getString("role_key");
|
|
|
+ if ("bd".equals(rKey) || "bdManager".equals(rKey)) {
|
|
|
+ result.put("code", 500);
|
|
|
+ result.put("msg", "该达人已被其他渠道人员绑定,绑定人:" + key.getString("user_name"));
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
// }
|
|
|
//查询 设置可绑定达人数
|
|
|
Integer count = kuaishouPromoterMapper.getUserPromotersCount(promoter.getUserId(), promoter.getMediaId());
|