diff --git a/esua-epdc/doc/db/dev_1010/esua_epdc_events.sql b/esua-epdc/doc/db/dev_1010/esua_epdc_events.sql
index 69182f922..c2c823286 100644
--- a/esua-epdc/doc/db/dev_1010/esua_epdc_events.sql
+++ b/esua-epdc/doc/db/dev_1010/esua_epdc_events.sql
@@ -11,4 +11,11 @@ ALTER TABLE epdc_item ADD GROUP_ID varchar(32) NULL COMMENT '社群ID';
ALTER TABLE epdc_events ADD GROUP_NAME varchar(128) NULL COMMENT '社群名称';
ALTER TABLE epdc_issue ADD GROUP_NAME varchar(128) NULL COMMENT '社群名称';
ALTER TABLE epdc_item ADD GROUP_NAME varchar(128) NULL COMMENT '社群名称';
-------------------------------------------2019-11-08-----------------------------------------------
\ No newline at end of file
+------------------------------------------2019-11-08-----------------------------------------------
+
+------------------------------------------2019-11-11-----------------------------------------------
+-- 增加话题ID字段
+ALTER TABLE epdc_events ADD TOPIC_ID varchar(32) NULL COMMENT '话题ID';
+ALTER TABLE epdc_issue ADD TOPIC_ID varchar(32) NULL COMMENT '话题ID';
+ALTER TABLE epdc_item ADD TOPIC_ID varchar(32) NULL COMMENT '话题ID';
+------------------------------------------2019-11-11-----------------------------------------------
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml
index 0fee0b718..fb435817c 100644
--- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml
@@ -33,6 +33,11 @@
epdc-websocket-client
1.0.0
+
+ com.esua.epdc
+ epdc-group-client
+ 1.0.0
+
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueDTO.java
index 839f141b3..63ef376fe 100644
--- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueDTO.java
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/issue/IssueDTO.java
@@ -173,4 +173,9 @@ public class IssueDTO implements Serializable {
*/
private String groupName;
+ /**
+ * 话题ID
+ */
+ private String topicId;
+
}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemDTO.java
index 01dd12909..f6d452fad 100755
--- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemDTO.java
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/ItemDTO.java
@@ -190,4 +190,9 @@ public class ItemDTO implements Serializable {
*/
private Date lastHandleTime;
+ /**
+ * 话题ID
+ */
+ private String topicId;
+
}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/entity/EpdcEventsEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/entity/EpdcEventsEntity.java
index 94dd4c87d..2453b2ddc 100644
--- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/entity/EpdcEventsEntity.java
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/entity/EpdcEventsEntity.java
@@ -149,4 +149,9 @@ public class EpdcEventsEntity extends BaseEpdcEntity {
*/
private String groupName;
+ /**
+ * 话题ID
+ */
+ private String topicId;
+
}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java
index 37f2600a6..a584e6889 100644
--- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java
@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
+import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
@@ -33,11 +34,13 @@ import com.elink.esua.epdc.constant.ImageConstant;
import com.elink.esua.epdc.constants.MenuCodeConstant;
import com.elink.esua.epdc.dto.MenuNoticeDTO;
import com.elink.esua.epdc.dto.SysDeptDTO;
+import com.elink.esua.epdc.dto.enums.TopicStateEnum;
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO;
import com.elink.esua.epdc.dto.events.*;
import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO;
import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO;
import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO;
+import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO;
import com.elink.esua.epdc.modules.async.DeptRespondTask;
import com.elink.esua.epdc.modules.async.NewsTask;
import com.elink.esua.epdc.modules.events.dao.EpdcEventsDao;
@@ -45,6 +48,7 @@ import com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity;
import com.elink.esua.epdc.modules.events.service.EpdcEventsService;
import com.elink.esua.epdc.modules.events.service.ImgService;
import com.elink.esua.epdc.modules.feign.AdminFeignClient;
+import com.elink.esua.epdc.modules.feign.GroupFeignClient;
import com.elink.esua.epdc.modules.issue.entity.IssueEntity;
import com.elink.esua.epdc.modules.issue.entity.IssueHandleEntity;
import com.elink.esua.epdc.modules.issue.service.IssueHandleService;
@@ -90,6 +94,9 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl listOfPendingReviewEvents(Map params) {
IPage page = getPage(params);
@@ -202,18 +209,41 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl listOfRejectEvents(Map params) {
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/GroupFeignClient.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/GroupFeignClient.java
new file mode 100644
index 000000000..9d1fa4c4e
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/GroupFeignClient.java
@@ -0,0 +1,46 @@
+package com.elink.esua.epdc.modules.feign;
+
+import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
+import com.elink.esua.epdc.commons.tools.utils.Result;
+import com.elink.esua.epdc.dto.topic.TopicDTO;
+import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO;
+import com.elink.esua.epdc.modules.feign.fallback.GroupFeignClientFallback;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.PostMapping;
+
+/**
+ *
+ * 社群模块调用
+ *
+ * @Author:liuchuang
+ * @Date:2019/11/11 10:31
+ */
+@FeignClient(name = ServiceConstant.EPDC_GROUP_SERVER, fallback = GroupFeignClientFallback.class)
+public interface GroupFeignClient {
+
+ /**
+ *
+ * 话题转议题审核回调
+ *
+ * @params [formDto]
+ * @return com.elink.esua.epdc.commons.tools.utils.Result
+ * @author liuchuang
+ * @since 2019/11/11 10:36
+ */
+ @PostMapping(value = "group/topic/reviewCallback", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
+ Result reviewCallback(TopicReviewFormDTO formDto);
+
+ /**
+ *
+ * 更新话题状态
+ *
+ * @params [formDto]
+ * @return com.elink.esua.epdc.commons.tools.utils.Result
+ * @author liuchuang
+ * @since 2019/11/11 13:31
+ */
+ @PostMapping(value = "group/topic/modifyState", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
+ Result modifyTopicState(TopicDTO formDto);
+
+}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/GroupFeignClientFallback.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/GroupFeignClientFallback.java
new file mode 100644
index 000000000..0d85f29e6
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/GroupFeignClientFallback.java
@@ -0,0 +1,27 @@
+package com.elink.esua.epdc.modules.feign.fallback;
+
+import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
+import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
+import com.elink.esua.epdc.commons.tools.utils.Result;
+import com.elink.esua.epdc.dto.topic.TopicDTO;
+import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO;
+import com.elink.esua.epdc.modules.feign.GroupFeignClient;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Author:liuchuang
+ * @Date:2019/11/11 10:31
+ */
+@Component
+public class GroupFeignClientFallback implements GroupFeignClient {
+
+ @Override
+ public Result reviewCallback(TopicReviewFormDTO formDto) {
+ return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "reviewCallback", formDto);
+ }
+
+ @Override
+ public Result modifyTopicState(TopicDTO formDto) {
+ return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "modifyTopicState", formDto);
+ }
+}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/entity/IssueEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/entity/IssueEntity.java
index 2ac9471a7..6385c71d3 100644
--- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/entity/IssueEntity.java
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/entity/IssueEntity.java
@@ -154,4 +154,9 @@ public class IssueEntity extends BaseEpdcEntity {
*/
private String groupName;
+ /**
+ * 话题ID
+ */
+ private String topicId;
+
}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java
index 38aa80822..6a41766b9 100644
--- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java
@@ -33,16 +33,19 @@ import com.elink.esua.epdc.constant.EventIssueItemState;
import com.elink.esua.epdc.constant.EventsNoticeConstant;
import com.elink.esua.epdc.constants.MenuCodeConstant;
import com.elink.esua.epdc.dto.MenuNoticeDTO;
+import com.elink.esua.epdc.dto.enums.TopicStateEnum;
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO;
import com.elink.esua.epdc.dto.events.EpdcEventsCommentsDTO;
import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO;
import com.elink.esua.epdc.dto.issue.*;
import com.elink.esua.epdc.dto.issue.form.*;
import com.elink.esua.epdc.dto.issue.result.*;
+import com.elink.esua.epdc.dto.topic.TopicDTO;
import com.elink.esua.epdc.modules.async.DeptRespondTask;
import com.elink.esua.epdc.modules.async.NewsTask;
import com.elink.esua.epdc.modules.comment.service.EventCommentService;
import com.elink.esua.epdc.modules.events.service.EpdcEventsService;
+import com.elink.esua.epdc.modules.feign.GroupFeignClient;
import com.elink.esua.epdc.modules.issue.dao.IssueDao;
import com.elink.esua.epdc.modules.issue.entity.IssueEntity;
import com.elink.esua.epdc.modules.issue.entity.IssueHandleEntity;
@@ -97,6 +100,9 @@ public class IssueServiceImpl extends BaseServiceImpl imp
@Autowired
private DeptRespondTask deptRespondTask;
+ @Autowired
+ private GroupFeignClient groupFeignClient;
+
@Override
public PageData listOfIssues(Map params) {
@@ -213,6 +219,14 @@ public class IssueServiceImpl extends BaseServiceImpl imp
informationFormDTO.setBusinessId(itemEntity.getId());
+ // 事件来源-友邻社群
+ if (StringUtils.isNotEmpty(entity.getGroupId())) {
+ // 更新话题状态
+ TopicDTO formDto = new TopicDTO();
+ formDto.setId(entity.getTopicId());
+ formDto.setState(TopicStateEnum.TOPIC_STATE_CHANGED_ITEM.getValue());
+ groupFeignClient.modifyTopicState(formDto);
+ }
// 发送菜单消息-待处理项目
itemService.sendItemHandleMenuNotice(itemEntity.getGridId(), null);
}
diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEntity.java
index 7da97889a..cddd19fe9 100755
--- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEntity.java
+++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEntity.java
@@ -171,9 +171,15 @@ public class ItemEntity extends BaseEpdcEntity {
* 社群名称
*/
private String groupName;
+
/**
* 最后一次处理时间
*/
private Date lastHandleTime;
+ /**
+ * 话题ID
+ */
+ private String topicId;
+
}
diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java
index 9d7baf898..049fec953 100644
--- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java
+++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java
@@ -69,6 +69,26 @@ public interface GroupNoticeConstant {
*/
String NOTICE_GROUP_TOPIC_CLOSED = "话题关闭";
+ /**
+ * 转议题-不通过
+ */
+ String NOTICE_TOPIC_TO_ISSUE_NOT_PASS = "转议题【审核不通过】";
+
+ /**
+ * 转议题-通过
+ */
+ String NOTICE_TOPIC_TO_ISSUE_PASS = "转议题【审核通过】";
+
+ /**
+ * 转议题-通过-内容-群主
+ */
+ String NOTICE_TOPIC_TO_ISSUE_PASS_LORD_CONTENT = "您转报的话题已经审核通过并成为议题,可在“党群议事”查看。";
+
+ /**
+ * 转议题-通过-内容-发布话题用户
+ */
+ String NOTICE_TOPIC_TO_ISSUE_PASS_TOPIC_USER_CONTENT = "您的话题已经审核通过并成为议题,可在 党群议事查看。";
+
/**
* 我的消息类型:0审核通知
*/
@@ -128,4 +148,14 @@ public interface GroupNoticeConstant {
* 话题关闭
*/
String NOTICE_BUSINESS_TYPE_GROUP_TOPIC_CLOSED = "groupTopicClosed";
+
+ /**
+ * 话题转议题通过
+ */
+ String NOTICE_BUSINESS_TYPE_TOPIC_TO_ISSUE_PASSED = "topicToIssuePass";
+
+ /**
+ * 话题转议题不通过
+ */
+ String NOTICE_BUSINESS_TYPE_TOPIC_TO_ISSUE_NOT_PASSED = "topicToIssueNotPassed ";
}
diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java
index f40debda7..865111522 100644
--- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java
+++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java
@@ -145,7 +145,7 @@ public class TopicDTO implements Serializable {
private String groupId;
/**
- * 状态 0:讨论中,5:转议题待审核,10:转议题审核不通过,15:已转议题,20:已转项目,25:已关闭
+ * 状态 0:讨论中,5:转议题待审核,10:已转议题,15:已转项目,20:已关闭
*/
private Integer state;
diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicReviewFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicReviewFormDTO.java
new file mode 100644
index 000000000..da77c377f
--- /dev/null
+++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicReviewFormDTO.java
@@ -0,0 +1,32 @@
+package com.elink.esua.epdc.dto.topic.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *
+ * 话题转议题审核
+ *
+ * @Author:liuchuang
+ * @Date:2019/11/11 10:21
+ */
+@Data
+public class TopicReviewFormDTO implements Serializable {
+ private static final long serialVersionUID = 6918129886991865847L;
+
+ /**
+ * 话题ID
+ */
+ private String topicId;
+
+ /**
+ * 处理意见
+ */
+ private String processingOpinions;
+
+ /**
+ * 状态 0:讨论中,10:已转议题
+ */
+ private Integer state;
+}
diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java
index 87ff1ce7c..bdcf2fb91 100644
--- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java
+++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java
@@ -28,6 +28,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.topic.TopicDTO;
import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO;
+import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO;
import com.elink.esua.epdc.modules.topic.excel.TopicExcel;
import com.elink.esua.epdc.modules.topic.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -108,4 +109,33 @@ public class TopicController {
return topicService.modifyTopicState(formDto, NumConstant.ONE_STR);
}
+ /**
+ *
+ * 话题转议题回调
+ *
+ * @params [formDto]
+ * @return com.elink.esua.epdc.commons.tools.utils.Result
+ * @author liuchuang
+ * @since 2019/11/11 10:48
+ */
+ @PostMapping("reviewCallback")
+ public Result reviewCallback(@RequestBody TopicReviewFormDTO formDto) {
+ return topicService.reviewCallback(formDto);
+ }
+
+ /**
+ *
+ * 更新话题状态
+ *
+ * @params [formDto]
+ * @return com.elink.esua.epdc.commons.tools.utils.Result
+ * @author liuchuang
+ * @since 2019/11/11 13:37
+ */
+ @PostMapping("modifyState")
+ public Result modifyState(@RequestBody TopicDTO formDto) {
+ topicService.update(formDto);
+ return new Result();
+ }
+
}
\ No newline at end of file
diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java
index 098dc3478..89fdd7a63 100644
--- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java
+++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java
@@ -25,6 +25,7 @@ import com.elink.esua.epdc.dto.topic.TopicDTO;
import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO;
import com.elink.esua.epdc.dto.topic.TopicListDTO;
import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO;
+import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO;
import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO;
import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO;
@@ -163,4 +164,15 @@ public interface TopicService extends BaseService {
* @since 2019/11/8 10:41
*/
Result changeToIssue(TopicChangeToIssueFormDTO formDto);
+
+ /**
+ *
+ * 话题转议题回调
+ *
+ * @params [formDto]
+ * @return com.elink.esua.epdc.commons.tools.utils.Result
+ * @author liuchuang
+ * @since 2019/11/11 10:50
+ */
+ Result reviewCallback(TopicReviewFormDTO formDto);
}
diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java
index 3b002d9f7..9896d7476 100644
--- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java
+++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java
@@ -39,6 +39,7 @@ import com.elink.esua.epdc.dto.topic.TopicDTO;
import com.elink.esua.epdc.dto.topic.TopicListDTO;
import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO;
+import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO;
import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO;
import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO;
import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO;
@@ -57,6 +58,7 @@ 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.Arrays;
import java.util.List;
import java.util.Map;
@@ -253,6 +255,64 @@ public class TopicServiceImpl extends BaseServiceImpl imp
return new Result().error();
}
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Result reviewCallback(TopicReviewFormDTO formDto) {
+ // 更新话题状态
+ TopicEntity entity = new TopicEntity();
+ entity.setId(formDto.getTopicId());
+ entity.setState(formDto.getState());
+ this.updateById(entity);
+ // 记录审核记录
+ TopicAuditRecordEntity auditRecordEntity = new TopicAuditRecordEntity();
+ auditRecordEntity.setTopicId(formDto.getTopicId());
+ auditRecordEntity.setProcessingOpinions(formDto.getProcessingOpinions());
+ // 话题信息
+ TopicEntity topicEntity = this.selectById(formDto.getTopicId());
+ // 群主信息
+ UserGroupDTO userGroupDTO = userGroupService.getLordInfoByGroupId(topicEntity.getGroupId());
+
+ List noticeList = new ArrayList<>();
+ // 组装发送消息内容-群主
+ EpdcInformationFormDTO lordNotice = new EpdcInformationFormDTO();
+ lordNotice.setType(GroupNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE);
+ lordNotice.setUserId(userGroupDTO.getUserId());
+ if (TopicStateEnum.TOPIC_STATE_CHANGED_ISSUE.getValue().equals(formDto.getState())) {
+ auditRecordEntity.setState(NumConstant.ONE);
+ lordNotice.setTitle(GroupNoticeConstant.NOTICE_TOPIC_TO_ISSUE_PASS);
+ lordNotice.setContent(GroupNoticeConstant.NOTICE_TOPIC_TO_ISSUE_PASS_LORD_CONTENT);
+ lordNotice.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_TOPIC_TO_ISSUE_PASSED);
+ lordNotice.setBusinessId(topicEntity.getIssueId());
+
+ // 组装发送消息内容-发布话题用户
+ EpdcInformationFormDTO topicUserNotice = new EpdcInformationFormDTO();
+ topicUserNotice.setType(GroupNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE);
+ topicUserNotice.setTitle(GroupNoticeConstant.NOTICE_TOPIC_TO_ISSUE_PASS);
+ topicUserNotice.setContent(GroupNoticeConstant.NOTICE_TOPIC_TO_ISSUE_PASS_TOPIC_USER_CONTENT);
+ topicUserNotice.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_TOPIC_TO_ISSUE_PASSED);
+ topicUserNotice.setBusinessId(topicEntity.getIssueId());
+ topicUserNotice.setUserId(topicEntity.getUserId());
+
+ noticeList.add(topicUserNotice);
+ } else {
+ auditRecordEntity.setState(NumConstant.ZERO);
+ lordNotice.setTitle(GroupNoticeConstant.NOTICE_TOPIC_TO_ISSUE_NOT_PASS);
+ lordNotice.setContent(topicEntity.getTopicContent());
+ lordNotice.setRelBusinessContent(formDto.getProcessingOpinions());
+ lordNotice.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_TOPIC_TO_ISSUE_NOT_PASSED);
+ lordNotice.setBusinessId(topicEntity.getId());
+ }
+ noticeList.add(lordNotice);
+ topicAuditRecordService.insert(auditRecordEntity);
+ // 发送消息
+ for (EpdcInformationFormDTO information:
+ noticeList) {
+ newsTask.insertUserInformation(information);
+ }
+
+ return new Result();
+ }
+
/**
*
* 话题转议题校验