From 68bc5121bb328a103554d6be1780b60eb7df3b07 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 15 Jun 2021 17:27:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=A6=E6=83=85=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=20=E4=B8=8A=E6=8A=A5=E4=BA=BA=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E9=9B=86=E5=90=88=E5=8F=8AID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/ScreenProjectDetailResultDTO.java | 9 +++++++ .../screen/impl/ScreenProjectServiceImpl.java | 24 +++++++++++++++++++ .../mapper/screen/ScreenProjectDataDao.xml | 1 + 3 files changed, 34 insertions(+) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java index d1fa2f824b..1c7391dd93 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java +++ b/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 reportUserRoleSet; /** * 上报人名 */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index 4bf518855a..74b013b653 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java +++ b/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 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 userRoles = userOpenFeignClient.getUserRoles(userRoleFormDTO); + if (userRoles != null && userRoles.success() && userRoles.getData() != null){ + String roles = userRoles.getData().getRoles(); + + if (StringUtils.isNotBlank(roles)){ + Map map = JSON.parseObject(roles, HashMap.class); + item.setReportUserRoleSet(map.keySet()); + } + } + } + //项目图片 List imgList = screenProjectDataDao.selectProjectImgs(formDTO.getProjectId(),item.getCustomerId()); item.setImgList(imgList); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index 3ed76af34c..0f0cb8c58c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/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,