diff --git a/esua-epdc/doc/db/dev_1010/esua_epdc_events.sql b/esua-epdc/doc/db/dev_1010/esua_epdc_events.sql new file mode 100644 index 000000000..c2c823286 --- /dev/null +++ b/esua-epdc/doc/db/dev_1010/esua_epdc_events.sql @@ -0,0 +1,21 @@ +------------------------------------------2019-11-08----------------------------------------------- +-- 删除友邻社区ID字段 +ALTER TABLE epdc_events DROP COLUMN FRIENDLY_COMMUNITY_ID; +ALTER TABLE epdc_issue DROP COLUMN FRIENDLY_COMMUNITY_ID; +ALTER TABLE epdc_item DROP COLUMN FRIENDLY_COMMUNITY_ID; +-- 增加社群ID字段 +ALTER TABLE epdc_events ADD GROUP_ID varchar(32) NULL COMMENT '社群ID'; +ALTER TABLE epdc_issue ADD GROUP_ID varchar(32) NULL COMMENT '社群ID'; +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----------------------------------------------- + +------------------------------------------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/doc/db/dev_1114/esua_epdc_admin.sql b/esua-epdc/doc/db/dev_1114/esua_epdc_admin.sql new file mode 100644 index 000000000..645821e05 --- /dev/null +++ b/esua-epdc/doc/db/dev_1114/esua_epdc_admin.sql @@ -0,0 +1,22 @@ +-------------------------------------------------------2019-11-14------------------------------------------------ +-- 新增党委部门管理表 +CREATE TABLE sys_party_dept( + ID BIGINT NOT NULL COMMENT '主键' , + PID BIGINT COMMENT '上级ID' , + PIDS VARCHAR(500) COMMENT '所有上级ID,用逗号分开' , + NAME VARCHAR(50) COMMENT '部门名称' , + TYPE_KEY VARCHAR(50) COMMENT '机构类型键值' , + PARTY_CODE VARCHAR(50) COMMENT '部门编码' , + SORT INT COMMENT '排序' , + DEL_FLAG VARCHAR(1) NOT NULL COMMENT '删除标记' , + CREATOR BIGINT NOT NULL COMMENT '创建者' , + CREATED_DATE DATETIME NOT NULL COMMENT '创建时间' , + UPDATER BIGINT NOT NULL COMMENT '更新者' , + UPDATED_DATE DATETIME NOT NULL COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '党委部门管理 党委部门管理';; + +-- 部门表新增所属党委ID字段 +ALTER TABLE sys_dept ADD ppid bigint NULL COMMENT '所属党委ID'; + +-------------------------------------------------------2019-11-14------------------------------------------------ \ No newline at end of file diff --git a/esua-epdc/doc/db/dev_1114/esua_epdc_events.sql b/esua-epdc/doc/db/dev_1114/esua_epdc_events.sql new file mode 100644 index 000000000..6f976f815 --- /dev/null +++ b/esua-epdc/doc/db/dev_1114/esua_epdc_events.sql @@ -0,0 +1,18 @@ +-------------------------------------------------------2019-11-14------------------------------------------------ +-- 新增接口日志表 +CREATE TABLE epdc_interface_log( + ID VARCHAR(32) NOT NULL COMMENT '主键' , + REFERENCE_ID VARCHAR(32) NOT NULL COMMENT '引用ID' , + BUSINESS_TYPE VARCHAR(100) COMMENT '业务类型' , + INTERFACE_NAME VARCHAR(200) NOT NULL COMMENT '调用接口名称' , + SUCCESS_FLAG VARCHAR(1) NOT NULL COMMENT '调用是否成功 0-调用失败,1-调用成功' , + CALL_MSG_BODY VARCHAR(2000) COMMENT '调用消息体' , + RETURN_MSG_BODY TEXT COMMENT '调用返回消息体' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + DEL_FLAG VARCHAR(1) NOT NULL COMMENT '删除标记' , + PRIMARY KEY (ID) +) COMMENT = '接口日志表 接口日志表';; +-------------------------------------------------------2019-11-14------------------------------------------------ \ No newline at end of file diff --git a/esua-epdc/doc/db/dev_1114/esua_epdc_user.sql b/esua-epdc/doc/db/dev_1114/esua_epdc_user.sql new file mode 100644 index 000000000..7a8e3ed75 --- /dev/null +++ b/esua-epdc/doc/db/dev_1114/esua_epdc_user.sql @@ -0,0 +1,39 @@ +-------------------------------------------------------2019-11-14------------------------------------------------ +-- 新建党员认证失败表 +CREATE TABLE epdc_party_authentication_failed( + ID VARCHAR(32) NOT NULL COMMENT '主键' , + REAL_NAME VARCHAR(20) NOT NULL COMMENT '姓名' , + MOBILE VARCHAR(20) COMMENT '手机号' , + IDENTITY_NO VARCHAR(20) NOT NULL COMMENT '身份证号' , + USER_ID VARCHAR(32) COMMENT '用户ID' , + ADDRESS VARCHAR(512) COMMENT '居民住址' , + POST VARCHAR(128) COMMENT '职务 字典表dict_name' , + POST_VALUE VARCHAR(32) COMMENT '职务ID 字典表dict_value' , + CADRE_FLAG VARCHAR(1) NOT NULL COMMENT '干部下沉标识 0-否,1-是' , + REGIST_FLAG VARCHAR(1) NOT NULL COMMENT '注册状态 0-否,1-是' , + REGIST_TIME DATETIME COMMENT '注册时间' , + STREET_NAME VARCHAR(128) COMMENT '街道名称' , + STREET_ID BIGINT COMMENT '街道ID' , + COMMUNITY_NAME VARCHAR(128) COMMENT '社区名称' , + COMMUNITY_ID BIGINT COMMENT '社区ID' , + GRID_NAME VARCHAR(128) COMMENT '网格名称' , + GRID_ID BIGINT COMMENT '网格ID' , + DEPT_ID BIGINT COMMENT '部门ID' , + STATE INT COMMENT '状态 0-认证失败' , + PROCESSING_OPINIONS VARCHAR(500) COMMENT '处理意见' , + REVISION INT COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) NOT NULL COMMENT '创建人' , + CREATED_TIME DATETIME NOT NULL COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) NOT NULL COMMENT '更新人' , + UPDATED_TIME DATETIME NOT NULL COMMENT '更新时间' , + DEL_FLAG VARCHAR(1) NOT NULL COMMENT '删除标记 0-否,1-是' , + PRIMARY KEY (ID) +) COMMENT = '党员认证失败表 党员认证失败表';; + +-- 党员表新增居住地址字段 +ALTER TABLE epdc_party_members ADD ADDRESS varchar(512) NULL COMMENT '居民住址'; + +-- 用户表增加约束 +ALTER TABLE esua_epdc_user.epdc_user ADD CONSTRAINT epdc_user_un UNIQUE KEY (`MOBILE`,`IDENTITY_NO`); + +-------------------------------------------------------2019-11-14------------------------------------------------ \ No newline at end of file diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java index c35f7343b..d56c9fb99 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/ServiceConstant.java @@ -46,7 +46,7 @@ public interface ServiceConstant { /** * 友邻社群模块 */ - String EPDC_NEIGHBOR_SERVER = "epdc-neighbor-server"; + String EPDC_GROUP_SERVER = "epdc-group-server"; /** * 新闻公告模块 */ diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserSexEnum.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserSexEnum.java new file mode 100644 index 000000000..ddbbc8f23 --- /dev/null +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserSexEnum.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.commons.tools.enums; + +/** + * 用户性别 枚举类 + * + * @author work@yujt.net.cn + * @date 2019/11/18 14:30 + */ +public enum UserSexEnum { + + /** + * 男 + */ + MALE("1"), + + /** + * 女 + */ + FEMALE("0"); + + private String sex; + + UserSexEnum(String sex) { + this.sex = sex; + } + + public String sex() { + return sex; + } +} diff --git a/esua-epdc/epdc-gateway/pom.xml b/esua-epdc/epdc-gateway/pom.xml index a4b2f7894..f84a048b6 100644 --- a/esua-epdc/epdc-gateway/pom.xml +++ b/esua-epdc/epdc-gateway/pom.xml @@ -106,9 +106,6 @@ lb://epdc-message-server - lb://epdc-neighbor-server - - http://127.0.0.1:9064 lb://epdc-oss-server @@ -120,10 +117,11 @@ http://127.0.0.1:9068 lb://epdc-demo-server + http://127.0.0.1:9064 + lb://epdc-websocket-server - - true + false 47.104.224.45:8848 http://localhost:9411 @@ -151,8 +149,6 @@ lb://epdc-job-server lb://epdc-message-server - lb://epdc-neighbor-server - lb://epdc-news-server lb://epdc-oss-server lb://epdc-events-server @@ -160,6 +156,7 @@ lb://epdc-user-server lb://epdc-demo-server + lb://epdc-group-server lb://epdc-websocket-server @@ -185,8 +182,6 @@ lb://epdc-job-server lb://epdc-message-server - lb://epdc-neighbor-server - lb://epdc-news-server lb://epdc-oss-server lb://epdc-events-server @@ -194,6 +189,7 @@ lb://epdc-user-server lb://epdc-demo-server + lb://epdc-group-server lb://epdc-websocket-server diff --git a/esua-epdc/epdc-gateway/src/main/resources/application.yml b/esua-epdc/epdc-gateway/src/main/resources/application.yml index 37a30e659..53946043b 100644 --- a/esua-epdc/epdc-gateway/src/main/resources/application.yml +++ b/esua-epdc/epdc-gateway/src/main/resources/application.yml @@ -83,11 +83,12 @@ spring: filters: - StripPrefix=1 #友邻社群模块 - - id: epdc-neighbor-server - uri: @gateway.routes.epdc-neighbor-server.uri@ + - id: epdc-group-server + uri: @gateway.routes.epdc-group-server.uri@ order: 9 predicates: - - Path=${server.servlet.context-path}/neighbor/** + - Path=/group/** + - Path=${server.servlet.context-path}/group/** filters: - StripPrefix=1 #新闻公告模块 diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/pom.xml b/esua-epdc/epdc-module/epdc-api/epdc-api-client/pom.xml index 8b601441a..fb4e2c8d7 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/pom.xml @@ -68,6 +68,11 @@ epdc-message-client 1.0.0 + + com.esua.epdc + epdc-group-client + 1.0.0 + diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java index ab9640135..dfbc61f96 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/form/EpdcCompleteUserInfoFormDTO.java @@ -51,4 +51,10 @@ public class EpdcCompleteUserInfoFormDTO implements Serializable { * 住处(楼栋-单元-房间) */ private String dwellingPlace; + + /** + * 0女,1男 + */ + @NotBlank(message = "性别不能为空") + private String sex; } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiGroupController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiGroupController.java new file mode 100644 index 000000000..6f132de78 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiGroupController.java @@ -0,0 +1,229 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; +import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; +import com.elink.esua.epdc.dto.group.form.*; +import com.elink.esua.epdc.dto.group.result.*; +import com.elink.esua.epdc.service.GroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * + * 移动端接口-社群模块 + * + * @Author:liuchuang + * @Date:2019/10/17 13:48 + */ +@RestController +@RequestMapping("group/group") +public class ApiGroupController { + + @Autowired + private GroupService groupService; + + /** + * + * 创建社群 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/17 13:58 + */ + @PostMapping("create") + public Result createGroup(@LoginUser TokenDto userDetail, @RequestBody GroupCreateFormDTO formDto) { + return groupService.saveGroup(userDetail, formDto); + } + + /** + * + * 解散社群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/21 9:51 + */ + @PostMapping("disband") + public Result disbandGroup(@RequestBody GroupSettingStateDTO formDto) { + return groupService.disbandGroup(formDto); + } + + /** + * + * 我的群列表 + * + * @params [userDetail] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/21 17:20 + */ + @GetMapping("listOfMine") + public Result> groupsOfMine(@LoginUser TokenDto userDetail) { + return groupService.listGroupsOfMine(userDetail); + } + + /** + * + * 推荐群列表 + * + * @params [userDetail] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/22 13:53 + */ + @GetMapping("listOfRecommend") + public Result> groupsOfRecommend(@LoginUser TokenDto userDetail) { + return groupService.listGroupsOfRecommend(userDetail); + } + + /** + * + * 社群详情 + * + * @params [userDetail, id] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/22 15:14 + */ + @GetMapping("detail/{id}") + public Result detail(@LoginUser TokenDto userDetail, @PathVariable("id") String id) { + return groupService.getGroupDetail(userDetail, id); + } + + /** + * + * 修改群介绍 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 15:33 + */ + @PostMapping("modifyIntroduction") + public Result modifyIntroduction(@LoginUser TokenDto userDetail, @RequestBody GroupIntroductionFormDTO formDto) { + return groupService.modifyIntroduction(userDetail, formDto); + } + + /** + * + * 修改群头像 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 17:25 + */ + @PostMapping("modifyAvatar") + public Result modifyAvatar(@LoginUser TokenDto userDetail, @RequestBody GroupModifyAvatarFormDTO formDto) { + return groupService.modifyAvatar(userDetail, formDto); + } + + /** + * + * 社群成员列表(待审核/审核通过) + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 9:13 + */ + @GetMapping("listOfMember") + public Result> listOfMember(@RequestBody GroupUsersFormDTO formDto) { + return groupService.listOfMember(formDto); + } + + /** + * + * 移除社群成员 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 10:35 + */ + @PostMapping("removeMember") + public Result removeMember(@LoginUser TokenDto userDetail, @RequestBody GroupUserRemoveOrQuitFormDTO formDto) { + return groupService.removeMember(userDetail, formDto); + } + + /** + * + * 退出社群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 10:40 + */ + @PostMapping("quitGroup") + public Result quitGroup(@LoginUser TokenDto userDetail, @RequestBody GroupUserRemoveOrQuitFormDTO formDto) { + return groupService.quitGroup(userDetail, formDto); + } + + /** + * + * 添加成员列表 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/23 16:39 + */ + @GetMapping("getInviteList") + public Result> getInviteList(@LoginUser TokenDto userDetail, @RequestBody EpdcUserGroupInviteFormDTO formDto) { + return groupService.listOfInviteUsers(userDetail, formDto); + } + + /** + * + * 添加社群成员 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 9:17 + */ + @PostMapping("addMember") + public Result addMember(@RequestBody GroupAddUserFormDTO formDto) { + return groupService.saveGroupUsers(formDto); + } + + /** + * + * 审核入群申请 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 13:22 + */ + @PostMapping("reviewApply") + public Result reviewApply(@RequestBody GroupUserReviewFormDTO formDto) { + return groupService.updateGroupUsers(formDto); + } + + /** + * + * 申请入群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/11 14:00 + */ + @PostMapping("applyForGroup") + public Result applyForGroup(@LoginUser TokenDto userDetail, @RequestBody GroupApplyFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return groupService.applyForGroup(userDetail, formDto); + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiTopicCommentController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiTopicCommentController.java new file mode 100644 index 000000000..a325ea0a7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiTopicCommentController.java @@ -0,0 +1,50 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; +import com.elink.esua.epdc.service.TopicCommentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 移动端接口-评论模块 + * @Author WJP + * @Date 2019/9/9 09:45 + */ +@RestController +@RequestMapping("group/comment") +public class ApiTopicCommentController { + + @Autowired + private TopicCommentService topicCommentService; + + /** + * 提交评论或回复接口 + */ + @PostMapping("submit") + public Result submit(@LoginUser TokenDto userDetail, @RequestBody TopicCommentFormDTO topicCommentFormDTO) { + return topicCommentService.submit(userDetail,topicCommentFormDTO); + } + + /** + * 评论(赞/踩) + */ + @PostMapping("statement") + public Result statement(@LoginUser TokenDto userDetail, @RequestBody TopicCommentStatementFormDTO topicCommentStatementFormDTO) { + return topicCommentService.statement(userDetail,topicCommentStatementFormDTO); + } + + /** + * 评论列表 + */ + @GetMapping("list") + public Result listOfComments(@LoginUser TokenDto userDetail, TopicCommentsFormDTO topicCommentsFormDTO) { + return topicCommentService.listOfComments(userDetail,topicCommentsFormDTO); + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiTopicController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiTopicController.java new file mode 100644 index 000000000..401ee3294 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiTopicController.java @@ -0,0 +1,136 @@ +package com.elink.esua.epdc.controller; + +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.group.result.TopicAuditRecordResultDTO; +import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO; +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.TopicSubmitFormDTO; +import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; +import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO; +import com.elink.esua.epdc.service.TopicService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * + * 移动端接口-话题模块 + * + * @Author:liuchuang + * @Date:2019/11/6 14:44 + */ +@RestController +@RequestMapping("group/topic") +public class ApiTopicController { + + @Autowired + private TopicService topicService; + + /** + * + * 发布话题 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 14:46 + */ + @PostMapping("submit") + public Result submit(@LoginUser TokenDto userDetail, @RequestBody TopicSubmitFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return topicService.saveTopic(userDetail, formDto); + } + + /** + * + * 话题列表 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/11 15:04 + */ + @GetMapping("list") + public Result> listTopic(@LoginUser TokenDto userDetail, @RequestBody TopicListFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return topicService.listOfTopic(userDetail, formDto); + } + + /** + * + * 我的话题列表 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/11 15:04 + */ + @GetMapping("listOfMine") + public Result> listTopicOfMine(@LoginUser TokenDto userDetail, @RequestBody TopicListFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return topicService.listTopicOfMine(userDetail, formDto); + } + + /** + * + * 话题详情 + * + * @params [id] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/7 15:37 + */ + @GetMapping("detail/{id}") + public Result detail(@PathVariable("id") String id) { + return topicService.getTopicDetailById(id); + } + + /** + * + * 关闭话题 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/7 16:10 + */ + @PostMapping("close") + public Result close(@LoginUser TokenDto userDetail, @RequestBody TopicCloseFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return topicService.closeTopic(userDetail, formDto); + } + + /** + * + * 话题审核记录 + * + * @params [topicId] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/8 9:39 + */ + @GetMapping("auditRecord/{topicId}") + public Result> auditRecord(@PathVariable("topicId") String topicId) { + return topicService.listOfTopicAuditRecord(topicId); + } + + /** + * + * 转议题 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/8 10:37 + */ + @PostMapping("changeToIssue") + public Result changeToIssue(@LoginUser TokenDto userDetail, @RequestBody TopicChangeToIssueFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return topicService.changeToIssue(userDetail, formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/GroupFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/GroupFeignClient.java new file mode 100644 index 000000000..b79f9e3a6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/GroupFeignClient.java @@ -0,0 +1,207 @@ +package com.elink.esua.epdc.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.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; +import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; +import com.elink.esua.epdc.dto.group.form.*; +import com.elink.esua.epdc.dto.group.result.*; +import com.elink.esua.epdc.feign.fallback.GroupFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * + * 社群模块调用 + * + * @Author:liuchuang + * @Date:2019/10/17 14:40 + */ +@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/10/17 14:44 + */ + @PostMapping(value = "group/epdc-app/group/create", consumes = MediaType.APPLICATION_JSON_VALUE) + Result createGroup(GroupCreateFormDTO formDto); + + /** + * + * 解散社群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/21 9:54 + */ + @PostMapping(value = "group/epdc-app/group/operate", consumes = MediaType.APPLICATION_JSON_VALUE) + Result disbandGroup(GroupSettingStateDTO formDto); + + /** + * + * 我的群列表 + * + * @params [formDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/21 17:26 + */ + @GetMapping(value = "group/epdc-app/group/listOfMine", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> listGroupsOfMine(GroupsOfMineFormDTO formDto); + + /** + * + * 推荐群列表 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/22 13:51 + */ + @GetMapping(value = "group/epdc-app/group/listOfRecommend", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> listGroupsOfRecommend(GroupsOfMineFormDTO formDto); + + /** + * + * 社群详情 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 15:09 + */ + @GetMapping(value = "group/epdc-app/group/detail", consumes = MediaType.APPLICATION_JSON_VALUE) + Result detail(GroupDetailForMobileEndFormDTO formDto); + + /** + * + * 修改群介绍 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 15:36 + */ + @PostMapping(value = "group/epdc-app/group/modifyIntroduction", consumes = MediaType.APPLICATION_JSON_VALUE) + Result modifyIntroduction(GroupIntroductionFormDTO formDto); + + /** + * + * 修改群头像 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 17:29 + */ + @PostMapping(value = "group/epdc-app/group/modifyAvatar", consumes = MediaType.APPLICATION_JSON_VALUE) + Result modifyAvatar(GroupModifyAvatarFormDTO formDto); + + /** + * + * 社群成员列表(待审核/审核通过) + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 9:16 + */ + @GetMapping(value = "group/epdc-app/group/listOfMember", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> listOfMember(GroupUsersFormDTO formDto); + + /** + * + * 移除社群成员 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 10:47 + */ + @PostMapping(value = "group/epdc-app/group/removeMember", consumes = MediaType.APPLICATION_JSON_VALUE) + Result removeMember(GroupUserRemoveOrQuitFormDTO formDto); + + /** + * + * 退出社群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 10:47 + */ + @PostMapping(value = "group/epdc-app/group/quitGroup", consumes = MediaType.APPLICATION_JSON_VALUE) + Result quitGroup(GroupUserRemoveOrQuitFormDTO formDto); + + /** + * + * 添加成员列表 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/23 16:38 + */ + @GetMapping(value = "group/epdc-app/usergroup/getInviteList", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> getInviteList(EpdcUserGroupInviteFormDTO formDto); + + /** + * + * 添加成员 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 9:37 + */ + @PostMapping(value = "group/epdc-app/usergroup/addMember", consumes = MediaType.APPLICATION_JSON_VALUE) + Result addMember(GroupAddUserFormDTO formDto); + + /** + * + * 审核入群申请 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 13:26 + */ + @PostMapping(value = "group/epdc-app/usergroup/reviewApply", consumes = MediaType.APPLICATION_JSON_VALUE) + Result reviewApply(GroupUserReviewFormDTO formDto); + + /** + * + * 申请入群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/11 14:04 + */ + @PostMapping(value = "group/epdc-app/group/applyForGroup", consumes = MediaType.APPLICATION_JSON_VALUE) + Result applyForGroup(GroupApplyFormDTO formDto); + + /** + * + * 更新社群用户党员标识 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/11 14:32 + */ + @PostMapping(value = "group/epdc-app/usergroup/partyMember", consumes = MediaType.APPLICATION_JSON_VALUE) + Result updateUserPartyMember(GroupUserPartyMemberFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/TopicCommentFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/TopicCommentFeignClient.java new file mode 100644 index 000000000..0540257eb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/TopicCommentFeignClient.java @@ -0,0 +1,35 @@ +package com.elink.esua.epdc.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.comment.TopicCommentFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; +import com.elink.esua.epdc.feign.fallback.TopicCommentFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * 评论模块调用 + * @Author LC + * @Date 2019/9/7 11:34 + */ +@FeignClient(name = ServiceConstant.EPDC_GROUP_SERVER, fallback = TopicCommentFeignClientFallback.class) +public interface TopicCommentFeignClient { + + + @PostMapping(value = "group/epdc-app/comment/submit", consumes = MediaType.APPLICATION_JSON_VALUE) + Result submit(TopicCommentFormDTO commentFormDTO); + + @PostMapping(value = "group/epdc-app/comment/statement", consumes = MediaType.APPLICATION_JSON_VALUE) + Result statement(TopicCommentStatementFormDTO commentStatementFormDTO); + + @GetMapping(value = "group/epdc-app/comment/list", consumes = MediaType.APPLICATION_JSON_VALUE) + Result listOfComments(TopicCommentsFormDTO formDto); + + + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/TopicFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/TopicFeignClient.java new file mode 100644 index 000000000..2054ceb43 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/TopicFeignClient.java @@ -0,0 +1,102 @@ +package com.elink.esua.epdc.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.group.result.TopicAuditRecordResultDTO; +import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO; +import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO; +import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; +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; +import com.elink.esua.epdc.feign.fallback.TopicFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * + * 社群-话题模块调用 + * + * @Author:liuchuang + * @Date:2019/11/6 15:36 + */ +@FeignClient(name = ServiceConstant.EPDC_GROUP_SERVER, fallback = TopicFeignClientFallback.class) +public interface TopicFeignClient { + + /** + * + * 发布话题 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 15:40 + */ + @PostMapping(value = "group/epdc-app/topic/submit", consumes = MediaType.APPLICATION_JSON_VALUE) + Result submit(TopicSubmitFormDTO formDto); + + /** + * + * 话题详情 + * + * @params [id] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/7 15:37 + */ + @GetMapping(value = "group/epdc-app/topic/detail/{id}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result detail(@PathVariable("id") String id); + + /** + * + * 话题列表 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/11 15:06 + */ + @GetMapping(value = "group/epdc-app/topic/list", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> listOfTopic(TopicListFormDTO formDto); + + /** + * + * 关闭话题 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/7 16:14 + */ + @PostMapping(value = "group/epdc-app/topic/close", consumes = MediaType.APPLICATION_JSON_VALUE) + Result close(TopicCloseFormDTO formDto); + + /** + * + * 话题审核记录 + * + * @params [topicId] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/8 9:41 + */ + @GetMapping(value = "group/epdc-app/topic/auditRecord/{topicId}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> auditRecord(@PathVariable("topicId") String topicId); + + /** + * + * 转议题 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/8 10:39 + */ + @PostMapping(value = "group/epdc-app/topic/changeToIssue", consumes = MediaType.APPLICATION_JSON_VALUE) + Result changeToIssue(TopicChangeToIssueFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/GroupFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/GroupFeignClientFallback.java new file mode 100644 index 000000000..42754e74d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/GroupFeignClientFallback.java @@ -0,0 +1,97 @@ +package com.elink.esua.epdc.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.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; +import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; +import com.elink.esua.epdc.dto.group.form.*; +import com.elink.esua.epdc.dto.group.result.*; +import com.elink.esua.epdc.feign.GroupFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author:liuchuang + * @Date:2019/10/17 14:40 + */ +@Component +public class GroupFeignClientFallback implements GroupFeignClient { + + @Override + public Result createGroup(GroupCreateFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "createGroup", formDto); + } + + @Override + public Result disbandGroup(GroupSettingStateDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "disbandGroup", formDto); + } + + @Override + public Result> listGroupsOfMine(GroupsOfMineFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "listGroupsOfMine", formDto); + } + + @Override + public Result> listGroupsOfRecommend(GroupsOfMineFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "listGroupsOfRecommend", formDto); + } + + @Override + public Result detail(GroupDetailForMobileEndFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "detail", formDto); + } + + @Override + public Result modifyIntroduction(GroupIntroductionFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "modifyIntroduction", formDto); + } + + @Override + public Result modifyAvatar(GroupModifyAvatarFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "modifyAvatar", formDto); + } + + @Override + public Result> listOfMember(GroupUsersFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "listOfMember", formDto); + } + + @Override + public Result removeMember(GroupUserRemoveOrQuitFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "removeMember", formDto); + } + + @Override + public Result quitGroup(GroupUserRemoveOrQuitFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "quitGroup", formDto); + } + + @Override + public Result> getInviteList(EpdcUserGroupInviteFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "getInviteList", formDto); + } + + @Override + public Result addMember(GroupAddUserFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "addMember", formDto); + } + + @Override + public Result reviewApply(GroupUserReviewFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "reviewApply", formDto); + } + + @Override + public Result applyForGroup(GroupApplyFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "applyForGroup", formDto); + } + + @Override + public Result updateUserPartyMember(GroupUserPartyMemberFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "updateUserPartyMember", formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/TopicCommentFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/TopicCommentFeignClientFallback.java new file mode 100644 index 000000000..f97e4efaf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/TopicCommentFeignClientFallback.java @@ -0,0 +1,32 @@ +package com.elink.esua.epdc.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.comment.TopicCommentFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; +import com.elink.esua.epdc.feign.TopicCommentFeignClient; +import org.springframework.stereotype.Component; + + +@Component +public class TopicCommentFeignClientFallback implements TopicCommentFeignClient { + + @Override + public Result submit(TopicCommentFormDTO commentFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "submit", commentFormDTO); + } + + @Override + public Result statement(TopicCommentStatementFormDTO commentStatementFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "statement", commentStatementFormDTO); + } + + @Override + public Result listOfComments(TopicCommentsFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "listOfComments", formDto); + } + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/TopicFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/TopicFeignClientFallback.java new file mode 100644 index 000000000..2c332b2e1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/TopicFeignClientFallback.java @@ -0,0 +1,55 @@ +package com.elink.esua.epdc.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.group.result.TopicAuditRecordResultDTO; +import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO; +import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO; +import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; +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; +import com.elink.esua.epdc.feign.TopicFeignClient; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.PathVariable; + +import java.util.List; + +/** + * @Author:liuchuang + * @Date:2019/11/6 15:36 + */ +@Component +public class TopicFeignClientFallback implements TopicFeignClient { + + @Override + public Result submit(TopicSubmitFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "submit", formDto); + } + + @Override + public Result detail(String id) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "detail", id); + } + + @Override + public Result close(TopicCloseFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "close", formDto); + } + + @Override + public Result> auditRecord(@PathVariable("topicId") String topicId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "auditRecord", topicId); + } + + @Override + public Result> listOfTopic(TopicListFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "listOfTopic", formDto); + } + + @Override + public Result changeToIssue(TopicChangeToIssueFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "changeToIssue", formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/GroupService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/GroupService.java new file mode 100644 index 000000000..902678854 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/GroupService.java @@ -0,0 +1,176 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; +import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; +import com.elink.esua.epdc.dto.group.form.*; +import com.elink.esua.epdc.dto.group.result.*; + +import java.util.List; + +/** + * + * 社群模块 + * + * @Author:liuchuang + * @Date:2019/10/17 13:55 + */ +public interface GroupService { + + /** + * + * 创建社群 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/17 13:58 + */ + Result saveGroup(TokenDto userDetail, GroupCreateFormDTO formDto); + + /** + * + * 解散社群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/21 9:51 + */ + Result disbandGroup(GroupSettingStateDTO dto); + + /** + * + * 我的群列表 + * + * @params [userDetail] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/21 17:21 + */ + Result> listGroupsOfMine(TokenDto userDetail); + + /** + * + * 推荐群列表 + * + * @params [userDetail] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/22 13:54 + */ + Result> listGroupsOfRecommend(TokenDto userDetail); + + /** + * + * 社群详情 + * + * @params [userDetail, id] + * @return com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO + * @author liuchuang + * @since 2019/10/22 15:15 + */ + Result getGroupDetail(TokenDto userDetail, String id); + + /** + * + * 修改群介绍 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 15:34 + */ + Result modifyIntroduction(TokenDto userDetail, GroupIntroductionFormDTO formDto); + + /** + * + * 修改群头像 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 17:26 + */ + Result modifyAvatar(TokenDto userDetail, GroupModifyAvatarFormDTO formDto); + + /** + * + * 社群成员列表(待审核/审核通过) + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 9:14 + */ + Result> listOfMember(GroupUsersFormDTO formDto); + + /** + * + * 移除社群成员 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 10:43 + */ + Result removeMember(TokenDto userDetail, GroupUserRemoveOrQuitFormDTO formDto); + + /** + * + * 退出社群 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 10:43 + */ + Result quitGroup(TokenDto userDetail, GroupUserRemoveOrQuitFormDTO formDto); + + /** + * + * 添加成员列表 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/23 16:40 + */ + Result> listOfInviteUsers(TokenDto userDetail, EpdcUserGroupInviteFormDTO formDto); + + /** + * + * 添加社群成员 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 9:18 + */ + Result saveGroupUsers(GroupAddUserFormDTO formDto); + + /** + * + * 审核入群申请 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 13:23 + */ + Result updateGroupUsers(GroupUserReviewFormDTO formDto); + + /** + * + * 申请入群 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/11 14:02 + */ + Result applyForGroup(TokenDto userDetail, GroupApplyFormDTO formDto); + +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/TopicCommentService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/TopicCommentService.java new file mode 100644 index 000000000..54802b4ae --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/TopicCommentService.java @@ -0,0 +1,34 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.annotation.LoginUser; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.comment.*; +import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; +import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; + + +/** + * 移动端接口-评论模块 + * @Author WJP + * @Date 2019/9/9 09:45 + */ +public interface TopicCommentService { + + /** + * 提交评论或回复接口 + */ + Result submit(@LoginUser TokenDto userDetail, TopicCommentFormDTO topicCommentFormDTO); + + /** + * 评论(赞/踩) + */ + Result statement(@LoginUser TokenDto userDetail, TopicCommentStatementFormDTO topicCommentStatementFormDTO); + + + /** + * 评论列表 + */ + Result listOfComments(TokenDto userDetail, TopicCommentsFormDTO topicCommentsFormDTO); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/TopicService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/TopicService.java new file mode 100644 index 000000000..b674e6400 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/TopicService.java @@ -0,0 +1,100 @@ +package com.elink.esua.epdc.service; + +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.group.result.TopicAuditRecordResultDTO; +import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO; +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.TopicSubmitFormDTO; +import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; +import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO; + +import java.util.List; + +/** + * + * 话题模块 + * + * @Author:liuchuang + * @Date:2019/11/6 14:48 + */ +public interface TopicService { + + /** + * + * 发布话题 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 14:51 + */ + Result saveTopic(TokenDto userDetail, TopicSubmitFormDTO formDto); + + /** + * + * 话题详情 + * + * @params [id] + * @return com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO + * @author liuchuang + * @since 2019/11/7 15:34 + */ + Result getTopicDetailById(String id); + + /** + * + * 关闭话题 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/7 16:11 + */ + Result closeTopic(TokenDto userDetail, TopicCloseFormDTO formDto); + + /** + * + * 话题审核记录 + * + * @params [topicId] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/8 9:43 + */ + Result> listOfTopicAuditRecord(String topicId); + + /** + * + * 话题列表 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/11 15:05 + */ + Result> listOfTopic(TokenDto userDetail, TopicListFormDTO formDto); + + /** + * + * 我的话题列表 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/11 15:50 + */ + Result> listTopicOfMine(TokenDto userDetail, TopicListFormDTO formDto); + + /** + * + * 转议题 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/8 10:37 + */ + Result changeToIssue(TokenDto userDetail, TopicChangeToIssueFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index 59defbbbf..0b2f1c825 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -20,11 +20,13 @@ import com.elink.esua.epdc.dto.epdc.result.EpdcUserGridResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; import com.elink.esua.epdc.dto.form.*; +import com.elink.esua.epdc.dto.group.form.GroupUserPartyMemberFormDTO; import com.elink.esua.epdc.dto.result.EpdcAppRegisterCallbackDTO; import com.elink.esua.epdc.dto.result.EpdcAppAuthorizationDTO; import com.elink.esua.epdc.dto.result.EpdcCompleteUserInfoDTO; import com.elink.esua.epdc.enums.*; import com.elink.esua.epdc.feign.AdminFeignClient; +import com.elink.esua.epdc.feign.GroupFeignClient; import com.elink.esua.epdc.feign.UserFeignClient; import com.elink.esua.epdc.jwt.JwtTokenProperties; import com.elink.esua.epdc.jwt.JwtTokenUtils; @@ -80,6 +82,9 @@ public class AppUserServiceImpl implements AppUserService { @Autowired private RedisUtils redisUtils; + @Autowired + private GroupFeignClient groupFeignClient; + private static String USER_FACE = "https://epdc.elinkchina.com.cn/esua-epdc/static/default/default_user_face.png"; @@ -705,6 +710,12 @@ public class AppUserServiceImpl implements AppUserService { tokenDto.setPartyFlag(user.getPartyFlag()); EpdcAppAuthorizationDTO authorizationDto = this.packageEpdcAppAuthorization(tokenDto, userGrid.getGrid(), userDto.getState()); + // 更新社群用户党员标识 + GroupUserPartyMemberFormDTO formDto = new GroupUserPartyMemberFormDTO(); + formDto.setUserId(user.getId()); + formDto.setPartyMember(user.getPartyFlag()); + groupFeignClient.updateUserPartyMember(formDto); + return new Result().ok(authorizationDto); } @@ -739,9 +750,6 @@ public class AppUserServiceImpl implements AppUserService { if (YesOrNoEnum.YES.value().equals(dto.getPartyFlag())) { dto.setState(AppUserStatesEnum.STATE_INFORMATION_PASSED.value()); dto.setSex(IdentityNoUtils.getSex(identityNo)); - dto.setNickname( - road.concat("-").concat(dto.getRealName().substring(NumConstant.ZERO, NumConstant.ONE)) - .concat(NumConstant.ZERO_STR.equals(dto.getSex()) ? "女士" : "先生")); dto.setBirthday(DateUtils.parse(IdentityNoUtils.getBirthday(identityNo), DateUtils.DATE_PATTERN)); } else { dto.setState(AppUserStatesEnum.STATE_COMPLETED_INFORMATION_PENDING_REVIEW.value()); diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java new file mode 100644 index 000000000..40fe3c679 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java @@ -0,0 +1,186 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CompleteDeptDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; +import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; +import com.elink.esua.epdc.dto.enums.GroupStateEnum; +import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; +import com.elink.esua.epdc.dto.group.form.*; +import com.elink.esua.epdc.dto.group.result.*; +import com.elink.esua.epdc.feign.AdminFeignClient; +import com.elink.esua.epdc.feign.GroupFeignClient; +import com.elink.esua.epdc.service.GroupService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * 社群模块 + * + * @Author:liuchuang + * @Date:2019/10/17 13:55 + */ +@Service +public class GroupServiceImpl implements GroupService { + + @Autowired + private AdminFeignClient adminFeignClient; + + @Autowired + private GroupFeignClient groupFeignClient; + + @Override + public Result saveGroup(TokenDto userDetail, GroupCreateFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + // 获取该网格所有上级机构 + Result deptDTOResult = adminFeignClient.getCompleteDept(userDetail.getGridId()); + CompleteDeptDTO deptDTO = deptDTOResult.getData(); + formDto.setArea(deptDTO.getDistrict()); + formDto.setAreaId(deptDTO.getDistrictId()); + formDto.setStreet(deptDTO.getStreet()); + formDto.setStreetId(deptDTO.getStreetId()); + formDto.setCommunity(deptDTO.getCommunity()); + formDto.setCommunityId(deptDTO.getCommunityId()); + formDto.setGrid(deptDTO.getGrid()); + formDto.setGridId(deptDTO.getGridId()); + formDto.setGroupCategory(NumConstant.ONE_STR); + // 群主信息 + GroupUserFormDTO groupUserFormDTO = new GroupUserFormDTO(); + groupUserFormDTO.setUserId(userDetail.getUserId()); + groupUserFormDTO.setNickname(userDetail.getNickname()); + groupUserFormDTO.setUserAvatar(userDetail.getFaceImg()); + groupUserFormDTO.setMobile(userDetail.getMobile()); + // 判断当前用户是否为党员 + if (!NumConstant.ONE_STR.equals(userDetail.getPartyFlag())) { + return new Result().error("您当前身份不是党员,不能创建社群"); + } + groupUserFormDTO.setPartyMember(userDetail.getPartyFlag()); + groupUserFormDTO.setLordFlag(NumConstant.ONE_STR); + groupUserFormDTO.setState(GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); + formDto.setGroupUserFormDTO(groupUserFormDTO); + + return groupFeignClient.createGroup(formDto); + } + + @Override + public Result disbandGroup(GroupSettingStateDTO dto) { + dto.setState(GroupStateEnum.GROUP_STATE_DISBANDED.getValue()); + return groupFeignClient.disbandGroup(dto); + } + + @Override + public Result> listGroupsOfMine(TokenDto userDetail) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + GroupsOfMineFormDTO formDto = new GroupsOfMineFormDTO(); + formDto.setUserId(userDetail.getUserId()); + formDto.setGridId(userDetail.getGridId()); + return groupFeignClient.listGroupsOfMine(formDto); + } + + @Override + public Result> listGroupsOfRecommend(TokenDto userDetail) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + GroupsOfMineFormDTO formDto = new GroupsOfMineFormDTO(); + formDto.setUserId(userDetail.getUserId()); + formDto.setGridId(userDetail.getGridId()); + return groupFeignClient.listGroupsOfRecommend(formDto); + } + + @Override + public Result getGroupDetail(TokenDto userDetail, String id) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + GroupDetailForMobileEndFormDTO formDto = new GroupDetailForMobileEndFormDTO(); + formDto.setId(id); + formDto.setUserId(userDetail.getUserId()); + return groupFeignClient.detail(formDto); + } + + @Override + public Result modifyIntroduction(TokenDto userDetail, GroupIntroductionFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + formDto.setUserId(userDetail.getUserId()); + return groupFeignClient.modifyIntroduction(formDto); + } + + @Override + public Result modifyAvatar(TokenDto userDetail, GroupModifyAvatarFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + formDto.setUserId(userDetail.getUserId()); + return groupFeignClient.modifyAvatar(formDto); + } + + @Override + public Result> listOfMember(GroupUsersFormDTO formDto) { + return groupFeignClient.listOfMember(formDto); + } + + @Override + public Result removeMember(TokenDto userDetail, GroupUserRemoveOrQuitFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + formDto.setOperatorId(userDetail.getUserId()); + return groupFeignClient.removeMember(formDto); + } + + @Override + public Result quitGroup(TokenDto userDetail, GroupUserRemoveOrQuitFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + formDto.setOperatorId(userDetail.getUserId()); + formDto.setUserId(userDetail.getUserId()); + return groupFeignClient.quitGroup(formDto); + } + + @Override + public Result> listOfInviteUsers(TokenDto userDetail, EpdcUserGroupInviteFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + formDto.setGridId(userDetail.getGridId()); + return groupFeignClient.getInviteList(formDto); + } + + @Override + public Result saveGroupUsers(GroupAddUserFormDTO formDto) { + return groupFeignClient.addMember(formDto); + } + + @Override + public Result updateGroupUsers(GroupUserReviewFormDTO formDto) { + return groupFeignClient.reviewApply(formDto); + } + + @Override + public Result applyForGroup(TokenDto userDetail, GroupApplyFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + formDto.setUserId(userDetail.getUserId()); + formDto.setNickname(userDetail.getNickname()); + formDto.setUserAvatar(userDetail.getFaceImg()); + formDto.setMobile(userDetail.getMobile()); + formDto.setPartyMember(userDetail.getPartyFlag()); + return groupFeignClient.applyForGroup(formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java new file mode 100644 index 000000000..c878f58c5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java @@ -0,0 +1,62 @@ +package com.elink.esua.epdc.service.impl; + + +import com.elink.esua.epdc.async.WxMaSecCheckTask; +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; +import com.elink.esua.epdc.feign.TopicCommentFeignClient; +import com.elink.esua.epdc.service.TopicCommentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.listener.Topic; +import org.springframework.stereotype.Service; + +/** + * 移动端接口-评论模块 + * @Author WJP + * @Date 2019/9/9 09:45 + */ +@Service +public class TopicCommentServiceImpl implements TopicCommentService { + + @Autowired + private TopicCommentFeignClient topicCommentFeignClient; + + @Autowired + private WxMaSecCheckTask wxMaSecCheckTask; + + @Override + public Result submit(TokenDto userDetail, TopicCommentFormDTO topicCommentFormDTO) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + // 上传内容安全检查 + wxMaSecCheckTask.checkMessage(topicCommentFormDTO.getContent()); + topicCommentFormDTO.setUserId(userDetail.getUserId()); + topicCommentFormDTO.setUserName(userDetail.getNickname()); + topicCommentFormDTO.setUserFace(userDetail.getFaceImg()); + return topicCommentFeignClient.submit(topicCommentFormDTO); + } + + @Override + public Result statement(TokenDto userDetail, TopicCommentStatementFormDTO topicCommentStatementFormDTO) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + topicCommentStatementFormDTO.setUseId(userDetail.getUserId()); + topicCommentStatementFormDTO.setUserName(userDetail.getNickname()); + return topicCommentFeignClient.statement(topicCommentStatementFormDTO); + } + + @Override + public Result listOfComments(TokenDto userDetail, TopicCommentsFormDTO topicCommentsFormDTO) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + topicCommentsFormDTO.setUserId(userDetail.getUserId()); + return topicCommentFeignClient.listOfComments(topicCommentsFormDTO); + } +} diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java new file mode 100644 index 000000000..86bf60786 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java @@ -0,0 +1,111 @@ +package com.elink.esua.epdc.service.impl; + +import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.CompleteDeptDTO; +import com.elink.esua.epdc.dto.enums.TopicStateEnum; +import com.elink.esua.epdc.dto.group.result.TopicAuditRecordResultDTO; +import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO; +import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO; +import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; +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; +import com.elink.esua.epdc.feign.AdminFeignClient; +import com.elink.esua.epdc.feign.TopicFeignClient; +import com.elink.esua.epdc.service.TopicService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * 话题模块 + * + * @Author:liuchuang + * @Date:2019/11/6 14:48 + */ +@Service +public class TopicServiceImpl implements TopicService { + + @Autowired + private AdminFeignClient adminFeignClient; + + @Autowired + private TopicFeignClient topicFeignClient; + + @Override + public Result saveTopic(TokenDto userDetail, TopicSubmitFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + + // 获取该网格所有上级机构 + Result deptDTOResult = adminFeignClient.getCompleteDept(userDetail.getGridId()); + CompleteDeptDTO deptDTO = deptDTOResult.getData(); + formDto.setArea(deptDTO.getDistrict()); + formDto.setAreaId(deptDTO.getDistrictId()); + formDto.setStreet(deptDTO.getStreet()); + formDto.setStreetId(deptDTO.getStreetId()); + formDto.setCommunity(deptDTO.getCommunity()); + formDto.setCommunityId(deptDTO.getCommunityId()); + formDto.setGrid(deptDTO.getGrid()); + formDto.setGridId(deptDTO.getGridId()); + + formDto.setUserId(userDetail.getUserId()); + formDto.setUserFace(userDetail.getFaceImg()); + formDto.setNickname(userDetail.getNickname()); + formDto.setPartyMember(userDetail.getPartyFlag()); + formDto.setMobile(userDetail.getMobile()); + formDto.setState(TopicStateEnum.TOPIC_STATE_IN_CONVERSATION.getValue()); + + return topicFeignClient.submit(formDto); + } + + @Override + public Result getTopicDetailById(String id) { + return topicFeignClient.detail(id); + } + + @Override + public Result closeTopic(TokenDto userDetail, TopicCloseFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + formDto.setUserId(userDetail.getUserId()); + return topicFeignClient.close(formDto); + } + + @Override + public Result> listOfTopicAuditRecord(String topicId) { + return topicFeignClient.auditRecord(topicId); + } + + @Override + public Result> listOfTopic(TokenDto userDetail, TopicListFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + formDto.setGridId(userDetail.getGridId()); + return topicFeignClient.listOfTopic(formDto); + } + + @Override + public Result> listTopicOfMine(TokenDto userDetail, TopicListFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + formDto.setUserId(userDetail.getUserId()); + return topicFeignClient.listOfTopic(formDto); + } + + @Override + public Result changeToIssue(TokenDto userDetail, TopicChangeToIssueFormDTO formDto) { + if (null == userDetail) { + return new Result().error("获取用户信息失败"); + } + formDto.setUserId(userDetail.getUserId()); + return topicFeignClient.changeToIssue(formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/EpdcCommentsAndAttitudeFromTopicFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/EpdcCommentsAndAttitudeFromTopicFormDTO.java new file mode 100644 index 000000000..65221ea4f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/EpdcCommentsAndAttitudeFromTopicFormDTO.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.dto.comment; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * + * 话题评论、评论支持反对数据 + * + * @Author:liuchuang + * @Date:2019/11/12 14:17 + */ +@Data +public class EpdcCommentsAndAttitudeFromTopicFormDTO implements Serializable { + private static final long serialVersionUID = 8779307899428155354L; + + /** + * 评论 + */ + private List comments; + + /** + * 表态 + */ + private List attitudes; +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventSubmitFormDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventSubmitFormDTO.java index 9ff25f7d6..05585d995 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventSubmitFormDTO.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventSubmitFormDTO.java @@ -46,7 +46,7 @@ public class EpdcEventSubmitFormDTO implements Serializable { /** * 区ID */ - @NotBlank(message = "用户区ID不能为空") + @NotNull(message = "用户区ID不能为空") private Long areaId; /** * 街道 @@ -55,7 +55,7 @@ public class EpdcEventSubmitFormDTO implements Serializable { /** * 街道ID */ - @NotBlank(message = "用户街道ID不能为空") + @NotNull(message = "用户街道ID不能为空") private Long streetId; /** * 社区 @@ -64,7 +64,7 @@ public class EpdcEventSubmitFormDTO implements Serializable { /** * 社区ID */ - @NotBlank(message = "用户社区ID不能为空") + @NotNull(message = "用户社区ID不能为空") private Long communityId; /** * 网格 @@ -73,7 +73,7 @@ public class EpdcEventSubmitFormDTO implements Serializable { /** * 网格ID */ - @NotBlank(message = "用户网格ID不能为空") + @NotNull(message = "用户网格ID不能为空") private Long gridId; /** * 用户ID @@ -100,4 +100,14 @@ public class EpdcEventSubmitFormDTO implements Serializable { * 手机号 */ private String mobile; + + /** + * 社群ID + */ + private String groupId; + + /** + * 社群名称 + */ + private String groupName; } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/interfacelog/InterfaceLogDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/interfacelog/InterfaceLogDTO.java new file mode 100644 index 000000000..0889cd6df --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/interfacelog/InterfaceLogDTO.java @@ -0,0 +1,96 @@ +/** + * 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.elink.esua.epdc.dto.interfacelog; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 接口日志表 接口日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-14 + */ +@Data +public class InterfaceLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 业务类型 + */ + private String businessType; + + /** + * 调用接口名称 + */ + private String interfaceName; + + /** + * 调用是否成功 0-调用失败,1-调用成功 + */ + private String successFlag; + + /** + * 调用消息体 + */ + private String callMsgBody; + + /** + * 调用返回消息体 + */ + private String returnMsgBody; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + +} 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 82b333663..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 @@ -21,7 +21,6 @@ import java.io.Serializable; import java.util.Date; import lombok.Data; -import java.math.BigDecimal; /** * 议题表 议题表 @@ -129,11 +128,6 @@ public class IssueDTO implements Serializable { */ private Double issueLongitude; - /** - * 友邻社区ID - */ - private String friendlyCommunityId; - /** * 议题状态 0-审核通过,2-已关闭,4-已转项目 */ @@ -169,4 +163,19 @@ public class IssueDTO implements Serializable { */ private Date updatedTime; + /** + * 社群ID + */ + private String groupId; + + /** + * 社群名称 + */ + 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 b10f649d8..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 @@ -19,6 +19,7 @@ package com.elink.esua.epdc.dto.item; import java.io.Serializable; import java.util.Date; + import lombok.Data; import java.math.BigDecimal; @@ -37,32 +38,32 @@ public class ItemDTO implements Serializable { /** * ID */ - private String id; + private String id; /** * 事件ID */ - private String eventId; + private String eventId; /** * 议题ID */ - private String issueId; + private String issueId; /** * 用户ID */ - private String userId; + private String userId; /** * 用户昵称 */ - private String nickName; + private String nickName; /** * 用户头像 */ - private String userFace; + private String userFace; /** * 手机号 */ @@ -71,116 +72,127 @@ public class ItemDTO implements Serializable { /** * 议题内容 */ - private String issueContent; + private String issueContent; /** * 区 */ - private String area; + private String area; /** * 区ID */ - private Long areaId; + private Long areaId; /** * 街道 */ - private String street; + private String street; /** * 街道ID */ - private Long streetId; + private Long streetId; /** * 社区 */ - private String community; + private String community; /** * 社区ID */ - private Long communityId; + private Long communityId; /** * 网格 */ - private String grid; + private String grid; /** * 网格ID */ - private Long gridId; + private Long gridId; /** * 议题位置地址 */ - private String issueAddress; + private String issueAddress; /** * 议题分类ID */ - private String issueCategoryId; + private String issueCategoryId; /** * 议题位置纬度 */ - private Double issusLatitude; + private Double issusLatitude; /** * 议题位置经度 */ - private Double issueLongitude; - - /** - * 友邻社区ID - */ - private String friendlyCommunityId; + private Double issueLongitude; /** * 评价打分 */ - private Integer issueScore; + private Integer issueScore; /** * 项目状态 0-待网格长处理,5-待社区处理,10-待街道党建办处理,15-待街道处理,20-待区直部门党建办处理,25-待区直部门处理,30-处理,35-关闭,40-结束议题 */ - private Integer itemState; + private Integer itemState; /** * 删除标识 0:未删除,1:已删除 */ - private String delFlag; + private String delFlag; /** * 乐观锁 */ - private Integer revision; + private Integer revision; /** * 创建人 */ - private String createdBy; + private String createdBy; /** * 创建时间 */ - private Date createdTime; + private Date createdTime; /** * 更新人 */ - private String updatedBy; + private String updatedBy; /** * 更新时间 */ - private Date updatedTime; + private Date updatedTime; + + + /** + * 社群ID + */ + private String groupId; + + /** + * 社群名称 + */ + private String groupName; /** * 最后一次处理时间 */ private Date lastHandleTime; + /** + * 话题ID + */ + private String topicId; + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/log/DeptRespondLogDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/log/DeptRespondLogDTO.java new file mode 100644 index 000000000..82a1edd0c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/log/DeptRespondLogDTO.java @@ -0,0 +1,96 @@ +/** + * 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.elink.esua.epdc.dto.log; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 部门响应记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-22 + */ +@Data +public class DeptRespondLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 引用类型 issue或item + */ + private String referenceType; + + /** + * 响应部门的id(被呼叫的部门即审核部门) + */ + private Long respondDeptId; + + /** + * 响应时间即审核时间 + */ + private Date respondTime; + + /** + * 响应类型,参考枚举类DeptRespondTypeEnum + */ + private Integer respondType; + + /** + * 删除标识 0:未删除,1:删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rule/DeptKpiConfigDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rule/DeptKpiConfigDTO.java new file mode 100644 index 000000000..5212e70e1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rule/DeptKpiConfigDTO.java @@ -0,0 +1,86 @@ +/** + * 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.elink.esua.epdc.dto.rule; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 考核规则 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-21 + */ +@Data +public class DeptKpiConfigDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 绩效指标编码 + */ + private String kpiItemCode; + + /** + * 绩效指标值 + */ + private Integer kpiItemValue; + + /** + * 绩效指标描述 + */ + private String kpiItemDesc; + + /** + * 删除标识 0:未删除,1:删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/time/DeptRespondTimeConfigDTO.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/time/DeptRespondTimeConfigDTO.java new file mode 100644 index 000000000..7440d1cb8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/time/DeptRespondTimeConfigDTO.java @@ -0,0 +1,127 @@ +/** + * 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.elink.esua.epdc.dto.time; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 绩效考核时间规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Data +public class DeptRespondTimeConfigDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 议题或项目类别ID(不可重复) + */ + private String categoryId; + + /** + * 类别名称 + */ + private String categoryName; + + /** + * 网格长在多少小时内响应算是有效响应 + */ + private Integer gridValidRespLimitHour; + + /** + * 网格长在多少小时内关闭算是有效关闭 + */ + private Integer gridValidCloseLimitHour; + + /** + * 社区在多少小时内响应算是有效响应 + */ + private Integer commValidRespLimitHour; + + /** + * 街道在多少小时内响应算是有效响应 + */ + private Integer streetValidRespLimitHour; + + /** + * 区直在多少小时内响应算是有效响应 + */ + private Integer districtValidRespLimitHour; + + /** + * 超过多少小时响应算是无效响应。此值应大于各部门的有效响应值。若响应发生在有效响应与无效响应之间,为超时响应。 + */ + private Integer invalidRespLimitHour; + + /** + * 有效响应系数 + */ + private BigDecimal validRespCoefficient; + + /** + * 超时响应系数 + */ + private BigDecimal overtimeRespCoefficient; + + /** + * 无效响应系数 + */ + private BigDecimal invalidRespCoefficient; + + /** + * 删除标识 0:未删除,1:删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/DeptKpiConfigEnum.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/DeptKpiConfigEnum.java new file mode 100644 index 000000000..d27fb7316 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/DeptKpiConfigEnum.java @@ -0,0 +1,58 @@ +package com.elink.esua.epdc.enums; + +/** + * 部门绩效考核项枚举 + * + * @author work@yujt.net.cn + * @date 2019/10/21 14:28 + */ +public enum DeptKpiConfigEnum { + + /** + * 选用单词:Grid(网格) Work(工作) Score(得分) Percent(百分比) + */ + G_WSP("G_WSP", "履行抓基层党建工作职责得分占比(%)"), + /** + * 选用单词:People(人们) Satisfied(满意) Percent(百分比) + */ + P_SP("P_SP", "群众满意度得分占比(%)"), + /** + * 选用单词:Grid(网格) Respond(响应) + */ + G_R("G_R", "群众反应问题网格响应率得分"), + /** + * 选用单词:Grid(网格) Satisfied(满意) + */ + G_S("G_S", "群众反应问题网格满意率得分"), + /** + * 选用单词:District(地区) Street(街道) Respond(响应) + */ + DS_R("DS_R", "(区直/街道)网格呼叫事项响应率得分"), + /** + * 选用单词:District(地区) Street(街道) Complete(完成) + */ + DS_C("DS_C", "(区直/街道)网格呼叫事项办结率得分"), + /** + * 选用单词:District(地区) Street(街道) Satisfied(满意) + */ + DS_S("DS_S", "(区直/街道)网格工作评议得分"); + + + private String code; + + private String desc; + + + DeptKpiConfigEnum(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/DeptRespondTypeEnum.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/DeptRespondTypeEnum.java new file mode 100644 index 000000000..e6569d443 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/DeptRespondTypeEnum.java @@ -0,0 +1,88 @@ +package com.elink.esua.epdc.enums; + + +import com.elink.esua.epdc.constant.EventIssueItemState; + +/** + * 部门响应类型枚举 + * + * @author work@yujt.net.cn + * @date 2019/10/21 09:52 + */ +public enum DeptRespondTypeEnum { + + /** + * 项目:处理 + */ + ITEM_I_HANDLE(ItemHandleCategoryEnum.HANDLE_I_HANDLE.getValue(), ItemHandleCategoryEnum.HANDLE_I_HANDLE.getName()), + /** + * 项目:流转协助 + */ + ITEM_CIRCULATION_ASSISTANCE(ItemHandleCategoryEnum.HANDLE_CIRCULATION_ASSISTANCE.getValue(), ItemHandleCategoryEnum.HANDLE_CIRCULATION_ASSISTANCE.getName()), + /** + * 项目:关闭 + */ + ITEM_HANDLED_CLOSE(ItemHandleCategoryEnum.HANDLE_CLOSE.getValue(), ItemHandleCategoryEnum.HANDLE_CLOSE.getName()), + /** + * 项目:结案 + */ + ITEM_HANDLED_END(ItemHandleCategoryEnum.HANDLE_CLOSING_CASE.getValue(), ItemHandleCategoryEnum.HANDLE_CLOSING_CASE.getName()), + + + //------------------------------------- + + /** + * 事件-驳回 + */ + EVENT_REVIEW_REJECT(EventIssueItemState.EVENT_REVIEW_REJECT,"事件驳回"), + + //----------------------------------------------------------- + /** + * 议题:审核通过 成为议题 + */ + ISSUE_HANDLED_PASS(EventIssueItemState.ISSUE_HANDLED_PASS, "审核通过"), + /** + * 议题:议题-已转项目 + */ + ISSUE_CHANGE_TO_ITEM(EventIssueItemState.ISSUE_CHANGE_TO_ITEM, "审核通过"), + /** + * 议题:反馈 + */ + ISSUE_HANDLED_FEEDBACK(EventIssueItemState.ISSUE_HANDLED_FEEDBACK, "反馈"), + /** + * 议题:关闭 + */ + ISSUE_CLOSED(EventIssueItemState.ISSUE_CLOSED, "关闭"), + + + //------------------------------------- + + + /** + * 被抢占响应(还未响应时,议题或项目已被关闭或结案) + */ + RESPONSE_BE_ROBBED(-1, "被抢占响应"), + + /** + * 超时响应 + */ + RESPONSE_TIMED_OUT(-2, "超时响应"); + + private int value; + private String desc; + + DeptRespondTypeEnum(int value, String desc) { + this.value = value; + this.desc = desc; + } + + + public int getValue() { + return value; + } + + public String getDesc() { + return desc; + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java new file mode 100644 index 000000000..6921bcdd3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java @@ -0,0 +1,35 @@ +package com.elink.esua.epdc.enums; + +/** + * 议题或项目枚举 + * + * @author work@yujt.net.cn + * @date 2019/10/21 10:30 + */ +public enum ReferenceTypeEnum { + + /** + * 议题 + */ + ISSUE("issue"), + + /** + * 项目 + */ + ITEM("item"), + + /** + * 事件 + */ + EVENT("event"); + + private String name; + + ReferenceTypeEnum(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/async/DeptRespondTask.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/async/DeptRespondTask.java new file mode 100644 index 000000000..7dd9776e8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/async/DeptRespondTask.java @@ -0,0 +1,138 @@ +package com.elink.esua.epdc.modules.async; + +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.security.user.UserDetail; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.constant.EventIssueItemState; +import com.elink.esua.epdc.constant.EventsNoticeConstant; +import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; +import com.elink.esua.epdc.dto.issue.form.IssueWaitHandleSubmitFormDTO; +import com.elink.esua.epdc.dto.item.form.ItemHandleSubmitFormDTO; +import com.elink.esua.epdc.dto.log.DeptRespondLogDTO; +import com.elink.esua.epdc.enums.DeptRespondTypeEnum; +import com.elink.esua.epdc.enums.ItemHandleCategoryEnum; +import com.elink.esua.epdc.enums.ReferenceTypeEnum; +import com.elink.esua.epdc.modules.issue.service.IssueService; +import com.elink.esua.epdc.modules.log.entity.DeptRespondLogEntity; +import com.elink.esua.epdc.modules.log.service.DeptRespondLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import java.util.Date; + +/** + * @author: qushutong + * @Date: 2019/10/22 14:22 + * @Description: 响应log日志 + */ +@Component +public class DeptRespondTask { + + @Autowired + private DeptRespondLogService deptRespondLogService; + + /*** + * 转议题插入部门响应记录 4-事件-审核通过 2-事件-驳回 + * @param dto + * @return void + * @author qushutong + * @date 2019/10/22 11:06 + */ + @Async + public void saveEventDeptRespond(EpdcEventsReviewFormDTO dto) { + //待审核 则不插入 + if (EventIssueItemState.EVENT_PENDING_REVIEW == dto.getEventState()) { + return; + } + //组装插入数据 + DeptRespondLogEntity entity = new DeptRespondLogEntity(); + UserDetail user = SecurityUser.getUser(); + entity.setReferenceId(dto.getId()); + entity.setReferenceType(ReferenceTypeEnum.EVENT.getName()); + entity.setRespondDeptId(user.getDeptId()); + entity.setRespondTime(new Date()); + //审核通过 + if (EventIssueItemState.EVENT_REVIEW_PASS == dto.getEventState()) { + entity.setRespondType(DeptRespondTypeEnum.ISSUE_HANDLED_PASS.getValue()); + }//驳回 + else if (EventIssueItemState.EVENT_REVIEW_REJECT == dto.getEventState()) { + entity.setRespondType(DeptRespondTypeEnum.EVENT_REVIEW_REJECT.getValue()); + } + DeptRespondLogDTO deptRespondLogDTO = ConvertUtils.sourceToTarget(entity, DeptRespondLogDTO.class); + deptRespondLogService.save(deptRespondLogDTO); + } + + /*** + * 议事处理审核/关闭 1-反馈,2-关闭,4-已转项目 不是这三种状态不作响应 + * @param dto + * @return void + * @author qushutong + * @date 2019/10/22 14:51 + */ + @Async + public void saveIssueDeptRespond(IssueWaitHandleSubmitFormDTO dto) { + //1-反馈,2-关闭,4-已转项目 不是这三种状态不作响应 + if (EventIssueItemState.ISSUE_CLOSED != dto.getState() || EventIssueItemState.ISSUE_HANDLED_FEEDBACK != dto.getState() || EventIssueItemState.ISSUE_CHANGE_TO_ITEM != dto.getState()) { + return; + } + //组装插入数据 + DeptRespondLogEntity entity = new DeptRespondLogEntity(); + UserDetail user = SecurityUser.getUser(); + entity.setReferenceId(dto.getId()); + entity.setReferenceType(ReferenceTypeEnum.ISSUE.getName()); + entity.setRespondDeptId(user.getDeptId()); + entity.setRespondTime(new Date()); + //议题关闭 1-反馈,2-关闭,4-已转项目 + if (EventIssueItemState.ISSUE_CLOSED == dto.getState()) { + entity.setRespondType(DeptRespondTypeEnum.ISSUE_CLOSED.getValue()); + } + //议题审核 + else if (EventIssueItemState.ISSUE_HANDLED_FEEDBACK == dto.getState()) { + entity.setRespondType(DeptRespondTypeEnum.ISSUE_HANDLED_FEEDBACK.getValue()); + } + //已转项目 + else if (EventIssueItemState.ISSUE_CHANGE_TO_ITEM == dto.getState()) { + entity.setRespondType(DeptRespondTypeEnum.ISSUE_CHANGE_TO_ITEM.getValue()); + } + DeptRespondLogDTO deptRespondLogDTO = ConvertUtils.sourceToTarget(entity, DeptRespondLogDTO.class); + deptRespondLogService.save(deptRespondLogDTO); + } + + + /*** + * 项目 处理方式:0 处理,1 流转协助,5 关闭,10 结案 + * @param dto + * @return void + * @author qushutong + * @date 2019/10/22 16:03 + */ + @Async + public void saveItemDeptRespond(ItemHandleSubmitFormDTO dto) { + //组装插入数据 + DeptRespondLogEntity entity = new DeptRespondLogEntity(); + UserDetail user = SecurityUser.getUser(); + entity.setReferenceId(dto.getId()); + entity.setReferenceType(ReferenceTypeEnum.ITEM.getName()); + entity.setRespondDeptId(user.getDeptId()); + entity.setRespondTime(new Date()); + //流转 + if (ItemHandleCategoryEnum.HANDLE_CIRCULATION_ASSISTANCE.getValue() == dto.getHandleCategory()) { + entity.setRespondType(DeptRespondTypeEnum.ITEM_CIRCULATION_ASSISTANCE.getValue()); + } + //关闭 + else if (ItemHandleCategoryEnum.HANDLE_CLOSE.getValue() == dto.getHandleCategory()) { + entity.setRespondType(DeptRespondTypeEnum.ITEM_HANDLED_CLOSE.getValue()); + } + //结案 + else if (ItemHandleCategoryEnum.HANDLE_CLOSING_CASE.getValue() == dto.getHandleCategory()) { + entity.setRespondType(DeptRespondTypeEnum.ITEM_HANDLED_END.getValue()); + } + //处理 + else if (ItemHandleCategoryEnum.HANDLE_CLOSING_CASE.getValue() == dto.getHandleCategory()) { + entity.setRespondType(DeptRespondTypeEnum.ITEM_I_HANDLE.getValue()); + } + DeptRespondLogDTO deptRespondLogDTO = ConvertUtils.sourceToTarget(entity, DeptRespondLogDTO.class); + deptRespondLogService.save(deptRespondLogDTO); + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java index d960b1330..cc13e34c0 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/AppEventCommentController.java @@ -40,7 +40,7 @@ public class AppEventCommentController { @Autowired private EventCommentUserAttitudeService eventCommentUserAttitudeService; - /** + /**AppTopicCommentController * 提交评论或回复接口 * @param commentFormDTO * @return diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/EventCommentController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/EventCommentController.java index c2da1982d..47be820d3 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/EventCommentController.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/controller/EventCommentController.java @@ -25,6 +25,7 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; 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.comment.EpdcCommentsAndAttitudeFromTopicFormDTO; import com.elink.esua.epdc.dto.comment.EventCommentDTO; import com.elink.esua.epdc.modules.comment.excel.EventCommentExcel; import com.elink.esua.epdc.modules.comment.service.EventCommentService; @@ -91,4 +92,18 @@ public class EventCommentController { ExcelUtils.exportExcelToTarget(response, null, list, EventCommentExcel.class); } + /** + * + * 接收话题评论和评论表态 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/12 14:25 + */ + @PostMapping("receive") + public Result receiveTopicCommentAndAttitude(@RequestBody EpdcCommentsAndAttitudeFromTopicFormDTO formDto){ + return eventCommentService.saveCommentAndAttitudeFromTopic(formDto); + } + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java index 7cc635474..da75da155 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/EventCommentService.java @@ -20,6 +20,7 @@ package com.elink.esua.epdc.modules.comment.service; import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.comment.EpdcCommentsAndAttitudeFromTopicFormDTO; import com.elink.esua.epdc.dto.comment.EventCommentDTO; import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; @@ -148,4 +149,15 @@ public interface EventCommentService extends BaseService { * @Date: 2019/9/9 19:05 */ IssueHotCommentResultDTO getHotComment(String eventId); + + /** + * + * 接收话题评论和评论表态 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/12 14:26 + */ + Result saveCommentAndAttitudeFromTopic(EpdcCommentsAndAttitudeFromTopicFormDTO formDto); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java index 272425aa0..2702cd908 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java @@ -26,7 +26,9 @@ import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.constant.EventsNoticeConstant; +import com.elink.esua.epdc.dto.comment.EpdcCommentsAndAttitudeFromTopicFormDTO; import com.elink.esua.epdc.dto.comment.EventCommentDTO; +import com.elink.esua.epdc.dto.comment.EventCommentUserAttitudeDTO; import com.elink.esua.epdc.dto.comment.form.CommentFormDTO; import com.elink.esua.epdc.dto.comment.form.EventCommentsFormDTO; import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO; @@ -36,7 +38,9 @@ import com.elink.esua.epdc.dto.issue.result.IssueHotCommentResultDTO; import com.elink.esua.epdc.modules.async.NewsTask; import com.elink.esua.epdc.modules.comment.dao.EventCommentDao; import com.elink.esua.epdc.modules.comment.entity.EventCommentEntity; +import com.elink.esua.epdc.modules.comment.entity.EventCommentUserAttitudeEntity; import com.elink.esua.epdc.modules.comment.service.EventCommentService; +import com.elink.esua.epdc.modules.comment.service.EventCommentUserAttitudeService; import com.elink.esua.epdc.modules.events.service.EpdcEventsService; import com.elink.esua.epdc.modules.issue.entity.IssueEntity; import com.elink.esua.epdc.modules.issue.service.IssueService; @@ -49,6 +53,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; @@ -76,6 +81,9 @@ public class EventCommentServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -289,4 +297,28 @@ public class EventCommentServiceImpl extends BaseServiceImpl commentEntities = new ArrayList<>(formDto.getComments().size()); + for (EventCommentDTO dto: + formDto.getComments()) { + EventCommentEntity entity = ConvertUtils.sourceToTarget(dto, EventCommentEntity.class); + commentEntities.add(entity); + } + this.insertBatch(commentEntities); + + // 保存表态 + List attitudeEntities = new ArrayList<>(formDto.getAttitudes().size()); + for (EventCommentUserAttitudeDTO dto: + formDto.getAttitudes()) { + EventCommentUserAttitudeEntity entity = ConvertUtils.sourceToTarget(dto, EventCommentUserAttitudeEntity.class); + attitudeEntities.add(entity); + } + eventCommentUserAttitudeService.insertBatch(attitudeEntities); + + return new Result(); + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java index acf532d2c..baeed4a1b 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java @@ -77,7 +77,7 @@ public interface EpdcEventsDao extends BaseDao { List selectListOfCommentsByEventId(Map params); /** - * 修改评论数+1 + * 评论数+1 */ void updateCommentNum(String id); 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 83a4c583a..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 @@ -114,10 +114,6 @@ public class EpdcEventsEntity extends BaseEpdcEntity { * 议题位置经度 */ private Double issueLongitude; - /** - * 友邻社区ID - */ - private String friendlyCommunityId; /** * 事件状态 0-待审核,2-驳回,4-审核通过 */ @@ -143,4 +139,19 @@ public class EpdcEventsEntity extends BaseEpdcEntity { */ private Integer browseNum; + /** + * 社群ID + */ + private String groupId; + + /** + * 社群名称 + */ + 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/excel/EpdcEventsExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/excel/EpdcEventsExcel.java index 37e56cbb0..f05e88e29 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/excel/EpdcEventsExcel.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/excel/EpdcEventsExcel.java @@ -61,8 +61,6 @@ public class EpdcEventsExcel { private BigDecimal issusLatitude; @Excel(name = "议题位置经度") private BigDecimal issueLongitude; - @Excel(name = "友邻社区ID") - private String friendlyCommunityId; @Excel(name = "事件状态 0-待审核,2-驳回,4-审核通过") private Integer eventState; @Excel(name = "删除标识 0:未删除,1:已删除") 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 b97407fab..3c53d730a 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; @@ -38,12 +39,14 @@ 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.modules.async.DeptRespondTask; import com.elink.esua.epdc.modules.async.NewsTask; import com.elink.esua.epdc.modules.events.dao.EpdcEventsDao; 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; @@ -54,6 +57,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.Arrays; +import java.util.List; +import java.util.Map; import java.util.*; /** @@ -77,12 +83,18 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl listOfPendingReviewEvents(Map params) { IPage page = getPage(params); @@ -97,9 +109,9 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - String issueCategoryId = (String)params.get("issueCategoryId"); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + String issueCategoryId = (String) params.get("issueCategoryId"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); wrapper.eq(StringUtils.isNotBlank(issueCategoryId), "ISSUE_CATEGORY_ID", issueCategoryId); @@ -174,7 +186,7 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl callbackMap = new HashMap<>(); + callbackMap.put("topicId", topicId); + callbackMap.put("processingOpinions", dto.getAdvice()); + callbackMap.put("eventId", dto.getId()); + if (dto.getEventState().equals(EventIssueItemState.EVENT_REVIEW_REJECT)) { + callbackMap.put("state", NumConstant.ZERO_STR); + } else if (dto.getEventState().equals(EventIssueItemState.EVENT_REVIEW_PASS)) { + callbackMap.put("state", "10"); + } + + groupFeignClient.reviewCallback(callbackMap); + } + @Override public PageData listOfRejectEvents(Map params) { IPage page = getPage(params); @@ -231,7 +271,7 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl callbackMap); + + /** + * + * 更新话题状态 + * + * @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(Map map); + +} 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..8ec25bf14 --- /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.modules.feign.GroupFeignClient; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * @Author:liuchuang + * @Date:2019/11/11 10:31 + */ +@Component +public class GroupFeignClientFallback implements GroupFeignClient { + + @Override + public Result reviewCallback(Map callbackMap) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "reviewCallback", callbackMap); + } + + @Override + public Result modifyTopicState(Map map) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "modifyTopicState", map); + } +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/controller/InterfaceLogController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/controller/InterfaceLogController.java new file mode 100644 index 000000000..bb61055b2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/controller/InterfaceLogController.java @@ -0,0 +1,94 @@ +/** + * 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.elink.esua.epdc.modules.interfacelog.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; +import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; +import com.elink.esua.epdc.dto.interfacelog.InterfaceLogDTO; +import com.elink.esua.epdc.modules.interfacelog.excel.InterfaceLogExcel; +import com.elink.esua.epdc.modules.interfacelog.service.InterfaceLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 接口日志表 接口日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-14 + */ +@RestController +@RequestMapping("interfacelog") +public class InterfaceLogController { + + @Autowired + private InterfaceLogService interfaceLogService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = interfaceLogService.listInterfaceLog(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + InterfaceLogDTO data = interfaceLogService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody InterfaceLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + interfaceLogService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody InterfaceLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + interfaceLogService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + interfaceLogService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = interfaceLogService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, InterfaceLogExcel.class); + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/dao/InterfaceLogDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/dao/InterfaceLogDao.java new file mode 100644 index 000000000..6cf6b38ca --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/dao/InterfaceLogDao.java @@ -0,0 +1,42 @@ +/** + * 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.elink.esua.epdc.modules.interfacelog.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.interfacelog.InterfaceLogDTO; +import com.elink.esua.epdc.modules.interfacelog.entity.InterfaceLogEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 接口日志表 接口日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-14 + */ +@Mapper +public interface InterfaceLogDao extends BaseDao { + /** + * + * @param params + * @return 获取接口日志列表 + */ + List listInterfaceLog(Map params); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/entity/InterfaceLogEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/entity/InterfaceLogEntity.java new file mode 100644 index 000000000..a6c14a871 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/entity/InterfaceLogEntity.java @@ -0,0 +1,69 @@ +/** + * 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.elink.esua.epdc.modules.interfacelog.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 接口日志表 接口日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_interface_log") +public class InterfaceLogEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 业务类型 + */ + private String businessType; + + /** + * 调用接口名称 + */ + private String interfaceName; + + /** + * 调用是否成功 0-调用失败,1-调用成功 + */ + private String successFlag; + + /** + * 调用消息体 + */ + private String callMsgBody; + + /** + * 调用返回消息体 + */ + private String returnMsgBody; + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/excel/InterfaceLogExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/excel/InterfaceLogExcel.java new file mode 100644 index 000000000..7026148f9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/excel/InterfaceLogExcel.java @@ -0,0 +1,71 @@ +/** + * 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.elink.esua.epdc.modules.interfacelog.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 接口日志表 接口日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-14 + */ +@Data +public class InterfaceLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "引用ID") + private String referenceId; + + @Excel(name = "业务类型") + private String businessType; + + @Excel(name = "调用接口名称") + private String interfaceName; + + @Excel(name = "调用是否成功 0-调用失败,1-调用成功") + private String successFlag; + + @Excel(name = "调用消息体") + private String callMsgBody; + + @Excel(name = "调用返回消息体") + private String returnMsgBody; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标记") + private String delFlag; + + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/redis/InterfaceLogRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/redis/InterfaceLogRedis.java new file mode 100644 index 000000000..01e7e7a1d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/redis/InterfaceLogRedis.java @@ -0,0 +1,47 @@ +/** + * 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.elink.esua.epdc.modules.interfacelog.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 接口日志表 接口日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-14 + */ +@Component +public class InterfaceLogRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/service/InterfaceLogService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/service/InterfaceLogService.java new file mode 100644 index 000000000..4b7aed2d4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/service/InterfaceLogService.java @@ -0,0 +1,95 @@ +/** + * 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.elink.esua.epdc.modules.interfacelog.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.interfacelog.InterfaceLogDTO; +import com.elink.esua.epdc.modules.interfacelog.entity.InterfaceLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 接口日志表 接口日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-14 + */ +public interface InterfaceLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-14 + */ + PageData listInterfaceLog(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-14 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return InterfaceLogDTO + * @author generator + * @date 2019-11-14 + */ + InterfaceLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-14 + */ + void save(InterfaceLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-14 + */ + void update(InterfaceLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-14 + */ + void delete(String[] ids); +} diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/service/impl/InterfaceLogServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/service/impl/InterfaceLogServiceImpl.java new file mode 100644 index 000000000..2b2b86bf6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/service/impl/InterfaceLogServiceImpl.java @@ -0,0 +1,101 @@ +/** + * 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.elink.esua.epdc.modules.interfacelog.service.impl; + +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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dto.interfacelog.InterfaceLogDTO; +import com.elink.esua.epdc.modules.interfacelog.dao.InterfaceLogDao; +import com.elink.esua.epdc.modules.interfacelog.entity.InterfaceLogEntity; +import com.elink.esua.epdc.modules.interfacelog.redis.InterfaceLogRedis; +import com.elink.esua.epdc.modules.interfacelog.service.InterfaceLogService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 接口日志表 接口日志表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-14 + */ +@Service +public class InterfaceLogServiceImpl extends BaseServiceImpl implements InterfaceLogService { + + @Autowired + private InterfaceLogRedis interfaceLogRedis; + + @Override + public PageData listInterfaceLog(Map params) { + IPage page = getPage(params); + List list = baseDao.listInterfaceLog(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, InterfaceLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public InterfaceLogDTO get(String id) { + InterfaceLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, InterfaceLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(InterfaceLogDTO dto) { + InterfaceLogEntity entity = ConvertUtils.sourceToTarget(dto, InterfaceLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(InterfaceLogDTO dto) { + InterfaceLogEntity entity = ConvertUtils.sourceToTarget(dto, InterfaceLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } +} 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 624462745..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 @@ -139,14 +139,24 @@ public class IssueEntity extends BaseEpdcEntity { */ private Double issueLongitude; - /** - * 友邻社区ID - */ - private String friendlyCommunityId; - /** * 议题状态 0-审核通过,2-已关闭,4-已转项目 */ private Integer issueState; + /** + * 社群ID + */ + private String groupId; + + /** + * 社群名称 + */ + 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/excel/IssueExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/excel/IssueExcel.java index da5d09cc7..3d0817900 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/excel/IssueExcel.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/excel/IssueExcel.java @@ -86,9 +86,6 @@ public class IssueExcel { @Excel(name = "议题位置经度") private BigDecimal issueLongitude; - @Excel(name = "友邻社区ID") - private String friendlyCommunityId; - @Excel(name = "议题状态 0-审核通过,2-已关闭,4-已转项目") private Integer issueState; 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 03e0a8d61..e37d8c502 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 @@ -39,9 +39,11 @@ 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.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; @@ -58,10 +60,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 议题表 议题表 @@ -93,6 +92,13 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Autowired private NewsTask newsTask; + @Autowired + private DeptRespondTask deptRespondTask; + + @Autowired + private GroupFeignClient groupFeignClient; + + @Override public PageData listOfIssues(Map params) { IPage page = getPage(params); @@ -107,8 +113,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp return ConvertUtils.sourceToTarget(entityList, IssueDTO.class); } - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -171,7 +177,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp informationFormDTO.setType(EventsNoticeConstant.NOTICE_TYPE_PROGRESS_NOTICE); informationFormDTO.setBusinessType(EventsNoticeConstant.NOTICE_BUSINESS_TYPE_ITEM); informationFormDTO.setBusinessId(entity.getId()); - informationFormDTO.setRelBusinessContent("议题:"+entity.getIssueContent()); + informationFormDTO.setRelBusinessContent("议题:" + entity.getIssueContent()); // 反馈、关闭 if (EventIssueItemState.ISSUE_HANDLED_FEEDBACK == dto.getState() || EventIssueItemState.ISSUE_CLOSED == dto.getState()) { @@ -208,11 +214,20 @@ public class IssueServiceImpl extends BaseServiceImpl imp informationFormDTO.setBusinessId(itemEntity.getId()); + // 事件来源-友邻社群 + if (StringUtils.isNotEmpty(entity.getGroupId())) { + // 更新话题状态 + Map map = new HashMap<>(); + map.put("topicId", entity.getTopicId()); + map.put("state", "15"); + groupFeignClient.modifyTopicState(map); + } // 发送菜单消息-待处理项目 itemService.sendItemHandleMenuNotice(itemEntity.getGridId(), null); } } - + //插入绩效部门响应日志表 + deptRespondTask.saveIssueDeptRespond(dto); // 发送消息 newsTask.insertUserInformation(informationFormDTO); // 发送菜单消息-议题待处理 @@ -264,7 +279,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp formDto.setSomeMonthsAgo(DateUtils.addDateMonths(new Date(), -6)); List data = baseDao.selectListOfNewOrHotIssues(formDto); // 查询最热评论 - for (IssueResultDTO dto: + for (IssueResultDTO dto : data) { IssueHotCommentResultDTO resultDTO = eventCommentService.getHotComment(dto.getEventId()); dto.setComment(resultDTO); @@ -298,7 +313,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp public Result> listIssuesAndEventsOfMine(IssuesAndEventsOfMineFormDTO formDTO) { List data = baseDao.selectListOfIssuesAndEventsOfMine(formDTO); // 查询最热评论 - for (IssuesAndEventsOfMineResultDTO dto: + for (IssuesAndEventsOfMineResultDTO dto : data) { IssueHotCommentResultDTO resultDTO = eventCommentService.getHotComment(dto.getEventId()); dto.setComment(resultDTO); @@ -325,6 +340,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp /** * 初始化项目 + * * @Params: [issueEntity] * @Return: com.elink.esua.epdc.modules.item.entity.ItemEntity * @Author: liuchuang @@ -353,7 +369,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp itemEntity.setIssueAddress(issueEntity.getIssueAddress()); itemEntity.setIssueLongitude(issueEntity.getIssueLongitude()); itemEntity.setIssueLatitude(issueEntity.getIssueLatitude()); - itemEntity.setFriendlyCommunityId(issueEntity.getFriendlyCommunityId()); + itemEntity.setGroupId(issueEntity.getGroupId()); + itemEntity.setGroupName(issueEntity.getGroupName()); itemEntity.setItemState(EventIssueItemState.ITEM_HANDLING); itemEntity.setLastHandleTime(new Date()); return itemEntity; 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 4e2bc160a..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 @@ -33,143 +33,153 @@ import java.util.Date; * @since v1.0.0 2019-09-04 */ @Data -@EqualsAndHashCode(callSuper=false) +@EqualsAndHashCode(callSuper = false) @TableName("epdc_item") public class ItemEntity extends BaseEpdcEntity { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; /** * 事件ID */ - private String eventId; + private String eventId; /** * 议题ID */ - private String issueId; + private String issueId; /** * 用户ID */ - private String userId; + private String userId; /** * 用户昵称 */ - private String nickName; + private String nickName; /** * 用户头像 */ - private String userFace; + private String userFace; - /** - * 党员标识 0:否,1:是 - */ - private String isPartyMember; - - /** - * 手机号 - */ - private String mobile; + /** + * 党员标识 0:否,1:是 + */ + private String isPartyMember; /** * 议题内容 */ - private String itemContent; + private String itemContent; - /** - * 发布时间 - */ - private Date distributeTime; + /** + * 发布时间 + */ + private Date distributeTime; /** * 区 */ - private String area; + private String area; /** * 区ID */ - private Long areaId; + private Long areaId; /** * 街道 */ - private String street; + private String street; /** * 街道ID */ - private Long streetId; + private Long streetId; /** * 社区 */ - private String community; + private String community; /** * 社区ID */ - private Long communityId; + private Long communityId; /** * 网格 */ - private String grid; + private String grid; /** * 网格ID */ - private Long gridId; + private Long gridId; /** * 议题位置地址 */ - private String issueAddress; + private String issueAddress; /** * 议题分类ID */ - private String issueCategoryId; + private String issueCategoryId; /** * 议题位置纬度 */ - private Double issueLatitude; + private Double issueLatitude; /** * 议题位置经度 */ - private Double issueLongitude; + private Double issueLongitude; /** - * 友邻社区ID + * 满意度评价得分 + */ + private Integer evaluationScore; + /** + * 满意度评价内容 */ - private String friendlyCommunityId; - + private String evaluationContent; /** - * 满意度评价得分 + * 满意度评价时间 */ - private Integer evaluationScore; - /** - * 满意度评价内容 - */ - private String evaluationContent; - /** - * 满意度评价时间 - */ - private Date evaluationTime; + private Date evaluationTime; /** * 项目状态 0-处理中,5-已关闭,10-已结案 */ - private Integer itemState; + private Integer itemState; + + /** + * 手机号 + */ + private String mobile; + + /** + * 社群ID + */ + private String groupId; + + /** + * 社群名称 + */ + private String groupName; + + /** + * 最后一次处理时间 + */ + private Date lastHandleTime; - /** - * 最后一次处理时间 - */ - 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/item/excel/ItemExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/ItemExcel.java index 6380d7761..20e431f49 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/ItemExcel.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/excel/ItemExcel.java @@ -89,9 +89,6 @@ public class ItemExcel { @Excel(name = "议题位置经度") private BigDecimal issueLongitude; - @Excel(name = "友邻社区ID") - private String friendlyCommunityId; - @Excel(name = "评价打分") private Integer issueScore; diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java index e2d2f3bd8..0a4ebc2b9 100755 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java @@ -45,6 +45,7 @@ import com.elink.esua.epdc.dto.item.ItemPendingHandleDTO; import com.elink.esua.epdc.dto.item.form.*; import com.elink.esua.epdc.dto.item.result.*; import com.elink.esua.epdc.enums.ItemHandleCategoryEnum; +import com.elink.esua.epdc.modules.async.DeptRespondTask; import com.elink.esua.epdc.modules.async.NewsTask; import com.elink.esua.epdc.modules.events.service.EpdcEventsService; import com.elink.esua.epdc.modules.feign.AdminFeignClient; @@ -93,6 +94,9 @@ public class ItemServiceImpl extends BaseServiceImpl implem @Autowired private NewsTask newsTask; + @Autowired + private DeptRespondTask deptRespondTask; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -132,8 +136,8 @@ public class ItemServiceImpl extends BaseServiceImpl implem return ConvertUtils.sourceToTarget(entityList, ItemDTO.class); } - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -199,7 +203,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem @Override public Result evaluation(EvaluationFormDTO evaluationFormDTO) { ItemEntity itemEntityResult = baseDao.selectById(evaluationFormDTO.getItemId()); - if (itemEntityResult.getUserId().equals(evaluationFormDTO.getUserId()) && itemEntityResult.getEvaluationScore() == null){ + if (itemEntityResult.getUserId().equals(evaluationFormDTO.getUserId()) && itemEntityResult.getEvaluationScore() == null) { ItemEntity itemEntity = new ItemEntity(); itemEntity.setId(evaluationFormDTO.getItemId()); itemEntity.setEvaluationScore(evaluationFormDTO.getEvaluationScore()); @@ -207,7 +211,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem itemEntity.setEvaluationTime(new Date()); baseDao.updateById(itemEntity); return new Result(); - }else { + } else { return new Result().error("您无法评价"); } } @@ -247,6 +251,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem /** * 项目详情-网格-可做操作和可流转部门 + * * @Params: [resultDTO, itemDeptDTOS] * @Return: com.elink.esua.epdc.dto.item.result.ItemDetailForPCEndResultDTO * @Author: liuchuang @@ -268,7 +273,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem if (null != itemDeptDTOS && itemDeptDTOS.size() > 0) { selected = true; // 判断已流转部门 - for (ItemDeptDTO dto: + for (ItemDeptDTO dto : itemDeptDTOS) { if (dto.getDeptId().equals(completeDeptDTO.getCommunityId())) { communitySelected = true; @@ -314,6 +319,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem /** * 项目详情-社区、街道部门、区直部门-可做操作 + * * @Params: [resultDTO] * @Return: com.elink.esua.epdc.dto.item.result.ItemDetailForPCEndResultDTO * @Author: liuchuang @@ -334,13 +340,14 @@ public class ItemServiceImpl extends BaseServiceImpl implem /** * 项目详情-街道党工委-可做操作和可流转部门 + * * @Params: [resultDTO, itemDeptDTOS] * @Return: com.elink.esua.epdc.dto.item.result.ItemDetailForPCEndResultDTO * @Author: liuchuang * @Date: 2019/9/16 16:17 */ private ItemDetailForPCEndResultDTO getHandleCategoryAndCirculationDeptOfStreet(ItemDetailForPCEndResultDTO resultDTO, - List itemDeptDTOS) { + List itemDeptDTOS) { // 可流转部门 Result> listResult = adminFeignClient.listOfItemCirculationDept(SecurityUser.getDeptId()); if (!listResult.success()) { @@ -349,14 +356,14 @@ public class ItemServiceImpl extends BaseServiceImpl implem List deptDTOS = listResult.getData(); // 初始化可流转部门-街道党工委:街道部门、区直部门 List deptResultDTOS = new ArrayList<>(); - for (SysDeptDTO dto: + for (SysDeptDTO dto : deptDTOS) { ItemCirculationDeptResultDTO circulationDeptResultDTO = new ItemCirculationDeptResultDTO(); circulationDeptResultDTO.setDeptId(dto.getId()); circulationDeptResultDTO.setDeptName(dto.getName()); circulationDeptResultDTO.setTypeKey(dto.getTypeKey()); circulationDeptResultDTO.setSelected(false); - for (ItemDeptDTO dto1: + for (ItemDeptDTO dto1 : itemDeptDTOS) { if (dto.getId().equals(dto1.getDeptId())) { circulationDeptResultDTO.setSelected(true); @@ -408,7 +415,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem informationFormDTO.setBusinessType(EventsNoticeConstant.NOTICE_BUSINESS_TYPE_ITEM); informationFormDTO.setBusinessId(entity.getId()); informationFormDTO.setTitle(EventsNoticeConstant.NOTICE_ITEM_HANDLE); - informationFormDTO.setRelBusinessContent("项目:"+entity.getItemContent()); + informationFormDTO.setRelBusinessContent("项目:" + entity.getItemContent()); ItemHandleProcessEntity handleProcessEntity = new ItemHandleProcessEntity(); handleProcessEntity.setHandlerDeptId(user.getDeptId()); @@ -435,7 +442,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem itemDeptService.saveItemDepts(SecurityUser.getDeptId(), dto, handleProcessEntity.getId()); List circulationDeptResultDTOS = dto.getDeptResultDTOS(); List newDeptIds = new ArrayList<>(); - for (ItemCirculationDeptResultDTO circulationDto: + for (ItemCirculationDeptResultDTO circulationDto : circulationDeptResultDTOS) { newDeptIds.add(circulationDto.getDeptId()); } @@ -469,6 +476,14 @@ public class ItemServiceImpl extends BaseServiceImpl implem handleProcessEntity.setHandlerDeptId(user.getDeptId()); itemHandleProcessService.insert(handleProcessEntity); } + // 记录处理记录 + handleProcessEntity.setItemId(dto.getId()); + handleProcessEntity.setHandleAdvice(dto.getHandleAdvice()); + handleProcessEntity.setOutHandleAdvice(dto.getOutHandleAdvice()); + handleProcessEntity.setHandlerDeptId(user.getDeptId()); + itemHandleProcessService.insert(handleProcessEntity); + //插入部门响应表 + deptRespondTask.saveItemDeptRespond(dto); // 更新项目最后一次处理时间 ItemEntity itemEntity = new ItemEntity(); @@ -496,6 +511,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem /** * 项目流转校验 + * * @Params: [dto] * @Return: com.elink.esua.epdc.commons.tools.utils.Result * @Author: liuchuang @@ -508,7 +524,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem } // 校验是否跨级流转 String typeKey = ""; - for (ItemCirculationDeptResultDTO circulationDeptResultDTO: + for (ItemCirculationDeptResultDTO circulationDeptResultDTO : dto.getDeptResultDTOS()) { if (!"".equals(typeKey) && !typeKey.equals(circulationDeptResultDTO.getTypeKey())) { return new Result().error("不可跨级流转协助,请重新选择流转协助部门"); @@ -526,7 +542,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem // 获取街道党工委已流转协助部门 List itemDeptDTOS = itemDeptService.listOfItemDept(dto.getId(), completeDept.getData().getStreetId()); if (null != itemDeptDTOS && itemDeptDTOS.size() > 0) { - return new Result().error(completeDept.getData().getStreet()+"已将该项目流转协助到其他部门,不能重新流转协助"); + return new Result().error(completeDept.getData().getStreet() + "已将该项目流转协助到其他部门,不能重新流转协助"); } } @@ -592,7 +608,7 @@ public class ItemServiceImpl extends BaseServiceImpl implem public void sendWhistlingDeptItemHandleMenuNotice(List deptIds, Long userId) { MenuNoticeDTO menuNoticeDTO = new MenuNoticeDTO(); menuNoticeDTO.setMenuCode(MenuCodeConstant.PARTY_GROUP_DISCUSSION_ITEM_HANDLE); - for (Long deptId: + for (Long deptId : deptIds) { // 获取吹哨部门待处理项目数量 int num = baseDao.selectCountOfItemWhistlingDeptNotice(deptId); diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/controller/DeptRespondLogController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/controller/DeptRespondLogController.java new file mode 100644 index 000000000..b8cc0bcfe --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/controller/DeptRespondLogController.java @@ -0,0 +1,94 @@ +/** + * 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.elink.esua.epdc.modules.log.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +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.log.DeptRespondLogDTO; +import com.elink.esua.epdc.modules.log.excel.DeptRespondLogExcel; +import com.elink.esua.epdc.modules.log.service.DeptRespondLogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 部门响应记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-22 + */ +@RestController +@RequestMapping("deptrespondlog") +public class DeptRespondLogController { + + @Autowired + private DeptRespondLogService deptRespondLogService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = deptRespondLogService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DeptRespondLogDTO data = deptRespondLogService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DeptRespondLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + deptRespondLogService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DeptRespondLogDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + deptRespondLogService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + deptRespondLogService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = deptRespondLogService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DeptRespondLogExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/dao/DeptRespondLogDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/dao/DeptRespondLogDao.java new file mode 100644 index 000000000..17bbfc82f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/dao/DeptRespondLogDao.java @@ -0,0 +1,33 @@ +/** + * 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.elink.esua.epdc.modules.log.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.log.entity.DeptRespondLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 部门响应记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-22 + */ +@Mapper +public interface DeptRespondLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/entity/DeptRespondLogEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/entity/DeptRespondLogEntity.java new file mode 100644 index 000000000..67fd80106 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/entity/DeptRespondLogEntity.java @@ -0,0 +1,66 @@ +/** + * 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.elink.esua.epdc.modules.log.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 部门响应记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_dept_respond_log") +public class DeptRespondLogEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 引用类型 issue或item + */ + private String referenceType; + + /** + * 响应部门的id(被呼叫的部门即审核部门) + */ + private Long respondDeptId; + + /** + * 响应时间即审核时间 + */ + private Date respondTime; + + /** + * 响应类型,参考枚举类DeptRespondTypeEnum + */ + private Integer respondType; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/excel/DeptRespondLogExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/excel/DeptRespondLogExcel.java new file mode 100644 index 000000000..12e31f896 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/excel/DeptRespondLogExcel.java @@ -0,0 +1,71 @@ +/** + * 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.elink.esua.epdc.modules.log.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 部门响应记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-22 + */ +@Data +public class DeptRespondLogExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "引用ID") + private String referenceId; + + @Excel(name = "引用类型 issue或item") + private String referenceType; + + @Excel(name = "响应部门的id(被呼叫的部门即审核部门)") + private Long respondDeptId; + + @Excel(name = "响应时间即审核时间") + private Date respondTime; + + @Excel(name = "响应类型,参考枚举类DeptRespondTypeEnum") + private Integer respondType; + + @Excel(name = "删除标识 0:未删除,1:删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/redis/DeptRespondLogRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/redis/DeptRespondLogRedis.java new file mode 100644 index 000000000..e186849fb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/redis/DeptRespondLogRedis.java @@ -0,0 +1,47 @@ +/** + * 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.elink.esua.epdc.modules.log.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 部门响应记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-22 + */ +@Component +public class DeptRespondLogRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/service/DeptRespondLogService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/service/DeptRespondLogService.java new file mode 100644 index 000000000..5c62038bf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/service/DeptRespondLogService.java @@ -0,0 +1,95 @@ +/** + * 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.elink.esua.epdc.modules.log.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.log.DeptRespondLogDTO; +import com.elink.esua.epdc.modules.log.entity.DeptRespondLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 部门响应记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-22 + */ +public interface DeptRespondLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-10-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-10-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DeptRespondLogDTO + * @author generator + * @date 2019-10-22 + */ + DeptRespondLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-22 + */ + void save(DeptRespondLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-22 + */ + void update(DeptRespondLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-10-22 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/service/impl/DeptRespondLogServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/service/impl/DeptRespondLogServiceImpl.java new file mode 100644 index 000000000..d8f3c4afa --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/service/impl/DeptRespondLogServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.elink.esua.epdc.modules.log.service.impl; + +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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.modules.log.dao.DeptRespondLogDao; +import com.elink.esua.epdc.dto.log.DeptRespondLogDTO; +import com.elink.esua.epdc.modules.log.entity.DeptRespondLogEntity; +import com.elink.esua.epdc.modules.log.redis.DeptRespondLogRedis; +import com.elink.esua.epdc.modules.log.service.DeptRespondLogService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 部门响应记录 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-22 + */ +@Service +public class DeptRespondLogServiceImpl extends BaseServiceImpl implements DeptRespondLogService { + + @Autowired + private DeptRespondLogRedis deptRespondLogRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DeptRespondLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DeptRespondLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DeptRespondLogDTO get(String id) { + DeptRespondLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DeptRespondLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DeptRespondLogDTO dto) { + DeptRespondLogEntity entity = ConvertUtils.sourceToTarget(dto, DeptRespondLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DeptRespondLogDTO dto) { + DeptRespondLogEntity entity = ConvertUtils.sourceToTarget(dto, DeptRespondLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/controller/DeptKpiConfigController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/controller/DeptKpiConfigController.java new file mode 100644 index 000000000..db8f9d0f7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/controller/DeptKpiConfigController.java @@ -0,0 +1,94 @@ +/** + * 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.elink.esua.epdc.modules.rule.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +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.rule.DeptKpiConfigDTO; +import com.elink.esua.epdc.modules.rule.excel.DeptKpiConfigExcel; +import com.elink.esua.epdc.modules.rule.service.DeptKpiConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 考核规则 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-21 + */ +@RestController +@RequestMapping("deptkpiconfig") +public class DeptKpiConfigController { + + @Autowired + private DeptKpiConfigService deptKpiConfigService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = deptKpiConfigService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DeptKpiConfigDTO data = deptKpiConfigService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DeptKpiConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + deptKpiConfigService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DeptKpiConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + deptKpiConfigService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + deptKpiConfigService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = deptKpiConfigService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DeptKpiConfigExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/dao/DeptKpiConfigDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/dao/DeptKpiConfigDao.java new file mode 100644 index 000000000..1caa6de84 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/dao/DeptKpiConfigDao.java @@ -0,0 +1,33 @@ +/** + * 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.elink.esua.epdc.modules.rule.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.rule.entity.DeptKpiConfigEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 考核规则 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-21 + */ +@Mapper +public interface DeptKpiConfigDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/entity/DeptKpiConfigEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/entity/DeptKpiConfigEntity.java new file mode 100644 index 000000000..490bc2989 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/entity/DeptKpiConfigEntity.java @@ -0,0 +1,56 @@ +/** + * 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.elink.esua.epdc.modules.rule.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 考核规则 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_dept_kpi_config") +public class DeptKpiConfigEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 绩效指标编码 + */ + private String kpiItemCode; + + /** + * 绩效指标值 + */ + private Integer kpiItemValue; + + /** + * 绩效指标描述 + */ + private String kpiItemDesc; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/excel/DeptKpiConfigExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/excel/DeptKpiConfigExcel.java new file mode 100644 index 000000000..a9092adb9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/excel/DeptKpiConfigExcel.java @@ -0,0 +1,65 @@ +/** + * 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.elink.esua.epdc.modules.rule.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 考核规则 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-21 + */ +@Data +public class DeptKpiConfigExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "绩效指标编码") + private String kpiItemCode; + + @Excel(name = "绩效指标值") + private Integer kpiItemValue; + + @Excel(name = "绩效指标描述") + private String kpiItemDesc; + + @Excel(name = "删除标识 0:未删除,1:删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/redis/DeptKpiConfigRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/redis/DeptKpiConfigRedis.java new file mode 100644 index 000000000..2d3edfa20 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/redis/DeptKpiConfigRedis.java @@ -0,0 +1,47 @@ +/** + * 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.elink.esua.epdc.modules.rule.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 考核规则 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-21 + */ +@Component +public class DeptKpiConfigRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/service/DeptKpiConfigService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/service/DeptKpiConfigService.java new file mode 100644 index 000000000..7ce501ae3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/service/DeptKpiConfigService.java @@ -0,0 +1,95 @@ +/** + * 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.elink.esua.epdc.modules.rule.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.rule.DeptKpiConfigDTO; +import com.elink.esua.epdc.modules.rule.entity.DeptKpiConfigEntity; + +import java.util.List; +import java.util.Map; + +/** + * 考核规则 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-21 + */ +public interface DeptKpiConfigService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-10-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-10-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DeptKpiConfigDTO + * @author generator + * @date 2019-10-21 + */ + DeptKpiConfigDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-21 + */ + void save(DeptKpiConfigDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-21 + */ + void update(DeptKpiConfigDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-10-21 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/service/impl/DeptKpiConfigServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/service/impl/DeptKpiConfigServiceImpl.java new file mode 100644 index 000000000..43d7e4900 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/service/impl/DeptKpiConfigServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.elink.esua.epdc.modules.rule.service.impl; + +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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.modules.rule.dao.DeptKpiConfigDao; +import com.elink.esua.epdc.dto.rule.DeptKpiConfigDTO; +import com.elink.esua.epdc.modules.rule.entity.DeptKpiConfigEntity; +import com.elink.esua.epdc.modules.rule.redis.DeptKpiConfigRedis; +import com.elink.esua.epdc.modules.rule.service.DeptKpiConfigService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 考核规则 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-21 + */ +@Service +public class DeptKpiConfigServiceImpl extends BaseServiceImpl implements DeptKpiConfigService { + + @Autowired + private DeptKpiConfigRedis deptKpiConfigRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DeptKpiConfigDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DeptKpiConfigDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DeptKpiConfigDTO get(String id) { + DeptKpiConfigEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DeptKpiConfigDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DeptKpiConfigDTO dto) { + DeptKpiConfigEntity entity = ConvertUtils.sourceToTarget(dto, DeptKpiConfigEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DeptKpiConfigDTO dto) { + DeptKpiConfigEntity entity = ConvertUtils.sourceToTarget(dto, DeptKpiConfigEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/controller/DeptRespondTimeConfigController.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/controller/DeptRespondTimeConfigController.java new file mode 100644 index 000000000..67a67eb81 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/controller/DeptRespondTimeConfigController.java @@ -0,0 +1,94 @@ +/** + * 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.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +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.time.DeptRespondTimeConfigDTO; +import com.elink.esua.epdc.modules.time.excel.DeptRespondTimeConfigExcel; +import com.elink.esua.epdc.modules.time.service.DeptRespondTimeConfigService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 绩效考核时间规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@RestController +@RequestMapping("deptrespondtimeconfig") +public class DeptRespondTimeConfigController { + + @Autowired + private DeptRespondTimeConfigService deptRespondTimeConfigService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = deptRespondTimeConfigService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + DeptRespondTimeConfigDTO data = deptRespondTimeConfigService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody DeptRespondTimeConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + deptRespondTimeConfigService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody DeptRespondTimeConfigDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + deptRespondTimeConfigService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + deptRespondTimeConfigService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = deptRespondTimeConfigService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, DeptRespondTimeConfigExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/dao/DeptRespondTimeConfigDao.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/dao/DeptRespondTimeConfigDao.java new file mode 100644 index 000000000..f082f1715 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/dao/DeptRespondTimeConfigDao.java @@ -0,0 +1,33 @@ +/** + * 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.elink.esua.epdc.modules.time.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.time.entity.DeptRespondTimeConfigEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 绩效考核时间规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Mapper +public interface DeptRespondTimeConfigDao extends BaseDao { + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/entity/DeptRespondTimeConfigEntity.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/entity/DeptRespondTimeConfigEntity.java new file mode 100644 index 000000000..0d913789a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/entity/DeptRespondTimeConfigEntity.java @@ -0,0 +1,97 @@ +/** + * 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.elink.esua.epdc.modules.time.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 绩效考核时间规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_dept_respond_time_config") +public class DeptRespondTimeConfigEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题或项目类别ID(不可重复) + */ + private String categoryId; + + /** + * 类别名称 + */ + private String categoryName; + + /** + * 网格长在多少小时内响应算是有效响应 + */ + private Integer gridValidRespLimitHour; + + /** + * 网格长在多少小时内关闭算是有效关闭 + */ + private Integer gridValidCloseLimitHour; + + /** + * 社区在多少小时内响应算是有效响应 + */ + private Integer commValidRespLimitHour; + + /** + * 街道在多少小时内响应算是有效响应 + */ + private Integer streetValidRespLimitHour; + + /** + * 区直在多少小时内响应算是有效响应 + */ + private Integer districtValidRespLimitHour; + + /** + * 超过多少小时响应算是无效响应。此值应大于各部门的有效响应值。若响应发生在有效响应与无效响应之间,为超时响应。 + */ + private Integer invalidRespLimitHour; + + /** + * 有效响应系数 + */ + private BigDecimal validRespCoefficient; + + /** + * 超时响应系数 + */ + private BigDecimal overtimeRespCoefficient; + + /** + * 无效响应系数 + */ + private BigDecimal invalidRespCoefficient; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/excel/DeptRespondTimeConfigExcel.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/excel/DeptRespondTimeConfigExcel.java new file mode 100644 index 000000000..d9fd7ea01 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/excel/DeptRespondTimeConfigExcel.java @@ -0,0 +1,90 @@ +/** + * 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.elink.esua.epdc.modules.time.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 绩效考核时间规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Data +public class DeptRespondTimeConfigExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "议题或项目类别ID(不可重复)") + private String categoryId; + + @Excel(name = "类别名称") + private String categoryName; + + @Excel(name = "网格长在多少小时内响应算是有效响应") + private Integer gridValidRespLimitHour; + + @Excel(name = "网格长在多少小时内关闭算是有效关闭") + private Integer gridValidCloseLimitHour; + + @Excel(name = "社区在多少小时内响应算是有效响应") + private Integer commValidRespLimitHour; + + @Excel(name = "街道在多少小时内响应算是有效响应") + private Integer streetValidRespLimitHour; + + @Excel(name = "区直在多少小时内响应算是有效响应") + private Integer districtValidRespLimitHour; + + @Excel(name = "超过多少小时响应算是无效响应。此值应大于各部门的有效响应值。若响应发生在有效响应与无效响应之间,为超时响应。") + private Integer invalidRespLimitHour; + + @Excel(name = "有效响应系数") + private BigDecimal validRespCoefficient; + + @Excel(name = "超时响应系数") + private BigDecimal overtimeRespCoefficient; + + @Excel(name = "无效响应系数") + private BigDecimal invalidRespCoefficient; + + @Excel(name = "删除标识 0:未删除,1:删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/redis/DeptRespondTimeConfigRedis.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/redis/DeptRespondTimeConfigRedis.java new file mode 100644 index 000000000..7126b78f4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/redis/DeptRespondTimeConfigRedis.java @@ -0,0 +1,47 @@ +/** + * 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.elink.esua.epdc.modules.time.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 绩效考核时间规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Component +public class DeptRespondTimeConfigRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/service/DeptRespondTimeConfigService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/service/DeptRespondTimeConfigService.java new file mode 100644 index 000000000..22e891acb --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/service/DeptRespondTimeConfigService.java @@ -0,0 +1,95 @@ +/** + * 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.elink.esua.epdc.modules.time.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.time.DeptRespondTimeConfigDTO; +import com.elink.esua.epdc.modules.time.entity.DeptRespondTimeConfigEntity; + +import java.util.List; +import java.util.Map; + +/** + * 绩效考核时间规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +public interface DeptRespondTimeConfigService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-10-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-10-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DeptRespondTimeConfigDTO + * @author generator + * @date 2019-10-23 + */ + DeptRespondTimeConfigDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-23 + */ + void save(DeptRespondTimeConfigDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-23 + */ + void update(DeptRespondTimeConfigDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-10-23 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/service/impl/DeptRespondTimeConfigServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/service/impl/DeptRespondTimeConfigServiceImpl.java new file mode 100644 index 000000000..d8d41269a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/service/impl/DeptRespondTimeConfigServiceImpl.java @@ -0,0 +1,104 @@ +/** + * 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.elink.esua.epdc.modules.time.service.impl; + +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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.modules.time.dao.DeptRespondTimeConfigDao; +import com.elink.esua.epdc.dto.time.DeptRespondTimeConfigDTO; +import com.elink.esua.epdc.modules.time.entity.DeptRespondTimeConfigEntity; +import com.elink.esua.epdc.modules.time.redis.DeptRespondTimeConfigRedis; +import com.elink.esua.epdc.modules.time.service.DeptRespondTimeConfigService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 绩效考核时间规则表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Service +public class DeptRespondTimeConfigServiceImpl extends BaseServiceImpl implements DeptRespondTimeConfigService { + + @Autowired + private DeptRespondTimeConfigRedis deptRespondTimeConfigRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DeptRespondTimeConfigDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DeptRespondTimeConfigDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DeptRespondTimeConfigDTO get(String id) { + DeptRespondTimeConfigEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DeptRespondTimeConfigDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DeptRespondTimeConfigDTO dto) { + DeptRespondTimeConfigEntity entity = ConvertUtils.sourceToTarget(dto, DeptRespondTimeConfigEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DeptRespondTimeConfigDTO dto) { + DeptRespondTimeConfigEntity entity = ConvertUtils.sourceToTarget(dto, DeptRespondTimeConfigEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/logback-spring.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/logback-spring.xml index 79a7dad72..88e9cdde6 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/logback-spring.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/logback-spring.xml @@ -133,7 +133,10 @@ - + + + + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/interfacelog/InterfaceLogDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/interfacelog/InterfaceLogDao.xml new file mode 100644 index 000000000..7eccbda04 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/interfacelog/InterfaceLogDao.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/log/DeptRespondLogDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/log/DeptRespondLogDao.xml new file mode 100644 index 000000000..52fb4fe51 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/log/DeptRespondLogDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/rule/DeptKpiConfigDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/rule/DeptKpiConfigDao.xml new file mode 100644 index 000000000..24a56affc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/rule/DeptKpiConfigDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/tiime/DeptRespondTimeConfigDao.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/tiime/DeptRespondTimeConfigDao.xml new file mode 100644 index 000000000..be817060e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/tiime/DeptRespondTimeConfigDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/pom.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-client/pom.xml new file mode 100644 index 000000000..0a7cc8b07 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/pom.xml @@ -0,0 +1,42 @@ + + + + epdc-group + com.esua.epdc + 1.0.0 + + 4.0.0 + + epdc-group-client + jar + + + + com.esua.epdc + epdc-commons-tools + 1.0.0 + + + com.esua.epdc + epdc-admin-client + 1.0.0 + + + com.esua.epdc + epdc-news-client + 1.0.0 + + + com.esua.epdc + epdc-user-client + 1.0.0 + + + com.esua.epdc + epdc-events-client + 1.0.0 + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentDTO.java new file mode 100755 index 000000000..3b284fcd5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentDTO.java @@ -0,0 +1,141 @@ +/** + * 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.elink.esua.epdc.dto.comment; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题评论表 话题评论表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Data +public class TopicCommentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 话题ID + */ + private String topicId; + + /** + * 评论人ID + */ + private String userId; + + /** + * 评论人昵称 + */ + private String username; + + /** + * 评论人头像 + */ + private String userFace; + + /** + * 评论内容 + */ + private String content; + + /** + * 评论类型 0:评论,1:回复,2:回复的回复 + */ + private String commentType; + + /** + * 回复的评论ID + */ + private String commentId; + + /** + * 被回复数 + */ + private Integer replyCount; + + /** + * 被回复人ID + */ + private String replyUserId; + + /** + * 被回复人名称 + */ + private String replyUsername; + + /** + * 被回复人头像 + */ + private String replyUserFace; + + /** + * 点赞数 + */ + private Integer likeCount; + + /** + * 点踩数 + */ + private Integer unLikeCount; + + /** + * 屏蔽标识 0:未屏蔽,1:已屏蔽 + */ + private String shieldFlag; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java new file mode 100644 index 000000000..d968ed85f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.elink.esua.epdc.dto.comment; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; + +/** + * 评论议题、提交评论 + * + */ +@Data +public class TopicCommentFormDTO { + + private static final long serialVersionUID = 1L; + + private String topicId; + + private String faCommentId; + + @Size(min = 1, max = 500, message = "评论内容不能超过500字") + private String content; + + /** + * 评论人ID + */ + @NotBlank(message = "评论人ID不能为空") + private String userId; + + /** + * 评论人昵称 + */ + private String userName; + + /** + * 评论人头像 + */ + private String userFace; + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentListDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentListDTO.java new file mode 100644 index 000000000..a13fcaa55 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentListDTO.java @@ -0,0 +1,62 @@ +package com.elink.esua.epdc.dto.comment; + +import com.elink.esua.epdc.dto.topic.ReplyCommentDto; +import com.elink.esua.epdc.dto.topic.UserBaseInfoDto; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author:liuchuang + * @Date:2019/11/12 10:55 + */ +@Data +public class TopicCommentListDTO implements Serializable { + private static final long serialVersionUID = 1678760230045285655L; + + /** + * 评论ID + */ + private String commentId; + /** + * 内容 + */ + private String content; + /** + * 用户是否赞过,false未赞 + */ + private boolean userLike; + /** + * 用户是否踩过,true踩 + */ + private boolean userDislike; + /** + * 评论时间 + */ + private Date commentTime; + /** + * 赞数 + */ + private Integer approveNum; + /** + * 踩数 + */ + private Integer opposeNum; + /** + * 表态次数 + */ + private Integer attitudeNum; + /** + * 用户信息 + */ + private UserBaseInfoDto user; + /** + * 屏蔽标识 0:未屏蔽,1:已屏蔽 + */ + private String shieldFlag; + /** + * 回复评论信息 + */ + private ReplyCommentDto replyComment; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentStatementFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentStatementFormDTO.java new file mode 100755 index 000000000..4e2e1fa0f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentStatementFormDTO.java @@ -0,0 +1,47 @@ +/** + * 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.elink.esua.epdc.dto.comment; + +import java.io.Serializable; +import lombok.Data; + + +@Data +public class TopicCommentStatementFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 表态 0赞;1踩;2取消点赞;3取消点踩 + */ + private String attitude; + + /** + * 评论ID + */ + private String commentId; + + private String topicId; + + private String useId; + + private String userName; + + + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentUserAttitudeDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentUserAttitudeDTO.java new file mode 100755 index 000000000..df61b235c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentUserAttitudeDTO.java @@ -0,0 +1,86 @@ +/** + * 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.elink.esua.epdc.dto.comment; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题评论用户表态表 话题评论用户表态表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Data +public class TopicCommentUserAttitudeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 评论ID + */ + private String commentId; + + /** + * 用户ID + */ + private String userId; + + /** + * 表态标识 0:点赞,1:点踩 + */ + private String attitudeFlag; + + /** + * 删除标记 0:未删除,1:删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentsFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentsFormDTO.java new file mode 100644 index 000000000..5878065a8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentsFormDTO.java @@ -0,0 +1,43 @@ +package com.elink.esua.epdc.dto.comment; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 移动端评论表单DTO + * @Author LC + * @Date 2019/9/9 15:09 + */ +@Data +public class TopicCommentsFormDTO implements Serializable { + private static final long serialVersionUID = -3804142943077174555L; + + /** + * 页码 + */ + @NotNull(message = "页码不能为空") + private Integer pageIndex; + /** + * 页容量 + */ + @NotNull(message = "分页数量不能为空") + private Integer pageSize; + /** + * 时间戳(yyyy-MM-dd HH:mm:ss) + */ + private String timestamp; + /** + * 列表类型 0最新;1最热 + */ + @NotBlank(message = "列表类型不能为空") + private String orderType; + + private String topicId; + /** + * 用户ID + */ + private String userId; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentsResultDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentsResultDTO.java new file mode 100644 index 000000000..3b4f3eb1a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentsResultDTO.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.dto.comment; + +import com.elink.esua.epdc.dto.topic.TopicCommentsDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 移动端评论列表DTO + * @Author LC + * @Date 2019/9/9 14:46 + */ +@Data +public class TopicCommentsResultDTO implements Serializable { + private static final long serialVersionUID = -5087234859322214256L; + + /** + * 表态数 + */ + private long statementNum; + + /** + * 评论 + */ + List commentsList; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicDeleteCommentsFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicDeleteCommentsFormDTO.java new file mode 100644 index 000000000..691295d25 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicDeleteCommentsFormDTO.java @@ -0,0 +1,16 @@ +package com.elink.esua.epdc.dto.comment; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author:liuchuang + * @Date:2019/11/12 11:06 + */ +@Data +public class TopicDeleteCommentsFormDTO implements Serializable { + private static final long serialVersionUID = -8359841146893592752L; + + private String[] commentIds; +} 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 new file mode 100644 index 000000000..049fec953 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java @@ -0,0 +1,161 @@ +package com.elink.esua.epdc.dto.constant; + +/** + * + * 发送消息常量 + * + * @Author:liuchuang + * @Date:2019/10/21 13:41 + */ +public interface GroupNoticeConstant { + + /** + * 社群审核未通过 + */ + String NOTICE_GROUP_NOT_PASSED = "你创建的社群【审核未通过】"; + + /** + * 社群审核通过 + */ + String NOTICE_GROUP_PASSED = "你创建的社群【审核通过】"; + + /** + * 社群解散 + */ + String NOTICE_GROUP_DISBAND = "你加入的社群已被解散"; + + /** + * 删除社群成员 + */ + String NOTICE_GROUP_USER_REMOVED_MEMBER = "你已被群主移除社群"; + + /** + * 邀请入群 + */ + String NOTICE_GROUP_USER_INVITED = "您已加入社群"; + + /** + * 邀请入群内容 + */ + String NOTICE_GROUP_USER_INVITED_CONTENT = "您已被群主邀请加入groupName社群,快进入社群看看吧。"; + + /** + * 入群申请通过 + */ + String NOTICE_GROUP_USER_REVIEW_PASSED = "入群申请【审核通过】"; + + /** + * 入群申请不通过 + */ + String NOTICE_GROUP_USER_REVIEW_NOT_PASSED = "入群申请【审核不通过】"; + + /** + * 入群申请通过内容 + */ + String NOTICE_GROUP_USER_REVIEW_PASSED_CONTENT = "您加入groupName社群的申请,审核已通过,快进入社群吧。"; + + /** + * 入群申请不通过内容 + */ + String NOTICE_GROUP_USER_REVIEW_NOT_PASSED_CONTENT = "您加入groupName社群的申请,审核未通过,原因:auditOpinion"; + + /** + * 退出社群 + */ + String NOTICE_GROUP_QUIT = "已退出社群"; + + /** + * 话题关闭 + */ + 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审核通知 + */ + String NOTICE_TYPE_AUDIT_NOTICE = "0"; + + /** + * 我的消息类型:1互动通知 + */ + String NOTICE_TYPE_INTERACTIVE_NOTICE = "1"; + + /** + * 我的消息类型:2进度通知 + */ + String NOTICE_TYPE_PROGRESS_NOTICE = "2"; + + /** + * 我的消息类型:3社群通知 + */ + String NOTICE_TYPE_GROUP_NOTICE = "3"; + + /** + * 消息所属业务类型:社群审核通过 + */ + String NOTICE_BUSINESS_TYPE_GROUP_PASSED = "groupPassed"; + + /** + * 消息所属业务类型:社群审核未通过或解散 + */ + String NOTICE_BUSINESS_TYPE_GROUP_NOT_PASSED_OR_DISBAND = "groupNotPassedOrDisband"; + + /** + * 消息所属业务类型:移除社群成员 + */ + String NOTICE_BUSINESS_TYPE_GROUP_USER_REMOVED_MEMBER = "groupRemovedMember"; + + /** + * 消息所属业务类型:退出社群 + */ + String NOTICE_BUSINESS_TYPE_GROUP_USER_QUIT = "groupQuit"; + + /** + * 社群邀请 + */ + String NOTICE_BUSINESS_TYPE_GROUP_USER_INVITED = "groupInvited"; + + /** + * 入群申请通过 + */ + String NOTICE_BUSINESS_TYPE_GROUP_USER_REVIEW_PASSED = "groupUserReviewPassed"; + + /** + * 入群申请未通过 + */ + String NOTICE_BUSINESS_TYPE_GROUP_USER_REVIEW_NOT_PASS = "groupUserReviewNotPass"; + + /** + * 话题关闭 + */ + 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/constant/TopicImageConstant.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/TopicImageConstant.java new file mode 100644 index 000000000..3161933e4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/TopicImageConstant.java @@ -0,0 +1,16 @@ +package com.elink.esua.epdc.dto.constant; + +/** + * + * 图片类型 + * + * @Author:liuchuang + * @Date:2019/11/6 16:17 + */ +public interface TopicImageConstant { + + /** + * 图片类型-事件 + */ + String TYPE_IMAGE_BIZ_TOPIC = "topic"; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/TopicNoticeConstant.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/TopicNoticeConstant.java new file mode 100644 index 000000000..a86d6702a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/TopicNoticeConstant.java @@ -0,0 +1,52 @@ +package com.elink.esua.epdc.dto.constant; + +/** + * 发送消息常量 + * @Author LC + * @Date 2019/9/18 17:26 + */ +public interface TopicNoticeConstant { + /** + * 话题被评论 + */ + String NOTICE_TOPIC_COMMENT = "你的话题【有新评论】"; + /** + * 评论被回复 + */ + String NOTICE_TOPIC_COMMENT_REPLY = "你的评论【有新回复】"; + /** + * 评论支持 + */ + String NOTICE_COMMENT_APPROVE = "你的评论【有新的支持】"; + /** + * 评论反对 + */ + String NOTICE_COMMENT_OPPOSE = "你的评论【有新的反对】"; + + + + /** + * 我的消息类型:1互动通知 + */ + String NOTICE_TYPE_INTERACTIVE_NOTICE = "1"; + + + /** + * 消息所属业务类型:话题评论 + */ + String NOTICE_BUSINESS_TYPE_TOPIC_COMMENT = "topicComment"; + /** + * 消息所属业务类型:话题评论回复 + */ + String NOTICE_BUSINESS_TYPE_TOPIC_COMMENT_REPLY = "topicCommentReply"; + + /** + * 消息所属业务类型:话题评论支持 + */ + String NOTICE_BUSINESS_TYPE_TOPIC_COMMENT_APPROVE = "topicCommentApprove"; + + /** + * 消息所属业务类型:话题评论反对 + */ + String NOTICE_BUSINESS_TYPE_TOPIC_COMMENT_OPPOSE = "topicCommentOppose"; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupStateEnum.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupStateEnum.java new file mode 100644 index 000000000..934ceb63c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupStateEnum.java @@ -0,0 +1,56 @@ +package com.elink.esua.epdc.dto.enums; + +/** + * + * 社群状态枚举 + * + * @Author:liuchuang + * @Date:2019/10/17 14:15 + */ +public enum GroupStateEnum { + + /** + * 0-待审核 + */ + GROUP_STATE_PENDING_REVIEW(0, "待审核"), + /** + * 5-审核不通过 + */ + GROUP_STATE_AUDIT_NOT_PASSED(5, "审核不通过"), + /** + * 10-审核通过 + */ + GROUP_STATE_EXAMINATION_PASSED(10, "审核通过"), + /** + * 15-禁言 + */ + GROUP_STATE_BANNED(15, "禁言"), + /** + * 20-已解散 + */ + GROUP_STATE_DISBANDED(20, "已解散"); + + private Integer value; + private String name; + + GroupStateEnum(Integer value, String name) { + this.value = value; + this.name = name; + } + + public Integer getValue() { + return value; + } + + public void setValue(Integer value) { + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupUserStateEnum.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupUserStateEnum.java new file mode 100644 index 000000000..43d8829b6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupUserStateEnum.java @@ -0,0 +1,56 @@ +package com.elink.esua.epdc.dto.enums; + +/** + * + * 社群成员状态枚举 + * + * @Author:liuchuang + * @Date:2019/10/17 15:38 + */ +public enum GroupUserStateEnum { + + /** + * 0-待审核 + */ + GROUP_USER_STATE_PENDING_REVIEW(0, "待审核"), + /** + * 5-审核不通过 + */ + GROUP_USER_STATE_AUDIT_NOT_PASSED(5, "审核不通过"), + /** + * 10-审核通过 + */ + GROUP_USER_STATE_EXAMINATION_PASSED(10, "审核通过"), + /** + * 15-已退群 + */ + GROUP_USER_STATE_RETIRED(15, "已退群"), + /** + * 20-已移除 + */ + GROUP_USER_STATE_REMOVED(20, "已移除"); + + private Integer value; + private String name; + + GroupUserStateEnum(Integer value, String name) { + this.value = value; + this.name = name; + } + + public Integer getValue() { + return value; + } + + public void setValue(Integer value) { + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/TopicStateEnum.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/TopicStateEnum.java new file mode 100644 index 000000000..157218ad7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/TopicStateEnum.java @@ -0,0 +1,56 @@ +package com.elink.esua.epdc.dto.enums; + +/** + * + * 话题状态枚举 + * + * @Author:liuchuang + * @Date:2019/11/6 15:11 + */ +public enum TopicStateEnum { + + /** + * 0-讨论中 + */ + TOPIC_STATE_IN_CONVERSATION(0, "讨论中"), + /** + * 5-转议题待审核 + */ + TOPIC_STATE_CHANGE_TO_ISSUE_PENDING_REVIEW(5, "转议题待审核"), + /** + * 10-已转议题 + */ + TOPIC_STATE_CHANGED_ISSUE(10, "已转议题"), + /** + * 15-已转项目 + */ + TOPIC_STATE_CHANGED_ITEM(15, "已转项目"), + /** + * 20-已关闭 + */ + TOPIC_STATE_CLOSED(20, "已关闭"); + + private Integer value; + private String name; + + TopicStateEnum(Integer value, String name) { + this.value = value; + this.name = name; + } + + public Integer getValue() { + return value; + } + + public void setValue(Integer value) { + this.value = value; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupActivityDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupActivityDTO.java new file mode 100644 index 000000000..aea5d2473 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupActivityDTO.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.dto.group; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 社群排行榜-活跃度 + * + * @Author:liuchuang + * @Date:2019/11/12 16:05 + */ +@Data +public class GroupActivityDTO implements Serializable { + private static final long serialVersionUID = -3033977017133093569L; + + /** + * 社群名称 + */ + private String groupName; + + /** + * 所属网格 + */ + private String ownGrid; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupDTO.java new file mode 100644 index 000000000..3cd96de40 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupDTO.java @@ -0,0 +1,141 @@ +/** + * 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.elink.esua.epdc.dto.group; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 社群表 社群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Data +public class GroupDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 社群名称 + */ + private String groupName; + + /** + * 社群头像 + */ + private String groupAvatar; + + /** + * 社群介绍 + */ + private String groupIntroduction; + + /** + * 社群类别 0:党员群,1:自建群 + */ + private String groupCategory; + + /** + * 区 + */ + private String area; + + /** + * 区ID + */ + private Long areaId; + + /** + * 街道 + */ + private String street; + + /** + * 街道ID + */ + private Long streetId; + + /** + * 社区 + */ + private String community; + + /** + * 社区ID + */ + private Long communityId; + + /** + * 网格 + */ + private String grid; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 状态 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散 + */ + private Integer state; + + /** + * 处理意见 + */ + private String processingOpinions; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupDetailDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupDetailDTO.java new file mode 100644 index 000000000..d5148ca1c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupDetailDTO.java @@ -0,0 +1,43 @@ +package com.elink.esua.epdc.dto.group; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * 社群审核详情DTO + * + * @Author:liuchuang + * @Date:2019/10/21 10:24 + */ +@Data +public class GroupDetailDTO implements Serializable { + private static final long serialVersionUID = -7520759616474298301L; + + /** + * 社群ID + */ + private String id; + + /** + * 社群名称 + */ + private String groupName; + + /** + * 社群介绍 + */ + private String groupIntroduction; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 群主 + */ + private String nickname; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupListDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupListDTO.java new file mode 100644 index 000000000..2fbf39f20 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupListDTO.java @@ -0,0 +1,24 @@ +package com.elink.esua.epdc.dto.group; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author:liuchuang + * @Date:2019/11/12 9:28 + */ +@Data +public class GroupListDTO implements Serializable { + private static final long serialVersionUID = 5340620329305821737L; + + /** + * 社群ID + */ + private String groupId; + + /** + * 社群名称 + */ + private String groupName; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupManagementDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupManagementDTO.java new file mode 100644 index 000000000..51e179d5c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupManagementDTO.java @@ -0,0 +1,51 @@ +package com.elink.esua.epdc.dto.group; + + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * 社群管理DTO + * + * @Author:liuchuang + * @Date:2019/10/15 15:05 + */ +@Data +public class GroupManagementDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 社群名称 + */ + private String groupName; + + + /** + * 社群类别 0:党员群,1:自建群 + */ + private String groupCategory; + + /** + * 状态 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散 + */ + private Integer state; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 群主 + */ + private String nickname; + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupMemberDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupMemberDTO.java new file mode 100644 index 000000000..5281597a8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupMemberDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.group; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author:liuchuang + * @Date:2019/11/12 16:07 + */ +@Data +public class GroupMemberDTO implements Serializable { + private static final long serialVersionUID = 5630344874027207828L; + + /** + * 社群名称 + */ + private String groupName; + + /** + * 群成员数量 + */ + private Integer memberNum; + + /** + * 所属网格 + */ + private String ownGrid; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupSettingStateDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupSettingStateDTO.java new file mode 100644 index 000000000..ed725021f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupSettingStateDTO.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.dto.group; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * + * 禁言、解禁、解散社群DTO + * + * @Author:liuchuang + * @Date:2019/10/21 9:21 + */ +@Data +public class GroupSettingStateDTO implements Serializable { + private static final long serialVersionUID = -1288250589698851089L; + + /** + * 社群ID + */ + @NotBlank(message = "社群id不能为空") + private String id; + + /** + * 状态 5:审核不通过,10:审核通过/解禁,15:禁言,20:解散 + */ + @NotNull(message = "社群状态不能为空") + private Integer state; + + /** + * 处理意见 + */ + private String processingOpinions; + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/UserGroupDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/UserGroupDTO.java new file mode 100644 index 000000000..3e34dd3de --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/UserGroupDTO.java @@ -0,0 +1,116 @@ +/** + * 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.elink.esua.epdc.dto.group; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户社群关系表 用户社群关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-17 + */ +@Data +public class UserGroupDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 社群ID + */ + private String groupId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户名 + */ + private String nickname; + + /** + * 用户头像 + */ + private String userAvatar; + + /** + * 手机号 + */ + private String mobile; + + /** + * 群主标识 0:否,1:是 + */ + private String lordFlag; + + /** + * 党员标识 0:否,1:是 + */ + private String partyMember; + + /** + * 状态 0:待审核,5:审核不通过,10:审核通过,15:已退群,20:已移除 + */ + private Integer state; + + /** + * 审核意见 + */ + private String auditOpinion; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/UserReviewDto.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/UserReviewDto.java new file mode 100644 index 000000000..f712861dc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/UserReviewDto.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.dto.group; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author:liuchuang + * @Date:2019/11/6 13:18 + */ +@Data +public class UserReviewDto implements Serializable { + private static final long serialVersionUID = 5555206313726765102L; + + private String id; + + /** + * 审核结果(5:审核不通过,10:审核通过) + */ + @NotNull(message = "审核结果不能为空") + private Integer state; + + /** + * 审核意见 + */ + private String auditOpinion; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupAddUserFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupAddUserFormDTO.java new file mode 100644 index 000000000..1bb8c65b1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupAddUserFormDTO.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * + * 添加成员Form DTO + * + * @Author:liuchuang + * @Date:2019/11/6 9:00 + */ +@Data +public class GroupAddUserFormDTO implements Serializable { + private static final long serialVersionUID = 7220929684754186126L; + + /** + * 社群ID + */ + private String groupId; + + /** + * 添加成员信息 + */ + List groupUserFormDtoList; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupApplyFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupApplyFormDTO.java new file mode 100644 index 000000000..e6965b443 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupApplyFormDTO.java @@ -0,0 +1,49 @@ +package com.elink.esua.epdc.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * + * 申请入群Form DTO + * + * @Author:liuchuang + * @Date:2019/11/11 13:58 + */ +@Data +public class GroupApplyFormDTO implements Serializable { + private static final long serialVersionUID = -1708301010893268772L; + + /** + * 社群ID + */ + @NotBlank(message = "社群ID不能为空") + private String groupId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户名 + */ + private String nickname; + + /** + * 用户头像 + */ + private String userAvatar; + + /** + * 手机号 + */ + private String mobile; + + /** + * 党员标识 0:否,1:是 + */ + private String partyMember; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupCreateFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupCreateFormDTO.java new file mode 100644 index 000000000..45578cde7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupCreateFormDTO.java @@ -0,0 +1,82 @@ +package com.elink.esua.epdc.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; + +/** + * + * 创建社群DTO + * + * @Author:liuchuang + * @Date:2019/10/17 13:52 + */ +@Data +public class GroupCreateFormDTO implements Serializable { + private static final long serialVersionUID = 2948200217356354599L; + + /** + * 社群名称 + */ + @NotBlank(message = "社群名称不能为空且在10个字以内") + @Size(min = 1, max = 10, message = "社群名称不能为空且在10个字以内") + private String groupName; + /** + * 社群头像 + */ + @NotBlank(message = "社群头像不能为空") + private String groupAvatar; + /** + * 社群介绍 + */ + @NotBlank(message = "社群介绍不能为空且在500个字以内") + @Size(min = 1, max = 500, message = "社群介绍不能为空且在500个字以内") + private String groupIntroduction; + /** + * 社群类别 0:党员群,1:自建群 + */ + private String groupCategory; + /** + * 区 + */ + private String area; + /** + * 区ID + */ + @NotNull(message = "用户区ID不能为空") + private Long areaId; + /** + * 街道 + */ + private String street; + /** + * 街道ID + */ + @NotNull(message = "用户街道ID不能为空") + private Long streetId; + /** + * 社区 + */ + private String community; + /** + * 社区ID + */ + @NotNull(message = "用户社区ID不能为空") + private Long communityId; + /** + * 网格 + */ + private String grid; + /** + * 网格ID + */ + @NotNull(message = "用户网格ID不能为空") + private Long gridId; + /** + * 群主信息 + */ + private GroupUserFormDTO groupUserFormDTO; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupDetailForMobileEndFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupDetailForMobileEndFormDTO.java new file mode 100644 index 000000000..746cdff97 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupDetailForMobileEndFormDTO.java @@ -0,0 +1,30 @@ +package com.elink.esua.epdc.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * + * 移动端-社群详情Form DTO + * + * @Author:liuchuang + * @Date:2019/10/22 14:59 + */ +@Data +public class GroupDetailForMobileEndFormDTO implements Serializable { + private static final long serialVersionUID = 143504049551089465L; + + /** + * 社群ID + */ + @NotBlank(message = "社群ID不能为空") + private String id; + + /** + * 用户ID + */ + @NotBlank(message = "用户ID不能为空") + private String userId; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupIntroductionFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupIntroductionFormDTO.java new file mode 100644 index 000000000..2ef659944 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupIntroductionFormDTO.java @@ -0,0 +1,38 @@ +package com.elink.esua.epdc.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serializable; + +/** + * + * 修改群介绍Form DTO + * + * @Author:liuchuang + * @Date:2019/10/22 15:28 + */ +@Data +public class GroupIntroductionFormDTO implements Serializable { + private static final long serialVersionUID = -9116266878310792465L; + + /** + * 社群ID + */ + @NotBlank(message = "社群ID不能为空") + private String id; + + /** + * 社群介绍 + */ + @NotBlank(message = "社群介绍不能为空且在500个字以内") + @Size(min = 1, max = 500, message = "社群介绍不能为空且在500个字以内") + private String groupIntroduction; + + /** + * 用户ID + */ + @NotBlank(message = "用户ID不能为空") + private String userId; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupModifyAvatarFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupModifyAvatarFormDTO.java new file mode 100644 index 000000000..06ef93e38 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupModifyAvatarFormDTO.java @@ -0,0 +1,36 @@ +package com.elink.esua.epdc.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * + * 修改群头像Form DTO + * + * @Author:liuchuang + * @Date:2019/10/22 17:15 + */ +@Data +public class GroupModifyAvatarFormDTO implements Serializable { + private static final long serialVersionUID = -1068809568439910879L; + + /** + * 社群ID + */ + @NotBlank(message = "社群ID不能为空") + private String id; + + /** + * 社群头像 + */ + @NotBlank(message = "社群头像不能为空") + private String groupAvatar; + + /** + * 用户ID + */ + @NotBlank(message = "用户ID不能为空") + private String userId; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserFormDTO.java new file mode 100644 index 000000000..c508d5cc6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserFormDTO.java @@ -0,0 +1,55 @@ +package com.elink.esua.epdc.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * + * 社群成员DTO + * + * @Author:liuchuang + * @Date:2019/10/17 14:27 + */ +@Data +public class GroupUserFormDTO implements Serializable { + private static final long serialVersionUID = -1532468675717622698L; + + /** + * 用户ID + */ + @NotBlank(message = "用户ID不能为空") + private String userId; + /** + * 用户昵称 + */ + @NotBlank(message = "用户昵称不能为空") + private String nickname; + /** + * 用户头像 + */ + @NotBlank(message = "用户头像不能为空") + private String userAvatar; + /** + * 用户手机号 + */ + @NotBlank(message = "用户联系方式不能为空") + private String mobile; + /** + * 群主标识 0:否,1:是 + */ + private String lordFlag; + /** + * 党员标识 0:否,1:是 + */ + private String partyMember; + /** + * 状态 0:待审核,5:审核不通过,10:审核通过,15:已退群,20:已移除 + */ + private Integer state; + /** + * 处理意见 + */ + private String auditOpinion; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserPartyMemberFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserPartyMemberFormDTO.java new file mode 100644 index 000000000..e7a2d240d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserPartyMemberFormDTO.java @@ -0,0 +1,27 @@ +package com.elink.esua.epdc.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author:liuchuang + * @Date:2019/11/11 14:24 + */ +@Data +public class GroupUserPartyMemberFormDTO implements Serializable { + private static final long serialVersionUID = 6172069865037633276L; + + /** + * 用户ID + */ + @NotBlank(message = "用户ID不能为空") + private String userId; + + /** + * 党员标识 0:否,1:是 + */ + @NotBlank(message = "党员标识不能为空") + private String partyMember; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserRemoveOrQuitFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserRemoveOrQuitFormDTO.java new file mode 100644 index 000000000..4f6f58e11 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserRemoveOrQuitFormDTO.java @@ -0,0 +1,39 @@ +package com.elink.esua.epdc.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * + * 删除社群成员或退出社群Form DTO + * + * @Author:liuchuang + * @Date:2019/10/23 10:04 + */ +@Data +public class GroupUserRemoveOrQuitFormDTO implements Serializable { + private static final long serialVersionUID = -4095328797214022209L; + + /** + * 操作人ID + */ + private String operatorId; + + /** + * 社群ID + */ + @NotBlank(message = "社群ID不能为空") + private String groupId; + + /** + * 用户ID + */ + private String userId; + + /** + * 状态 + */ + private Integer state; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserReviewFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserReviewFormDTO.java new file mode 100644 index 000000000..ea184a99a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserReviewFormDTO.java @@ -0,0 +1,31 @@ +package com.elink.esua.epdc.dto.group.form; + +import com.elink.esua.epdc.dto.group.UserReviewDto; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * + * 入群审核Form DTO + * + * @Author:liuchuang + * @Date:2019/11/6 11:07 + */ +@Data +public class GroupUserReviewFormDTO implements Serializable { + private static final long serialVersionUID = 490810653280939342L; + + /** + * 社群ID + */ + @NotBlank(message = "社群ID不能为空") + private String groupId; + + /** + * 审核用户 + */ + private List userReviewDtoList; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUsersFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUsersFormDTO.java new file mode 100644 index 000000000..733431d69 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUsersFormDTO.java @@ -0,0 +1,31 @@ +package com.elink.esua.epdc.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * + * 社群成员Form DTO + * + * @Author:liuchuang + * @Date:2019/10/23 9:10 + */ +@Data +public class GroupUsersFormDTO implements Serializable { + private static final long serialVersionUID = 7099778185347825038L; + + /** + * 社群ID + */ + @NotBlank(message = "社群ID不能为空") + private String groupId; + + /** + * 状态 0:待审核,10:审核通过 + */ + @NotNull(message = "成员状态不能为空") + private Integer state; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupsOfMineFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupsOfMineFormDTO.java new file mode 100644 index 000000000..67c82d929 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupsOfMineFormDTO.java @@ -0,0 +1,31 @@ +package com.elink.esua.epdc.dto.group.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * + * 我的群FormDTO + * + * @Author:liuchuang + * @Date:2019/10/21 17:06 + */ +@Data +public class GroupsOfMineFormDTO implements Serializable { + private static final long serialVersionUID = 6427160357602633892L; + + /** + * 用户ID + */ + @NotBlank(message = "用户ID不能为空") + private String userId; + + /** + * 网格ID + */ + @NotNull(message = "网格ID不能为空") + private Long gridId; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupDetailForMobileEndResultDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupDetailForMobileEndResultDTO.java new file mode 100644 index 000000000..8bed92e8e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupDetailForMobileEndResultDTO.java @@ -0,0 +1,62 @@ +package com.elink.esua.epdc.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 移动端-社群详情Result DTO + * + * @Author:liuchuang + * @Date:2019/10/22 14:53 + */ +@Data +public class GroupDetailForMobileEndResultDTO implements Serializable { + private static final long serialVersionUID = -9095533656720281885L; + + /** + * 社群ID + */ + private String id; + + /** + * 社群名称 + */ + private String groupName; + + /** + * 社群头像 + */ + private String groupAvatar; + + /** + * 群主 + */ + private String nickname; + + /** + * 总人数 + */ + private Integer totalNum; + + /** + * 话题数量 + */ + private Integer topicNum; + + /** + * 转到党群议事话题数量 + */ + private Integer changeToIssueNum; + + /** + * 社群类别(0:党员群,1:自建群) + */ + private String groupCategory; + + /** + * 当前用户是否是群主(0:否,1:是) + */ + private String lordFlag; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupUserListResultDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupUserListResultDTO.java new file mode 100644 index 000000000..7d517e871 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupUserListResultDTO.java @@ -0,0 +1,45 @@ +package com.elink.esua.epdc.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * 社群成员列表DTO + * + * @Author:liuchuang + * @Date:2019/10/21 11:06 + */ +@Data +public class GroupUserListResultDTO implements Serializable { + private static final long serialVersionUID = -3650254690194925656L; + + private String id; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户名 + */ + private String nickname; + + /** + * 用户头像 + */ + private String userAvatar; + + /** + * 群主标识 0:否,1:是 + */ + private String lordFlag; + + /** + * 申请时间 + */ + private Date createdTime; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupsOfMineResultDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupsOfMineResultDTO.java new file mode 100644 index 000000000..53dada3e9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupsOfMineResultDTO.java @@ -0,0 +1,68 @@ +package com.elink.esua.epdc.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * 我的群列表DTO + * + * @Author:liuchuang + * @Date:2019/10/21 17:00 + */ +@Data +public class GroupsOfMineResultDTO implements Serializable { + private static final long serialVersionUID = 346523775154631726L; + + /** + * 社群ID + */ + private String id; + + /** + * 社群名称 + */ + private String groupName; + + /** + * 社群头像 + */ + private String groupAvatar; + + /** + * 总人数 + */ + private Integer totalNum; + + /** + * 党员人数 + */ + private Integer partyMemberNum; + + /** + * 未读话题数量 + */ + private Integer unreadTopicNum; + + /** + * 最新一条话题发布时间(yyyy-MM-dd HH:mm) + */ + private Date latestTopicTime; + + /** + * 社群类别(0:党员群,1:自建群) + */ + private String groupCategory; + + /** + * 社群状态(0:待审核,5:审核不通过,10:审核通过,15:禁言) + */ + private Integer state; + + /** + * 群名称下方的描述 + */ + private String description; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupsOfRecommendResultDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupsOfRecommendResultDTO.java new file mode 100644 index 000000000..40d81a99b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupsOfRecommendResultDTO.java @@ -0,0 +1,42 @@ +package com.elink.esua.epdc.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 推荐群DTO + * + * @Author:liuchuang + * @Date:2019/10/22 11:18 + */ +@Data +public class GroupsOfRecommendResultDTO implements Serializable { + private static final long serialVersionUID = 9117108366107815457L; + + /** + * 社群ID + */ + private String id; + + /** + * 社群名称 + */ + private String groupName; + + /** + * 社群头像 + */ + private String groupAvatar; + + /** + * 总人数 + */ + private String totalNum; + + /** + * 党员人数 + */ + private String partyMemberNum; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/TopicAuditRecordResultDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/TopicAuditRecordResultDTO.java new file mode 100644 index 000000000..4ad0a70f0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/TopicAuditRecordResultDTO.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * 话题审核记录Result DTO + * + * @Author:liuchuang + * @Date:2019/11/8 9:25 + */ +@Data +public class TopicAuditRecordResultDTO implements Serializable { + private static final long serialVersionUID = 8330963966208262163L; + + /** + * 状态(0:审核不通过,2:已关闭) + */ + private Integer state; + + /** + * 处理意见 + */ + private String processionOpinions; + + /** + * 审核时间 + */ + private Date createdTime; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/ReplyCommentDto.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/ReplyCommentDto.java new file mode 100644 index 000000000..c95459eed --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/ReplyCommentDto.java @@ -0,0 +1,24 @@ +package com.elink.esua.epdc.dto.topic; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 被回复的评论 + * @Author LC + * @Date 2019/9/6 17:25 + */ +@Data +public class ReplyCommentDto implements Serializable { + private static final long serialVersionUID = 3501567846629315395L; + + /** + * 用户名 + */ + private String userName; + /** + * 内容 + */ + private String content; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicAuditRecordDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicAuditRecordDTO.java new file mode 100644 index 000000000..2ed155f29 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicAuditRecordDTO.java @@ -0,0 +1,86 @@ +/** + * 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.elink.esua.epdc.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题审核记录表 话题审核记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-07 + */ +@Data +public class TopicAuditRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 话题ID + */ + private String topicId; + + /** + * 状态 0:审核不通过,1:审核通过,2:已关闭 + */ + private Integer state; + + /** + * 处理意见 + */ + private String processingOpinions; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicCommentsDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicCommentsDTO.java new file mode 100644 index 000000000..81e30103c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicCommentsDTO.java @@ -0,0 +1,61 @@ +package com.elink.esua.epdc.dto.topic; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 事件评论DTO + * @Author LC + * @Date 2019/9/6 17:20 + */ +@Data +public class TopicCommentsDTO implements Serializable { + private static final long serialVersionUID = 2112619345374657409L; + + /** + * 评论ID + */ + private String commentId; + /** + * 内容 + */ + private String content; + /** + * 用户是否赞过,false未赞 + */ + private boolean userLike; + /** + * 用户是否踩过,true踩 + */ + private boolean userDislike; + /** + * 评论时间 + */ + private Date commentTime; + /** + * 赞数 + */ + private Integer approveNum; + /** + * 踩数 + */ + private Integer opposeNum; + /** + * 表态次数 + */ + private Integer attitudeNum; + /** + * 用户信息 + */ + private UserBaseInfoDto user; + /** + * 屏蔽标识 0:未屏蔽,1:已屏蔽 + */ + private String shieldFlag; + /** + * 回复评论信息 + */ + private ReplyCommentDto replyComment; +} 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 new file mode 100644 index 000000000..865111522 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java @@ -0,0 +1,192 @@ +/** + * 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.elink.esua.epdc.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 话题表 话题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Data +public class TopicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String userFace; + + /** + * 党员标识 0:否,1:是 + */ + private String partyMember; + + /** + * 手机号 + */ + private String mobile; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 议题ID + */ + private String issueId; + + /** + * 项目ID + */ + private String itemId; + + /** + * 区 + */ + private String area; + + /** + * 区ID + */ + private Long areaId; + + /** + * 街道 + */ + private String street; + + /** + * 街道ID + */ + private Long streetId; + + /** + * 社区 + */ + private String community; + + /** + * 社区ID + */ + private Long communityId; + + /** + * 网格 + */ + private String grid; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 话题地址 + */ + private String topicAddress; + + /** + * 话题位置纬度 + */ + private Double topicLatitude; + + /** + * 话题位置经度 + */ + private Double topicLongitude; + + /** + * 友邻社群 + */ + private String groupName; + + /** + * 友邻社群ID + */ + private String groupId; + + /** + * 状态 0:讨论中,5:转议题待审核,10:已转议题,15:已转项目,20:已关闭 + */ + private Integer state; + + /** + * 评论数 + */ + private Integer commentNum; + + /** + * 浏览数 + */ + private Integer browseNum; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDetailDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDetailDTO.java new file mode 100644 index 000000000..29a5c2201 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDetailDTO.java @@ -0,0 +1,69 @@ +package com.elink.esua.epdc.dto.topic; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * + * 话题详情 + * + * @Author:liuchuang + * @Date:2019/11/12 10:14 + */ +@Data +public class TopicDetailDTO implements Serializable { + private static final long serialVersionUID = -6928257901328686670L; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 发布人 + */ + private String nickname; + + /** + * 手机号 + */ + private String mobile; + + /** + * 发布时间 + */ + private Date createdTime; + + /** + * 话题地址 + */ + private String topicAddress; + + /** + * 话题位置纬度 + */ + private Double topicLatitude; + + /** + * 话题位置经度 + */ + private Double topicLongitude; + + /** + * 友邻社群 + */ + private String groupName; + + /** + * 所属网格详细信息 + */ + private String ownGrid; + + /** + * 图片 + */ + private List images; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicImgDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicImgDTO.java new file mode 100644 index 000000000..292134001 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicImgDTO.java @@ -0,0 +1,86 @@ +/** + * 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.elink.esua.epdc.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题图片表 话题图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-06 + */ +@Data +public class TopicImgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 图片地址 + */ + private String imgUrl; + + /** + * 图片类型 + */ + private String imgType; + + /** + * 删除标记 0:未删除,1:删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/UserBaseInfoDto.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/UserBaseInfoDto.java new file mode 100644 index 000000000..0dc771654 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/UserBaseInfoDto.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.dto.topic; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户基础信息DTO + * @Author LC + * @Date 2019/9/6 17:23 + */ +@Data +public class UserBaseInfoDto implements Serializable { + private static final long serialVersionUID = -6564298463849924671L; + + /** + * 用户ID + */ + private String userId; + /** + * 用户名 + */ + private String userName; + /** + * 用户头像 + */ + private String userFace; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicChangeToIssueFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicChangeToIssueFormDTO.java new file mode 100644 index 000000000..73458e48a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicChangeToIssueFormDTO.java @@ -0,0 +1,29 @@ +package com.elink.esua.epdc.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * + * 话题转议题Form DTO + * + * @Author:liuchuang + * @Date:2019/11/8 10:29 + */ +@Data +public class TopicChangeToIssueFormDTO implements Serializable { + private static final long serialVersionUID = 8702626187257949690L; + + /** + * 话题ID + */ + @NotBlank(message = "话题ID不能为空") + private String id; + + /** + * 操作人ID + */ + private String userId; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicCloseFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicCloseFormDTO.java new file mode 100644 index 000000000..18036ceda --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicCloseFormDTO.java @@ -0,0 +1,37 @@ +package com.elink.esua.epdc.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serializable; + +/** + * + * 关闭话题Form DTO + * + * @Author:liuchuang + * @Date:2019/11/7 16:07 + */ +@Data +public class TopicCloseFormDTO implements Serializable { + private static final long serialVersionUID = -8847567240714882803L; + + /** + * 话题ID + */ + @NotBlank(message = "话题ID不能为空") + private String id; + + /** + * 关闭原因 + */ + @NotBlank(message = "关闭原因不能为空且在50字以内") + @Size(min = 1, max = 50, message = "关闭原因不能为空且在50字以内") + private String processingOpinions; + + /** + * 操作人ID + */ + private String userId; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicListFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicListFormDTO.java new file mode 100644 index 000000000..7be27cfe6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicListFormDTO.java @@ -0,0 +1,51 @@ +package com.elink.esua.epdc.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; +import java.util.Date; + +@Data +public class TopicListFormDTO implements Serializable { + + private static final long serialVersionUID = 2286962006082337344L; + + /** + * 社群ID + */ + private String groupId; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 用户ID + */ + private String userId; + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0") + private Integer pageSize; + + /** + * 第一页查询发起时的时间 + */ + private String timestamp; + + /** + * 只查询半年内的数据 + */ + private Date someMonthsAgo; + +} 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..19937f228 --- /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,37 @@ +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; + + /** + * 事件ID + */ + private String eventId; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicSubmitFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicSubmitFormDTO.java new file mode 100644 index 000000000..e5fcca01f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicSubmitFormDTO.java @@ -0,0 +1,131 @@ +package com.elink.esua.epdc.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.List; + +/** + * + * 发布话题Form DTO + * + * @Author:liuchuang + * @Date:2019/11/6 14:33 + */ +@Data +public class TopicSubmitFormDTO implements Serializable { + private static final long serialVersionUID = 7888315361241643792L; + + /** + * 话题内容 + */ + @NotBlank(message = "话题内容不能为空且在2000个字以内") + @Size(min = 1, max = 2000, message = "话题内容不能为空且在2000个字以内") + private String topicContent; + + /** + * 图片 + */ + private List images; + + /** + * 话题地址 + */ + @NotBlank(message = "话题地址不能为空") + private String topicAddress; + + /** + * 话题位置纬度 + */ + private Double topicLatitude; + + /** + * 话题位置经度 + */ + private Double topicLongitude; + + /** + * 友邻社群 + */ + @NotBlank(message = "友邻社群名称不能为空") + private String groupName; + + /** + * 友邻社群ID + */ + @NotBlank(message = "友邻社群ID不能为空") + private String groupId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String userFace; + + /** + * 党员标识 0:否,1:是 + */ + private String partyMember; + + /** + * 手机号 + */ + private String mobile; + + /** + * 区 + */ + private String area; + + /** + * 区ID + */ + private Long areaId; + + /** + * 街道 + */ + private String street; + + /** + * 街道ID + */ + private Long streetId; + + /** + * 社区 + */ + private String community; + + /** + * 社区ID + */ + private Long communityId; + + /** + * 网格 + */ + private String grid; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 状态 0:讨论中,5:转议题待审核,10:转议题审核不通过,15:已转议题,20:已转项目,25:已关闭 + */ + private Integer state; + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/result/TopicDetailResultDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/result/TopicDetailResultDTO.java new file mode 100644 index 000000000..7ae17a005 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/result/TopicDetailResultDTO.java @@ -0,0 +1,79 @@ +package com.elink.esua.epdc.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * + * 话题详情 + * + * @Author:liuchuang + * @Date:2019/11/7 15:25 + */ +@Data +public class TopicDetailResultDTO implements Serializable { + private static final long serialVersionUID = -4978924751646345443L; + + /** + * 话题ID + */ + private String id; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 话题地址 + */ + private String topicAddress; + + /** + * 发布时间 + */ + private Date createdTime; + + /** + * 发布人 + */ + private String nickname; + + /** + * 发布人头像 + */ + private String userAvatar; + + /** + * 党员标识(0-否,1-是) + */ + private String partyMember; + + /** + * 浏览数 + */ + private Integer browseNum; + + /** + * 是否可操作(true 可评、赞等) + */ + private Boolean operationalFlag; + + /** + * 是否可关闭(true 可以) + */ + private Boolean closeFlag; + + /** + * 是否可转议题(true 可以) + */ + private Boolean changeFlag; + + /** + * 图片 + */ + private List images; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/result/TopicListResultDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/result/TopicListResultDTO.java new file mode 100644 index 000000000..c6157522c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/result/TopicListResultDTO.java @@ -0,0 +1,66 @@ +package com.elink.esua.epdc.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@Data +public class TopicListResultDTO implements Serializable { + + private static final long serialVersionUID = -4978924751646345443L; + + /** + * 话题ID + */ + private String id; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 发布人 + */ + private String nickname; + + /** + * 发布人头像 + */ + private String userAvatar; + + /** + * 发布时间 + */ + private Date createdTime; + + /** + * 党员标识(0-否,1-是) + */ + private String partyMember; + + /** + * 状态 + */ + private Integer state; + + /** + * 议题ID + */ + private String issueId; + + /** + * 项目ID + */ + private String itemId; + + /** + * 图片 + */ + private List images; + + + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml new file mode 100644 index 000000000..b34bada6e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml @@ -0,0 +1,177 @@ + + + + epdc-group + com.esua.epdc + 1.0.0 + + 4.0.0 + + epdc-group-server + jar + + + + com.esua.epdc + epdc-group-client + 1.0.0 + + + com.esua.epdc + epdc-commons-tools + 1.0.0 + + + com.esua.epdc + epdc-commons-mybatis + 1.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + com.spotify + docker-maven-plugin + + + + ${project.basedir}/src/main/java + + + + true + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + + ${basedir}/src/main/resources + + **/application*.yml + **/*.properties + logback-spring.xml + registry.conf + + + + + + + + + dev + + true + + + dev + + 9064 + + 2 + 47.104.224.45 + 6379 + elink@888 + + + + + epdc + elink833066 + + false + 47.104.224.45:8848 + + + + + test + + test + + 9064 + + 2 + 47.104.224.45 + 6379 + elink@888 + + + + + epdc + elink833066 + + true + 47.104.224.45:8848 + + + + + prod + + prod + + 9064 + + + 8 + 121.42.149.50 + 9001 + elink888 + + + + + epdc + elink833066 + + true + 172.31.171.61:9300 + + + + + diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/GroupApplication.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/GroupApplication.java new file mode 100644 index 000000000..5bc8db4b4 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/GroupApplication.java @@ -0,0 +1,21 @@ +package com.elink.esua.epdc; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * 友邻社群模块 + * + * @author Mark sunlightcs@gmail.com + * @since 1.1.0 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class GroupApplication { + public static void main(String[] args) { + SpringApplication.run(GroupApplication.class, args); + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/config/ModuleConfigImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/config/ModuleConfigImpl.java new file mode 100644 index 000000000..852336743 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/config/ModuleConfigImpl.java @@ -0,0 +1,18 @@ +package com.elink.esua.epdc.config; + +import com.elink.esua.epdc.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息-友邻社群模块 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "group"; + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/config/ThreadConfig.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/config/ThreadConfig.java new file mode 100644 index 000000000..589e6e990 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/config/ThreadConfig.java @@ -0,0 +1,42 @@ +package com.elink.esua.epdc.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.task.TaskExecutor; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.ThreadPoolExecutor; + +/** + * 线程池 + * + * @author rongchao + * @Date 18-11-27 + */ +@Configuration +@EnableAsync +public class ThreadConfig { + + @Bean + public TaskExecutor taskExecutor() { + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + // 设置核心线程数 + executor.setCorePoolSize(5); + // 设置最大线程数 + executor.setMaxPoolSize(10); + // 设置队列容量 + executor.setQueueCapacity(20); + // 设置线程活跃时间(秒) + executor.setKeepAliveSeconds(60); + // 设置默认线程名称 + executor.setThreadNamePrefix("esd-"); + // 设置拒绝策略 + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + // 等待所有任务结束后再关闭线程池 + executor.setWaitForTasksToCompleteOnShutdown(true); + executor.setAwaitTerminationSeconds(60); + executor.initialize(); + return executor; + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/async/NewsTask.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/async/NewsTask.java new file mode 100644 index 000000000..8a43096a0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/async/NewsTask.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.modules.async; + +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.modules.feign.NewsFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +/** + * 新闻通知消息模块 线程任务 + * + * @author work@yujt.net.cn + * @date 2019/9/18 15:39 + */ +@Component +public class NewsTask { + + @Autowired + private NewsFeignClient newsFeignClient; + + /** + * 给用户发送消息 + * + * @param informationDto + * @return void + * @author work@yujt.net.cn + * @date 2019/9/18 15:39 + */ + @Async + public void insertUserInformation(EpdcInformationFormDTO informationDto) { + newsFeignClient.saveInformation(informationDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/async/TopicChangeToIssueTask.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/async/TopicChangeToIssueTask.java new file mode 100644 index 000000000..10a4a832e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/async/TopicChangeToIssueTask.java @@ -0,0 +1,41 @@ +package com.elink.esua.epdc.modules.async; + +import com.elink.esua.epdc.dto.comment.EpdcCommentsAndAttitudeFromTopicFormDTO; +import com.elink.esua.epdc.dto.comment.EventCommentDTO; +import com.elink.esua.epdc.dto.comment.EventCommentUserAttitudeDTO; +import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO; +import com.elink.esua.epdc.modules.comment.service.TopicCommentService; +import com.elink.esua.epdc.modules.feign.EventFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * + * 话题转议题异步处理操作 + * + * @Author:liuchuang + * @Date:2019/11/12 13:31 + */ +@Component +public class TopicChangeToIssueTask { + + @Autowired + private EventFeignClient eventFeignClient; + + /** + * + * 拷贝评论、评论的支持反对到事件 + * + * @params [topicId] + * @return void + * @author liuchuang + * @since 2019/11/12 13:32 + */ + @Async + public void copyCommentsAndAttitudeToEvents(EpdcCommentsAndAttitudeFromTopicFormDTO eventFormDto) { + eventFeignClient.receiveTopicCommentAndAttitude(eventFormDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/AppTopicCommentController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/AppTopicCommentController.java new file mode 100755 index 000000000..2ef2aa2c6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/AppTopicCommentController.java @@ -0,0 +1,70 @@ +/** + * 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.elink.esua.epdc.modules.comment.controller; + +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentsResultDTO; +import com.elink.esua.epdc.modules.comment.service.TopicCommentService; +import com.elink.esua.epdc.modules.comment.service.TopicCommentUserAttitudeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +@RestController +@RequestMapping(Constant.EPDC_APP + "comment") +public class AppTopicCommentController { + + @Autowired + private TopicCommentService topicCommentService; + + @Autowired + private TopicCommentUserAttitudeService topicCommentUserAttitudeService; + + /** + * 提交评论或回复接口 + */ + @PostMapping("submit") + public Result submit(@RequestBody TopicCommentFormDTO commentFormDTO){ + ValidatorUtils.validateEntity(commentFormDTO); + return topicCommentService.submit(commentFormDTO); + } + + /** + * 评论列表 + */ + @GetMapping("list") + public Result listOfComments(@RequestBody TopicCommentsFormDTO formDto) { + return topicCommentService.listOfComments(formDto); + } + + /** + * 评论(赞/踩)接口 + * @param formDto + * @return + */ + @PostMapping("statement") + public Result statement(@RequestBody TopicCommentStatementFormDTO formDto) { + topicCommentUserAttitudeService.statement(formDto); + return new Result(); + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/TopicCommentController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/TopicCommentController.java new file mode 100755 index 000000000..04c3645a5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/TopicCommentController.java @@ -0,0 +1,125 @@ +/** + * 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.elink.esua.epdc.modules.comment.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +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.comment.TopicCommentDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentListDTO; +import com.elink.esua.epdc.dto.comment.TopicDeleteCommentsFormDTO; +import com.elink.esua.epdc.modules.comment.excel.TopicCommentExcel; +import com.elink.esua.epdc.modules.comment.service.TopicCommentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 话题评论表 话题评论表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@RestController +@RequestMapping("topiccomment") +public class TopicCommentController { + + @Autowired + private TopicCommentService topicCommentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = topicCommentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TopicCommentDTO data = topicCommentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TopicCommentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + topicCommentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TopicCommentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + topicCommentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + topicCommentService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = topicCommentService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, TopicCommentExcel.class); + } + + /** + * + * 评论列表 + * + * @params [params] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/12 10:37 + */ + @GetMapping("comments") + public Result> commentsList(@RequestParam Map params) { + PageData page = topicCommentService.listComments(params); + return new Result>().ok(page); + } + + /** + * + * 屏蔽评论 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/12 11:07 + */ + @PostMapping("deleteComment") + public Result deleteComment(@RequestBody TopicDeleteCommentsFormDTO formDto) { + return topicCommentService.modifyCommentById(formDto.getCommentIds()); + } + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/TopicCommentUserAttitudeController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/TopicCommentUserAttitudeController.java new file mode 100755 index 000000000..12e54fdd0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/TopicCommentUserAttitudeController.java @@ -0,0 +1,94 @@ +/** + * 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.elink.esua.epdc.modules.comment.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +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.comment.TopicCommentUserAttitudeDTO; +import com.elink.esua.epdc.modules.comment.excel.TopicCommentUserAttitudeExcel; +import com.elink.esua.epdc.modules.comment.service.TopicCommentUserAttitudeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 话题评论用户表态表 话题评论用户表态表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@RestController +@RequestMapping("topiccommentuserattitude") +public class TopicCommentUserAttitudeController { + + @Autowired + private TopicCommentUserAttitudeService topicCommentUserAttitudeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = topicCommentUserAttitudeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TopicCommentUserAttitudeDTO data = topicCommentUserAttitudeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TopicCommentUserAttitudeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + topicCommentUserAttitudeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TopicCommentUserAttitudeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + topicCommentUserAttitudeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + topicCommentUserAttitudeService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = topicCommentUserAttitudeService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, TopicCommentUserAttitudeExcel.class); + } + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/dao/TopicCommentDao.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/dao/TopicCommentDao.java new file mode 100755 index 000000000..109ba8125 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/dao/TopicCommentDao.java @@ -0,0 +1,119 @@ +/** + * 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.elink.esua.epdc.modules.comment.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.comment.EventCommentDTO; +import com.elink.esua.epdc.dto.comment.EventCommentUserAttitudeDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentListDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; +import com.elink.esua.epdc.dto.topic.TopicCommentsDTO; +import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO; +import com.elink.esua.epdc.modules.comment.entity.TopicCommentEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 话题评论表 话题评论表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Mapper +public interface TopicCommentDao extends BaseDao { + + void updateReplyCount(String commentId); + + /** + * 赞数+1 + * @param commentId + */ + void updateApproveNumAdd(String commentId); + + /** + * 踩数+1 + * @param commentId + */ + void updateOpposeNumAdd(String commentId); + + /** + * 赞数-1 + * @param commentId + */ + void updateApproveNumSubtract(String commentId); + + /** + * 踩数-1 + * @param commentId + */ + void updateOpposeNumSubtract(String commentId); + + + long selectCountOfStatementNum(String topicId); + + + List selectListOfComments(TopicCommentsFormDTO formDTO); + + /** + * + * 评论列表 + * + * @params [params] + * @return java.util.List + * @author liuchuang + * @since 2019/11/12 10:41 + */ + List selectListOfCommentsByTopicId(Map params); + + /** + * + * 屏蔽评论 + * + * @params [commentIds] + * @return void + * @author liuchuang + * @since 2019/11/12 11:08 + */ + void updateCommentShieldFlag(@Param("commentIds") String[] commentIds); + + /** + * + * 获取话题评论并转成事件评论 + * + * @params [formDto] + * @return java.util.List + * @author liuchuang + * @since 2019/11/12 13:52 + */ + List selectListCommentForEvent(TopicReviewFormDTO formDto); + + /** + * + * 获取话题评论的表态并转成事件评论的表态 + * + * @params [topicId] + * @return java.util.List + * @author liuchuang + * @since 2019/11/12 14:12 + */ + List selectListCommentAttitudeForEvent(String topicId); + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/dao/TopicCommentUserAttitudeDao.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/dao/TopicCommentUserAttitudeDao.java new file mode 100755 index 000000000..31618083e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/dao/TopicCommentUserAttitudeDao.java @@ -0,0 +1,33 @@ +/** + * 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.elink.esua.epdc.modules.comment.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.comment.entity.TopicCommentUserAttitudeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题评论用户表态表 话题评论用户表态表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Mapper +public interface TopicCommentUserAttitudeDao extends BaseDao { + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/entity/TopicCommentEntity.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/entity/TopicCommentEntity.java new file mode 100755 index 000000000..ee4068dd8 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/entity/TopicCommentEntity.java @@ -0,0 +1,111 @@ +/** + * 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.elink.esua.epdc.modules.comment.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题评论表 话题评论表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_topic_comment") +public class TopicCommentEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 话题ID + */ + private String topicId; + + /** + * 评论人ID + */ + private String userId; + + /** + * 评论人昵称 + */ + private String username; + + /** + * 评论人头像 + */ + private String userFace; + + /** + * 评论内容 + */ + private String content; + + /** + * 评论类型 0:评论,1:回复,2:回复的回复 + */ + private String commentType; + + /** + * 回复的评论ID + */ + private String commentId; + + /** + * 被回复数 + */ + private Integer replyCount; + + /** + * 被回复人ID + */ + private String replyUserId; + + /** + * 被回复人名称 + */ + private String replyUsername; + + /** + * 被回复人头像 + */ + private String replyUserFace; + + /** + * 点赞数 + */ + private Integer likeCount; + + /** + * 点踩数 + */ + private Integer unLikeCount; + + /** + * 屏蔽标识 0:未屏蔽,1:已屏蔽 + */ + private String shieldFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/entity/TopicCommentUserAttitudeEntity.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/entity/TopicCommentUserAttitudeEntity.java new file mode 100755 index 000000000..3d1359e97 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/entity/TopicCommentUserAttitudeEntity.java @@ -0,0 +1,56 @@ +/** + * 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.elink.esua.epdc.modules.comment.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题评论用户表态表 话题评论用户表态表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_topic_comment_user_attitude") +public class TopicCommentUserAttitudeEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 评论ID + */ + private String commentId; + + /** + * 用户ID + */ + private String userId; + + /** + * 表态标识 0:点赞,1:点踩 + */ + private String attitudeFlag; + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/excel/TopicCommentExcel.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/excel/TopicCommentExcel.java new file mode 100755 index 000000000..005adc83e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/excel/TopicCommentExcel.java @@ -0,0 +1,98 @@ +/** + * 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.elink.esua.epdc.modules.comment.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 话题评论表 话题评论表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Data +public class TopicCommentExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "话题ID") + private String topicId; + + @Excel(name = "评论人ID") + private String userId; + + @Excel(name = "评论人昵称") + private String username; + + @Excel(name = "评论人头像") + private String userFace; + + @Excel(name = "评论内容") + private String content; + + @Excel(name = "评论类型 0:评论,1:回复,2:回复的回复") + private String commentType; + + @Excel(name = "回复的评论ID") + private String commentId; + + @Excel(name = "被回复数") + private Integer replyCount; + + @Excel(name = "被回复人ID") + private String replyUserId; + + @Excel(name = "被回复人名称") + private String replyUsername; + + @Excel(name = "被回复人头像") + private String replyUserFace; + + @Excel(name = "点赞数") + private Integer likeCount; + + @Excel(name = "点踩数") + private Integer unLikeCount; + + @Excel(name = "屏蔽标识 0:未屏蔽,1:已屏蔽") + private String shieldFlag; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/excel/TopicCommentUserAttitudeExcel.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/excel/TopicCommentUserAttitudeExcel.java new file mode 100755 index 000000000..3f2b8930c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/excel/TopicCommentUserAttitudeExcel.java @@ -0,0 +1,65 @@ +/** + * 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.elink.esua.epdc.modules.comment.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 话题评论用户表态表 话题评论用户表态表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Data +public class TopicCommentUserAttitudeExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "评论ID") + private String commentId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "表态标识 0:点赞,1:点踩") + private String attitudeFlag; + + @Excel(name = "删除标记 0:未删除,1:删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/redis/TopicCommentRedis.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/redis/TopicCommentRedis.java new file mode 100755 index 000000000..b5f48c502 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/redis/TopicCommentRedis.java @@ -0,0 +1,47 @@ +/** + * 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.elink.esua.epdc.modules.comment.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 话题评论表 话题评论表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Component +public class TopicCommentRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/redis/TopicCommentUserAttitudeRedis.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/redis/TopicCommentUserAttitudeRedis.java new file mode 100755 index 000000000..b21c40035 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/redis/TopicCommentUserAttitudeRedis.java @@ -0,0 +1,47 @@ +/** + * 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.elink.esua.epdc.modules.comment.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 话题评论用户表态表 话题评论用户表态表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Component +public class TopicCommentUserAttitudeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/TopicCommentService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/TopicCommentService.java new file mode 100755 index 000000000..3fb16066f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/TopicCommentService.java @@ -0,0 +1,177 @@ +/** + * 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.elink.esua.epdc.modules.comment.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.comment.*; +import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO; +import com.elink.esua.epdc.modules.comment.entity.TopicCommentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 话题评论表 话题评论表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +public interface TopicCommentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-10-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-10-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicCommentDTO + * @author generator + * @date 2019-10-23 + */ + TopicCommentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-23 + */ + void save(TopicCommentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-23 + */ + void update(TopicCommentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-10-23 + */ + void delete(String[] ids); + + /** + * 提交评论或回复接口 + * @param commentFormDTO + */ + Result submit(TopicCommentFormDTO commentFormDTO); + + /** + * 移动端评论列表 + */ + Result listOfComments(TopicCommentsFormDTO formDto); + + /** + * 赞数+1 + * @param commentId + */ + void updateApproveNumAdd(String commentId); + + /** + * 踩数+1 + * @param commentId + */ + void updateOpposeNumAdd(String commentId); + + + /** + * 赞数-1 + * @param commentId + */ + void updateApproveNumSubtract(String commentId); + + /** + * 踩数-1 + * @param commentId + */ + void updateOpposeNumSubtract(String commentId); + + /** + * + * 评论列表 + * + * @params [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @author liuchuang + * @since 2019/11/12 10:38 + */ + PageData listComments(Map params); + + /** + * + * 屏蔽评论 + * + * @params [commentIds] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/12 11:07 + */ + Result modifyCommentById(String[] commentIds); + + /** + * + * 获取话题评论并转成事件评论 + * + * @params [formDto] + * @return java.util.List + * @author liuchuang + * @since 2019/11/12 13:52 + */ + List listCommentForEvent(TopicReviewFormDTO formDto); + + /** + * + * 获取话题评论的表态并转成事件评论的表态 + * + * @params [topicId] + * @return java.util.List + * @author liuchuang + * @since 2019/11/12 14:13 + */ + List listCommentAttitudeForEvent(String topicId); +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/TopicCommentUserAttitudeService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/TopicCommentUserAttitudeService.java new file mode 100755 index 000000000..03f5eae9e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/TopicCommentUserAttitudeService.java @@ -0,0 +1,103 @@ +/** + * 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.elink.esua.epdc.modules.comment.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentUserAttitudeDTO; +import com.elink.esua.epdc.modules.comment.entity.TopicCommentUserAttitudeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 话题评论用户表态表 话题评论用户表态表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +public interface TopicCommentUserAttitudeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-10-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-10-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicCommentUserAttitudeDTO + * @author generator + * @date 2019-10-23 + */ + TopicCommentUserAttitudeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-23 + */ + void save(TopicCommentUserAttitudeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-23 + */ + void update(TopicCommentUserAttitudeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-10-23 + */ + void delete(String[] ids); + + /** + * 评论(赞/踩)接口 + * @param formDto + * @return + */ + void statement(TopicCommentStatementFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java new file mode 100755 index 000000000..ad8b332d7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java @@ -0,0 +1,241 @@ +/** + * 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.elink.esua.epdc.modules.comment.service.impl; + +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.NumConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.comment.*; +import com.elink.esua.epdc.dto.constant.TopicNoticeConstant; +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.dto.topic.TopicCommentsDTO; +import com.elink.esua.epdc.dto.topic.TopicDTO; +import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO; +import com.elink.esua.epdc.modules.async.NewsTask; +import com.elink.esua.epdc.modules.comment.dao.TopicCommentDao; +import com.elink.esua.epdc.modules.comment.entity.TopicCommentEntity; +import com.elink.esua.epdc.modules.comment.redis.TopicCommentRedis; +import com.elink.esua.epdc.modules.comment.service.TopicCommentService; +import com.elink.esua.epdc.modules.topic.service.TopicService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题评论表 话题评论表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Service +public class TopicCommentServiceImpl extends BaseServiceImpl implements TopicCommentService { + + @Autowired + private TopicService topicService; + + @Autowired + private NewsTask newsTask; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicCommentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicCommentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public TopicCommentDTO get(String id) { + TopicCommentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicCommentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicCommentDTO dto) { + TopicCommentEntity entity = ConvertUtils.sourceToTarget(dto, TopicCommentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicCommentDTO dto) { + TopicCommentEntity entity = ConvertUtils.sourceToTarget(dto, TopicCommentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result submit(TopicCommentFormDTO commentFormDTO) { + + TopicCommentEntity commentEntity = new TopicCommentEntity(); + commentEntity.setContent(commentFormDTO.getContent()); + commentEntity.setUserId(commentFormDTO.getUserId()); + commentEntity.setUsername(commentFormDTO.getUserName()); + commentEntity.setUserFace(commentFormDTO.getUserFace()); + + boolean isComment = true; + + // 评论类型 0-评论 + String commentType = NumConstant.ZERO_STR; + // 父评论:用户回复的那条评论 + TopicCommentEntity parentComment = null; + if (!StringUtils.isEmpty(commentFormDTO.getFaCommentId())) { + parentComment = this.selectById(commentFormDTO.getFaCommentId()); + if (null == parentComment || null == parentComment.getId()) { + return new Result().error("您要回复的评论不存在"); + } + isComment = false; + commentType = NumConstant.ONE_STR; + commentEntity.setCommentId(commentFormDTO.getFaCommentId()); + commentEntity.setReplyUserId(parentComment.getUserId()); + commentEntity.setReplyUsername(parentComment.getUsername()); + commentEntity.setReplyUserFace(parentComment.getUserFace()); + } + commentEntity.setCommentType(commentType); + if (NumConstant.ONE != baseDao.insert(commentEntity)) { + return new Result().error("评论失败"); + } + // 回复加1 + if (NumConstant.ONE_STR.equals(commentType)) { + baseDao.updateReplyCount(commentFormDTO.getFaCommentId()); + } + // 评论数加1 + topicService.updateCommentNum(commentEntity.getTopicId()); + + // 话题信息 + TopicDTO topicDto = topicService.get(commentFormDTO.getTopicId()); + + // 组装发送消息内容 + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + informationFormDTO.setType(TopicNoticeConstant.NOTICE_TYPE_INTERACTIVE_NOTICE); + informationFormDTO.setBusinessId(topicDto.getId()); + if (isComment) { + // 评论 + informationFormDTO.setUserId(topicDto.getUserId()); + informationFormDTO.setContent(topicDto.getTopicContent()); + informationFormDTO.setTitle(TopicNoticeConstant.NOTICE_TOPIC_COMMENT); + informationFormDTO.setBusinessType(TopicNoticeConstant.NOTICE_BUSINESS_TYPE_TOPIC_COMMENT); + informationFormDTO.setRelBusinessContent(commentFormDTO.getUserName()+":"+commentFormDTO.getContent()); + } else { + // 回复 + informationFormDTO.setUserId(parentComment.getUserId()); + informationFormDTO.setContent(commentFormDTO.getUserName()+":"+commentFormDTO.getContent()); + informationFormDTO.setTitle(TopicNoticeConstant.NOTICE_TOPIC_COMMENT_REPLY); + informationFormDTO.setBusinessType(TopicNoticeConstant.NOTICE_BUSINESS_TYPE_TOPIC_COMMENT_REPLY); + informationFormDTO.setRelBusinessContent(parentComment.getContent()); + } + // 发送消息 + newsTask.insertUserInformation(informationFormDTO); + + return new Result(); + } + + + @Override + public Result listOfComments(TopicCommentsFormDTO formDto) { + // 表态数 + long statementNum = baseDao.selectCountOfStatementNum(formDto.getTopicId()); + int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageIndex(pageIndex); + // 评论 + List list = baseDao.selectListOfComments(formDto); + TopicCommentsResultDTO data = new TopicCommentsResultDTO(); + data.setStatementNum(statementNum); + data.setCommentsList(list); + return new Result().ok(data); + + } + + @Override + public void updateApproveNumAdd(String commentId) { + baseDao.updateApproveNumAdd(commentId); + } + + @Override + public void updateOpposeNumAdd(String commentId) { + baseDao.updateOpposeNumAdd(commentId); + } + + @Override + public void updateApproveNumSubtract(String commentId) { + baseDao.updateApproveNumSubtract(commentId); + } + + @Override + public void updateOpposeNumSubtract(String commentId) { + baseDao.updateOpposeNumSubtract(commentId); + } + + @Override + public PageData listComments(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListOfCommentsByTopicId(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result modifyCommentById(String[] commentIds) { + baseDao.updateCommentShieldFlag(commentIds); + return new Result(); + } + + @Override + public List listCommentForEvent(TopicReviewFormDTO formDto) { + return baseDao.selectListCommentForEvent(formDto); + } + + @Override + public List listCommentAttitudeForEvent(String topicId) { + return baseDao.selectListCommentAttitudeForEvent(topicId); + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentUserAttitudeServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentUserAttitudeServiceImpl.java new file mode 100755 index 000000000..10f97d91d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentUserAttitudeServiceImpl.java @@ -0,0 +1,186 @@ +/** + * 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.elink.esua.epdc.modules.comment.service.impl; + +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.NumConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dto.comment.TopicCommentDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentUserAttitudeDTO; +import com.elink.esua.epdc.dto.constant.TopicNoticeConstant; +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.modules.async.NewsTask; +import com.elink.esua.epdc.modules.comment.dao.TopicCommentUserAttitudeDao; +import com.elink.esua.epdc.modules.comment.entity.TopicCommentUserAttitudeEntity; +import com.elink.esua.epdc.modules.comment.service.TopicCommentService; +import com.elink.esua.epdc.modules.comment.service.TopicCommentUserAttitudeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题评论用户表态表 话题评论用户表态表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Service +public class TopicCommentUserAttitudeServiceImpl extends BaseServiceImpl implements TopicCommentUserAttitudeService { + + @Autowired + private TopicCommentService topicCommentService; + + @Autowired + private NewsTask newsTask; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicCommentUserAttitudeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicCommentUserAttitudeDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public TopicCommentUserAttitudeDTO get(String id) { + TopicCommentUserAttitudeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicCommentUserAttitudeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicCommentUserAttitudeDTO dto) { + TopicCommentUserAttitudeEntity entity = ConvertUtils.sourceToTarget(dto, TopicCommentUserAttitudeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicCommentUserAttitudeDTO dto) { + TopicCommentUserAttitudeEntity entity = ConvertUtils.sourceToTarget(dto, TopicCommentUserAttitudeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void statement(TopicCommentStatementFormDTO formDto) { + //根据用户id和事件id查询记录 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(formDto.getUseId()), "USER_ID", formDto.getUseId()); + wrapper.eq(StringUtils.isNotBlank(formDto.getCommentId()), "COMMENT_ID", formDto.getCommentId()); + TopicCommentUserAttitudeEntity topicCommentUserAttitudeEntity = baseDao.selectOne(wrapper); + + // 组装发送消息内容 + TopicCommentDTO commentDto = topicCommentService.get(formDto.getCommentId()); + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + informationFormDTO.setType(TopicNoticeConstant.NOTICE_TYPE_INTERACTIVE_NOTICE); + informationFormDTO.setUserId(commentDto.getUserId()); + informationFormDTO.setContent(commentDto.getContent()); + + if (NumConstant.ZERO_STR.equals(formDto.getAttitude()) || NumConstant.ONE_STR.equals(formDto.getAttitude())){ + if (topicCommentUserAttitudeEntity == null){ + //没有点赞或者点踩,直接插入数据 + TopicCommentUserAttitudeDTO topicCommentUserAttitudeDTO = new TopicCommentUserAttitudeDTO(); + topicCommentUserAttitudeDTO.setCommentId(formDto.getCommentId()); + topicCommentUserAttitudeDTO.setUserId(formDto.getUseId()); + topicCommentUserAttitudeDTO.setAttitudeFlag(formDto.getAttitude()); + this.save(topicCommentUserAttitudeDTO); + + if (NumConstant.ZERO_STR.equals(formDto.getAttitude())){ + topicCommentService.updateApproveNumAdd(formDto.getCommentId()); + + // 支持 + informationFormDTO.setTitle(TopicNoticeConstant.NOTICE_COMMENT_APPROVE); + informationFormDTO.setBusinessType(TopicNoticeConstant.NOTICE_BUSINESS_TYPE_TOPIC_COMMENT_APPROVE); + informationFormDTO.setRelBusinessContent(formDto.getUserName()+"支持了你的评论"); + } + if (NumConstant.ONE_STR.equals(formDto.getAttitude())){ + topicCommentService.updateOpposeNumAdd(formDto.getCommentId()); + + // 反对 + informationFormDTO.setTitle(TopicNoticeConstant.NOTICE_COMMENT_OPPOSE); + informationFormDTO.setBusinessType(TopicNoticeConstant.NOTICE_BUSINESS_TYPE_TOPIC_COMMENT_OPPOSE); + informationFormDTO.setRelBusinessContent(formDto.getUserName()+"反对了你的评论"); + } + + }else { + if (!formDto.getAttitude().equals(topicCommentUserAttitudeEntity.getAttitudeFlag())){ + topicCommentUserAttitudeEntity.setAttitudeFlag(formDto.getAttitude()); + this.updateById(topicCommentUserAttitudeEntity); + + if (NumConstant.ZERO_STR.equals(formDto.getAttitude())){ + //赞数加1 踩数减一 + topicCommentService.updateApproveNumAdd(formDto.getCommentId()); + topicCommentService.updateOpposeNumSubtract(formDto.getCommentId()); + }else { + //踩数加一 赞数减一 + topicCommentService.updateOpposeNumAdd(formDto.getCommentId()); + topicCommentService.updateApproveNumSubtract(formDto.getCommentId()); + } + } + } + }else { + //删除点赞或踩的记录,如果重新点赞或踩则重新插入 + this.deleteById(topicCommentUserAttitudeEntity.getId()); + if (NumConstant.TWO_STR.equals(formDto.getAttitude())){ + //取消赞 + topicCommentService.updateApproveNumSubtract(formDto.getCommentId()); + } + if (NumConstant.THREE_STR.equals(formDto.getAttitude())){ + //取消踩 + topicCommentService.updateOpposeNumSubtract(formDto.getCommentId()); + } + } + // 发送消息 + newsTask.insertUserInformation(informationFormDTO); + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/EventFeignClient.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/EventFeignClient.java new file mode 100644 index 000000000..d6e88e2e1 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/EventFeignClient.java @@ -0,0 +1,45 @@ +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.comment.EpdcCommentsAndAttitudeFromTopicFormDTO; +import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; +import com.elink.esua.epdc.modules.feign.fallback.EventFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * + * 事件模块调用 + * + * @Author:liuchuang + * @Date:2019/11/8 13:36 + */ +@FeignClient(name = ServiceConstant.EPDC_EVENTS_SERVER, fallback = EventFeignClientFallback.class) +public interface EventFeignClient { + + /** + * + * 话题转议题 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/8 14:42 + */ + @PostMapping(value = "events/epdc-app/event/submit", consumes = MediaType.APPLICATION_JSON_VALUE) + Result submitEvent(EpdcEventSubmitFormDTO formDto); + + /** + * + * 接收话题评论和评论表态 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/12 14:35 + */ + @PostMapping(value = "events/eventcomment/receive", consumes = MediaType.APPLICATION_JSON_VALUE) + Result receiveTopicCommentAndAttitude(EpdcCommentsAndAttitudeFromTopicFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/NewsFeignClient.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/NewsFeignClient.java new file mode 100644 index 000000000..bc75e5d05 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/NewsFeignClient.java @@ -0,0 +1,32 @@ +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.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.modules.feign.fallback.NewsFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * 消息模块 + * + * @author work@yujt.net.cn + * @date 2019/9/18 15:37 + */ +@FeignClient(name = ServiceConstant.EPDC_NEWS_SERVER, fallback = NewsFeignClientFallback.class) +public interface NewsFeignClient { + + /** + * 给用户发消息 + * + * @param formDto + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author work@yujt.net.cn + * @date 2019/9/18 15:40 + */ + @PostMapping(value = "news/epdc-app/information/save", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveInformation(@RequestBody EpdcInformationFormDTO formDto); + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/UserFeignClient.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/UserFeignClient.java new file mode 100644 index 000000000..3c37483e2 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/UserFeignClient.java @@ -0,0 +1,34 @@ +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.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; +import com.elink.esua.epdc.modules.feign.fallback.UserFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; + +import java.util.List; + +/** + * + * 用户模块 + * + * @Author:liuchuang + * @Date:2019/10/23 16:00 + */ +@FeignClient(name = ServiceConstant.EPDC_USER_SERVER, fallback = UserFeignClientFallback.class) +public interface UserFeignClient { + + /** + * + * 社群添加好友列表 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/23 16:19 + */ + @GetMapping("app-user/epdc-app/user/getInviteUserList") + Result> getInviteUserList(EpdcUserGroupInviteFormDTO formDto); +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/EventFeignClientFallback.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/EventFeignClientFallback.java new file mode 100644 index 000000000..7b1a14a38 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/EventFeignClientFallback.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.comment.EpdcCommentsAndAttitudeFromTopicFormDTO; +import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; +import com.elink.esua.epdc.modules.feign.EventFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Author:liuchuang + * @Date:2019/11/8 13:36 + */ +@Component +public class EventFeignClientFallback implements EventFeignClient { + + @Override + public Result submitEvent(EpdcEventSubmitFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "submitEvent", formDto); + } + + @Override + public Result receiveTopicCommentAndAttitude(EpdcCommentsAndAttitudeFromTopicFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "receiveTopicCommentAndAttitude", formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/NewsFeignClientFallback.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/NewsFeignClientFallback.java new file mode 100644 index 000000000..0a2c9f20a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/NewsFeignClientFallback.java @@ -0,0 +1,21 @@ +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.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.modules.feign.NewsFeignClient; +import org.springframework.stereotype.Component; + +/** + * @author work@yujt.net.cn + * @date 2019/9/18 15:38 + */ +@Component +public class NewsFeignClientFallback implements NewsFeignClient { + + @Override + public Result saveInformation(EpdcInformationFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "saveInformation", formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/UserFeignClientFallback.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/UserFeignClientFallback.java new file mode 100644 index 000000000..4984aec98 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/UserFeignClientFallback.java @@ -0,0 +1,24 @@ +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.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; +import com.elink.esua.epdc.modules.feign.UserFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Author:liuchuang + * @Date:2019/10/23 16:01 + */ +@Component +public class UserFeignClientFallback implements UserFeignClient { + + @Override + public Result> getInviteUserList(EpdcUserGroupInviteFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getInviteUserList", formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/AppGroupController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/AppGroupController.java new file mode 100644 index 000000000..8c3c11f58 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/AppGroupController.java @@ -0,0 +1,204 @@ +package com.elink.esua.epdc.modules.group.controller; + +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; +import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; +import com.elink.esua.epdc.dto.group.form.*; +import com.elink.esua.epdc.dto.group.result.*; +import com.elink.esua.epdc.modules.group.service.GroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * + * 移动端社群模块 + * + * @Author:liuchuang + * @Date:2019/10/17 13:46 + */ +@RestController +@RequestMapping(Constant.EPDC_APP + "group") +public class AppGroupController { + + @Autowired + private GroupService groupService; + + /** + * + * 创建社群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/17 14:56 + */ + @PostMapping("create") + public Result createGroup(@RequestBody GroupCreateFormDTO formDto) { + //效验数据 + ValidatorUtils.validateEntity(formDto); + return groupService.saveGroup(formDto); + } + + /** + * + * 解散社群 + * + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/21 9:31 + */ + @PostMapping("operate") + public Result operate(@RequestBody GroupSettingStateDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto); + return groupService.modifyGroupState(dto); + } + + /** + * + * 我的群列表 + * + * @params [formDTO] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/21 17:18 + */ + @GetMapping("listOfMine") + public Result> groupsOfMine(@RequestBody GroupsOfMineFormDTO formDto) { + //效验数据 + ValidatorUtils.validateEntity(formDto); + List data = groupService.listGroupsOfMine(formDto); + return new Result>().ok(data); + } + + /** + * + * 推荐群列表 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/22 13:49 + */ + @GetMapping("listOfRecommend") + public Result> groupsOfRecommend(@RequestBody GroupsOfMineFormDTO formDto) { + //效验数据 + ValidatorUtils.validateEntity(formDto); + List data = groupService.listGroupsOfRecommend(formDto); + return new Result>().ok(data); + } + + /** + * + * 社群详情 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 15:07 + */ + @GetMapping("detail") + public Result detail(@RequestBody GroupDetailForMobileEndFormDTO formDto) { + //效验数据 + ValidatorUtils.validateEntity(formDto); + GroupDetailForMobileEndResultDTO resultDto = groupService.getGroupDetailForMobileEnd(formDto); + return new Result().ok(resultDto); + } + + /** + * + * 修改群介绍 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 15:39 + */ + @PostMapping("modifyIntroduction") + public Result modifyIntroduction(@RequestBody GroupIntroductionFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return groupService.modifyIntroduction(formDto); + } + + /** + * + * 修改群头像 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 17:30 + */ + @PostMapping("modifyAvatar") + public Result modifyAvatar(@RequestBody GroupModifyAvatarFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return groupService.modifyAvatar(formDto); + } + + /** + * + * 社群成员列表(待审核/审核通过) + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 9:18 + */ + @GetMapping("listOfMember") + public Result> listOfMember(@RequestBody GroupUsersFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return groupService.listOfMember(formDto); + } + + /** + * + * 移除社群成员 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 10:52 + */ + @PostMapping("removeMember") + public Result removeMember(@RequestBody GroupUserRemoveOrQuitFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + formDto.setState(GroupUserStateEnum.GROUP_USER_STATE_REMOVED.getValue()); + return groupService.modifyMemberState(formDto); + } + + /** + * + * 退出社群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 10:52 + */ + @PostMapping("quitGroup") + public Result quitGroup(@RequestBody GroupUserRemoveOrQuitFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + formDto.setState(GroupUserStateEnum.GROUP_USER_STATE_RETIRED.getValue()); + return groupService.modifyMemberState(formDto); + } + + /** + * + * 申请入群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/11 14:00 + */ + @PostMapping("applyForGroup") + public Result applyForGroup(@RequestBody GroupApplyFormDTO formDto) { + return groupService.applyForGroup(formDto); + } + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/AppUserGroupController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/AppUserGroupController.java new file mode 100644 index 000000000..63f7cb5a6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/AppUserGroupController.java @@ -0,0 +1,89 @@ +package com.elink.esua.epdc.modules.group.controller; + +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; +import com.elink.esua.epdc.dto.group.form.GroupAddUserFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupUserPartyMemberFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupUserReviewFormDTO; +import com.elink.esua.epdc.modules.group.service.UserGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * + * 移动端社群成员模块 + * + * @Author:liuchuang + * @Date:2019/11/6 9:40 + */ +@RestController +@RequestMapping(Constant.EPDC_APP + "usergroup") +public class AppUserGroupController { + + @Autowired + private UserGroupService userGroupService; + + /** + * + * 添加成员列表 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/23 16:37 + */ + @GetMapping("getInviteList") + public Result> getInviteList(@RequestBody EpdcUserGroupInviteFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return userGroupService.listOfInviteUsers(formDto); + } + + /** + * + * 添加社群成员 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 9:17 + */ + @PostMapping("addMember") + public Result addMember(@RequestBody GroupAddUserFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return userGroupService.saveGroupUsers(formDto); + } + + /** + * + * 审核入群申请 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 13:26 + */ + @PostMapping("reviewApply") + public Result reviewApply(@RequestBody GroupUserReviewFormDTO formDto) { + return userGroupService.modifyGroupUsers(formDto); + } + + /** + * + * 更新社群用户党员标识 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/11 14:32 + */ + @PostMapping("partyMember") + public Result updateUserPartyMember(@RequestBody GroupUserPartyMemberFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + return userGroupService.modifyGroupUsersPartyMember(formDto); + } +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/GroupController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/GroupController.java new file mode 100644 index 000000000..ff7518ae6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/GroupController.java @@ -0,0 +1,184 @@ +/** + * 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.elink.esua.epdc.modules.group.controller; + +import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +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.group.*; +import com.elink.esua.epdc.modules.group.excel.GroupExcel; +import com.elink.esua.epdc.modules.group.service.GroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 社群表 社群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@RestController +@RequestMapping("group") +public class GroupController { + + @Autowired + private GroupService groupService; + + /** + * + * 社群列表 状态state 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散 + * + * @params [params] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/11 14:53 + */ + @GetMapping("page") + @DataFilter(tableAlias = "gp", deptId = "grid_id", prefix = "AND", isPendingCreator = false) + public Result> page(@RequestParam Map params){ + PageData page = groupService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GroupDTO data = groupService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GroupDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + groupService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GroupDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + groupService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + groupService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = groupService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, GroupExcel.class); + } + + /** + * + * 社群审核详情信息 + * + * @params [id] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/21 10:32 + */ + @GetMapping("detail/{id}") + public Result detail(@PathVariable("id") String id){ + GroupDetailDTO data = groupService.getGroupDetail(id); + return new Result().ok(data); + } + + /** + * + * 审核、禁言、解禁、解散社群 + * + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/21 9:31 + */ + @PostMapping("operate") + public Result operate(@RequestBody GroupSettingStateDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto); + return groupService.modifyGroupState(dto); + } + + /** + * + * 获取网格下所有社群 + * + * @params [] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/12 9:30 + */ + @GetMapping("groupList") + public Result> groupList() { + List data = groupService.listOfGroupByGridId(SecurityUser.getDeptId()); + return new Result>().ok(data); + } + + /** + * + * 排行榜-活跃度 + * + * @params [params] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/12 16:10 + */ + @GetMapping("activity") + @DataFilter(tableAlias = "gp", deptId = "grid_id", prefix = "AND", isPendingCreator = false) + public Result> pageOfActivity(@RequestParam Map params) { + PageData page = groupService.listGroupOrderByActivity(params); + return new Result>().ok(page); + } + + /** + * + * 排行榜-群成员数量 + * + * @params [params] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/12 16:11 + */ + @GetMapping("member") + @DataFilter(tableAlias = "gp", deptId = "grid_id", prefix = "AND", isPendingCreator = false) + public Result> pageOfMember(@RequestParam Map params) { + PageData page = groupService.listGroupOrderByMember(params); + return new Result>().ok(page); + } + +} \ 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/group/controller/UserGroupController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/UserGroupController.java new file mode 100644 index 000000000..c2cb63fba --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/UserGroupController.java @@ -0,0 +1,84 @@ +/** + * 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.elink.esua.epdc.modules.group.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +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.group.UserGroupDTO; +import com.elink.esua.epdc.modules.group.service.UserGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 用户社群关系表 用户社群关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-17 + */ +@RestController +@RequestMapping("usergroup") +public class UserGroupController { + + @Autowired + private UserGroupService userGroupService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = userGroupService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + UserGroupDTO data = userGroupService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody UserGroupDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + userGroupService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody UserGroupDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + userGroupService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + userGroupService.delete(ids); + 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/group/dao/GroupDao.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/dao/GroupDao.java new file mode 100644 index 000000000..5524f1baa --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/dao/GroupDao.java @@ -0,0 +1,141 @@ +/** + * 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.elink.esua.epdc.modules.group.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.group.*; +import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; +import com.elink.esua.epdc.modules.group.entity.GroupEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 社群表 社群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Mapper +public interface GroupDao extends BaseDao { + + /** + * + * 社群列表 + * + * @params [params] + * @return java.util.List + * @author liuchuang + * @since 2019/10/11 14:54 + */ + List selectListOfGroups(Map params); + + /** + * + * 查询社群名称重复数量 + * + * @params [gridId, groupName] + * @return java.lang.Long + * @author liuchuang + * @since 2019/10/17 16:38 + */ + Long selectListOfRepeatGroupName(Long gridId, String groupName); + + /** + * + * 社群审核详情信息 + * + * @params [id] + * @return com.elink.esua.epdc.dto.group.GroupDetailDTO + * @author liuchuang + * @since 2019/10/21 10:32 + */ + GroupDetailDTO selectOneOfGroupDetail(String id); + + /** + * + * 移动端-我的群列表 + * + * @params [formDTO] + * @return java.util.List + * @author liuchuang + * @since 2019/10/21 17:08 + */ + List selectListGroupsOfMine(GroupsOfMineFormDTO formDto); + + /** + * + * 移动端-推荐群列表 + * + * @params [formDto] + * @return java.util.List + * @author liuchuang + * @since 2019/10/22 13:45 + */ + List selectListGroupsOfRecommend(GroupsOfMineFormDTO formDto); + + /** + * + * 移动端-社群详情 + * + * @params [formDto] + * @return com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO + * @author liuchuang + * @since 2019/10/22 15:02 + */ + GroupDetailForMobileEndResultDTO selectOneOfGroupDetailForMobileEnd(GroupDetailForMobileEndFormDTO formDto); + + /** + * + * 获取网格下所有社群 + * + * @params [deptId] + * @return java.util.List + * @author liuchuang + * @since 2019/11/12 9:35 + */ + List selectListOfGroupByGridId(Long deptId); + + /** + * + * 排行榜-活跃度 + * + * @params [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @author liuchuang + * @since 2019/11/12 16:14 + */ + List selectListOfGroupOrderByActivity(Map params); + + /** + * + * 排行榜-群成员数量 + * + * @params [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @author liuchuang + * @since 2019/11/12 16:14 + */ + List selectListOfGroupOrderByMember(Map params); + +} \ 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/group/dao/UserGroupDao.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/dao/UserGroupDao.java new file mode 100644 index 000000000..f4a963428 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/dao/UserGroupDao.java @@ -0,0 +1,117 @@ +/** + * 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.elink.esua.epdc.modules.group.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.group.UserGroupDTO; +import com.elink.esua.epdc.dto.group.form.GroupUserPartyMemberFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupUserRemoveOrQuitFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; +import com.elink.esua.epdc.modules.group.entity.UserGroupEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 用户社群关系表 用户社群关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-17 + */ +@Mapper +public interface UserGroupDao extends BaseDao { + + /** + * + * 社群成员列表 + * + * @params [params] + * @return java.util.List + * @author liuchuang + * @since 2019/10/17 10:31 + */ + List selectListOfGroupUsers(Map params); + + /** + * + * 移动端-社群成员列表 + * + * @params [groupId] + * @return java.util.List + * @author liuchuang + * @since 2019/10/21 11:14 + */ + List selectListOfGroupUsersByState(String groupId, Integer state); + + /** + * + * 群主信息 + * + * @params [groupId] + * @return com.elink.esua.epdc.dto.group.UserGroupDTO + * @author liuchuang + * @since 2019/10/22 15:57 + */ + UserGroupDTO selectOneOfLordInfoByGroupId(String groupId); + + /** + * + * 操作社群成员 + * + * @params [formDto] + * @return void + * @author liuchuang + * @since 2019/10/23 12:00 + */ + void updateMemberState(GroupUserRemoveOrQuitFormDTO formDto); + + /** + * + * 获取社群成员信息 + * + * @params [groupId, userId, state] + * @return com.elink.esua.epdc.dto.group.UserGroupDTO + * @author liuchuang + * @since 2019/10/23 13:47 + */ + UserGroupDTO selectOnOfUserInfo(String groupId, String userId, Integer state); + + /** + * + * 获取社群用户ID + * + * @params [groupId, states] + * @return java.util.List + * @author liuchuang + * @since 2019/10/23 15:04 + */ + List selectListOfGroupUserIdsByState(String groupId, int[] states); + + /** + * + * 更新社群用户党员标识 + * + * @params [formDto] + * @return void + * @author liuchuang + * @since 2019/11/11 14:30 + */ + void updateGroupUsersPartyMember(GroupUserPartyMemberFormDTO formDto); + +} \ 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/group/entity/GroupEntity.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/entity/GroupEntity.java new file mode 100644 index 000000000..ecd842435 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/entity/GroupEntity.java @@ -0,0 +1,111 @@ +/** + * 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.elink.esua.epdc.modules.group.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 社群表 社群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_group") +public class GroupEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 社群名称 + */ + private String groupName; + + /** + * 社群头像 + */ + private String groupAvatar; + + /** + * 社群介绍 + */ + private String groupIntroduction; + + /** + * 社群类别 0:党员群,1:自建群 + */ + private String groupCategory; + + /** + * 区 + */ + private String area; + + /** + * 区ID + */ + private Long areaId; + + /** + * 街道 + */ + private String street; + + /** + * 街道ID + */ + private Long streetId; + + /** + * 社区 + */ + private String community; + + /** + * 社区ID + */ + private Long communityId; + + /** + * 网格 + */ + private String grid; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 状态 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散 + */ + private Integer state; + + /** + * 处理意见 + */ + private String processingOpinions; + +} \ 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/group/entity/UserGroupEntity.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/entity/UserGroupEntity.java new file mode 100644 index 000000000..7227fd708 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/entity/UserGroupEntity.java @@ -0,0 +1,84 @@ +/** + * 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.elink.esua.epdc.modules.group.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户社群关系表 用户社群关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_user_group") +public class UserGroupEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 社群ID + */ + private String groupId; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户名 + */ + private String nickname; + + /** + * 用户头像 + */ + private String userAvatar; + + /** + * 手机号 + */ + private String mobile; + + /** + * 群主标识 0:否,1:是 + */ + private String lordFlag; + + /** + * 党员标识 0:否,1:是 + */ + private String partyMember; + + /** + * 状态 0:待审核,5:审核不通过,10:审核通过,15:已退群,20:已移除 + */ + private Integer state; + + /** + * 审核意见 + */ + private String auditOpinion; + +} \ 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/group/excel/GroupExcel.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/excel/GroupExcel.java new file mode 100644 index 000000000..bdd6912a6 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/excel/GroupExcel.java @@ -0,0 +1,98 @@ +/** + * 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.elink.esua.epdc.modules.group.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 社群表 社群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Data +public class GroupExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "社群名称") + private String groupName; + + @Excel(name = "社群头像") + private String groupAvatar; + + @Excel(name = "社群介绍") + private String groupIntroduction; + + @Excel(name = "社群类别 0:党员群,1:自建群") + private String groupCategory; + + @Excel(name = "区") + private String area; + + @Excel(name = "区ID") + private String areaId; + + @Excel(name = "街道") + private String street; + + @Excel(name = "街道ID") + private String streetId; + + @Excel(name = "社区") + private String community; + + @Excel(name = "社区ID") + private String communityId; + + @Excel(name = "网格") + private String grid; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "状态 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散") + private Integer state; + + @Excel(name = "处理意见") + private String processingOpinions; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ 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/group/redis/GroupRedis.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/redis/GroupRedis.java new file mode 100644 index 000000000..49c78036a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/redis/GroupRedis.java @@ -0,0 +1,47 @@ +/** + * 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.elink.esua.epdc.modules.group.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 社群表 社群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Component +public class GroupRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ 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/group/service/GroupService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/GroupService.java new file mode 100644 index 000000000..0fb53fbd3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/GroupService.java @@ -0,0 +1,253 @@ +/** + * 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.elink.esua.epdc.modules.group.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.group.*; +import com.elink.esua.epdc.dto.group.form.*; +import com.elink.esua.epdc.dto.group.result.*; +import com.elink.esua.epdc.modules.group.entity.GroupEntity; + +import java.util.List; +import java.util.Map; + +/** + * 社群表 社群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +public interface GroupService extends BaseService { + + /** + * 默认分页 社群列表 + * + * @param params + * @return PageData + * @author generator + * @date 2019-10-10 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-10-10 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GroupDTO + * @author generator + * @date 2019-10-10 + */ + GroupDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-10 + */ + void save(GroupDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-10 + */ + void update(GroupDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-10-10 + */ + void delete(String[] ids); + + /** + * + * 移动端-创建社群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/17 14:57 + */ + Result saveGroup(GroupCreateFormDTO formDto); + + /** + * + * 社群审核详情信息 + * + * @params [id] + * @return com.elink.esua.epdc.dto.group.GroupDetailDTO + * @author liuchuang + * @since 2019/10/21 10:32 + */ + GroupDetailDTO getGroupDetail(String id); + + /** + * + * 禁言、解禁、解散社群 + * + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/21 9:31 + */ + Result modifyGroupState(GroupSettingStateDTO dto); + + /** + * + * 移动端-我的群列表 + * + * @params [formDTO] + * @return java.util.List + * @author liuchuang + * @since 2019/10/21 17:09 + */ + List listGroupsOfMine(GroupsOfMineFormDTO formDto); + + /** + * + * 移动端-推荐群列表 + * + * @params [formDto] + * @return java.util.List + * @author liuchuang + * @since 2019/10/22 13:46 + */ + List listGroupsOfRecommend(GroupsOfMineFormDTO formDto); + + /** + * + * 移动端-社群详情 + * + * @params [formDto] + * @return com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO + * @author liuchuang + * @since 2019/10/22 15:04 + */ + GroupDetailForMobileEndResultDTO getGroupDetailForMobileEnd(GroupDetailForMobileEndFormDTO formDto); + + /** + * + * 移动端-修改群介绍 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 15:34 + */ + Result modifyIntroduction(GroupIntroductionFormDTO formDto); + + /** + * + * 移动端-修改群头像 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/22 17:31 + */ + Result modifyAvatar(GroupModifyAvatarFormDTO formDto); + + /** + * + * 移动端-社群成员列表(待审核/审核通过) + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 9:19 + */ + Result> listOfMember(GroupUsersFormDTO formDto); + + /** + * + * 移动端-操作社群成员 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 11:01 + */ + Result modifyMemberState(GroupUserRemoveOrQuitFormDTO formDto); + + /** + * + * 申请入群 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/11 14:07 + */ + Result applyForGroup(GroupApplyFormDTO formDto); + + /** + * + * 获取网格下所有社群 + * + * @params [deptId] + * @return java.util.List + * @author liuchuang + * @since 2019/11/12 9:33 + */ + List listOfGroupByGridId(Long deptId); + + /** + * + * 排行榜-活跃度 + * + * @params [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @author liuchuang + * @since 2019/11/12 16:14 + */ + PageData listGroupOrderByActivity(Map params); + + /** + * + * 排行榜-群成员数量 + * + * @params [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @author liuchuang + * @since 2019/11/12 16:14 + */ + PageData listGroupOrderByMember(Map params); + +} \ 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/group/service/UserGroupService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/UserGroupService.java new file mode 100644 index 000000000..a6a816a24 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/UserGroupService.java @@ -0,0 +1,191 @@ +/** + * 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.elink.esua.epdc.modules.group.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; +import com.elink.esua.epdc.dto.group.UserGroupDTO; +import com.elink.esua.epdc.dto.group.form.GroupAddUserFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupUserPartyMemberFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupUserRemoveOrQuitFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupUserReviewFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; +import com.elink.esua.epdc.modules.group.entity.UserGroupEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户社群关系表 用户社群关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-17 + */ +public interface UserGroupService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-10-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-10-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserGroupDTO + * @author generator + * @date 2019-10-17 + */ + UserGroupDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-17 + */ + void save(UserGroupDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-17 + */ + void update(UserGroupDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-10-17 + */ + void delete(String[] ids); + + /** + * + * 社群成员列表 + * + * @params [groupId, state: 0:待审核,5:审核不通过,10:审核通过,15:已退群,20:已移除] + * @return java.util.List + * @author liuchuang + * @since 2019/10/21 11:20 + */ + List listOfUserGroup(String groupId, Integer state); + + /** + * + * 群主信息 + * + * @params [groupId] + * @return com.elink.esua.epdc.dto.group.UserGroupDTO + * @author liuchuang + * @since 2019/10/22 15:58 + */ + UserGroupDTO getLordInfoByGroupId(String groupId); + + /** + * + * 操作社群成员 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/23 11:20 + */ + Result modifyMemberState(GroupUserRemoveOrQuitFormDTO formDto); + + /** + * + * 获取社群成员信息 + * + * @params [groupId, userId, state] + * @return com.elink.esua.epdc.dto.group.UserGroupDTO + * @author liuchuang + * @since 2019/10/23 13:46 + */ + UserGroupDTO getGroupUserInfo(String groupId, String userId, Integer state); + + /** + * + * 移动端-添加成员列表 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/10/23 16:37 + */ + Result> listOfInviteUsers(EpdcUserGroupInviteFormDTO formDto); + + /** + * + * 移动端-添加社群成员 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 9:18 + */ + Result saveGroupUsers(GroupAddUserFormDTO formDto); + + /** + * + * 移动端审核入群申请 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 13:29 + */ + Result modifyGroupUsers(GroupUserReviewFormDTO formDto); + + /** + * + * 更新社群用户党员标识 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/11 14:27 + */ + Result modifyGroupUsersPartyMember(GroupUserPartyMemberFormDTO formDto); +} \ 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/group/service/impl/GroupServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/impl/GroupServiceImpl.java new file mode 100644 index 000000000..c26dc6cba --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/impl/GroupServiceImpl.java @@ -0,0 +1,328 @@ +/** + * 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.elink.esua.epdc.modules.group.service.impl; + +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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.constant.GroupNoticeConstant; +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.dto.group.*; +import com.elink.esua.epdc.dto.enums.GroupStateEnum; +import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; +import com.elink.esua.epdc.dto.group.form.*; +import com.elink.esua.epdc.dto.group.result.*; +import com.elink.esua.epdc.modules.async.NewsTask; +import com.elink.esua.epdc.modules.group.dao.GroupDao; +import com.elink.esua.epdc.modules.group.entity.GroupEntity; +import com.elink.esua.epdc.modules.group.entity.UserGroupEntity; +import com.elink.esua.epdc.modules.group.service.GroupService; +import com.elink.esua.epdc.modules.group.service.UserGroupService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 社群表 社群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Service +public class GroupServiceImpl extends BaseServiceImpl implements GroupService { + + @Autowired + private UserGroupService userGroupService; + + @Autowired + private NewsTask newsTask; + + @Override + public PageData page(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListOfGroups(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GroupDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GroupDTO get(String id) { + GroupEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GroupDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GroupDTO dto) { + GroupEntity entity = ConvertUtils.sourceToTarget(dto, GroupEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GroupDTO dto) { + GroupEntity entity = ConvertUtils.sourceToTarget(dto, GroupEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result saveGroup(GroupCreateFormDTO formDto) { + // 去掉社群名称中的空白 + formDto.setGroupName(formDto.getGroupName().replaceAll("\\s*", "")); + // 校验社群名称是否已存在 + Long amount = baseDao.selectListOfRepeatGroupName(formDto.getGridId(), formDto.getGroupName()); + if (amount > 0) { + return new Result().error("群名称已存在,请修改"); + } + GroupEntity entity = ConvertUtils.sourceToTarget(formDto, GroupEntity.class); + if (insert(entity)) { + UserGroupDTO userGroupDTO = ConvertUtils.sourceToTarget(formDto.getGroupUserFormDTO(), UserGroupDTO.class); + userGroupDTO.setGroupId(entity.getId()); + userGroupService.save(userGroupDTO); + } + return new Result(); + } + + @Override + public GroupDetailDTO getGroupDetail(String id) { + return baseDao.selectOneOfGroupDetail(id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result modifyGroupState(GroupSettingStateDTO dto) { + // 获取社群当前状态 + GroupEntity entity = baseDao.selectById(dto.getId()); + if (null != entity) { + // 已解散的社群不能禁言和解禁 + if ((GroupStateEnum.GROUP_STATE_EXAMINATION_PASSED.getValue().equals(dto.getState()) + || GroupStateEnum.GROUP_STATE_BANNED.getValue().equals(dto.getState())) + && GroupStateEnum.GROUP_STATE_DISBANDED.getValue().equals(entity.getState())) { + return new Result().error("操作失败,当前社群已解散"); + } else { + GroupEntity groupEntity = new GroupEntity(); + groupEntity.setId(dto.getId()); + groupEntity.setState(dto.getState()); + groupEntity.setProcessingOpinions(dto.getProcessingOpinions()); + baseDao.updateById(groupEntity); + + // 组装发送消息内容 + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + informationFormDTO.setContent("《".concat(entity.getGroupName()).concat("》")); + informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE); + informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_NOT_PASSED_OR_DISBAND); + informationFormDTO.setBusinessId(dto.getId()); + informationFormDTO.setRelBusinessContent(dto.getProcessingOpinions()); + boolean sendNotice = false; + // 社群审核不通过 + if (GroupStateEnum.GROUP_STATE_AUDIT_NOT_PASSED.getValue().equals(dto.getState())) { + sendNotice = true; + informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_NOT_PASSED); + } + // 社群审核通过 + if (GroupStateEnum.GROUP_STATE_EXAMINATION_PASSED.getValue().equals(dto.getState()) + && GroupStateEnum.GROUP_STATE_PENDING_REVIEW.getValue().equals(entity.getState())) { + sendNotice = true; + informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_PASSED); + informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_PASSED); + informationFormDTO.setRelBusinessContent("快去加好友吧"); + } + // 解散 + if (GroupStateEnum.GROUP_STATE_DISBANDED.getValue().equals(dto.getState())) { + sendNotice = true; + informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_DISBAND); + informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_GROUP_NOTICE); + } + + // 发送通知 + if (sendNotice) { + // 获取群成员列表 + List userListResultDTOS = userGroupService.listOfUserGroup(dto.getId(), GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); + for (GroupUserListResultDTO usersDTO: + userListResultDTOS) { + informationFormDTO.setUserId(usersDTO.getUserId()); + newsTask.insertUserInformation(informationFormDTO); + } + } + + return new Result(); + } + } + + return new Result().error("操作失败"); + } + + @Override + public List listGroupsOfMine(GroupsOfMineFormDTO formDto) { + return baseDao.selectListGroupsOfMine(formDto); + } + + @Override + public List listGroupsOfRecommend(GroupsOfMineFormDTO formDto) { + return baseDao.selectListGroupsOfRecommend(formDto); + } + + @Override + public GroupDetailForMobileEndResultDTO getGroupDetailForMobileEnd(GroupDetailForMobileEndFormDTO formDto) { + return baseDao.selectOneOfGroupDetailForMobileEnd(formDto); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result modifyIntroduction(GroupIntroductionFormDTO formDto) { + // 获取群主信息 + UserGroupDTO userGroupDTO = userGroupService.getLordInfoByGroupId(formDto.getId()); + // 判断当前用户是否为群主 + if (!formDto.getUserId().equals(userGroupDTO.getUserId())) { + return new Result().error("操作失败,只有群主可以修改群介绍"); + } + GroupEntity entity = new GroupEntity(); + entity.setId(formDto.getId()); + entity.setGroupIntroduction(formDto.getGroupIntroduction()); + baseDao.updateById(entity); + + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result modifyAvatar(GroupModifyAvatarFormDTO formDto) { + // 获取群主信息 + UserGroupDTO userGroupDTO = userGroupService.getLordInfoByGroupId(formDto.getId()); + // 判断当前用户是否为群主 + if (!formDto.getUserId().equals(userGroupDTO.getUserId())) { + return new Result().error("操作失败,只有群主可以修改群头像"); + } + GroupEntity entity = new GroupEntity(); + entity.setId(formDto.getId()); + entity.setGroupAvatar(formDto.getGroupAvatar()); + baseDao.updateById(entity); + + return new Result(); + } + + @Override + public Result> listOfMember(GroupUsersFormDTO formDto) { + List data = userGroupService.listOfUserGroup(formDto.getGroupId(), formDto.getState()); + return new Result>().ok(data); + } + + @Override + public Result modifyMemberState(GroupUserRemoveOrQuitFormDTO formDto) { + // 获取成员信息 + UserGroupDTO userGroupDto = userGroupService.getGroupUserInfo(formDto.getGroupId(), formDto.getOperatorId(), GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); + // 获取群主信息 + UserGroupDTO lordGroupDto = userGroupService.getLordInfoByGroupId(formDto.getGroupId()); + // 获取社群信息 + GroupEntity groupEntity = baseDao.selectById(formDto.getGroupId()); + + // 组装发送消息内容 + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + informationFormDTO.setContent("《".concat(groupEntity.getGroupName()).concat("》")); + informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_GROUP_NOTICE); + informationFormDTO.setBusinessId(formDto.getGroupId()); + if (GroupUserStateEnum.GROUP_USER_STATE_REMOVED.getValue().equals(formDto.getState())) { + // 移除社群成员 + if (!NumConstant.ONE_STR.equals(userGroupDto.getLordFlag())) { + return new Result().error("操作失败,只有群主可以删除社群成员"); + } + informationFormDTO.setUserId(formDto.getUserId()); + informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_USER_REMOVED_MEMBER); + informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_USER_REMOVED_MEMBER); + } else if (GroupUserStateEnum.GROUP_USER_STATE_RETIRED.getValue().equals(formDto.getState())){ + // 退出社群 + if (NumConstant.ONE_STR.equals(userGroupDto.getLordFlag())) { + return new Result().error("操作失败,群主不可以退出社群"); + } + informationFormDTO.setUserId(lordGroupDto.getUserId()); + informationFormDTO.setTitle(userGroupDto.getNickname().concat(GroupNoticeConstant.NOTICE_GROUP_QUIT)); + informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_USER_QUIT); + } + + // 更新社群成员状态 + userGroupService.modifyMemberState(formDto); + // 发送通知 + newsTask.insertUserInformation(informationFormDTO); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result applyForGroup(GroupApplyFormDTO formDto) { + UserGroupEntity userGroupEntity = ConvertUtils.sourceToTarget(formDto, UserGroupEntity.class); + userGroupEntity.setLordFlag(NumConstant.ZERO_STR); + userGroupEntity.setState(GroupUserStateEnum.GROUP_USER_STATE_PENDING_REVIEW.getValue()); + if (userGroupService.insert(userGroupEntity)) { + return new Result(); + } + + return new Result().error(); + } + + @Override + public List listOfGroupByGridId(Long deptId) { + return baseDao.selectListOfGroupByGridId(deptId); + } + + @Override + public PageData listGroupOrderByActivity(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListOfGroupOrderByActivity(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public PageData listGroupOrderByMember(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListOfGroupOrderByMember(params); + return new PageData<>(list, page.getTotal()); + } +} \ 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/group/service/impl/UserGroupServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/impl/UserGroupServiceImpl.java new file mode 100644 index 000000000..16a5d26e9 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/impl/UserGroupServiceImpl.java @@ -0,0 +1,250 @@ +/** + * 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.elink.esua.epdc.modules.group.service.impl; + +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.NumConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.constant.GroupNoticeConstant; +import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; +import com.elink.esua.epdc.dto.group.GroupDTO; +import com.elink.esua.epdc.dto.group.UserGroupDTO; +import com.elink.esua.epdc.dto.group.UserReviewDto; +import com.elink.esua.epdc.dto.group.form.*; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; +import com.elink.esua.epdc.modules.async.NewsTask; +import com.elink.esua.epdc.modules.feign.UserFeignClient; +import com.elink.esua.epdc.modules.group.dao.UserGroupDao; +import com.elink.esua.epdc.modules.group.entity.UserGroupEntity; +import com.elink.esua.epdc.modules.group.service.GroupService; +import com.elink.esua.epdc.modules.group.service.UserGroupService; +import org.apache.commons.lang3.StringUtils; +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; + +/** + * 用户社群关系表 用户社群关系表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-17 + */ +@Service +public class UserGroupServiceImpl extends BaseServiceImpl implements UserGroupService { + + @Autowired + private UserFeignClient userFeignClient; + + @Autowired + private GroupService groupService; + + @Autowired + private NewsTask newsTask; + + @Override + public PageData page(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListOfGroupUsers(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserGroupDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public UserGroupDTO get(String id) { + UserGroupEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserGroupDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserGroupDTO dto) { + UserGroupEntity entity = ConvertUtils.sourceToTarget(dto, UserGroupEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserGroupDTO dto) { + UserGroupEntity entity = ConvertUtils.sourceToTarget(dto, UserGroupEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List listOfUserGroup(String groupId, Integer state) { + return baseDao.selectListOfGroupUsersByState(groupId, state); + } + + @Override + public UserGroupDTO getLordInfoByGroupId(String groupId) { + return baseDao.selectOneOfLordInfoByGroupId(groupId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result modifyMemberState(GroupUserRemoveOrQuitFormDTO formDto) { + baseDao.updateMemberState(formDto); + return new Result(); + } + + @Override + public UserGroupDTO getGroupUserInfo(String groupId, String userId, Integer state) { + return baseDao.selectOnOfUserInfo(groupId, userId, state); + } + + @Override + public Result> listOfInviteUsers(EpdcUserGroupInviteFormDTO formDto) { + // 获取社群当前待审核和审核通过的成员ID + int[] states = {GroupUserStateEnum.GROUP_USER_STATE_PENDING_REVIEW.getValue(), GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()}; + List userIds = baseDao.selectListOfGroupUserIdsByState(formDto.getGroupId(), states); + formDto.setUserIds(userIds); + + return userFeignClient.getInviteUserList(formDto); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result saveGroupUsers(GroupAddUserFormDTO formDto) { + List userGroupEntities = new ArrayList<>(formDto.getGroupUserFormDtoList().size()); + UserGroupEntity entity = null; + for (GroupUserFormDTO userDto: + formDto.getGroupUserFormDtoList()) { + entity = new UserGroupEntity(); + entity.setGroupId(formDto.getGroupId()); + entity.setUserId(userDto.getUserId()); + entity.setNickname(userDto.getNickname()); + entity.setUserAvatar(userDto.getUserAvatar()); + entity.setMobile(userDto.getMobile()); + entity.setPartyMember(userDto.getPartyMember()); + entity.setLordFlag(NumConstant.ZERO_STR); + entity.setState(GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); + + userGroupEntities.add(entity); + } + + if (insertBatch(userGroupEntities)) { + // 获取社群信息 + GroupDTO groupDto = groupService.get(formDto.getGroupId()); + // 组装发送消息内容 + for (UserGroupEntity userGroupEntity: + userGroupEntities) { + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + informationFormDTO.setContent(GroupNoticeConstant.NOTICE_GROUP_USER_INVITED_CONTENT.replace("groupName", groupDto.getGroupName())); + informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_GROUP_NOTICE); + informationFormDTO.setBusinessId(formDto.getGroupId()); + informationFormDTO.setUserId(userGroupEntity.getUserId()); + informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_USER_INVITED); + informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_USER_INVITED); + + // 发送通知 + newsTask.insertUserInformation(informationFormDTO); + } + return new Result(); + } + + return new Result().error(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result modifyGroupUsers(GroupUserReviewFormDTO formDto) { + List userGroupEntities = new ArrayList<>(formDto.getUserReviewDtoList().size()); + UserGroupEntity entity = null; + for (UserReviewDto userReviewDto: + formDto.getUserReviewDtoList()) { + entity = new UserGroupEntity(); + entity.setId(userReviewDto.getId()); + entity.setState(userReviewDto.getState()); + entity.setAuditOpinion(userReviewDto.getAuditOpinion()); + + userGroupEntities.add(entity); + } + if (updateBatchById(userGroupEntities)) { + // 获取社群信息 + GroupDTO groupDto = groupService.get(formDto.getGroupId()); + // 组装发送消息内容 + for (UserGroupEntity userGroupEntity: + userGroupEntities) { + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE); + informationFormDTO.setUserId(userGroupEntity.getUserId()); + if (GroupUserStateEnum.GROUP_USER_STATE_AUDIT_NOT_PASSED.getValue().equals(userGroupEntity.getState())) { + informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_USER_REVIEW_NOT_PASSED); + informationFormDTO.setContent(GroupNoticeConstant.NOTICE_GROUP_USER_REVIEW_NOT_PASSED_CONTENT + .replace("groupName", groupDto.getGroupName()) + .replace("auditOpinion", userGroupEntity.getAuditOpinion())); + informationFormDTO.setBusinessId(userGroupEntity.getId()); + informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_USER_REVIEW_NOT_PASS); + } else { + informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_USER_REVIEW_PASSED); + informationFormDTO.setContent(GroupNoticeConstant.NOTICE_GROUP_USER_REVIEW_PASSED_CONTENT + .replace("groupName", groupDto.getGroupName())); + informationFormDTO.setBusinessId(formDto.getGroupId()); + informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_USER_REVIEW_PASSED); + } + // 发送通知 + newsTask.insertUserInformation(informationFormDTO); + } + return new Result(); + } + + return new Result().error(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result modifyGroupUsersPartyMember(GroupUserPartyMemberFormDTO formDto) { + baseDao.updateGroupUsersPartyMember(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/controller/AppTopicController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/AppTopicController.java new file mode 100644 index 000000000..88102d089 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/AppTopicController.java @@ -0,0 +1,119 @@ +package com.elink.esua.epdc.modules.topic.controller; + +import com.elink.esua.epdc.commons.tools.constant.Constant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.group.result.TopicAuditRecordResultDTO; +import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO; +import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO; +import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; +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; +import com.elink.esua.epdc.modules.topic.service.TopicService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * + * 移动端-话题模块 + * + * @Author:liuchuang + * @Date:2019/11/6 15:43 + */ +@RestController +@RequestMapping(Constant.EPDC_APP + "topic") +public class AppTopicController { + + @Autowired + private TopicService topicService; + + /** + * + * 发布话题 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 15:52 + */ + @PostMapping("submit") + public Result submit(@RequestBody TopicSubmitFormDTO formDto) { + return topicService.saveTopic(formDto); + } + + /** + * + * 话题列表 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/11 15:07 + */ + @GetMapping("list") + public Result> listOfTopic(@RequestBody TopicListFormDTO formDto) { + List data = topicService.listOfTopic(formDto); + return new Result>().ok(data); + } + + /** + * + * 话题详情 + * + * @params [id] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/7 15:37 + */ + @GetMapping("detail/{id}") + public Result detail(@PathVariable("id") String id) { + TopicDetailResultDTO data = topicService.getTopicDetailById(id); + return new Result().ok(data); + } + + /** + * + * 关闭话题 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/7 16:14 + */ + @PostMapping("close") + public Result close(@RequestBody TopicCloseFormDTO formDto) { + return topicService.modifyTopicState(formDto, NumConstant.ZERO_STR); + } + + /** + * + * 话题审核记录 + * + * @params [topicId] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @author liuchuang + * @since 2019/11/8 9:39 + */ + @GetMapping("auditRecord/{topicId}") + public Result> auditRecord(@PathVariable("topicId") String topicId) { + List data = topicService.listOfTopicAuditRecord(topicId); + return new Result>().ok(data); + } + + /** + * + * 转议题 + * + * @params [userDetail, formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/8 10:37 + */ + @PostMapping("changeToIssue") + public Result changeToIssue(@RequestBody TopicChangeToIssueFormDTO formDto) { + return topicService.changeToIssue(formDto); + } +} 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 new file mode 100644 index 000000000..38fb4b3dd --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java @@ -0,0 +1,164 @@ +/** + * 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.elink.esua.epdc.modules.topic.controller; + +import com.elink.esua.epdc.commons.mybatis.annotation.DataFilter; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +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.TopicDetailDTO; +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; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 话题表 话题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@RestController +@RequestMapping("topic") +public class TopicController { + + @Autowired + private TopicService topicService; + + @GetMapping("page") + @DataFilter(tableAlias = "temp", deptId = "grid_id", prefix = "AND", isPendingCreator = false) + public Result> page(@RequestParam Map params){ + PageData page = topicService.listTopic(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TopicDTO data = topicService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TopicDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + topicService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TopicDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + topicService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + topicService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = topicService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, TopicExcel.class); + } + + /** + * + * 关闭话题 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/7 17:39 + */ + @PostMapping("close") + public Result close(@RequestBody TopicCloseFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + 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 Map callbackMap) { + TopicReviewFormDTO formDto = new TopicReviewFormDTO(); + formDto.setTopicId(callbackMap.get("topicId")); + formDto.setProcessingOpinions(callbackMap.get("processingOpinions")); + formDto.setEventId(callbackMap.get("eventId")); + formDto.setState(Integer.valueOf(callbackMap.get("state"))); + 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(); + } + + /** + * + * 话题详情 + * + * @params [id] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/12 10:22 + */ + @GetMapping("detail/{id}") + public Result detail(@PathVariable("id") String id) { + TopicDetailDTO data = topicService.getDetail(id); + return new Result().ok(data); + } + +} \ 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/dao/TopicAuditRecordDao.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicAuditRecordDao.java new file mode 100644 index 000000000..1a4fe1c4e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicAuditRecordDao.java @@ -0,0 +1,46 @@ +/** + * 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.elink.esua.epdc.modules.topic.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.group.result.TopicAuditRecordResultDTO; +import com.elink.esua.epdc.modules.topic.entity.TopicAuditRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 话题审核记录表 话题审核记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-07 + */ +@Mapper +public interface TopicAuditRecordDao extends BaseDao { + + /** + * + * 话题审核记录 + * + * @params [topicId] + * @return java.util.List + * @author liuchuang + * @since 2019/11/8 9:32 + */ + List selectListOfTopicAuditRecord(String topicId); +} \ 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/dao/TopicDao.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicDao.java new file mode 100644 index 000000000..ab96687f0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicDao.java @@ -0,0 +1,102 @@ +/** + * 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.elink.esua.epdc.modules.topic.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; +import com.elink.esua.epdc.dto.topic.TopicDTO; +import com.elink.esua.epdc.dto.topic.TopicDetailDTO; +import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO; +import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; +import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO; +import com.elink.esua.epdc.modules.topic.entity.TopicEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 话题表 话题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Mapper +public interface TopicDao extends BaseDao { + + /** + * 评论数+1 + */ + void updateCommentNum(String id); + + /** + * + * 移动端-话题详情 + * + * @params [id] + * @return com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO + * @author liuchuang + * @since 2019/11/7 15:32 + */ + TopicDetailResultDTO selectOneOfTopicDetailById(String id); + + /** + * + * 移动端-话题列表 + * + * @params [formDto] + * @return java.util.List + * @author liuchuang + * @since 2019/11/11 15:14 + */ + List selectListOfTopic(TopicListFormDTO formDto); + + /** + * + * 话题转议题详情数据 + * + * @params [id] + * @return com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO + * @author liuchuang + * @since 2019/11/8 15:11 + */ + EpdcEventSubmitFormDTO selectOneOfTopicForChangeToIssue(String id); + + /** + * + * 话题列表 + * + * @params [params] + * @return java.util.List + * @author liuchuang + * @since 2019/11/12 9:45 + */ + List selectListTopic(Map params); + + /** + * + * 话题详情 + * + * @params [id] + * @return com.elink.esua.epdc.dto.topic.TopicDetailDTO + * @author liuchuang + * @since 2019/11/12 10:25 + */ + TopicDetailDTO selectOneOfTopic(String id); + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicImgDao.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicImgDao.java new file mode 100644 index 000000000..d71212c21 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicImgDao.java @@ -0,0 +1,33 @@ +/** + * 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.elink.esua.epdc.modules.topic.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.topic.entity.TopicImgEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题图片表 话题图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-06 + */ +@Mapper +public interface TopicImgDao extends BaseDao { + +} \ 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/entity/TopicAuditRecordEntity.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/entity/TopicAuditRecordEntity.java new file mode 100644 index 000000000..5f0ffae59 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/entity/TopicAuditRecordEntity.java @@ -0,0 +1,56 @@ +/** + * 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.elink.esua.epdc.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题审核记录表 话题审核记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_topic_audit_record") +public class TopicAuditRecordEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 话题ID + */ + private String topicId; + + /** + * 状态 0:审核不通过,1:审核通过,2:已关闭 + */ + private Integer state; + + /** + * 处理意见 + */ + private String processingOpinions; + +} \ 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/entity/TopicEntity.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/entity/TopicEntity.java new file mode 100644 index 000000000..5de270f3c --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/entity/TopicEntity.java @@ -0,0 +1,162 @@ +/** + * 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.elink.esua.epdc.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 话题表 话题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_topic") +public class TopicEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户昵称 + */ + private String nickname; + + /** + * 用户头像 + */ + private String userFace; + + /** + * 党员标识 0:否,1:是 + */ + private String partyMember; + + /** + * 手机号 + */ + private String mobile; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 议题ID + */ + private String issueId; + + /** + * 项目ID + */ + private String itemId; + + /** + * 区 + */ + private String area; + + /** + * 区ID + */ + private Long areaId; + + /** + * 街道 + */ + private String street; + + /** + * 街道ID + */ + private Long streetId; + + /** + * 社区 + */ + private String community; + + /** + * 社区ID + */ + private Long communityId; + + /** + * 网格 + */ + private String grid; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 话题地址 + */ + private String topicAddress; + + /** + * 话题位置纬度 + */ + private BigDecimal topicLatitude; + + /** + * 话题位置经度 + */ + private BigDecimal topicLongitude; + + /** + * 友邻社群 + */ + private String groupName; + + /** + * 友邻社群ID + */ + private String groupId; + + /** + * 状态 0:讨论中,5:转议题待审核,10:转议题审核不通过,15:已转议题,20:已转项目,25:已关闭 + */ + private Integer state; + + /** + * 评论数 + */ + private Integer commentNum; + + /** + * 浏览数 + */ + private Integer browseNum; + +} \ 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/entity/TopicImgEntity.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/entity/TopicImgEntity.java new file mode 100644 index 000000000..f56d8558a --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/entity/TopicImgEntity.java @@ -0,0 +1,56 @@ +/** + * 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.elink.esua.epdc.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题图片表 话题图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_topic_img") +public class TopicImgEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 引用ID + */ + private String referenceId; + + /** + * 图片地址 + */ + private String imgUrl; + + /** + * 图片类型 + */ + private String imgType; + +} \ 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/excel/TopicExcel.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/excel/TopicExcel.java new file mode 100644 index 000000000..52b227dc7 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/excel/TopicExcel.java @@ -0,0 +1,126 @@ +/** + * 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.elink.esua.epdc.modules.topic.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 话题表 话题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Data +public class TopicExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "用户昵称") + private String nickname; + + @Excel(name = "用户头像") + private String userFace; + + @Excel(name = "党员标识 0:否,1:是") + private String partyMember; + + @Excel(name = "话题内容") + private String topicContent; + + @Excel(name = "议题ID") + private String issueId; + + @Excel(name = "项目ID") + private String itemId; + + @Excel(name = "区") + private String area; + + @Excel(name = "区ID") + private Long areaId; + + @Excel(name = "街道") + private String street; + + @Excel(name = "街道ID") + private Long streetId; + + @Excel(name = "社区") + private String community; + + @Excel(name = "社区ID") + private Long communityId; + + @Excel(name = "网格") + private String grid; + + @Excel(name = "网格ID") + private Long gridId; + + @Excel(name = "话题地址") + private String topicAddress; + + @Excel(name = "话题位置纬度") + private BigDecimal topicLatitude; + + @Excel(name = "话题位置经度") + private BigDecimal topicLongitude; + + @Excel(name = "友邻社群") + private String groupName; + + @Excel(name = "友邻社群ID") + private String groupId; + + @Excel(name = "状态 0:讨论中,5:转议题待审核,10:转议题审核不通过,15:已转议题,20:已转项目,25:已关闭") + private Integer state; + + @Excel(name = "评论数") + private Integer commentNum; + + @Excel(name = "浏览数") + private Integer browseNum; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ 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/redis/TopicRedis.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/redis/TopicRedis.java new file mode 100644 index 000000000..0dbf9cbbf --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/redis/TopicRedis.java @@ -0,0 +1,47 @@ +/** + * 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.elink.esua.epdc.modules.topic.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 话题表 话题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Component +public class TopicRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ 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/TopicAuditRecordService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicAuditRecordService.java new file mode 100644 index 000000000..e71170878 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicAuditRecordService.java @@ -0,0 +1,107 @@ +/** + * 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.elink.esua.epdc.modules.topic.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.group.result.TopicAuditRecordResultDTO; +import com.elink.esua.epdc.dto.topic.TopicAuditRecordDTO; +import com.elink.esua.epdc.modules.topic.entity.TopicAuditRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 话题审核记录表 话题审核记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-07 + */ +public interface TopicAuditRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-07 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-07 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicAuditRecordDTO + * @author generator + * @date 2019-11-07 + */ + TopicAuditRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-07 + */ + void save(TopicAuditRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-07 + */ + void update(TopicAuditRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-07 + */ + void delete(String[] ids); + + /** + * + * 话题审核记录 + * + * @params [topicId] + * @return java.util.List + * @author liuchuang + * @since 2019/11/8 9:35 + */ + List listOfTopicAuditRecord(String topicId); +} \ 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/TopicImgService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicImgService.java new file mode 100644 index 000000000..a60c55a76 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicImgService.java @@ -0,0 +1,106 @@ +/** + * 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.elink.esua.epdc.modules.topic.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.topic.TopicImgDTO; +import com.elink.esua.epdc.modules.topic.entity.TopicImgEntity; + +import java.util.List; +import java.util.Map; + +/** + * 话题图片表 话题图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-06 + */ +public interface TopicImgService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicImgDTO + * @author generator + * @date 2019-11-06 + */ + TopicImgDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-06 + */ + void save(TopicImgDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-06 + */ + void update(TopicImgDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-06 + */ + void delete(String[] ids); + + /** + * + * 保存图片 + * + * @params [images, referenceId, imgType] + * @return boolean + * @author liuchuang + * @since 2019/11/6 16:20 + */ + boolean saveImages(List images, String referenceId, String imgType); +} \ 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 new file mode 100644 index 000000000..64a5bba20 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java @@ -0,0 +1,210 @@ +/** + * 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.elink.esua.epdc.modules.topic.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.group.result.TopicAuditRecordResultDTO; +import com.elink.esua.epdc.dto.topic.TopicDTO; +import com.elink.esua.epdc.dto.topic.TopicDetailDTO; +import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO; +import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO; +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; +import com.elink.esua.epdc.modules.topic.entity.TopicEntity; + +import java.util.List; +import java.util.Map; + +/** + * 话题表 话题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +public interface TopicService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-10-10 + */ + PageData page(Map params); + + /** + * + * 话题列表 + * + * @params [params] + * @return com.elink.esua.epdc.commons.tools.page.PageData + * @author liuchuang + * @since 2019/11/12 9:43 + */ + PageData listTopic(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-10-10 + */ + List list(Map params); + + /** + * + * 移动端-话题列表 + * + * @params [formDto] + * @return java.util.List + * @author liuchuang + * @since 2019/11/11 15:08 + */ + List listOfTopic(TopicListFormDTO formDto); + + /** + * 单条查询 + * + * @param id + * @return TopicDTO + * @author generator + * @date 2019-10-10 + */ + TopicDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-10 + */ + void save(TopicDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-10-10 + */ + void update(TopicDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-10-10 + */ + void delete(String[] ids); + + + /** + * 评论数+1 + */ + void updateCommentNum(String id); + + /** + * + * 移动端-发布话题 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/6 15:53 + */ + Result saveTopic(TopicSubmitFormDTO formDto); + + /** + * + * 移动端-话题详情 + * + * @params [id] + * @return com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO + * @author liuchuang + * @since 2019/11/7 15:34 + */ + TopicDetailResultDTO getTopicDetailById(String id); + + /** + * + * 关闭话题 + * + * @params [formDto, operatorUser(操作人:0-群主,1-网格长)] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/7 16:50 + */ + Result modifyTopicState(TopicCloseFormDTO formDto, String operatorUser); + + /** + * + * 话题审核记录 + * + * @params [topicId] + * @return java.util.List + * @author liuchuang + * @since 2019/11/8 9:35 + */ + List listOfTopicAuditRecord(String topicId); + + /** + * + * 移动端-转议题 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @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); + + /** + * + * 话题详情 + * + * @params [id] + * @return com.elink.esua.epdc.dto.topic.TopicDetailDTO + * @author liuchuang + * @since 2019/11/12 10:24 + */ + TopicDetailDTO getDetail(String id); +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicAuditRecordServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicAuditRecordServiceImpl.java new file mode 100644 index 000000000..91893dedc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicAuditRecordServiceImpl.java @@ -0,0 +1,106 @@ +/** + * 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.elink.esua.epdc.modules.topic.service.impl; + +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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dto.group.result.TopicAuditRecordResultDTO; +import com.elink.esua.epdc.dto.topic.TopicAuditRecordDTO; +import com.elink.esua.epdc.modules.topic.dao.TopicAuditRecordDao; +import com.elink.esua.epdc.modules.topic.entity.TopicAuditRecordEntity; +import com.elink.esua.epdc.modules.topic.service.TopicAuditRecordService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题审核记录表 话题审核记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-07 + */ +@Service +public class TopicAuditRecordServiceImpl extends BaseServiceImpl implements TopicAuditRecordService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicAuditRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicAuditRecordDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public TopicAuditRecordDTO get(String id) { + TopicAuditRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicAuditRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicAuditRecordDTO dto) { + TopicAuditRecordEntity entity = ConvertUtils.sourceToTarget(dto, TopicAuditRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicAuditRecordDTO dto) { + TopicAuditRecordEntity entity = ConvertUtils.sourceToTarget(dto, TopicAuditRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List listOfTopicAuditRecord(String topicId) { + return baseDao.selectListOfTopicAuditRecord(topicId); + } + +} \ 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/impl/TopicImgServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicImgServiceImpl.java new file mode 100644 index 000000000..7f506f409 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicImgServiceImpl.java @@ -0,0 +1,119 @@ +/** + * 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.elink.esua.epdc.modules.topic.service.impl; + +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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dto.topic.TopicImgDTO; +import com.elink.esua.epdc.modules.topic.dao.TopicImgDao; +import com.elink.esua.epdc.modules.topic.entity.TopicImgEntity; +import com.elink.esua.epdc.modules.topic.service.TopicImgService; +import org.apache.commons.lang3.StringUtils; +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; + +/** + * 话题图片表 话题图片表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-06 + */ +@Service +public class TopicImgServiceImpl extends BaseServiceImpl implements TopicImgService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicImgDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicImgDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public TopicImgDTO get(String id) { + TopicImgEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicImgDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicImgDTO dto) { + TopicImgEntity entity = ConvertUtils.sourceToTarget(dto, TopicImgEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicImgDTO dto) { + TopicImgEntity entity = ConvertUtils.sourceToTarget(dto, TopicImgEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean saveImages(List images, String referenceId, String imgType) { + if (null == images || images.isEmpty()) { + return true; + } + List imgEntities = new ArrayList<>(images.size()); + TopicImgEntity entity = null; + for (String url: + images) { + entity = new TopicImgEntity(); + entity.setReferenceId(referenceId); + entity.setImgUrl(url); + entity.setImgType(imgType); + imgEntities.add(entity); + } + return insertBatch(imgEntities); + } + +} \ 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/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 new file mode 100644 index 000000000..4e3858466 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -0,0 +1,394 @@ +/** + * 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.elink.esua.epdc.modules.topic.service.impl; + +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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.utils.DateUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.dto.comment.EpdcCommentsAndAttitudeFromTopicFormDTO; +import com.elink.esua.epdc.dto.comment.EventCommentDTO; +import com.elink.esua.epdc.dto.comment.EventCommentUserAttitudeDTO; +import com.elink.esua.epdc.dto.constant.GroupNoticeConstant; +import com.elink.esua.epdc.dto.constant.TopicImageConstant; +import com.elink.esua.epdc.dto.enums.GroupStateEnum; +import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; +import com.elink.esua.epdc.dto.enums.TopicStateEnum; +import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; +import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; +import com.elink.esua.epdc.dto.group.GroupDTO; +import com.elink.esua.epdc.dto.group.UserGroupDTO; +import com.elink.esua.epdc.dto.group.result.TopicAuditRecordResultDTO; +import com.elink.esua.epdc.dto.topic.TopicDTO; +import com.elink.esua.epdc.dto.topic.TopicDetailDTO; +import com.elink.esua.epdc.dto.topic.form.TopicListFormDTO; +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; +import com.elink.esua.epdc.modules.async.NewsTask; +import com.elink.esua.epdc.modules.async.TopicChangeToIssueTask; +import com.elink.esua.epdc.modules.comment.service.TopicCommentService; +import com.elink.esua.epdc.modules.feign.EventFeignClient; +import com.elink.esua.epdc.modules.group.service.GroupService; +import com.elink.esua.epdc.modules.group.service.UserGroupService; +import com.elink.esua.epdc.modules.topic.dao.TopicDao; +import com.elink.esua.epdc.modules.topic.entity.TopicAuditRecordEntity; +import com.elink.esua.epdc.modules.topic.entity.TopicEntity; +import com.elink.esua.epdc.modules.topic.service.TopicAuditRecordService; +import com.elink.esua.epdc.modules.topic.service.TopicImgService; +import com.elink.esua.epdc.modules.topic.service.TopicService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 话题表 话题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Service +public class TopicServiceImpl extends BaseServiceImpl implements TopicService { + + @Autowired + private TopicImgService topicImgService; + + @Autowired + private UserGroupService userGroupService; + + @Autowired + private GroupService groupService; + + @Autowired + private TopicAuditRecordService topicAuditRecordService; + + @Autowired + private NewsTask newsTask; + + @Autowired + private EventFeignClient eventFeignClient; + + @Autowired + private TopicCommentService topicCommentService; + + @Autowired + private TopicChangeToIssueTask topicChangeToIssueTask; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicDTO.class); + } + + @Override + public PageData listTopic(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListTopic(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public TopicDTO get(String id) { + TopicEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicDTO dto) { + TopicEntity entity = ConvertUtils.sourceToTarget(dto, TopicEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicDTO dto) { + TopicEntity entity = ConvertUtils.sourceToTarget(dto, TopicEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void updateCommentNum(String id) { + baseDao.updateCommentNum(id); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result saveTopic(TopicSubmitFormDTO formDto) { + TopicEntity entity = ConvertUtils.sourceToTarget(formDto, TopicEntity.class); + if (insert(entity)) { + // 保存图片 + topicImgService.saveImages(formDto.getImages(), entity.getId(), TopicImageConstant.TYPE_IMAGE_BIZ_TOPIC); + return new Result(); + } + return new Result().error(); + } + + @Override + public TopicDetailResultDTO getTopicDetailById(String id) { + TopicDetailResultDTO resultDto = baseDao.selectOneOfTopicDetailById(id); + if (null != resultDto) { + // 更新浏览次数 + TopicEntity entity = new TopicEntity(); + entity.setId(id); + entity.setBrowseNum(resultDto.getBrowseNum() + 1); + this.updateById(entity); + } + return resultDto; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result modifyTopicState(TopicCloseFormDTO formDto, String operatorUser) { + TopicDTO topicDto = get(formDto.getId()); + // 获取社群信息 + GroupDTO groupDto = groupService.get(topicDto.getGroupId()); + if (GroupStateEnum.GROUP_STATE_DISBANDED.getValue().equals(groupDto.getState())) { + return new Result().error("社群已解散,不可以关闭话题"); + } + // 群主关闭话题 + if (NumConstant.ZERO_STR.equals(operatorUser)) { + // 获取用户信息 + UserGroupDTO userDto = userGroupService.getGroupUserInfo(topicDto.getGroupId(), formDto.getUserId(), GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); + if (null == userDto || !NumConstant.ONE_STR.equals(userDto.getLordFlag())) { + return new Result().error("您不是群主,不可以关闭话题"); + } + } + + TopicEntity entity = new TopicEntity(); + entity.setId(formDto.getId()); + entity.setState(TopicStateEnum.TOPIC_STATE_CLOSED.getValue()); + if (updateById(entity)) { + // 插入话题操作记录表 + TopicAuditRecordEntity auditRecordEntity = new TopicAuditRecordEntity(); + auditRecordEntity.setTopicId(formDto.getId()); + auditRecordEntity.setState(NumConstant.TWO); + auditRecordEntity.setProcessingOpinions(formDto.getProcessingOpinions()); + topicAuditRecordService.insert(auditRecordEntity); + + // 发送消息通知 + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_INTERACTIVE_NOTICE); + informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_TOPIC_CLOSED); + informationFormDTO.setContent(topicDto.getTopicContent()); + informationFormDTO.setBusinessId(topicDto.getId()); + informationFormDTO.setUserId(topicDto.getUserId()); + informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_TOPIC_CLOSED); + informationFormDTO.setRelBusinessContent("关闭原因:"+formDto.getProcessingOpinions()); + + // 发送通知 + newsTask.insertUserInformation(informationFormDTO); + return new Result(); + } + return new Result().error(); + } + + @Override + public List listOfTopicAuditRecord(String topicId) { + return topicAuditRecordService.listOfTopicAuditRecord(topicId); + } + + @Override + public List listOfTopic(TopicListFormDTO formDto) { + int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageIndex(pageIndex); + // 查询半年内的数据 + formDto.setSomeMonthsAgo(DateUtils.addDateMonths(new Date(), -6)); + return baseDao.selectListOfTopic(formDto); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result changeToIssue(TopicChangeToIssueFormDTO formDto) { + TopicDTO topicDto = this.get(formDto.getId()); + // 校验 + Result checkResult = this.checkTopicToIssue(topicDto, formDto.getUserId()); + if (!checkResult.success()) { + return checkResult; + } + // 插入事件表 + EpdcEventSubmitFormDTO eventSubmitFormDto = baseDao.selectOneOfTopicForChangeToIssue(formDto.getId()); + Result eventResult = eventFeignClient.submitEvent(eventSubmitFormDto); + if (!eventResult.success()) { + return eventResult; + } + + // 更新话题状态 + TopicEntity entity = new TopicEntity(); + entity.setId(formDto.getId()); + entity.setState(TopicStateEnum.TOPIC_STATE_CHANGE_TO_ISSUE_PENDING_REVIEW.getValue()); + if (updateById(entity)) { + return new Result(); + } + + 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); + + // 拷贝评论、评论的支持反对到事件 + this.copyCommentsAndAttitudeToEvents(formDto); + } 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(); + } + + @Override + public TopicDetailDTO getDetail(String id) { + return baseDao.selectOneOfTopic(id); + } + + /** + * + * 话题转议题校验 + * + * @params [topicDto, userId] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/11/8 11:16 + */ + private Result checkTopicToIssue(TopicDTO topicDto, String userId) { + // 校验社群状态 + GroupDTO groupDto = groupService.get(topicDto.getGroupId()); + if (null == groupDto || GroupStateEnum.GROUP_STATE_DISBANDED.getValue().equals(groupDto.getState())) { + return new Result().error("话题转议题失败,当前社群已解散"); + } + // 校验用户身份 + UserGroupDTO userDto = userGroupService.getGroupUserInfo(topicDto.getGroupId(), userId, GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); + if (null == userDto || !NumConstant.ONE_STR.equals(userDto.getLordFlag())) { + return new Result().error("您不是群主,不可以转为议题"); + } + // 校验话题状态 + if (!TopicStateEnum.TOPIC_STATE_IN_CONVERSATION.getValue().equals(topicDto.getState())) { + return new Result().error("当前话题不是讨论中状态,不可以转为议题"); + } + + return new Result(); + } + + /** + * + * 拷贝评论、评论的支持反对到事件 + * + * @params [formDto] + * @return void + * @author liuchuang + * @since 2019/11/13 11:18 + */ + private void copyCommentsAndAttitudeToEvents(TopicReviewFormDTO formDto) { + // 获取话题下所有评论 + List comments = topicCommentService.listCommentForEvent(formDto); + // 获取话题下所有评论的表态 + List attitudes = topicCommentService.listCommentAttitudeForEvent(formDto.getTopicId()); + + EpdcCommentsAndAttitudeFromTopicFormDTO eventFormDto = new EpdcCommentsAndAttitudeFromTopicFormDTO(); + eventFormDto.setComments(comments); + eventFormDto.setAttitudes(attitudes); + topicChangeToIssueTask.copyCommentsAndAttitudeToEvents(eventFormDto); + } + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml new file mode 100644 index 000000000..ebf9e2d72 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml @@ -0,0 +1,87 @@ +server: + port: @server.port@ + servlet: + context-path: /group + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epdc-group-server + # 环境 dev|test|prod + profiles: + active: @spring.profiles.active@ + messages: + encoding: UTF-8 + basename: i18n/messages,i18n/messages_common + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + timeout: 30s + port: @spring.redis.port@ + password: @spring.redis.password@ + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + register-enabled: @nacos.register-enabled@ + alibaba: + seata: + tx-service-group: epdc-group-server-fescar-service-group + datasource: + druid: + driver-class-name: com.mysql.jdbc.Driver + url: @spring.datasource.druid.url@ + username: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + +feign: + hystrix: + enabled: true + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.elink.esua.epdc.modules.*.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: UUID + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/logback-spring.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/logback-spring.xml new file mode 100644 index 000000000..3375c4c54 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/logback-spring.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/comment/TopicCommentDao.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/comment/TopicCommentDao.xml new file mode 100755 index 000000000..136b2a2a0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/comment/TopicCommentDao.xml @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE epdc_topic_comment + SET REPLY_COUNT = REPLY_COUNT + 1 + WHERE ID = #{commentId} + + + + UPDATE epdc_topic_comment + SET LIKE_COUNT = LIKE_COUNT + 1 + WHERE ID = #{commentId} + + + + + UPDATE epdc_topic_comment + SET UN_LIKE_COUNT = UN_LIKE_COUNT + 1 + WHERE ID = #{commentId} + + + + UPDATE epdc_topic_comment + SET LIKE_COUNT = LIKE_COUNT - 1 + WHERE ID = #{commentId} + + + + + UPDATE epdc_topic_comment + SET UN_LIKE_COUNT = UN_LIKE_COUNT - 1 + WHERE ID = #{commentId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE epdc_topic_comment SET SHIELD_FLAG = '1' WHERE ID IN + + #{commentId} + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/comment/TopicCommentUserAttitudeDao.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/comment/TopicCommentUserAttitudeDao.xml new file mode 100755 index 000000000..2d6d40d28 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/comment/TopicCommentUserAttitudeDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/GroupDao.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/GroupDao.xml new file mode 100644 index 000000000..8e6021827 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/GroupDao.xml @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/UserGroupDao.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/UserGroupDao.xml new file mode 100644 index 000000000..4b5611d38 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/UserGroupDao.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + UPDATE epdc_user_group SET STATE = #{state} WHERE GROUP_ID = #{groupId} AND USER_ID = #{userId} AND DEL_FLAG = '0' + + + + + + + + UPDATE epdc_user_group SET PARTY_MEMBER = #{partyMember} WHERE USER_ID = #{userId} + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicAuditRecordDao.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicAuditRecordDao.xml new file mode 100644 index 000000000..63c988423 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicAuditRecordDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml new file mode 100644 index 000000000..b401f16ac --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml @@ -0,0 +1,264 @@ + + + + + + + + UPDATE epdc_topic SET COMMENT_NUM = COMMENT_NUM + 1 WHERE ID = #{id} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/registry.conf b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/registry.conf new file mode 100644 index 000000000..fb64abd71 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/registry.conf @@ -0,0 +1,21 @@ +registry { + # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa + type = "nacos" + + nacos { + serverAddr = "@nacos.server-addr@" + namespace = "public" + cluster = "default" + } +} + +config { + # file、nacos 、apollo、zk、consul、etcd3 + type = "nacos" + + nacos { + serverAddr = "@nacos.server-addr@" + namespace = "public" + cluster = "default" + } +} diff --git a/esua-epdc/epdc-module/epdc-group/pom.xml b/esua-epdc/epdc-module/epdc-group/pom.xml new file mode 100644 index 000000000..882f9e411 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/pom.xml @@ -0,0 +1,18 @@ + + + + epdc-module + com.esua.epdc + 1.0.0 + + 4.0.0 + + epdc-group + pom + + epdc-group-client + epdc-group-server + + + diff --git a/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java b/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java index f163843ba..17428cd70 100644 --- a/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java +++ b/esua-epdc/epdc-module/epdc-news/epdc-news-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcInformationFormDTO.java @@ -64,7 +64,7 @@ public class EpdcInformationFormDTO implements Serializable { * 消息所属业务类型:event事件审核;issueComment议题评论;issueReply议题评论回复;itemComment项目评论;itemReply项目评论回复; * issueApprove支持议题;itemApprove支持项目;issueCommentApprove议题评论支持;issueCommentOppose议题评论反对; * itemCommentApprove项目评论支持;itemCommentOppose项目评论反对;issue议题处理; - * item项目处理;crowd社群邀请等 + * item项目处理;groupInvited社群邀请等 */ @NotBlank(message = "消息所属业务类型不能为空") private String businessType; diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyAuthenticationFailedDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyAuthenticationFailedDTO.java new file mode 100644 index 000000000..70b09a96b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyAuthenticationFailedDTO.java @@ -0,0 +1,166 @@ +/** + * 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.elink.esua.epdc.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党员认证失败表 党员认证失败表 + * + * @author gp gupeng@elink-cn.com + * @since v1.0.0 2019-11-15 + */ +@Data +public class PartyAuthenticationFailedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 姓名 + */ + private String realName; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 职务 字典表dict_name + */ + private String post; + + /** + * 职务ID 字典表dict_value + */ + private String postValue; + + /** + * 干部下沉标识 0-否,1-是 + */ + private String cadreFlag; + + /** + * 注册状态 0-否,1-是 + */ + private String registFlag; + + /** + * 注册时间 + */ + private Date registTime; + + /** + * 街道名称 + */ + private String streetName; + + /** + * 街道ID + */ + private Long streetId; + + /** + * 社区名称 + */ + private String communityName; + + /** + * 社区ID + */ + private Long communityId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 状态 0-认证失败 + */ + private Integer state; + + /** + * 处理意见 + */ + private String processingOpinions; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 0-否,1-是 + */ + private String delFlag; + + /** + * 用户ID + */ + private String userId; + + /** + * 居民住址 + */ + private String address; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserDTO.java index 00d6c2a51..271040877 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserDTO.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserDTO.java @@ -66,7 +66,8 @@ public class UserDTO implements Serializable { private String faceImg; /** - * 性别(女性-female,男性-male) + * 性别(女性-0,男性-1) + * {@link com.elink.esua.epdc.commons.tools.enums.UserSexEnum} */ private String sex; diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserGroupInviteFormDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserGroupInviteFormDTO.java new file mode 100644 index 000000000..4ed8b22d3 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserGroupInviteFormDTO.java @@ -0,0 +1,52 @@ +package com.elink.esua.epdc.dto.epdc.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * + * 社群添加好友列表Form DTO + * + * @Author:liuchuang + * @Date:2019/10/23 15:12 + */ +@Data +public class EpdcUserGroupInviteFormDTO implements Serializable { + private static final long serialVersionUID = 3535094231006462718L; + + /** + * 网格ID + */ + @NotNull(message = "网格ID不能为空") + private Long gridId; + + /** + * 社群ID + */ + @NotBlank(message = "社群ID不能为空") + private String groupId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 路 + */ + private String road; + + /** + * 姓氏 + */ + private String lastName; + + /** + * 已入群或待审核用户ID + */ + List userIds; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcUserGroupInviteResultDTO.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcUserGroupInviteResultDTO.java new file mode 100644 index 000000000..382049724 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcUserGroupInviteResultDTO.java @@ -0,0 +1,42 @@ +package com.elink.esua.epdc.dto.epdc.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 成员信息 + * + * @Author:liuchuang + * @Date:2019/10/23 15:17 + */ +@Data +public class EpdcUserGroupInviteResultDTO implements Serializable { + private static final long serialVersionUID = -542091852373464243L; + + /** + * 用户ID + */ + private String userId; + + /** + * 用户名 + */ + private String nickname; + + /** + * 用户头像 + */ + private String userAvatar; + + /** + * 党员标识(0:否,1:是) + */ + private String partyMember; + + /** + * 手机号 + */ + private String mobile; +} diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/enums/AppUserStatesEnum.java b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/enums/AppUserStatesEnum.java index 5272a76bd..866183e1e 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/enums/AppUserStatesEnum.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/enums/AppUserStatesEnum.java @@ -33,7 +33,12 @@ public enum AppUserStatesEnum { /** * 用户未注册 */ - STATE_NOT_REGISTERED(NumConstant.FOUR_STR); + STATE_NOT_REGISTERED(NumConstant.FOUR_STR), + + /** + * 用户认证党员失败 + */ + PARTY_MEMBER_AUTHENTICATION_FAILED(NumConstant.FIVE_STR); private String value; diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java index 703760398..c76d0f49d 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java @@ -3,15 +3,20 @@ package com.elink.esua.epdc.controller; import com.elink.esua.epdc.commons.tools.constant.Constant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserRegistFormDTO; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDto; import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterAuditMsgResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; import com.elink.esua.epdc.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * 对移动端开放 * @@ -160,6 +165,20 @@ public class EpdcAppUserController { return userService.getUserRegisterAuditResult(userId); } + /** + * 社群添加好友列表 + * + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @params [formDto] + * @author liuchuang + * @since 2019/10/23 16:22 + */ + @GetMapping("getInviteUserList") + public Result> getInviteUserList(@RequestBody EpdcUserGroupInviteFormDTO formDto) { + List data = userService.listOfInviteUsers(formDto); + return new Result>().ok(data); + } + /** * 检查用户注册状态 * diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyAuthenticationFailedController.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyAuthenticationFailedController.java new file mode 100644 index 000000000..aca44598d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyAuthenticationFailedController.java @@ -0,0 +1,94 @@ +/** + * 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.elink.esua.epdc.controller; + +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; +import com.elink.esua.epdc.commons.tools.utils.Result; +import com.elink.esua.epdc.commons.tools.validator.AssertUtils; +import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; +import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; +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.PartyAuthenticationFailedDTO; +import com.elink.esua.epdc.excel.PartyAuthenticationFailedExcel; +import com.elink.esua.epdc.service.PartyAuthenticationFailedService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 党员认证失败表 党员认证失败表 + * + * @author gp gupeng@elink-cn.com + * @since v1.0.0 2019-11-15 + */ +@RestController +@RequestMapping("partyauthenticationfailed") +public class PartyAuthenticationFailedController { + + @Autowired + private PartyAuthenticationFailedService partyAuthenticationFailedService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = partyAuthenticationFailedService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PartyAuthenticationFailedDTO data = partyAuthenticationFailedService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PartyAuthenticationFailedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + partyAuthenticationFailedService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody PartyAuthenticationFailedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + partyAuthenticationFailedService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + partyAuthenticationFailedService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = partyAuthenticationFailedService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PartyAuthenticationFailedExcel.class); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyAuthenticationFailedDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyAuthenticationFailedDao.java new file mode 100644 index 000000000..352315cb0 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyAuthenticationFailedDao.java @@ -0,0 +1,45 @@ +/** + * 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.elink.esua.epdc.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.PartyAuthenticationFailedDTO; +import com.elink.esua.epdc.entity.PartyAuthenticationFailedEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * 党员认证失败表 党员认证失败表 + * + * @author gp gupeng@elink-cn.com + * @since v1.0.0 2019-11-15 + */ +@Mapper +public interface PartyAuthenticationFailedDao extends BaseDao { + + /** + * 查询认证失败的党员列表 + * @params params + * @return java.util.List + * @author gp + * @date 2019-11-18 + */ + List selectListDto(Map params); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java index b88daeeb2..07ac76e5c 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java @@ -18,10 +18,12 @@ package com.elink.esua.epdc.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDto; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterAuditMsgResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; import com.elink.esua.epdc.entity.UserEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -77,6 +79,16 @@ public interface UserDao extends BaseDao { */ int deleteAuditFailureByOpenId(@Param("wxOpenId") String wxOpenId); + /** + * 移动端-社群添加好友列表 + * + * @return java.util.List + * @params [formDto] + * @author liuchuang + * @since 2019/10/23 16:25 + */ + List selectListOfInviteUsers(EpdcUserGroupInviteFormDTO formDto); + /** * 查询用户列表 * diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyAuthenticationFailedEntity.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyAuthenticationFailedEntity.java new file mode 100644 index 000000000..862d20235 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyAuthenticationFailedEntity.java @@ -0,0 +1,136 @@ +/** + * 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.elink.esua.epdc.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 党员认证失败表 党员认证失败表 + * + * @author gp gupeng@elink-cn.com + * @since v1.0.0 2019-11-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epdc_party_authentication_failed") +public class PartyAuthenticationFailedEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 姓名 + */ + private String realName; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 + */ + private String identityNo; + + /** + * 职务 字典表dict_name + */ + private String post; + + /** + * 职务ID 字典表dict_value + */ + private String postValue; + + /** + * 干部下沉标识 0-否,1-是 + */ + private String cadreFlag; + + /** + * 注册状态 0-否,1-是 + */ + private String registFlag; + + /** + * 注册时间 + */ + private Date registTime; + + /** + * 街道名称 + */ + private String streetName; + + /** + * 街道ID + */ + private Long streetId; + + /** + * 社区名称 + */ + private String communityName; + + /** + * 社区ID + */ + private Long communityId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格ID + */ + private Long gridId; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 状态 0-认证失败 + */ + private Integer state; + + /** + * 处理意见 + */ + private String processingOpinions; + + /** + * 用户ID + */ + private String userId; + + /** + * 居民住址 + */ + private String address; + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyAuthenticationFailedExcel.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyAuthenticationFailedExcel.java new file mode 100644 index 000000000..cca915878 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyAuthenticationFailedExcel.java @@ -0,0 +1,113 @@ +/** + * 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.elink.esua.epdc.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党员认证失败表 党员认证失败表 + * + * @author gp gupeng@elink-cn.com + * @since v1.0.0 2019-11-15 + */ +@Data +public class PartyAuthenticationFailedExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "姓名") + private String realName; + + @Excel(name = "手机号") + private String mobile; + + @Excel(name = "身份证号") + private String identityNo; + + @Excel(name = "职务 字典表dict_name") + private String post; + + @Excel(name = "职务ID 字典表dict_value") + private String postValue; + + @Excel(name = "干部下沉标识 0-否,1-是") + private String cadreFlag; + + @Excel(name = "注册状态 0-否,1-是") + private String registFlag; + + @Excel(name = "注册时间") + private Date registTime; + + @Excel(name = "街道名称") + private String streetName; + + @Excel(name = "街道ID") + private Long streetId; + + @Excel(name = "社区名称") + private String communityName; + + @Excel(name = "社区ID") + private Long communityId; + + @Excel(name = "网格名称") + private String gridName; + + @Excel(name = "网格ID") + private Long gridId; + + @Excel(name = "部门ID") + private Long deptId; + + @Excel(name = "状态 0-认证失败") + private Integer state; + + @Excel(name = "处理意见") + private String processingOpinions; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标记 0-否,1-是") + private String delFlag; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "居民住址") + private String address; + + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/PartyAuthenticationFailedRedis.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/PartyAuthenticationFailedRedis.java new file mode 100644 index 000000000..c41b64224 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/PartyAuthenticationFailedRedis.java @@ -0,0 +1,47 @@ +/** + * 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.elink.esua.epdc.redis; + +import com.elink.esua.epdc.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 党员认证失败表 党员认证失败表 + * + * @author gp gupeng@elink-cn.com + * @since v1.0.0 2019-11-15 + */ +@Component +public class PartyAuthenticationFailedRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyAuthenticationFailedService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyAuthenticationFailedService.java new file mode 100644 index 000000000..3901c8c7d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyAuthenticationFailedService.java @@ -0,0 +1,95 @@ +/** + * 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.elink.esua.epdc.service; + +import com.elink.esua.epdc.commons.mybatis.service.BaseService; +import com.elink.esua.epdc.commons.tools.page.PageData; +import com.elink.esua.epdc.dto.PartyAuthenticationFailedDTO; +import com.elink.esua.epdc.entity.PartyAuthenticationFailedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党员认证失败表 党员认证失败表 + * + * @author gp gupeng@elink-cn.com + * @since v1.0.0 2019-11-15 + */ +public interface PartyAuthenticationFailedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2019-11-15 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-11-15 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PartyAuthenticationFailedDTO + * @author generator + * @date 2019-11-15 + */ + PartyAuthenticationFailedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-15 + */ + void save(PartyAuthenticationFailedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2019-11-15 + */ + void update(PartyAuthenticationFailedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2019-11-15 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java index 4c5830b2b..e50e87529 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserService.java @@ -21,11 +21,14 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserRegistFormDTO; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDto; import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterAuditMsgResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; import com.elink.esua.epdc.entity.UserEntity; import java.util.List; @@ -136,6 +139,16 @@ public interface UserService extends BaseService { */ Result getUserRegisterAuditResult(String userId); + /** + * 移动端-社群添加好友列表 + * + * @return java.util.List + * @params [formDto] + * @author liuchuang + * @since 2019/10/23 16:24 + */ + List listOfInviteUsers(EpdcUserGroupInviteFormDTO formDto); + /** * 网格长注册 * diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyAuthenticationFailedServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyAuthenticationFailedServiceImpl.java new file mode 100644 index 000000000..91c708c3d --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyAuthenticationFailedServiceImpl.java @@ -0,0 +1,101 @@ +/** + * 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.elink.esua.epdc.service.impl; + +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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.dao.PartyAuthenticationFailedDao; +import com.elink.esua.epdc.dto.PartyAuthenticationFailedDTO; +import com.elink.esua.epdc.entity.PartyAuthenticationFailedEntity; +import com.elink.esua.epdc.redis.PartyAuthenticationFailedRedis; +import com.elink.esua.epdc.service.PartyAuthenticationFailedService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 党员认证失败表 党员认证失败表 + * + * @author gp gupeng@elink-cn.com + * @since v1.0.0 2019-11-15 + */ +@Service +public class PartyAuthenticationFailedServiceImpl extends BaseServiceImpl implements PartyAuthenticationFailedService { + + @Autowired + private PartyAuthenticationFailedRedis partyAuthenticationFailedRedis; + + @Override + public PageData page(Map params) { + IPage page = this.getPage(params); + List list = baseDao.selectListDto(params); + return new PageData<>(list, page.getTotal()); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PartyAuthenticationFailedDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + return wrapper; + } + + @Override + public PartyAuthenticationFailedDTO get(String id) { + PartyAuthenticationFailedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PartyAuthenticationFailedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PartyAuthenticationFailedDTO dto) { + PartyAuthenticationFailedEntity entity = ConvertUtils.sourceToTarget(dto, PartyAuthenticationFailedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PartyAuthenticationFailedDTO dto) { + PartyAuthenticationFailedEntity entity = ConvertUtils.sourceToTarget(dto, PartyAuthenticationFailedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java index 802fdce5f..c6e16f462 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java @@ -24,23 +24,29 @@ 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.enums.UserSexEnum; import com.elink.esua.epdc.commons.tools.enums.YesOrNoEnum; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.constant.UserFieldConsant; +import com.elink.esua.epdc.dao.PartyAuthenticationFailedDao; import com.elink.esua.epdc.dao.PartyMembersDao; import com.elink.esua.epdc.dao.UserDao; import com.elink.esua.epdc.dto.UserDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.form.EpdcUserRegistFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterAuditMsgResultDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; import com.elink.esua.epdc.dto.UserGridRelationDTO; import com.elink.esua.epdc.dto.epdc.EpdcCompleteAppUserDTO; import com.elink.esua.epdc.dto.epdc.EpdcGridLeaderRegisterDTO; import com.elink.esua.epdc.dto.epdc.form.*; import com.elink.esua.epdc.dto.epdc.result.EpdcResidentDetailResultDto; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterAuditMsgResultDTO; import com.elink.esua.epdc.dto.epdc.result.EpdcUserRegisterInfoResultDTO; +import com.elink.esua.epdc.entity.PartyAuthenticationFailedEntity; import com.elink.esua.epdc.entity.PartyMembersEntity; import com.elink.esua.epdc.entity.UserEntity; import com.elink.esua.epdc.entity.UserGridRelationEntity; @@ -48,7 +54,6 @@ import com.elink.esua.epdc.enums.AppUserAuditStateEnum; import com.elink.esua.epdc.enums.AppUserStatesEnum; import com.elink.esua.epdc.service.UserGridRelationService; import com.elink.esua.epdc.service.UserService; -import com.elink.esua.epdc.service.UserTagRelationService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -72,7 +77,7 @@ public class UserServiceImpl extends BaseServiceImpl implem private PartyMembersDao partyMembersDao; @Autowired - private UserTagRelationService userTagRelationService; + private UserGridRelationService userGridRelationService; @Override @@ -262,8 +267,10 @@ public class UserServiceImpl extends BaseServiceImpl implem return new Result().ok(dto); } - @Autowired - private UserGridRelationService userGridRelationService; + @Override + public List listOfInviteUsers(EpdcUserGroupInviteFormDTO formDto) { + return baseDao.selectListOfInviteUsers(formDto); + } @Override @Transactional(rollbackFor = Exception.class) @@ -408,14 +415,6 @@ public class UserServiceImpl extends BaseServiceImpl implem } if (YesOrNoEnum.YES.value().equals(userDto.getPartyFlag())) { - QueryWrapper partyWrapper = new QueryWrapper<>(); - partyWrapper.eq(UserFieldConsant.IDENTITY_NO, userDto.getIdentityNo()) - .eq(UserFieldConsant.REAL_NAME, userDto.getRealName()); - selectCount = this.partyMembersDao.selectCount(partyWrapper); - if (selectCount != NumConstant.ONE) { - return new Result().error("无法匹配党员信息"); - } - userWrapper = new QueryWrapper<>(); userWrapper.eq(UserFieldConsant.IDENTITY_NO, userDto.getIdentityNo()) .ne(FieldConstant.ID, userId); @@ -428,6 +427,9 @@ public class UserServiceImpl extends BaseServiceImpl implem return new Result().ok(userEntity.getState()); } + @Autowired + private PartyAuthenticationFailedDao partyAuthenticationFailedDao; + @Override @Transactional(rollbackFor = Exception.class) public Result completeUserInfo(EpdcAppUserCompleteInfoFormDTO formDto) { @@ -437,9 +439,6 @@ public class UserServiceImpl extends BaseServiceImpl implem UserGridRelationDTO userGridRelation = formDto.getUserGridRelation(); UserEntity oldEntity = this.baseDao.selectById(userDto.getId()); - String nicknamePrefix = "网格长-"; - // 姓 - String lastName = userDto.getRealName().substring(NumConstant.ZERO, NumConstant.ONE); if (YesOrNoEnum.YES.value().equals(userDto.getPartyFlag())) { PartyMembersEntity partyMembersEntity = new PartyMembersEntity(); @@ -451,30 +450,41 @@ public class UserServiceImpl extends BaseServiceImpl implem partyMembersEntity.setGridName(userGridRelation.getGrid()); partyMembersEntity.setRegistFlag(YesOrNoEnum.YES.value()); - UpdateWrapper partyUpdate = new UpdateWrapper<>(); - partyUpdate.eq(UserFieldConsant.IDENTITY_NO, userDto.getIdentityNo()) + QueryWrapper partyWrapper = new QueryWrapper<>(); + partyWrapper.eq(UserFieldConsant.IDENTITY_NO, userDto.getIdentityNo()) .eq(UserFieldConsant.REAL_NAME, userDto.getRealName()); - - if (this.partyMembersDao.update(partyMembersEntity, partyUpdate) != NumConstant.ONE) { - throw new RenException("保存党员信息异常"); - } - if (oldEntity.getNickname().startsWith(nicknamePrefix)) { - userDto.setNickname(nicknamePrefix.concat(lastName).concat(NumConstant.ZERO_STR.equals(userDto.getSex()) ? "女士" : "先生")); + int selectCount = this.partyMembersDao.selectCount(partyWrapper); + + if (selectCount == NumConstant.ZERO) { + // 党员库中没有,存进党员认证失败表 + PartyAuthenticationFailedEntity authenticationFailedEntity = ConvertUtils.sourceToTarget(partyMembersEntity, PartyAuthenticationFailedEntity.class); + authenticationFailedEntity.setState(Integer.parseInt(YesOrNoEnum.NO.value())); + authenticationFailedEntity.setAddress(userDto.getAddress()); + partyAuthenticationFailedDao.insert(authenticationFailedEntity); + + userDto.setState(AppUserStatesEnum.PARTY_MEMBER_AUTHENTICATION_FAILED.value()); + }else { + UpdateWrapper partyUpdate = new UpdateWrapper<>(); + partyUpdate.eq(UserFieldConsant.IDENTITY_NO, userDto.getIdentityNo()) + .eq(UserFieldConsant.REAL_NAME, userDto.getRealName()); + + this.partyMembersDao.update(partyMembersEntity, partyUpdate); } + } else { if (oldEntity.getState().equals(AppUserStatesEnum.STATE_INFORMATION_NOT_PASSED.value())) { userDto.setState(AppUserStatesEnum.STATE_COMPLETED_INFORMATION_PENDING_REVIEW.value()); } - String sex = oldEntity.getSex(); - userDto.setSex(sex); - if (!oldEntity.getNickname().startsWith(nicknamePrefix)) { - nicknamePrefix = userDto.getRoad().concat("-"); - } - if (StringUtils.isNotBlank(sex) && NumConstant.ZERO_STR.equals(sex)) { - userDto.setNickname(nicknamePrefix.concat(lastName).concat("女士")); - } else { - userDto.setNickname(nicknamePrefix.concat(lastName).concat("先生")); - } + } + + String nicknamePrefix = "网格长-"; + // 姓 + String lastName = userDto.getRealName().substring(NumConstant.ZERO, NumConstant.ONE); + if (oldEntity.getNickname().startsWith(nicknamePrefix)) { + userDto.setNickname(nicknamePrefix.concat(lastName).concat(UserSexEnum.FEMALE.sex().equals(userDto.getSex()) ? "女士" : "先生")); + }else { + userDto.setNickname( + userDto.getRoad().concat("-").concat(lastName).concat(UserSexEnum.FEMALE.sex().equals(userDto.getSex()) ? "女士" : "先生")); } UserEntity userEntity = ConvertUtils.sourceToTarget(userDto, UserEntity.class); diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyAuthenticationFailedDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyAuthenticationFailedDao.xml new file mode 100644 index 000000000..20eb7280e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyAuthenticationFailedDao.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml index d3bd56a33..995c67122 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml @@ -61,13 +61,13 @@ LIMIT 1 + + + diff --git a/esua-epdc/epdc-module/pom.xml b/esua-epdc/epdc-module/pom.xml index 882dc9184..1eb51a51c 100644 --- a/esua-epdc/epdc-module/pom.xml +++ b/esua-epdc/epdc-module/pom.xml @@ -26,6 +26,7 @@ epdc-services epdc-user epdc-demo + epdc-group epdc-websocket diff --git a/renren-cloud-generator/src/main/resources/application.yml b/renren-cloud-generator/src/main/resources/application.yml index f88851291..dc0f5909f 100644 --- a/renren-cloud-generator/src/main/resources/application.yml +++ b/renren-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://47.104.224.45:3308/esua_epdc_news?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://47.104.224.45:3308/esua_epdc_group?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epdc password: elink833066 #oracle配置