From 763d7b1d6fa59109fdb2718cc18dbd5d85af2a9b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 12 May 2020 15:27:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E7=AE=A1=E7=90=86-=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E8=AE=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/CloseIssueFormDTO.java | 27 +++++ .../gov-issue/gov-issue-server/pom.xml | 18 +++ .../com/epmet/constant/IssueConstant.java | 38 +++++++ .../epmet/constant/UserMessageConstant.java | 25 +++++ .../controller/IssueManageController.java | 28 +++++ .../com/epmet/feign/GovOrgFeignClient.java | 13 +++ .../com/epmet/feign/MessageFeignClient.java | 15 +++ .../com/epmet/feign/ResiGroupFeignClient.java | 14 +++ .../fallback/GovOrgFeignClientFallBack.java | 8 ++ .../fallback/MessageFeignClientFallback.java | 8 ++ .../ResiGroupFeignClientFallBack.java | 9 ++ .../java/com/epmet/service/IssueService.java | 9 ++ .../epmet/service/impl/IssueServiceImpl.java | 105 ++++++++++++++++++ .../epmet/dto/result/AgencyGridResultDTO.java | 52 +++++++++ .../constant/CustomerAgencyConstant.java | 4 + .../controller/CustomerAgencyController.java | 13 +++ .../epmet/service/CustomerAgencyService.java | 9 ++ .../impl/CustomerAgencyServiceImpl.java | 37 +++++- .../topic/controller/ResiTopicController.java | 17 ++- .../topic/service/ResiTopicService.java | 8 ++ .../service/impl/ResiTopicServiceImpl.java | 6 + 21 files changed, 455 insertions(+), 8 deletions(-) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridResultDTO.java diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java new file mode 100644 index 0000000000..d633a49564 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 议题管理-关闭议题-接口入参 + * @Author sun + */ +@Data +public class CloseIssueFormDTO implements Serializable { + private static final long serialVersionUID = 4859779755214502427L; + + @NotBlank(message = "议题Id不能为空") + private String issueId; + + @NotBlank(message = "解决状态不能为空") + private String resolveType; + + @NotBlank(message = "关闭理由不能为空") + @Length(max=1000,message = "手机号不能超过1000位") + private String closeReason; +} + diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index 98fa317a75..35dc7a854b 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -60,6 +60,24 @@ feign-httpclient 10.3.0 + + com.epmet + gov-org-client + 2.0.0 + compile + + + com.epmet + resi-group-client + 2.0.0 + compile + + + com.epmet + epmet-message-client + 2.0.0 + compile + diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java index f8c36c2cac..48ed20352d 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java @@ -14,4 +14,42 @@ package com.epmet.constant; * @since 1.0.0 */ public interface IssueConstant { + /** + * 议题状态-表决中 + */ + String ISSUE_VOTING = "voting"; + /** + * 议题状态-已转项目 + */ + String ISSUE_SHIFT_PROJECT = "shift_project"; + /** + * 议题状态-已关闭 + */ + String ISSUE_CLOSED = "closed"; + /** + * 议题解决类型-已解决 + */ + String ISSUE_RESLOVED = "resloved"; + /** + * 议题解决类型-未解决 + */ + String ISSUE_UNRESLOVED = "unresloved"; + + String SELECT_EXCEPTION = "获取议题详情数据失败"; + String UPPDATE_EXCEPTION = "议题详情表数据更新失败"; + + /** + * 议题来源类型类型-话题 + */ + String ISSUE_RESI_TOPIC = "resi_topic"; + + String SELECT_TOPIC_EXCEPTION = "获取话题数据失败"; + String SAVE_MSG_EXCEPTION = "关闭议题时给用户发送消息失败"; + + /** + * 议题管理-操作人所属机构类型(机构:agency | 部门:dept | 网格:grid) + */ + String ISSUE_AGENCY = "agency"; + String ISSUE_DEPT = "dept"; + String ISSUE_GRID = "grid"; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java new file mode 100644 index 0000000000..ccbb7faa87 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java @@ -0,0 +1,25 @@ +package com.epmet.constant; + +/** + * @Description 议题管理模块消息通知 + * @Author sun + */ +public interface UserMessageConstant { + + /** + * 消息标题 + */ + String ISSUE_TITLE = "您有一条议题消息"; + + /** + * 议题关闭时,选择已解决 + */ + String ISSUE_RESLOVED_MSG = "您好,您发表的话题\"%s\"问题已解决,解决方案是:%s"; + + /** + * 议题关闭时,选择无需解决 + */ + String ISSUE_UNRESLOVED_MSG = "您好,您发表的话题\"%s\"问题无需解决,原因:%s"; + + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java index 186e2a2e3a..6ad967cdca 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java @@ -1,5 +1,16 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.CloseIssueFormDTO; +import com.epmet.service.IssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -11,5 +22,22 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("manage") public class IssueManageController { + + @Autowired + private IssueService issueService; + + /** + * @param formDTO + * @return + * @Author sun + * @Description 议题管理-关闭议题 + **/ + @PostMapping("closeissue") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_CLOSE) + public Result closeIssue(@LoginUser TokenDto tokenDTO, @RequestBody CloseIssueFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + issueService.closeIssue(formDTO); + return new Result(); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java index b8f7090437..9cd829abe4 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -1,8 +1,13 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.result.AgencyGridResultDTO; import com.epmet.feign.fallback.GovOrgFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; /** * @Description 调用gov-org服务 @@ -11,4 +16,12 @@ import org.springframework.cloud.openfeign.FeignClient; */ @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) public interface GovOrgFeignClient { + /** + * @param + * @return + * @Author sun + * @Description 根据组织Id、网格Id查询组织、网格名称 + **/ + @PostMapping("/gov/org/customergrid/getcustomergridbygridid") + Result getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/MessageFeignClient.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/MessageFeignClient.java index 0f61ebfa6b..3c994298c5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/MessageFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/MessageFeignClient.java @@ -1,8 +1,14 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.feign.fallback.MessageFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; /** * @Description 调用epmet-message服务 @@ -11,4 +17,13 @@ import org.springframework.cloud.openfeign.FeignClient; */ @FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = MessageFeignClientFallback.class) public interface MessageFeignClient { + + /** + * @param msgList + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 关闭议题给话题创建人和议题发起人发送消息 + **/ + @PostMapping(value = "message/usermessage/saveusermessagelist", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveUserMessageList(List msgList); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java index f47fd95a21..6ca577ec34 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java @@ -1,8 +1,13 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.AgencyGridResultDTO; import com.epmet.feign.fallback.ResiGroupFeignClientFallBack; +import com.epmet.resi.group.dto.topic.ResiTopicDTO; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; /** * @Description 调用resi-group服务 @@ -11,4 +16,13 @@ import org.springframework.cloud.openfeign.FeignClient; */ @FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupFeignClientFallBack.class) public interface ResiGroupFeignClient { + + /** + * @param + * @return + * @Author sun + * @Description 根据话题Id查询话题信息 + **/ + @PostMapping("/resi/group/topic/gettopicbyid/{topicId}") + Result getTopicById(@PathVariable("topicId") String topicId); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java index 5205700ec6..8aec17593a 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -1,5 +1,9 @@ package com.epmet.feign.fallback; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.AgencyGridResultDTO; import com.epmet.feign.GovOrgFeignClient; import org.springframework.stereotype.Component; @@ -9,4 +13,8 @@ import org.springframework.stereotype.Component; */ @Component public class GovOrgFeignClientFallBack implements GovOrgFeignClient { + @Override + public Result getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getagencyandgrid", agencyGridResultDTO); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java index ebd50f1adc..bb5491ea78 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java @@ -3,13 +3,21 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.feign.MessageFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * @Description 调用epmet-message服务 * @Author sun */ @Component public class MessageFeignClientFallback implements MessageFeignClient { + + @Override + public Result saveUserMessageList(List msgList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessageList", msgList); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java index dfb34c250d..6f09e42b89 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java @@ -1,6 +1,11 @@ package com.epmet.feign.fallback; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.AgencyGridResultDTO; import com.epmet.feign.ResiGroupFeignClient; +import com.epmet.resi.group.dto.topic.ResiTopicDTO; import org.springframework.stereotype.Component; /** @@ -9,4 +14,8 @@ import org.springframework.stereotype.Component; */ @Component public class ResiGroupFeignClientFallBack implements ResiGroupFeignClient { + @Override + public Result getTopicById(String topicId) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "gettopicbyid", topicId); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index 7890e150fa..ab38c329c5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.form.CloseIssueFormDTO; import com.epmet.dto.form.IssueDetailFormDTO; import com.epmet.dto.result.IssueResultDTO; import com.epmet.entity.IssueEntity; @@ -19,4 +20,12 @@ public interface IssueService extends BaseService { */ IssueResultDTO detail(IssueDetailFormDTO issueDetail); + /** + * @param formDTO + * @return + * @Author sun + * @Description 议题管理-关闭议题 + **/ + void closeIssue(CloseIssueFormDTO formDTO); + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 327d135bd8..536a12307e 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1,13 +1,34 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.IssueConstant; +import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.UserMessageConstant; import com.epmet.dao.IssueDao; +import com.epmet.dao.IssueProcessDao; +import com.epmet.dto.form.CloseIssueFormDTO; import com.epmet.dto.form.IssueDetailFormDTO; +import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.dto.result.AgencyGridResultDTO; import com.epmet.dto.result.IssueResultDTO; import com.epmet.entity.IssueEntity; +import com.epmet.entity.IssueProcessEntity; +import com.epmet.feign.GovOrgFeignClient; +import com.epmet.feign.MessageFeignClient; +import com.epmet.feign.ResiGroupFeignClient; +import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.service.IssueService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; /** * @Author zxc @@ -18,6 +39,14 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Autowired private IssueDao issueDao; + @Autowired + private GovOrgFeignClient govOrgFeignClient; + @Autowired + private IssueProcessDao issueProcessDao; + @Autowired + private ResiGroupFeignClient resiGroupFeignClient; + @Autowired + private MessageFeignClient messageFeignClient; /** * @Description 议题详情 @@ -31,4 +60,80 @@ public class IssueServiceImpl extends BaseServiceImpl imp IssueResultDTO issueResult = issueDao.issueDetail(issueDetail); return issueResult; } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 议题管理-关闭议题 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void closeIssue(CloseIssueFormDTO formDTO) { + Date date = new Date(); + //1:更新议题详情表数据 + IssueEntity entity = baseDao.selectById(formDTO.getIssueId()); + if (null == entity) { + throw new RenException(IssueConstant.SELECT_EXCEPTION); + } + entity.setIssueStatus(IssueConstant.ISSUE_CLOSED); + entity.setCloseReason(formDTO.getCloseReason()); + entity.setResolveType(formDTO.getResolveType()); + entity.setVotingDeadline(date); + entity.setClosedTime(date); + if (baseDao.updateById(entity) < NumConstant.ONE) { + throw new RenException(IssueConstant.UPPDATE_EXCEPTION); + } + //2:调用gov-org服务,查询组织网格名称 + AgencyGridResultDTO agencyGridResultDTO = new AgencyGridResultDTO(); + agencyGridResultDTO.setAgencyId(entity.getOrgId()); + agencyGridResultDTO.setGridId(entity.getGridId()); + Result resultDTO = govOrgFeignClient.getAgencyAndGrid(agencyGridResultDTO); + agencyGridResultDTO = resultDTO.getData(); + //3:议题进展记录表新增数据 + IssueProcessEntity processEntity = new IssueProcessEntity(); + processEntity.setIssueId(formDTO.getIssueId()); + processEntity.setIssueStatus(IssueConstant.ISSUE_CLOSED); + processEntity.setOrgType(IssueConstant.ISSUE_GRID); + processEntity.setOrgId(entity.getOrgId()); + processEntity.setOperationExplain(formDTO.getCloseReason()); + processEntity.setOrgName(agencyGridResultDTO.getAgencyName()+"-"+agencyGridResultDTO.getGridName()); + issueProcessDao.insert(processEntity); + //4:调用epmet-message服务,给居民端话题创建人和议题发起人发送消息 + if(!saveUserMessageList(formDTO, entity).success()){ + throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION); + } + } + /** + * @Description 关闭议题给话题创建人和议题发起人发送消息 + * @author sun + */ + private Result saveUserMessageList(CloseIssueFormDTO formDTO, IssueEntity entity){ + //1:调用resi-group查询话题创建人数据(目前议题来源只有来自话题) + Result resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); + if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { + throw new RenException(IssueConstant.SELECT_TOPIC_EXCEPTION); + } + ResiTopicDTO topicDTO = resultTopicDTO.getData(); + //2:分别给话题创建人、议题发起人发送消息 + List msgList = new ArrayList<>(); + UserMessageFormDTO msgDTO = new UserMessageFormDTO(); + msgDTO.setCustomerId(entity.getCustomerId()); + msgDTO.setGridId(entity.getGridId()); + msgDTO.setApp(AppClientConstant.APP_RESI); + msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE); + String messageContent = ""; + if (IssueConstant.ISSUE_RESLOVED.equals(formDTO.getResolveType())) { + messageContent = String.format(UserMessageConstant.ISSUE_RESLOVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason()); + } else if (IssueConstant.ISSUE_UNRESLOVED.equals(formDTO.getResolveType())) { + messageContent = String.format(UserMessageConstant.ISSUE_UNRESLOVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason()); + } + msgDTO.setMessageContent(messageContent); + msgDTO.setReadFlag(ReadFlagConstant.UN_READ); + msgDTO.setUserId(topicDTO.getCreatedBy()); + msgList.add(msgDTO); + msgDTO.setUserId(entity.getCreatedBy()); + msgList.add(msgDTO); + return messageFeignClient.saveUserMessageList(msgList); + } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridResultDTO.java new file mode 100644 index 0000000000..26fe8f9292 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridResultDTO.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 查询组织网格名称-接口返参 + * + * @author sun + */ +@Data +public class AgencyGridResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String agencyId; + /** + * 机关组织名称 + */ + private String agencyName; + /** + * 网格Id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java index 7200bca2a3..330185b612 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java @@ -34,4 +34,8 @@ public interface CustomerAgencyConstant { * 区县名称不能为空 */ String DISTRICT_EXCEPTION = "区县级机关名称不能为空"; + /** + * 组织信息查询失败 + */ + String SELECT_EXCEPTION = "根据组织ID未查询到机构组织信息"; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 9de0e27f8e..ee839de020 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -27,6 +27,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.result.AgencyGridResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.excel.CustomerAgencyExcel; import com.epmet.service.CustomerAgencyService; @@ -104,4 +105,16 @@ public class CustomerAgencyController { public Result> getStaffOrgList(@RequestBody StaffOrgFormDTO staffOrgsFormDTO) { return customerAgencyService.getStaffOrgList(staffOrgsFormDTO); } + + /** + * @param agencyGridResultDTO + * @return + * @Author sun + * @Description 根据组织Id、网格Id查询组织、网格名称 + **/ + @PostMapping("getagencyandgrid") + public Result getAgencyAndGrid(@RequestBody AgencyGridResultDTO agencyGridResultDTO) { + return new Result().ok(customerAgencyService.getAgencyAndGrid(agencyGridResultDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 62892b4576..dceb37c12e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.result.AgencyGridResultDTO; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.entity.CustomerAgencyEntity; @@ -104,4 +105,12 @@ public interface CustomerAgencyService extends BaseService * @Date 2020/4/20 21:45 **/ Result> getStaffOrgList(StaffOrgFormDTO staffOrgsFormDTO); + + /** + * @param agencyGridResultDTO + * @return + * @Author sun + * @Description 根据组织Id、网格Id查询组织、网格名称 + **/ + AgencyGridResultDTO getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 06f83a0d25..43d442b32e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -21,19 +21,22 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerAgencyConstant; +import com.epmet.constant.CustomerGridConstant; import com.epmet.dao.CustomerAgencyDao; +import com.epmet.dao.CustomerGridDao; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerDTO; -import com.epmet.dto.form.*; -import com.epmet.dto.result.*; +import com.epmet.dto.form.CustomerFormDTO; +import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.result.AgencyGridResultDTO; +import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerAgencyRedis; import com.epmet.service.CustomerAgencyService; @@ -62,6 +65,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -138,4 +143,28 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl>().ok(list); } + + /** + * @param agencyGridResultDTO + * @return + * @Author sun + * @Description 根据组织Id、网格Id查询组织、网格名称 + **/ + @Override + public AgencyGridResultDTO getAgencyAndGrid(AgencyGridResultDTO agencyGridResultDTO) { + //1:查询组织机关信息 + CustomerAgencyEntity agencyEntity = baseDao.selectById(agencyGridResultDTO.getAgencyId()); + if (null == agencyEntity) { + throw new RenException(CustomerAgencyConstant.SELECT_EXCEPTION); + } + agencyGridResultDTO.setAgencyName(agencyEntity.getOrganizationName()); + //2:查询网格信 + CustomerGridEntity gridEntity = customerGridDao.selectById(agencyGridResultDTO.getGridId()); + if (null == gridEntity) { + throw new RenException(CustomerGridConstant.SELECT_EXCEPTION); + } + agencyGridResultDTO.setGridName(gridEntity.getGridName()); + return agencyGridResultDTO; + } + } \ No newline at end of file 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 6a86db52ff..9391a4c9d6 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 @@ -5,6 +5,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.modules.topic.service.ResiTopicService; +import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.TopicInfoDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO; @@ -12,10 +13,7 @@ import com.epmet.resi.group.dto.topic.result.ResiTopicIncludeIssueDetailResultDT import com.epmet.resi.group.dto.topic.result.ResiTopicIncludeIssueInfoResultDTO; import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -199,4 +197,15 @@ public class ResiTopicController { return new Result().ok(topicService.selectDetail(topicInfo)); } + /** + * @param topicId + * @return + * @Author sun + * @Description 根据话题Id查询话题信息 + **/ + @PostMapping(value = "gettopicbyid/{topicId}") + public Result getTopicById(@PathVariable("topicId") String topicId){ + return new Result().ok(topicService.getTopicById(topicId)); + } + } 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 f7694dcf76..74cc6c3633 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 @@ -229,4 +229,12 @@ public interface ResiTopicService extends BaseService { */ TopicInfoDTO selectDetail(TopicInfoFormDTO formDTO); + /** + * @param topicId + * @return + * @Author sun + * @Description 根据话题Id查询话题信息 + **/ + ResiTopicDTO getTopicById(String topicId); + } \ No newline at end of file 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 920c6cfda4..f775c004d6 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 @@ -931,6 +931,12 @@ public class ResiTopicServiceImpl extends BaseServiceImpl