|
@@ -3,12 +3,18 @@ package cn.com.ctop.common.module.service.impl;
|
|
|
import cn.com.ctop.common.module.entity.UserAllocation;
|
|
|
import cn.com.ctop.common.module.mapper.UserAllocationMapper;
|
|
|
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.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springframework.context.annotation.Primary;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @Description: 用户分配
|
|
@@ -39,4 +45,37 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
|
|
|
queryWrapper.orderByDesc("id");
|
|
|
return this.list(queryWrapper);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> getPangolinAccountListByParams(String userId, JSONObject data) {
|
|
|
+ Map<String,Object>result = new HashMap<>();
|
|
|
+ Long projectId = data.getLong("project_id");
|
|
|
+ QueryWrapper<UserAllocation>queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("media_id", CtopAdConstant.PLATFORM_TYPE_PANGOLIN);
|
|
|
+ if(null != userId&&!"".equals(userId.trim())){
|
|
|
+ queryWrapper.eq("user_id",userId);
|
|
|
+ }
|
|
|
+ if(null != projectId&&projectId != 0){
|
|
|
+ queryWrapper.eq("project_id",projectId);
|
|
|
+ }
|
|
|
+ List<UserAllocation> allocations = this.list(queryWrapper);
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
+ result.put("data",allocations);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> getPangolinProjectListByParams(String userId) {
|
|
|
+ Map<String,Object>result = new HashMap<>();
|
|
|
+ QueryWrapper<UserAllocation>queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.select("distinct project_id,project_name");
|
|
|
+ queryWrapper.eq("media_id",CtopAdConstant.PLATFORM_TYPE_PANGOLIN);
|
|
|
+ if(null != userId&&!"".equals(userId.trim())){
|
|
|
+ queryWrapper.eq("user_id",userId);
|
|
|
+ }
|
|
|
+ List<UserAllocation> allocations = this.list(queryWrapper);
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
+ result.put("data",allocations);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|