diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java index df2f60b2f2..f00079315d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java @@ -2,7 +2,6 @@ package com.epmet.project.dto.result; import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO; import lombok.Data; -import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.ArrayList; @@ -51,11 +50,17 @@ public class ProjectDetailResultDTO implements Serializable { */ private List departmentList; + /** + * 话题内容add at 21.03.01 + */ + private String topicContent; + public ProjectDetailResultDTO() { this.eventTitle = ""; this.eventContent = ""; this.eventSource = ""; this.imgUrlList = new ArrayList<>(); this.processList = new ArrayList<>(); + this.topicContent=""; } } diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 4d702728f5..8cb39e2c6b 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -88,6 +88,12 @@ epmet-commons-dynamic-datasource 2.0.0 + + com.epmet + resi-group-client + 2.0.0 + compile + diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java index 6b37fd0ccd..c295821788 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java @@ -26,8 +26,11 @@ import com.epmet.project.dto.form.DifficultyRankFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.result.ProjectDetailResultDTO; import com.epmet.project.dto.result.*; +import com.epmet.resi.group.dto.topic.ResiTopicDTO; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -58,7 +61,8 @@ public class ProjectServiceImpl implements ProjectService { @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; - + @Autowired + private ResiGroupOpenFeignClient resiGroupOpenFeignClient; /** * @Author sun * @Description 数据-项目-获取汇总数据 @@ -223,6 +227,13 @@ public class ProjectServiceImpl implements ProjectService { List departmentNameListResultDTOS = ConvertUtils.sourceToTarget(data.getDepartmentList(), DepartmentNameListResultDTO.class); projectDetailResultDTO.setDepartmentList(departmentNameListResultDTOS); projectDetailResultDTO.setDepartmentNameList(data.getDepartmentNameList()); + //返回话题内容 + if(result.success()&&null!=result.getData()){ + Result topicResult = resiGroupOpenFeignClient.queryTopicInfoByIssueId(result.getData().getIssueId()); + if (topicResult.success() && null != topicResult.getData() && StringUtils.isNotBlank(topicResult.getData().getTopicContent())) { + projectDetailResultDTO.setTopicContent(topicResult.getData().getTopicContent()); + } + } return projectDetailResultDTO; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 0d93d8888b..77e03507f8 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -10,12 +10,14 @@ import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; import com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; +import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.*; import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -193,4 +195,7 @@ public interface ResiGroupOpenFeignClient { @PostMapping("resi/group/topic/sendevent") Result sendEvent(@RequestBody TopicEventFormDTO param); + + @PostMapping("resi/group/topic/querytopicinfobyissue/{issueId}") + Result queryTopicInfoByIssueId(@PathVariable("issueId")String issueId); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index 3b0a14800e..8d19545c5a 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -1,7 +1,6 @@ package com.epmet.resi.group.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.group.dto.group.form.*; @@ -13,6 +12,7 @@ import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; +import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.group.dto.topic.result.MyPartIssueResultDTO; @@ -138,4 +138,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "sendEvent",param); } + + @Override + public Result queryTopicInfoByIssueId(String issueId) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "queryTopicInfoByIssueId", issueId); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index a104d2a7f4..3c9e24c98f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -1,6 +1,5 @@ package com.epmet.modules.topic.controller; -import com.baomidou.mybatisplus.extension.api.R; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.epmet.commons.tools.annotation.LoginUser; @@ -16,6 +15,7 @@ import com.epmet.resi.group.dto.topic.TopicInfoDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.*; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; @@ -434,4 +434,11 @@ public class ResiTopicController { return new Result(); } + @PostMapping("querytopicinfobyissueid/{issueId}") + public Result queryTopicInfoByIssueId(@PathVariable("issueId") String issueId) { + if (StringUtils.isNotBlank(issueId)) { + return new Result().ok(topicService.queryTopicInfoByIssueId(issueId)); + } + return new Result<>(); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java index 567bde67cd..ebbab2046a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java @@ -210,4 +210,6 @@ public interface ResiTopicDao extends BaseDao { * @date 2020/12/23 下午2:25 */ String selectCustomerIdByTopicId(@Param("topicId")String topicId); + + ResiTopicDTO selectByIssueId(@Param("issueId") String issueId); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index 32a3389ccb..bd0ee09762 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -351,4 +351,15 @@ public interface ResiTopicService extends BaseService { * @Date 2020/12/31 10:28 */ void sendWxmpUpdateSubscribe(TokenDto tokenDto, String id, String type); + + /** + * @Description 根据事件枚举发送积分事件 + * @param param + * @return void + * @author wangc + * @date 2021.01.04 16:41 + */ + void sendTopicPointEventByEventType(TopicEventFormDTO param); + + ResiTopicDTO queryTopicInfoByIssueId(String issueId); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 928098a9be..19268d3411 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -2176,6 +2176,66 @@ public class ResiTopicServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>(); + //话题被转为项目 话题作者 + + BasePointEventMsg pointEventMsg = new BasePointEventMsg(); + pointEventMsg.setCustomerId(group.getCustomerId()); + pointEventMsg.setUserId(topic.getCreatedBy()); + pointEventMsg.setActionFlag(MqConstant.PLUS); + pointEventMsg.setIsCommon(false); + pointEventMsg.setEventTag(EventEnum.TOPIC_SHIFTED_TO_PROJECT.getEventTag()); + //某某小组中发布的话题“某某某…” (前十个字后面省略号) 被转为议题 + String content = CharMatcher.WHITESPACE.trimFrom(topic.getTopicContent()); + pointEventMsg.setRemark(new StringBuilder(group.getGroupName()).append("小组中发布的") + .append( + StringUtils.isBlank(content) || + StringUtils.equals("语音话题",content) ? "语音话题" : + "话题\"" + + content + .substring(NumConstant.ZERO,content.length() < NumConstant.TEN ? content.length() : NumConstant.TEN) + + (NumConstant.TEN > content.length() ? "\"" : "…\"") + ).append("被转为项目").toString()); + pointEventMsgList.add(pointEventMsg); + mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); + if(!SendMqMsgUtils.sendMsg(mqBaseMsgDTO).success()){ + log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param)); + } + } + } + + @Override + public ResiTopicDTO queryTopicInfoByIssueId(String issueId) { + return baseDao.selectByIssueId(issueId); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index b06e35bcf6..c43610feb9 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -571,5 +571,10 @@ AND t.ID = #{topicId} +