Browse Source

项目详情返回 上报人角色集合及ID

master
jianjun 4 years ago
parent
commit
68bc5121bb
  1. 9
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java
  2. 24
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  3. 1
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

9
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java

@ -7,6 +7,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;
/**
* @description:
@ -36,6 +37,14 @@ public class ScreenProjectDetailResultDTO implements Serializable {
* 所属类别名称
*/
private String categoryName;
/**
* 上报人ID
*/
private String reportUserId;
/**
* 上报人角色列表
*/
private Set<String> reportUserRoleSet;
/**
* 上报人名
*/

24
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -10,6 +11,8 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.dto.CustomerAgencyUserRoleDTO;
import com.epmet.dto.form.CustomerAgencyUserRoleFormDTO;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.form.screen.ColorProjectTotalFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
@ -20,6 +23,7 @@ import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDT
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.project.CustomerProjectCategoryDTO;
import lombok.extern.slf4j.Slf4j;
@ -29,6 +33,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -56,6 +61,8 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
/**
* @Description 3项目详情
@ -105,6 +112,23 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
public Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO) {
List<ScreenProjectDetailResultDTO> resultDTOS = screenProjectDataDao.projectDistributionDetail(formDTO.getProjectId());
resultDTOS.forEach(item -> {
//获取联系人
if (StringUtils.isNotBlank(item.getReportUserId())){
CustomerAgencyUserRoleFormDTO userRoleFormDTO = new CustomerAgencyUserRoleFormDTO();
userRoleFormDTO.setCustomerId(formDTO.getCustomerId());
userRoleFormDTO.setStaffId(item.getReportUserId());
Result<CustomerAgencyUserRoleDTO> userRoles = userOpenFeignClient.getUserRoles(userRoleFormDTO);
if (userRoles != null && userRoles.success() && userRoles.getData() != null){
String roles = userRoles.getData().getRoles();
if (StringUtils.isNotBlank(roles)){
Map<String,String> map = JSON.parseObject(roles, HashMap.class);
item.setReportUserRoleSet(map.keySet());
}
}
}
//项目图片
List<String> imgList = screenProjectDataDao.selectProjectImgs(formDTO.getProjectId(),item.getCustomerId());
item.setImgList(imgList);

1
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml

@ -63,6 +63,7 @@
project_content AS projectContent,
project_create_time as reportTime,
ALL_CATEGORY_NAME as categoryName,
LINK_USER_ID as reportUserId,
LINK_NAME as reportUserName,
link_mobile as mobile,
project_address as reportAddress,

Loading…
Cancel
Save