|
@@ -14,11 +14,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.apache.shiro.SecurityUtils;
|
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.system.entity.SysUser;
|
|
import org.jeecg.common.system.entity.SysUser;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
-import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
import org.jeecg.modules.ctop.entity.ProjectMember;
|
|
import org.jeecg.modules.ctop.entity.ProjectMember;
|
|
import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
|
|
import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
|
|
import org.jeecg.modules.ctop.service.IAdvertiserService;
|
|
import org.jeecg.modules.ctop.service.IAdvertiserService;
|
|
@@ -212,10 +210,10 @@ public class ProjectMemberController {
|
|
|
|
|
|
|
|
|
|
@GetMapping("/projectList")
|
|
@GetMapping("/projectList")
|
|
- public Map<String, Object> projectList() {
|
|
|
|
|
|
+ public Map<String, Object> projectList(String userId) {
|
|
Map<String, Object> result = new HashMap<>();
|
|
Map<String, Object> result = new HashMap<>();
|
|
try {
|
|
try {
|
|
- String userId = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getId();
|
|
|
|
|
|
+
|
|
String roleCode = sysRoleService.getRoleCodeByUserId(userId);
|
|
String roleCode = sysRoleService.getRoleCodeByUserId(userId);
|
|
if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
|
|
if ("admin".equals(roleCode) || roleCode.contains("sale") || "meidaManager".equals(roleCode)) {
|
|
List<Project> projects = projectService.list();
|
|
List<Project> projects = projectService.list();
|
|
@@ -284,24 +282,24 @@ public class ProjectMemberController {
|
|
|
|
|
|
@GetMapping(value = "/participateListV3")
|
|
@GetMapping(value = "/participateListV3")
|
|
public Result participateListV3(ProjectMember projectMember,
|
|
public Result participateListV3(ProjectMember projectMember,
|
|
- @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
|
- @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
|
- HttpServletRequest req) {
|
|
|
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
|
+ HttpServletRequest req) {
|
|
|
|
|
|
- Result<IPage<ProjectMember>> result = this.participateListV2(projectMember,pageNo,pageSize,req);
|
|
|
|
|
|
+ Result<IPage<ProjectMember>> result = this.participateListV2(projectMember, pageNo, pageSize, req);
|
|
List<ProjectMember> resultList = new ArrayList<>();
|
|
List<ProjectMember> resultList = new ArrayList<>();
|
|
- if (result.isSuccess()){
|
|
|
|
|
|
+ if (result.isSuccess()) {
|
|
List<ProjectMember> listProject = result.getResult().getRecords();
|
|
List<ProjectMember> listProject = result.getResult().getRecords();
|
|
- if (!Check.isNull(listProject)){
|
|
|
|
- Map<String, List<ProjectMember>> groupByMedia = listProject.stream().filter(p-> (!Check.isNull(p.getMediaId()))).collect(Collectors.groupingBy(ProjectMember::getMediaId));
|
|
|
|
|
|
+ if (!Check.isNull(listProject)) {
|
|
|
|
+ Map<String, List<ProjectMember>> groupByMedia = listProject.stream().filter(p -> (!Check.isNull(p.getMediaId()))).collect(Collectors.groupingBy(ProjectMember::getMediaId));
|
|
resultList = groupByMedia.get(projectMember.getMediaId());
|
|
resultList = groupByMedia.get(projectMember.getMediaId());
|
|
- if (!Check.isNull(resultList)){
|
|
|
|
|
|
+ if (!Check.isNull(resultList)) {
|
|
resultList.stream().filter(p -> (!Check.isNull(p.getAdvertiserName()))).collect(Collectors.toList());
|
|
resultList.stream().filter(p -> (!Check.isNull(p.getAdvertiserName()))).collect(Collectors.toList());
|
|
- resultList = resultList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ProjectMember :: getAdvertiserId))), ArrayList::new));
|
|
|
|
- }
|
|
|
|
|
|
+ resultList = resultList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ProjectMember::getAdvertiserId))), ArrayList::new));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return Result.successMsg("成功。",resultList);
|
|
|
|
|
|
+ }
|
|
|
|
+ return Result.successMsg("成功。", resultList);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -512,7 +510,7 @@ public class ProjectMemberController {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@GetMapping("/getProjectAccountByUserId")
|
|
@GetMapping("/getProjectAccountByUserId")
|
|
- public Result<List<Map<String, Object>>> getProjectAccountBy(String mediaType,String userId) {
|
|
|
|
|
|
+ public Result<List<Map<String, Object>>> getProjectAccountBy(String mediaType, String userId) {
|
|
Result<List<Map<String, Object>>> resultBody = new Result<>();
|
|
Result<List<Map<String, Object>>> resultBody = new Result<>();
|
|
try {
|
|
try {
|
|
List<Map<String, Object>> result = projectMemberService.getProjectAccountByUserId(userId, mediaType);
|
|
List<Map<String, Object>> result = projectMemberService.getProjectAccountByUserId(userId, mediaType);
|