|
@@ -48,9 +48,9 @@ public class KuaishouMaterialReportDailyDwController {
|
|
|
@PostMapping(value = "/getProjectAccountByUserId")
|
|
|
public Map<String, Object> getProjectAccount(@RequestBody JSONObject params) {
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
- String userId = params.getString("userId");
|
|
|
+ String getUserId = params.getString("userId");
|
|
|
String type = params.getString("type");
|
|
|
- if (null == userId || "".equals(userId.trim()) || null == type || "".equals(type.trim())) {
|
|
|
+ if (null == getUserId || "".equals(getUserId.trim()) || null == type || "".equals(type.trim())) {
|
|
|
ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_PARAM_ERROR);
|
|
|
return resultMap;
|
|
|
}
|
|
@@ -63,17 +63,22 @@ public class KuaishouMaterialReportDailyDwController {
|
|
|
mediaIds.add(3);
|
|
|
}
|
|
|
//查询用户角色
|
|
|
+ String userId = getUserId;
|
|
|
String roleCode = sysRoleMapper.getRoleCodeByUserId(userId);
|
|
|
//角色为 管理员 || 销售 || 媒介 查询全部
|
|
|
if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
|
|
|
userId = null;
|
|
|
}
|
|
|
+ String operatorId = null;
|
|
|
+ if ("operator".equals(roleCode) || roleCode.contains("operationAssistant")) {
|
|
|
+ operatorId = getUserId;
|
|
|
+ }
|
|
|
//查询项目信息以及广告主
|
|
|
List<JSONObject> projectList = projectMemberService.getProjectByUserIdAndMediaIds(userId, mediaIds);
|
|
|
List<JSONObject> haveList = new ArrayList<>();
|
|
|
if (!Check.isNull(projectList)) {
|
|
|
//项目id 查询账户人员信息
|
|
|
- Map<Long, List<JSONObject>> accountMap = userAllocationService.getAccountListByProjectList(projectList);
|
|
|
+ Map<Long, List<JSONObject>> accountMap = userAllocationService.getAccountListByProjectList(projectList,operatorId);
|
|
|
for (int i = 0; i < projectList.size(); i++) {
|
|
|
JSONObject project = projectList.get(i);
|
|
|
if (!Check.isNull(project)) {
|