|
@@ -6,7 +6,6 @@ import cn.com.ctop.common.module.service.IUserAllocationService;
|
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
|
import cn.com.ctop.common.module.utils.ResultMapUtils;
|
|
|
import cn.com.ctop.common.module.utils.StatusCode;
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -96,8 +95,8 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<UserAllocation> listByMediaId(String mediaId,int accountStatus) {
|
|
|
- return userAllocationMapper.listByMediaId(mediaId,accountStatus);
|
|
|
+ public List<UserAllocation> listByMediaId(String mediaId, int accountStatus) {
|
|
|
+ return userAllocationMapper.listByMediaId(mediaId, accountStatus);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -128,11 +127,11 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
|
|
|
|
|
|
@Override
|
|
|
public List<JSONObject> getAccountIdsByUserId(String userId) {
|
|
|
- List<JSONObject> result= new ArrayList<>();
|
|
|
- if(userId.equals("e9ca23d68d884d4ebb19d07889727dae")){
|
|
|
- result=userAllocationMapper.getAllAccountIdsByMediaId("2");
|
|
|
- }else {
|
|
|
- result=userAllocationMapper.getAccountIdsByUserId(userId);
|
|
|
+ List<JSONObject> result = new ArrayList<>();
|
|
|
+ if (userId.equals("e9ca23d68d884d4ebb19d07889727dae")) {
|
|
|
+ result = userAllocationMapper.getAllAccountIdsByMediaId("2");
|
|
|
+ } else {
|
|
|
+ result = userAllocationMapper.getAccountIdsByUserId(userId);
|
|
|
|
|
|
}
|
|
|
return result;
|
|
@@ -157,4 +156,23 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
|
|
|
public List<Long> getAccountsByDeleteComment() {
|
|
|
return userAllocationMapper.queryAccountsByDeleteComment();
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<Long, List<JSONObject>> getAccountListByProjectList(List<JSONObject> projectList) {
|
|
|
+ Map<Long, List<JSONObject>> map = new HashMap<>();
|
|
|
+ List list = new ArrayList();
|
|
|
+ for (int i = 0; i < projectList.size(); i++) {
|
|
|
+ JSONObject jsonObject = projectList.get(i);
|
|
|
+ list.add(jsonObject.getLong("projectId"));
|
|
|
+ map.put(jsonObject.getLong("projectId"), new ArrayList<>());
|
|
|
+ }
|
|
|
+ List<JSONObject> jsonList = userAllocationMapper.getAccountListByProjectList(list);
|
|
|
+ for (int i = 0; i < jsonList.size(); i++) {
|
|
|
+ JSONObject jsonObject = jsonList.get(i);
|
|
|
+ Long projectId = jsonObject.getLong("projectId");
|
|
|
+ List<JSONObject> jsonObjects = map.get(projectId);
|
|
|
+ jsonObjects.add(jsonObject);
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|