From 405622c0fba4078da61a2cd028984ed21dbb3977 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Thu, 10 Oct 2019 16:03:30 +0800 Subject: [PATCH 01/51] =?UTF-8?q?=E5=8F=8B=E9=82=BB=E7=A4=BE=E7=BE=A4?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esua-epdc/epdc-gateway/pom.xml | 11 +- .../src/main/resources/application.yml | 6 +- .../epdc-group/epdc-group-client/pom.xml | 32 +++ .../dto/group/GroupDTO.java | 141 +++++++++++++ .../dto/topic/TopicDTO.java | 187 ++++++++++++++++++ .../epdc-group/epdc-group-server/pom.xml | 177 +++++++++++++++++ .../com.elink.esua.epdc/GroupApplication.java | 21 ++ .../config/ModuleConfigImpl.java | 18 ++ .../group/controller/GroupController.java | 94 +++++++++ .../modules/group/dao/GroupDao.java | 33 ++++ .../modules/group/entity/GroupEntity.java | 111 +++++++++++ .../modules/group/excel/GroupExcel.java | 98 +++++++++ .../modules/group/redis/GroupRedis.java | 47 +++++ .../modules/group/service/GroupService.java | 95 +++++++++ .../group/service/impl/GroupServiceImpl.java | 104 ++++++++++ .../topic/controller/TopicController.java | 94 +++++++++ .../modules/topic/dao/TopicDao.java | 33 ++++ .../modules/topic/entity/TopicEntity.java | 157 +++++++++++++++ .../modules/topic/excel/TopicExcel.java | 126 ++++++++++++ .../modules/topic/redis/TopicRedis.java | 47 +++++ .../modules/topic/service/TopicService.java | 95 +++++++++ .../topic/service/impl/TopicServiceImpl.java | 104 ++++++++++ .../src/main/resources/application.yml | 87 ++++++++ .../src/main/resources/logback-spring.xml | 159 +++++++++++++++ .../main/resources/mapper/group/GroupDao.xml | 7 + .../main/resources/mapper/topic/TopicDao.xml | 7 + .../src/main/resources/registry.conf | 21 ++ esua-epdc/epdc-module/epdc-group/pom.xml | 18 ++ esua-epdc/epdc-module/pom.xml | 1 + .../src/main/resources/application.yml | 2 +- 30 files changed, 2122 insertions(+), 11 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/pom.xml create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/pom.xml create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/GroupApplication.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/config/ModuleConfigImpl.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/GroupController.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/dao/GroupDao.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/entity/GroupEntity.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/excel/GroupExcel.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/redis/GroupRedis.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/GroupService.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/impl/GroupServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicDao.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/entity/TopicEntity.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/excel/TopicExcel.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/redis/TopicRedis.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/application.yml create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/logback-spring.xml create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/GroupDao.xml create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/registry.conf create mode 100644 esua-epdc/epdc-module/epdc-group/pom.xml diff --git a/esua-epdc/epdc-gateway/pom.xml b/esua-epdc/epdc-gateway/pom.xml index 67b2c43fb..7b1adf95f 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,6 +117,8 @@ http://127.0.0.1:9068 lb://epdc-demo-server + http://127.0.0.1:9064 + false 47.104.224.45:8848 @@ -149,8 +148,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 @@ -158,6 +155,7 @@ lb://epdc-user-server lb://epdc-demo-server + lb://epdc-group-server true @@ -182,8 +180,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 @@ -191,6 +187,7 @@ lb://epdc-user-server lb://epdc-demo-server + lb://epdc-group-server 8 121.42.149.50 diff --git a/esua-epdc/epdc-gateway/src/main/resources/application.yml b/esua-epdc/epdc-gateway/src/main/resources/application.yml index e866953cd..44f0fc0aa 100644 --- a/esua-epdc/epdc-gateway/src/main/resources/application.yml +++ b/esua-epdc/epdc-gateway/src/main/resources/application.yml @@ -81,11 +81,11 @@ spring: filters: - StripPrefix=0 #友邻社群模块 - - 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=/neighbor/** + - Path=/group/** filters: - StripPrefix=0 #新闻公告模块 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..dff1e822e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/pom.xml @@ -0,0 +1,32 @@ + + + + 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 + + + + \ 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/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..b887bd338 --- /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 String areaId; + + /** + * 街道 + */ + private String street; + + /** + * 街道ID + */ + private String streetId; + + /** + * 社区 + */ + private String community; + + /** + * 社区ID + */ + private String communityId; + + /** + * 网格 + */ + private String grid; + + /** + * 网格ID + */ + private String 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/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..de01e3e1f --- /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,187 @@ +/** + * 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 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; + + /** + * 删除标记 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-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/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..2a4f1159a --- /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,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.group.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.group.GroupDTO; +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; + + @GetMapping("page") + 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); + } + +} \ 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..fde2e1fa6 --- /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,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.group.dao; + +import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.modules.group.entity.GroupEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 社群表 社群表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Mapper +public interface GroupDao 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/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..b98616500 --- /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 String areaId; + + /** + * 街道 + */ + private String street; + + /** + * 街道ID + */ + private String streetId; + + /** + * 社区 + */ + private String community; + + /** + * 社区ID + */ + private String communityId; + + /** + * 网格 + */ + private String grid; + + /** + * 网格ID + */ + private String 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/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..ea62fdb1e --- /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,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.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.dto.group.GroupDTO; +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); +} \ 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..f0d718bfd --- /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,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.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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dto.group.GroupDTO; +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.redis.GroupRedis; +import com.elink.esua.epdc.modules.group.service.GroupService; +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 GroupRedis groupRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GroupDTO.class); + } + + @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)); + } + +} \ 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/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..301c7a695 --- /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,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.topic.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.topic.TopicDTO; +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") + public Result> page(@RequestParam Map params){ + PageData page = topicService.page(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); + } + +} \ 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..e6d7e9c43 --- /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,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.TopicEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题表 话题表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-10 + */ +@Mapper +public interface TopicDao 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/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..f3bfc712c --- /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,157 @@ +/** + * 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 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/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/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..6e63b7df8 --- /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,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.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.TopicDTO; +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); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2019-10-10 + */ + List list(Map params); + + /** + * 单条查询 + * + * @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); +} \ 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..388b99d45 --- /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,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.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.page.PageData; +import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; +import com.elink.esua.epdc.dto.topic.TopicDTO; +import com.elink.esua.epdc.modules.topic.dao.TopicDao; +import com.elink.esua.epdc.modules.topic.entity.TopicEntity; +import com.elink.esua.epdc.modules.topic.redis.TopicRedis; +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-10 + */ +@Service +public class TopicServiceImpl extends BaseServiceImpl implements TopicService { + + @Autowired + private TopicRedis topicRedis; + + @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 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)); + } + +} \ No newline at end of file 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/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..842875dc5 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/GroupDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ 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..a5b72af95 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file 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/pom.xml b/esua-epdc/epdc-module/pom.xml index 4abd74cfe..8ac112caa 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 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配置 From c51af426d2fd41350dd91c0befde0abf07f93ef0 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Tue, 15 Oct 2019 16:34:59 +0800 Subject: [PATCH 02/51] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/group/GroupManagementDTO.java | 46 +++++++++++++++++++ .../group/controller/GroupController.java | 18 ++++++-- .../modules/group/dao/GroupDao.java | 15 ++++++ .../modules/group/service/GroupService.java | 5 +- .../group/service/impl/GroupServiceImpl.java | 16 ++----- .../main/resources/mapper/group/GroupDao.xml | 31 ++++++++++++- 6 files changed, 114 insertions(+), 17 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupManagementDTO.java 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..ad53356bf --- /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,46 @@ +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; + +} 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 index 2a4f1159a..860d954a1 100644 --- 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 @@ -17,6 +17,7 @@ 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.utils.ExcelUtils; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -26,6 +27,7 @@ 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.GroupDTO; +import com.elink.esua.epdc.dto.group.GroupManagementDTO; 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; @@ -49,10 +51,20 @@ 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") - public Result> page(@RequestParam Map params){ - PageData page = groupService.page(params); - return new Result>().ok(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}") 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 index fde2e1fa6..374f1d984 100644 --- 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 @@ -18,9 +18,13 @@ package com.elink.esua.epdc.modules.group.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.modules.group.entity.GroupEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; +import java.util.Map; + /** * 社群表 社群表 * @@ -29,5 +33,16 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface GroupDao extends BaseDao { + + /** + * + * 社群列表 + * + * @params [params] + * @return java.util.List + * @author liuchuang + * @since 2019/10/11 14:54 + */ + List selectListOfGroups(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/GroupService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/GroupService.java index ea62fdb1e..537ee10c2 100644 --- 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 @@ -20,6 +20,7 @@ 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.dto.group.GroupDTO; +import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.modules.group.entity.GroupEntity; import java.util.List; @@ -34,14 +35,14 @@ import java.util.Map; public interface GroupService extends BaseService { /** - * 默认分页 + * 默认分页 社群列表 * * @param params * @return PageData * @author generator * @date 2019-10-10 */ - PageData page(Map params); + PageData page(Map params); /** * 默认查询 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 index f0d718bfd..0e5796621 100644 --- 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 @@ -24,12 +24,11 @@ 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.group.GroupDTO; +import com.elink.esua.epdc.dto.group.GroupManagementDTO; 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.redis.GroupRedis; import com.elink.esua.epdc.modules.group.service.GroupService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -46,16 +45,11 @@ import java.util.Map; @Service public class GroupServiceImpl extends BaseServiceImpl implements GroupService { - @Autowired - private GroupRedis groupRedis; - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, GroupDTO.class); + public PageData page(Map params) { + IPage page = getPage(params); + List list = baseDao.selectListOfGroups(params); + return new PageData<>(list, page.getTotal()); } @Override 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 index 842875dc5..4db1798ce 100644 --- 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 @@ -1,7 +1,36 @@ - + + + \ No newline at end of file From 6a74a2a4d6a65ee9c60ae158165857ef48d672b8 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Thu, 17 Oct 2019 16:54:20 +0800 Subject: [PATCH 03/51] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E3=80=81=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/constant/ServiceConstant.java | 2 +- .../epdc-api/epdc-api-client/pom.xml | 5 + .../epdc/controller/ApiGroupController.java | 42 +++++++ .../esua/epdc/feign/GroupFeignClient.java | 32 +++++ .../fallback/GroupFeignClientFallback.java | 21 ++++ .../elink/esua/epdc/service/GroupService.java | 26 ++++ .../epdc/service/impl/GroupServiceImpl.java | 66 ++++++++++ .../events/form/EpdcEventSubmitFormDTO.java | 8 +- .../dto/group/GroupDTO.java | 8 +- .../dto/group/GroupManagementDTO.java | 5 + .../dto/group/UserGroupDTO.java | 116 ++++++++++++++++++ .../dto/group/enums/GroupStateEnum.java | 53 ++++++++ .../dto/group/enums/GroupUserStateEnum.java | 56 +++++++++ .../dto/group/form/GroupCreateFormDTO.java | 82 +++++++++++++ .../dto/group/form/GroupUserFormDTO.java | 59 +++++++++ .../group/controller/AppGroupController.java | 43 +++++++ .../group/controller/UserGroupController.java | 84 +++++++++++++ .../modules/group/dao/GroupDao.java | 11 ++ .../modules/group/dao/UserGroupDao.java | 48 ++++++++ .../modules/group/entity/GroupEntity.java | 8 +- .../modules/group/entity/UserGroupEntity.java | 84 +++++++++++++ .../modules/group/service/GroupService.java | 13 ++ .../group/service/UserGroupService.java | 95 ++++++++++++++ .../group/service/impl/GroupServiceImpl.java | 27 ++++ .../service/impl/UserGroupServiceImpl.java | 97 +++++++++++++++ .../main/resources/mapper/group/GroupDao.xml | 8 +- .../resources/mapper/group/UserGroupDao.xml | 29 +++++ 27 files changed, 1114 insertions(+), 14 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiGroupController.java create mode 100644 esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/GroupFeignClient.java create mode 100644 esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/GroupFeignClientFallback.java create mode 100644 esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/GroupService.java create mode 100644 esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/UserGroupDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupStateEnum.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupUserStateEnum.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupCreateFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/AppGroupController.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/UserGroupController.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/dao/UserGroupDao.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/entity/UserGroupEntity.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/UserGroupService.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/impl/UserGroupServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/UserGroupDao.xml 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 fb585d6cf..2937b5573 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-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-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..78903981c --- /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,42 @@ +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.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.service.GroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * + * 移动端接口-社群模块 + * + * @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); + } + +} 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..c4f0cea29 --- /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,32 @@ +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.form.GroupCreateFormDTO; +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.PostMapping; + +/** + * + * 社群模块调用 + * + * @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); +} 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..71c05362e --- /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,21 @@ +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.form.GroupCreateFormDTO; +import com.elink.esua.epdc.feign.GroupFeignClient; +import org.springframework.stereotype.Component; + +/** + * @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); + } +} 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..aa22514ff --- /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,26 @@ +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.form.GroupCreateFormDTO; + +/** + * + * 社群模块 + * + * @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); +} 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..cce6d61e6 --- /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,66 @@ +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.group.enums.GroupUserStateEnum; +import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; +import com.elink.esua.epdc.feign.AdminFeignClient; +import com.elink.esua.epdc.feign.GroupFeignClient; +import com.elink.esua.epdc.service.GroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * + * 社群模块 + * + * @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); + } +} 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 5d1da6411..2f7662872 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 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 index b887bd338..3cd96de40 100644 --- 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 @@ -66,7 +66,7 @@ public class GroupDTO implements Serializable { /** * 区ID */ - private String areaId; + private Long areaId; /** * 街道 @@ -76,7 +76,7 @@ public class GroupDTO implements Serializable { /** * 街道ID */ - private String streetId; + private Long streetId; /** * 社区 @@ -86,7 +86,7 @@ public class GroupDTO implements Serializable { /** * 社区ID */ - private String communityId; + private Long communityId; /** * 网格 @@ -96,7 +96,7 @@ public class GroupDTO implements Serializable { /** * 网格ID */ - private String gridId; + private Long gridId; /** * 状态 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散 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 index ad53356bf..51e179d5c 100644 --- 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 @@ -43,4 +43,9 @@ public class GroupManagementDTO implements Serializable { */ 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/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/enums/GroupStateEnum.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupStateEnum.java new file mode 100644 index 000000000..4f01b8c31 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupStateEnum.java @@ -0,0 +1,53 @@ +package com.elink.esua.epdc.dto.group.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/group/enums/GroupUserStateEnum.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupUserStateEnum.java new file mode 100644 index 000000000..74adbca9f --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupUserStateEnum.java @@ -0,0 +1,56 @@ +package com.elink.esua.epdc.dto.group.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/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/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..2f1450feb --- /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,59 @@ +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 + */ + private String groupId; + /** + * 用户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-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..2e65f8023 --- /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,43 @@ +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.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.modules.group.service.GroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * + * 移动端社群模块 + * + * @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); + } +} 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 index 374f1d984..eabcda417 100644 --- 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 @@ -44,5 +44,16 @@ public interface GroupDao extends BaseDao { * @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); } \ 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..c153a7660 --- /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,48 @@ +/** + * 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.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); + +} \ 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 index b98616500..ecd842435 100644 --- 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 @@ -66,7 +66,7 @@ public class GroupEntity extends BaseEpdcEntity { /** * 区ID */ - private String areaId; + private Long areaId; /** * 街道 @@ -76,7 +76,7 @@ public class GroupEntity extends BaseEpdcEntity { /** * 街道ID */ - private String streetId; + private Long streetId; /** * 社区 @@ -86,7 +86,7 @@ public class GroupEntity extends BaseEpdcEntity { /** * 社区ID */ - private String communityId; + private Long communityId; /** * 网格 @@ -96,7 +96,7 @@ public class GroupEntity extends BaseEpdcEntity { /** * 网格ID */ - private String gridId; + private Long gridId; /** * 状态 0:待审核,5:审核不通过,10:审核通过,15:禁言,20:已解散 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/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 index 537ee10c2..daca9ae3d 100644 --- 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 @@ -19,8 +19,10 @@ 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.GroupDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; +import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.modules.group.entity.GroupEntity; import java.util.List; @@ -93,4 +95,15 @@ public interface GroupService extends BaseService { * @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); } \ 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..57640f321 --- /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,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.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.dto.group.UserGroupDTO; +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); +} \ 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 index 0e5796621..bfb141494 100644 --- 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 @@ -23,12 +23,17 @@ 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.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; +import com.elink.esua.epdc.dto.group.UserGroupDTO; +import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; 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.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; @@ -45,6 +50,9 @@ import java.util.Map; @Service public class GroupServiceImpl extends BaseServiceImpl implements GroupService { + @Autowired + private UserGroupService userGroupService; + @Override public PageData page(Map params) { IPage page = getPage(params); @@ -95,4 +103,23 @@ public class GroupServiceImpl extends BaseServiceImpl imp 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(); + } + } \ 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..517f5f0ec --- /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,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.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.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.UserGroupDTO; +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.UserGroupService; +import org.apache.commons.lang3.StringUtils; +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-17 + */ +@Service +public class UserGroupServiceImpl extends BaseServiceImpl implements UserGroupService { + + @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)); + } + +} \ No newline at end of file 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 index 4db1798ce..3f46a39d8 100644 --- 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 @@ -18,7 +18,9 @@ AND ugp.LORD_FLAG = '1' WHERE gp.DEL_FLAG = '0' - AND gp.STATE = #{state} + + AND gp.STATE = #{state} + AND gp.GRID_ID = #{gridId} @@ -32,5 +34,9 @@ gp.GROUP_CATEGORY, gp.CREATED_TIME DESC + + \ 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..a91258736 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/UserGroupDao.xml @@ -0,0 +1,29 @@ + + + + + + + + \ No newline at end of file From 3e40094dea8240bd4b33b9acbbae9412f6298aa9 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Mon, 21 Oct 2019 10:01:30 +0800 Subject: [PATCH 04/51] =?UTF-8?q?=E7=A6=81=E8=A8=80=E3=80=81=E8=A7=A3?= =?UTF-8?q?=E7=A6=81=E3=80=81=E8=A7=A3=E6=95=A3=E7=A4=BE=E7=BE=A4=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiGroupController.java | 15 +++++++++ .../esua/epdc/feign/GroupFeignClient.java | 13 ++++++++ .../fallback/GroupFeignClientFallback.java | 6 ++++ .../elink/esua/epdc/service/GroupService.java | 12 +++++++ .../epdc/service/impl/GroupServiceImpl.java | 8 +++++ .../dto/group/GroupSettingStateDTO.java | 32 +++++++++++++++++++ .../group/controller/AppGroupController.java | 17 ++++++++++ .../group/controller/GroupController.java | 17 ++++++++++ .../modules/group/service/GroupService.java | 12 +++++++ .../group/service/impl/GroupServiceImpl.java | 25 +++++++++++++++ 10 files changed, 157 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupSettingStateDTO.java 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 index 78903981c..b780f1fb3 100644 --- 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 @@ -3,6 +3,7 @@ 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.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.service.GroupService; import org.springframework.beans.factory.annotation.Autowired; @@ -39,4 +40,18 @@ public class ApiGroupController { 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); + } + } 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 index c4f0cea29..e5c9dfc11 100644 --- 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 @@ -2,6 +2,7 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.feign.fallback.GroupFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -29,4 +30,16 @@ public interface GroupFeignClient { */ @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); } 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 index 71c05362e..1a2d9b66b 100644 --- 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 @@ -3,6 +3,7 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.feign.GroupFeignClient; import org.springframework.stereotype.Component; @@ -18,4 +19,9 @@ public class GroupFeignClientFallback implements GroupFeignClient { 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); + } } 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 index aa22514ff..e7530c3da 100644 --- 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 @@ -2,6 +2,7 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; /** @@ -23,4 +24,15 @@ public interface GroupService { * @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); } 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 index cce6d61e6..2d7bdebb5 100644 --- 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 @@ -4,6 +4,8 @@ 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.group.GroupSettingStateDTO; +import com.elink.esua.epdc.dto.group.enums.GroupStateEnum; import com.elink.esua.epdc.dto.group.enums.GroupUserStateEnum; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; @@ -63,4 +65,10 @@ public class GroupServiceImpl implements GroupService { return groupFeignClient.createGroup(formDto); } + + @Override + public Result disbandGroup(GroupSettingStateDTO dto) { + dto.setState(GroupStateEnum.GROUP_STATE_DISBANDED.getValue()); + return groupFeignClient.disbandGroup(dto); + } } 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..fe58a24f8 --- /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,32 @@ +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; + + /** + * 状态 10:解禁,15:禁言,20:解散 + */ + @NotNull(message = "社群状态不能为空") + private Integer state; + +} 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 index 2e65f8023..2edc84608 100644 --- 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 @@ -3,6 +3,7 @@ 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.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.modules.group.service.GroupService; import org.springframework.beans.factory.annotation.Autowired; @@ -40,4 +41,20 @@ public class AppGroupController { 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); + } } 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 index 860d954a1..b0f3d2f23 100644 --- 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 @@ -28,6 +28,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.dto.group.GroupDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; +import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; 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; @@ -103,4 +104,20 @@ public class GroupController { ExcelUtils.exportExcelToTarget(response, null, list, GroupExcel.class); } + /** + * + * 禁言、解禁、解散社群 + * + * @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); + } + } \ 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 index daca9ae3d..49e8ef764 100644 --- 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 @@ -22,6 +22,7 @@ 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.GroupDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; +import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.modules.group.entity.GroupEntity; @@ -106,4 +107,15 @@ public interface GroupService extends BaseService { * @since 2019/10/17 14:57 */ Result saveGroup(GroupCreateFormDTO formDto); + + /** + * + * 禁言、解禁、解散社群 + * + * @params [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author liuchuang + * @since 2019/10/21 9:31 + */ + Result modifyGroupState(GroupSettingStateDTO dto); } \ 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 index bfb141494..7d0f325e3 100644 --- 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 @@ -26,7 +26,9 @@ import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; +import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.UserGroupDTO; +import com.elink.esua.epdc.dto.group.enums.GroupStateEnum; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.modules.group.dao.GroupDao; import com.elink.esua.epdc.modules.group.entity.GroupEntity; @@ -122,4 +124,27 @@ public class GroupServiceImpl extends BaseServiceImpl imp return new Result(); } + @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()); + baseDao.updateById(groupEntity); + return new Result(); + } + } + + return new Result().error("操作失败"); + } + } \ No newline at end of file From 059ad7abb4ff36abb56585ae38ceff12e93eb107 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Mon, 21 Oct 2019 10:40:26 +0800 Subject: [PATCH 05/51] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/group/GroupDetailDTO.java | 43 +++++++++++++++++++ .../dto/group/GroupSettingStateDTO.java | 7 ++- .../group/controller/GroupController.java | 18 +++++++- .../modules/group/dao/GroupDao.java | 12 ++++++ .../modules/group/service/GroupService.java | 12 ++++++ .../group/service/impl/GroupServiceImpl.java | 11 +++-- .../main/resources/mapper/group/GroupDao.xml | 17 ++++++++ 7 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupDetailDTO.java 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/GroupSettingStateDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupSettingStateDTO.java index fe58a24f8..ed725021f 100644 --- 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 @@ -24,9 +24,14 @@ public class GroupSettingStateDTO implements Serializable { private String id; /** - * 状态 10:解禁,15:禁言,20:解散 + * 状态 5:审核不通过,10:审核通过/解禁,15:禁言,20:解散 */ @NotNull(message = "社群状态不能为空") private Integer state; + /** + * 处理意见 + */ + private String processingOpinions; + } 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 index b0f3d2f23..978de31df 100644 --- 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 @@ -27,6 +27,7 @@ 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.GroupDTO; +import com.elink.esua.epdc.dto.group.GroupDetailDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.modules.group.excel.GroupExcel; @@ -106,7 +107,22 @@ public class GroupController { /** * - * 禁言、解禁、解散社群 + * 社群审核详情信息 + * + * @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 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 index eabcda417..000732171 100644 --- 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 @@ -18,6 +18,7 @@ package com.elink.esua.epdc.modules.group.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.group.GroupDetailDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.modules.group.entity.GroupEntity; import org.apache.ibatis.annotations.Mapper; @@ -55,5 +56,16 @@ public interface GroupDao extends BaseDao { * @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); } \ 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 index 49e8ef764..7d75fab02 100644 --- 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 @@ -21,6 +21,7 @@ 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.GroupDTO; +import com.elink.esua.epdc.dto.group.GroupDetailDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; @@ -108,6 +109,17 @@ public interface GroupService extends BaseService { */ 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); + /** * * 禁言、解禁、解散社群 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 index 7d0f325e3..2318ee237 100644 --- 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 @@ -24,10 +24,7 @@ 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.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.group.GroupDTO; -import com.elink.esua.epdc.dto.group.GroupManagementDTO; -import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; -import com.elink.esua.epdc.dto.group.UserGroupDTO; +import com.elink.esua.epdc.dto.group.*; import com.elink.esua.epdc.dto.group.enums.GroupStateEnum; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.modules.group.dao.GroupDao; @@ -124,6 +121,11 @@ public class GroupServiceImpl extends BaseServiceImpl imp return new Result(); } + @Override + public GroupDetailDTO getGroupDetail(String id) { + return baseDao.selectOneOfGroupDetail(id); + } + @Override @Transactional(rollbackFor = Exception.class) public Result modifyGroupState(GroupSettingStateDTO dto) { @@ -139,6 +141,7 @@ public class GroupServiceImpl extends BaseServiceImpl imp GroupEntity groupEntity = new GroupEntity(); groupEntity.setId(dto.getId()); groupEntity.setState(dto.getState()); + groupEntity.setProcessingOpinions(dto.getProcessingOpinions()); baseDao.updateById(groupEntity); return new Result(); } 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 index 3f46a39d8..3bc49613e 100644 --- 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 @@ -38,5 +38,22 @@ SELECT COUNT(ID) amount FROM epdc_group WHERE DEL_FLAG = '0' AND GRID_ID = #{gridId} AND GROUP_NAME = #{groupName} + + \ No newline at end of file From eea2b556511418b72ddac9aafb71d6b7656cca06 Mon Sep 17 00:00:00 2001 From: yujintao Date: Mon, 21 Oct 2019 11:10:59 +0800 Subject: [PATCH 06/51] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E7=B1=BB=EF=BC=9B=E4=BF=AE=E6=94=B9oss=E6=A8=A1=E5=9D=97pom?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../esua/epdc/enums/DeptRespondTypeEnum.java | 79 +++++++++++++++++++ .../esua/epdc/enums/IssueOrItemEnum.java | 31 ++++++++ .../epdc-oss/epdc-oss-server/pom.xml | 5 ++ 3 files changed, 115 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/DeptRespondTypeEnum.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/IssueOrItemEnum.java 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..8d7203362 --- /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,79 @@ +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()), + + + //------------------------------------- + + + /** + * 议题:审核通过 + */ + ISSUE_HANDLED_PASS(EventIssueItemState.ISSUE_HANDLED_PASS, "审核通过"), + /** + * 议题:反馈 + */ + ISSUE_HANDLED_FEEDBACK(EventIssueItemState.ISSUE_HANDLED_FEEDBACK, "反馈"), + /** + * 议题:关闭 + */ + ISSUE_HANDLED_CLOSED(EventIssueItemState.ISSUE_HANDLED_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/IssueOrItemEnum.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/IssueOrItemEnum.java new file mode 100644 index 000000000..035894c13 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/IssueOrItemEnum.java @@ -0,0 +1,31 @@ +package com.elink.esua.epdc.enums; + +/** + * 议题或项目枚举 + * + * @author work@yujt.net.cn + * @date 2019/10/21 10:30 + */ +public enum IssueOrItemEnum { + + /** + * 议题 + */ + ISSUE("issue"), + + /** + * 项目 + */ + ITEM("item"); + + + private String name; + + IssueOrItemEnum(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml index 7b33f45a1..8bfcd5b93 100644 --- a/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml +++ b/esua-epdc/epdc-module/epdc-oss/epdc-oss-server/pom.xml @@ -89,6 +89,11 @@ fastdfs-client ${fastdfs.version} + + com.google.code.gson + gson + 2.8.5 + From 4565f24075fc666033e6c7d02c003e798e0907e8 Mon Sep 17 00:00:00 2001 From: yujintao Date: Mon, 21 Oct 2019 14:58:10 +0800 Subject: [PATCH 07/51] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9E=9A=E4=B8=BE?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../esua/epdc/enums/DeptKpiConfigEnum.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/DeptKpiConfigEnum.java 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; + } +} From b487c21418944f4fe868ef9145c3dc18c679011e Mon Sep 17 00:00:00 2001 From: liuchuang Date: Mon, 21 Oct 2019 15:19:54 +0800 Subject: [PATCH 08/51] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E3=80=81=E8=A7=A3=E6=95=A3=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/service/impl/GroupServiceImpl.java | 4 +- .../dto/constant/GroupNoticeConstant.java | 56 +++++++++++++++++++ .../dto/{group => }/enums/GroupStateEnum.java | 2 +- .../{group => }/enums/GroupUserStateEnum.java | 2 +- .../group/result/GroupUserListResultDTO.java | 39 +++++++++++++ .../config/ThreadConfig.java | 42 ++++++++++++++ .../modules/async/NewsTask.java | 33 +++++++++++ .../modules/feign/NewsFeignClient.java | 32 +++++++++++ .../fallback/NewsFeignClientFallback.java | 21 +++++++ .../modules/group/dao/UserGroupDao.java | 12 ++++ .../group/service/UserGroupService.java | 12 ++++ .../group/service/impl/GroupServiceImpl.java | 50 ++++++++++++++++- .../service/impl/UserGroupServiceImpl.java | 6 ++ .../resources/mapper/group/UserGroupDao.xml | 4 ++ 14 files changed, 310 insertions(+), 5 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java rename esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/{group => }/enums/GroupStateEnum.java (95%) rename esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/{group => }/enums/GroupUserStateEnum.java (95%) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupUserListResultDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/config/ThreadConfig.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/async/NewsTask.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/NewsFeignClient.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/NewsFeignClientFallback.java 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 index 2d7bdebb5..3f3ab544b 100644 --- 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 @@ -5,8 +5,8 @@ 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.group.GroupSettingStateDTO; -import com.elink.esua.epdc.dto.group.enums.GroupStateEnum; -import com.elink.esua.epdc.dto.group.enums.GroupUserStateEnum; +import com.elink.esua.epdc.dto.enums.GroupStateEnum; +import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; import com.elink.esua.epdc.feign.AdminFeignClient; 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..5d7b5c961 --- /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,56 @@ +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 = "你的社群【已解散】"; + + /** + * 我的消息类型: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"; +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupStateEnum.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupStateEnum.java similarity index 95% rename from esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupStateEnum.java rename to esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupStateEnum.java index 4f01b8c31..c01c83ac8 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupStateEnum.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupStateEnum.java @@ -1,4 +1,4 @@ -package com.elink.esua.epdc.dto.group.enums; +package com.elink.esua.epdc.dto.enums; /** * @Author:liuchuang diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupUserStateEnum.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupUserStateEnum.java similarity index 95% rename from esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupUserStateEnum.java rename to esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupUserStateEnum.java index 74adbca9f..43d8829b6 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/enums/GroupUserStateEnum.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/enums/GroupUserStateEnum.java @@ -1,4 +1,4 @@ -package com.elink.esua.epdc.dto.group.enums; +package com.elink.esua.epdc.dto.enums; /** * 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..ba65387b2 --- /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,39 @@ +package com.elink.esua.epdc.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * + * 社群成员列表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; +} 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/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/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/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 index c153a7660..acce862a9 100644 --- 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 @@ -19,6 +19,7 @@ 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.result.GroupUserListResultDTO; import com.elink.esua.epdc.modules.group.entity.UserGroupEntity; import org.apache.ibatis.annotations.Mapper; @@ -44,5 +45,16 @@ public interface UserGroupDao extends BaseDao { * @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); } \ 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 index 57640f321..53091dcbb 100644 --- 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 @@ -20,6 +20,7 @@ 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.dto.group.UserGroupDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; import com.elink.esua.epdc.modules.group.entity.UserGroupEntity; import java.util.List; @@ -92,4 +93,15 @@ public interface UserGroupService extends BaseService { * @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); } \ 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 index 2318ee237..c4966573b 100644 --- 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 @@ -24,9 +24,14 @@ 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.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.group.enums.GroupStateEnum; +import com.elink.esua.epdc.dto.enums.GroupStateEnum; +import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; +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.service.GroupService; @@ -52,6 +57,9 @@ public class GroupServiceImpl extends BaseServiceImpl imp @Autowired private UserGroupService userGroupService; + @Autowired + private NewsTask newsTask; + @Override public PageData page(Map params) { IPage page = getPage(params); @@ -143,6 +151,46 @@ public class GroupServiceImpl extends BaseServiceImpl imp 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(); } } 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 index 517f5f0ec..e52e92dc5 100644 --- 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 @@ -24,6 +24,7 @@ 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.UserGroupDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; 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.UserGroupService; @@ -94,4 +95,9 @@ public class UserGroupServiceImpl extends BaseServiceImpl listOfUserGroup(String groupId, Integer state) { + return baseDao.selectListOfGroupUsersByState(groupId, state); + } + } \ 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 index a91258736..d5aafb150 100644 --- 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 @@ -26,4 +26,8 @@ ugp.CREATED_TIME DESC + + \ No newline at end of file From 66678490fb8088592b3849cfa8a7bd7bd7567ea9 Mon Sep 17 00:00:00 2001 From: yujintao Date: Mon, 21 Oct 2019 15:32:35 +0800 Subject: [PATCH 09/51] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc-events-server/src/main/resources/logback-spring.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 @@ - + + + + From 43cbe32a61ecca13201282fd4f09d03c6189d460 Mon Sep 17 00:00:00 2001 From: qushutong <1976590620@qq.com> Date: Mon, 21 Oct 2019 16:10:21 +0800 Subject: [PATCH 10/51] =?UTF-8?q?=E8=80=83=E6=A0=B8=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../esua/epdc/dto/rule/DeptKpiConfigDTO.java | 86 +++++++++++++++ .../controller/DeptKpiConfigController.java | 94 ++++++++++++++++ .../modules/rule/dao/DeptKpiConfigDao.java | 33 ++++++ .../rule/entity/DeptKpiConfigEntity.java | 56 ++++++++++ .../rule/excel/DeptKpiConfigExcel.java | 65 +++++++++++ .../rule/redis/DeptKpiConfigRedis.java | 47 ++++++++ .../rule/service/DeptKpiConfigService.java | 95 ++++++++++++++++ .../impl/DeptKpiConfigServiceImpl.java | 104 ++++++++++++++++++ .../mapper/rule/DeptKpiConfigDao.xml | 20 ++++ 9 files changed, 600 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/rule/DeptKpiConfigDTO.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/controller/DeptKpiConfigController.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/dao/DeptKpiConfigDao.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/entity/DeptKpiConfigEntity.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/excel/DeptKpiConfigExcel.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/redis/DeptKpiConfigRedis.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/service/DeptKpiConfigService.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rule/service/impl/DeptKpiConfigServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/rule/DeptKpiConfigDao.xml 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-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/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 From ca748e4c9ed5d456d481c79b748a37e7f30ac161 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Mon, 21 Oct 2019 17:30:42 +0800 Subject: [PATCH 11/51] =?UTF-8?q?=E6=88=91=E7=9A=84=E7=BE=A4=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiGroupController.java | 22 ++++-- .../esua/epdc/feign/GroupFeignClient.java | 17 +++++ .../fallback/GroupFeignClientFallback.java | 9 +++ .../elink/esua/epdc/service/GroupService.java | 14 ++++ .../epdc/service/impl/GroupServiceImpl.java | 12 ++++ .../dto/group/form/GroupsOfMineFormDTO.java | 31 +++++++++ .../group/result/GroupsOfMineResultDTO.java | 68 +++++++++++++++++++ .../group/controller/AppGroupController.java | 29 ++++++-- .../modules/group/dao/GroupDao.java | 13 ++++ .../modules/group/service/GroupService.java | 13 ++++ .../group/service/impl/GroupServiceImpl.java | 7 ++ .../main/resources/mapper/group/GroupDao.xml | 42 ++++++++++++ 12 files changed, 268 insertions(+), 9 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupsOfMineFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupsOfMineResultDTO.java 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 index b780f1fb3..33cdbde1c 100644 --- 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 @@ -5,12 +5,12 @@ import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.service.GroupService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * @@ -54,4 +54,18 @@ public class ApiGroupController { 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); + } + } 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 index e5c9dfc11..7a95daca1 100644 --- 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 @@ -4,11 +4,16 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; 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; + /** * * 社群模块调用 @@ -42,4 +47,16 @@ public interface GroupFeignClient { */ @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); } 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 index 1a2d9b66b..d3e03cb92 100644 --- 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 @@ -5,9 +5,13 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.feign.GroupFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * @Author:liuchuang * @Date:2019/10/17 14:40 @@ -24,4 +28,9 @@ public class GroupFeignClientFallback implements GroupFeignClient { 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); + } } 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 index e7530c3da..5a564cbed 100644 --- 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 @@ -4,6 +4,9 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; + +import java.util.List; /** * @@ -35,4 +38,15 @@ public interface GroupService { * @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); } 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 index 3f3ab544b..51768d80f 100644 --- 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 @@ -9,12 +9,16 @@ import com.elink.esua.epdc.dto.enums.GroupStateEnum; import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.GroupFeignClient; import com.elink.esua.epdc.service.GroupService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * * 社群模块 @@ -71,4 +75,12 @@ public class GroupServiceImpl implements GroupService { dto.setState(GroupStateEnum.GROUP_STATE_DISBANDED.getValue()); return groupFeignClient.disbandGroup(dto); } + + @Override + public Result> listGroupsOfMine(TokenDto userDetail) { + GroupsOfMineFormDTO formDto = new GroupsOfMineFormDTO(); + formDto.setUserId(userDetail.getUserId()); + formDto.setGridId(userDetail.getGridId()); + return groupFeignClient.listGroupsOfMine(formDto); + } } 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/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-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 index 2edc84608..f5f1f8458 100644 --- 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 @@ -5,12 +5,13 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.modules.group.service.GroupService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * @@ -44,7 +45,7 @@ public class AppGroupController { /** * - * 禁言、解禁、解散社群 + * 解散社群 * * @params [dto] * @return com.elink.esua.epdc.commons.tools.utils.Result @@ -57,4 +58,22 @@ public class AppGroupController { 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); + } + } 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 index 000732171..7707fe58b 100644 --- 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 @@ -20,6 +20,8 @@ package com.elink.esua.epdc.modules.group.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.group.GroupDetailDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; +import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.modules.group.entity.GroupEntity; import org.apache.ibatis.annotations.Mapper; @@ -67,5 +69,16 @@ public interface GroupDao extends BaseDao { * @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); } \ 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 index 7d75fab02..c6a5c3d18 100644 --- 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 @@ -25,6 +25,8 @@ import com.elink.esua.epdc.dto.group.GroupDetailDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.modules.group.entity.GroupEntity; import java.util.List; @@ -130,4 +132,15 @@ public interface GroupService extends BaseService { * @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); } \ 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 index c4966573b..007e8cfed 100644 --- 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 @@ -30,7 +30,9 @@ 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.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; 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; @@ -198,4 +200,9 @@ public class GroupServiceImpl extends BaseServiceImpl imp return new Result().error("操作失败"); } + @Override + public List listGroupsOfMine(GroupsOfMineFormDTO formDto) { + return baseDao.selectListGroupsOfMine(formDto); + } + } \ No newline at end of file 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 index 3bc49613e..51977e5a9 100644 --- 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 @@ -55,5 +55,47 @@ AND gp.ID = #{id} + + \ No newline at end of file From 3a00f633b84009cab9c13af22ef2e89ac69497ce Mon Sep 17 00:00:00 2001 From: liuchuang Date: Tue, 22 Oct 2019 11:04:53 +0800 Subject: [PATCH 12/51] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/group/GroupDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 51977e5a9..f578ddaff 100644 --- 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 @@ -51,7 +51,7 @@ AND ugp.DEL_FLAG = '0' AND ugp.LORD_FLAG = '1' WHERE - gp.DEL_FLAG = '1' + gp.DEL_FLAG = '0' AND gp.ID = #{id} From 15abbe1fb062dd76f53b9db0665cf63854aca939 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Tue, 22 Oct 2019 14:00:27 +0800 Subject: [PATCH 13/51] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E7=BE=A4=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiGroupController.java | 15 +++++++ .../esua/epdc/feign/GroupFeignClient.java | 13 ++++++ .../fallback/GroupFeignClientFallback.java | 6 +++ .../elink/esua/epdc/service/GroupService.java | 12 ++++++ .../epdc/service/impl/GroupServiceImpl.java | 15 +++++++ .../result/GroupsOfRecommendResultDTO.java | 42 +++++++++++++++++++ .../group/controller/AppGroupController.java | 18 ++++++++ .../modules/group/dao/GroupDao.java | 12 ++++++ .../modules/group/service/GroupService.java | 12 ++++++ .../group/service/impl/GroupServiceImpl.java | 6 +++ .../main/resources/mapper/group/GroupDao.xml | 27 +++++++++++- 11 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupsOfRecommendResultDTO.java 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 index 33cdbde1c..b9f442381 100644 --- 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 @@ -6,6 +6,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; import com.elink.esua.epdc.service.GroupService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -68,4 +69,18 @@ public class ApiGroupController { 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); + } + } 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 index 7a95daca1..036c917bf 100644 --- 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 @@ -6,6 +6,7 @@ import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; import com.elink.esua.epdc.feign.fallback.GroupFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -59,4 +60,16 @@ public interface GroupFeignClient { */ @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); } 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 index d3e03cb92..be39ebf02 100644 --- 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 @@ -7,6 +7,7 @@ import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; import com.elink.esua.epdc.feign.GroupFeignClient; import org.springframework.stereotype.Component; @@ -33,4 +34,9 @@ public class GroupFeignClientFallback implements GroupFeignClient { 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); + } } 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 index 5a564cbed..d4c55ac40 100644 --- 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 @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; import java.util.List; @@ -49,4 +50,15 @@ public interface GroupService { * @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); } 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 index 51768d80f..9e2d94cea 100644 --- 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 @@ -11,6 +11,7 @@ import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.GroupFeignClient; import com.elink.esua.epdc.service.GroupService; @@ -78,9 +79,23 @@ public class GroupServiceImpl implements GroupService { @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); + } } 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-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 index f5f1f8458..b9039ea44 100644 --- 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 @@ -7,6 +7,7 @@ import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; 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.service.GroupService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -76,4 +77,21 @@ public class AppGroupController { 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); + } + } 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 index 7707fe58b..866291014 100644 --- 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 @@ -22,6 +22,7 @@ import com.elink.esua.epdc.dto.group.GroupDetailDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; 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; @@ -80,5 +81,16 @@ public interface GroupDao extends BaseDao { * @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); } \ 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 index c6a5c3d18..65d6ffb9e 100644 --- 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 @@ -27,6 +27,7 @@ import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; 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 java.util.List; @@ -143,4 +144,15 @@ public interface GroupService extends BaseService { * @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); } \ 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 index 007e8cfed..b4897399d 100644 --- 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 @@ -33,6 +33,7 @@ import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; 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; @@ -205,4 +206,9 @@ public class GroupServiceImpl extends BaseServiceImpl imp return baseDao.selectListGroupsOfMine(formDto); } + @Override + public List listGroupsOfRecommend(GroupsOfMineFormDTO formDto) { + return baseDao.selectListGroupsOfRecommend(formDto); + } + } \ No newline at end of file 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 index f578ddaff..4817f3283 100644 --- 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 @@ -63,7 +63,10 @@ gp.GROUP_CATEGORY, gp.STATE, COUNT( ugp1.ID ) AS totalNum, - SUM( ugp1.PARTY_MEMBER = '1' ) AS partyMemberNum, + CASE + WHEN SUM( ugp1.PARTY_MEMBER = '1' ) IS NULL THEN + 0 ELSE SUM( ugp1.PARTY_MEMBER = '1' ) + END AS partyMemberNum, COUNT( ugpr.ID ) AS unreadTopicNum, MAX( ugpr.TOPIC_SUBMIT_TIME ) AS latestTopicTime, CASE @@ -97,5 +100,27 @@ latestTopicTime DESC + + \ No newline at end of file From 4610652a2630c4b9dbdda9ec9e1be90cce34235c Mon Sep 17 00:00:00 2001 From: liuchuang Date: Tue, 22 Oct 2019 15:21:30 +0800 Subject: [PATCH 14/51] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiGroupController.java | 15 +++++ .../esua/epdc/feign/GroupFeignClient.java | 14 +++++ .../fallback/GroupFeignClientFallback.java | 7 +++ .../elink/esua/epdc/service/GroupService.java | 12 ++++ .../epdc/service/impl/GroupServiceImpl.java | 13 ++++ .../form/GroupDetailForMobileEndFormDTO.java | 30 +++++++++ .../GroupDetailForMobileEndResultDTO.java | 62 +++++++++++++++++++ .../group/controller/AppGroupController.java | 19 ++++++ .../modules/group/dao/GroupDao.java | 13 ++++ .../modules/group/service/GroupService.java | 13 ++++ .../group/service/impl/GroupServiceImpl.java | 7 +++ .../main/resources/mapper/group/GroupDao.xml | 46 +++++++++++++- 12 files changed, 249 insertions(+), 2 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupDetailForMobileEndFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/GroupDetailForMobileEndResultDTO.java 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 index b9f442381..fdb58d47b 100644 --- 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 @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +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.service.GroupService; @@ -83,4 +84,18 @@ public class ApiGroupController { 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); + } + } 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 index 036c917bf..8ae0507dc 100644 --- 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 @@ -4,7 +4,9 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +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.feign.fallback.GroupFeignClientFallback; @@ -72,4 +74,16 @@ public interface GroupFeignClient { */ @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); } 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 index be39ebf02..c18b33695 100644 --- 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 @@ -5,7 +5,9 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +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.feign.GroupFeignClient; @@ -39,4 +41,9 @@ public class GroupFeignClientFallback implements GroupFeignClient { 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); + } } 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 index d4c55ac40..c0b2f9a18 100644 --- 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 @@ -4,6 +4,7 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +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; @@ -61,4 +62,15 @@ public interface GroupService { * @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); } 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 index 9e2d94cea..41d0d9b35 100644 --- 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 @@ -8,8 +8,10 @@ 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.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; 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.feign.AdminFeignClient; @@ -98,4 +100,15 @@ public class GroupServiceImpl implements GroupService { 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); + } } 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/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-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 index b9039ea44..71095da44 100644 --- 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 @@ -5,7 +5,9 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +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.service.GroupService; @@ -94,4 +96,21 @@ public class AppGroupController { 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); + } + } 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 index 866291014..661c7f075 100644 --- 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 @@ -20,7 +20,9 @@ package com.elink.esua.epdc.modules.group.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.group.GroupDetailDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; +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; @@ -92,5 +94,16 @@ public interface GroupDao extends BaseDao { * @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); } \ 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 index 65d6ffb9e..abe4b11fc 100644 --- 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 @@ -25,7 +25,9 @@ import com.elink.esua.epdc.dto.group.GroupDetailDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +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; @@ -155,4 +157,15 @@ public interface GroupService extends BaseService { * @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); } \ 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 index b4897399d..6a3ab9fee 100644 --- 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 @@ -30,7 +30,9 @@ 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.GroupCreateFormDTO; +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.GroupUserListResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; @@ -211,4 +213,9 @@ public class GroupServiceImpl extends BaseServiceImpl imp return baseDao.selectListGroupsOfRecommend(formDto); } + @Override + public GroupDetailForMobileEndResultDTO getGroupDetailForMobileEnd(GroupDetailForMobileEndFormDTO formDto) { + return baseDao.selectOneOfGroupDetailForMobileEnd(formDto); + } + } \ No newline at end of file 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 index 4817f3283..a3a8f33f1 100644 --- 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 @@ -68,7 +68,7 @@ 0 ELSE SUM( ugp1.PARTY_MEMBER = '1' ) END AS partyMemberNum, COUNT( ugpr.ID ) AS unreadTopicNum, - MAX( ugpr.TOPIC_SUBMIT_TIME ) AS latestTopicTime, + MAX( tp.CREATED_TIME ) AS latestTopicTime, CASE WHEN gp.STATE = 0 THEN '网格长会尽快审核您创建的社群,请耐心等待' @@ -90,6 +90,8 @@ AND ugpr.DEL_FLAG = '0' AND ugpr.USER_ID = #{userId} AND ugpr.READ_FLAG = '0' + LEFT JOIN epdc_topic tp ON gp.ID = tp.GROUP_ID + AND tp.DEL_FLAG = '0' WHERE gp.DEL_FLAG = '0' AND gp.GRID_ID = #{gridId} @@ -97,7 +99,7 @@ GROUP BY gp.ID ORDER BY - latestTopicTime DESC + MAX( tp.CREATED_TIME ) DESC + + From ba0ba16f09395dd67f2b70e29aa06ee4b3bf3a27 Mon Sep 17 00:00:00 2001 From: qushutong <1976590620@qq.com> Date: Tue, 22 Oct 2019 15:49:07 +0800 Subject: [PATCH 15/51] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=20=E8=AE=AE=E4=BA=8B?= =?UTF-8?q?=20=E6=8F=92=E5=85=A5=E9=83=A8=E9=97=A8=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../esua/epdc/dto/log/DeptRespondLogDTO.java | 96 ++++++++++++++++ .../esua/epdc/enums/DeptRespondTypeEnum.java | 13 ++- ...OrItemEnum.java => ReferenceTypeEnum.java} | 10 +- .../epdc/modules/async/DeptRespondTask.java | 96 ++++++++++++++++ .../service/impl/EpdcEventsServiceImpl.java | 27 ++++- .../issue/service/impl/IssueServiceImpl.java | 19 +++- .../controller/DeptRespondLogController.java | 94 ++++++++++++++++ .../modules/log/dao/DeptRespondLogDao.java | 33 ++++++ .../log/entity/DeptRespondLogEntity.java | 66 +++++++++++ .../log/excel/DeptRespondLogExcel.java | 71 ++++++++++++ .../log/redis/DeptRespondLogRedis.java | 47 ++++++++ .../log/service/DeptRespondLogService.java | 95 ++++++++++++++++ .../impl/DeptRespondLogServiceImpl.java | 104 ++++++++++++++++++ .../mapper/log/DeptRespondLogDao.xml | 22 ++++ 14 files changed, 776 insertions(+), 17 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/log/DeptRespondLogDTO.java rename esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/{IssueOrItemEnum.java => ReferenceTypeEnum.java} (70%) create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/async/DeptRespondTask.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/controller/DeptRespondLogController.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/dao/DeptRespondLogDao.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/entity/DeptRespondLogEntity.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/excel/DeptRespondLogExcel.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/redis/DeptRespondLogRedis.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/service/DeptRespondLogService.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/log/service/impl/DeptRespondLogServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/log/DeptRespondLogDao.xml 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/enums/DeptRespondTypeEnum.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/DeptRespondTypeEnum.java index 8d7203362..e6569d443 100644 --- 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 @@ -31,11 +31,20 @@ public enum DeptRespondTypeEnum { //------------------------------------- + /** + * 事件-驳回 + */ + EVENT_REVIEW_REJECT(EventIssueItemState.EVENT_REVIEW_REJECT,"事件驳回"), + //----------------------------------------------------------- /** - * 议题:审核通过 + * 议题:审核通过 成为议题 */ ISSUE_HANDLED_PASS(EventIssueItemState.ISSUE_HANDLED_PASS, "审核通过"), + /** + * 议题:议题-已转项目 + */ + ISSUE_CHANGE_TO_ITEM(EventIssueItemState.ISSUE_CHANGE_TO_ITEM, "审核通过"), /** * 议题:反馈 */ @@ -43,7 +52,7 @@ public enum DeptRespondTypeEnum { /** * 议题:关闭 */ - ISSUE_HANDLED_CLOSED(EventIssueItemState.ISSUE_HANDLED_CLOSED, "关闭"), + ISSUE_CLOSED(EventIssueItemState.ISSUE_CLOSED, "关闭"), //------------------------------------- diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/IssueOrItemEnum.java b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java similarity index 70% rename from esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/IssueOrItemEnum.java rename to esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java index 035894c13..6921bcdd3 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/IssueOrItemEnum.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/enums/ReferenceTypeEnum.java @@ -6,7 +6,7 @@ package com.elink.esua.epdc.enums; * @author work@yujt.net.cn * @date 2019/10/21 10:30 */ -public enum IssueOrItemEnum { +public enum ReferenceTypeEnum { /** * 议题 @@ -16,12 +16,16 @@ public enum IssueOrItemEnum { /** * 项目 */ - ITEM("item"); + ITEM("item"), + /** + * 事件 + */ + EVENT("event"); private String name; - IssueOrItemEnum(String name) { + ReferenceTypeEnum(String name) { this.name = 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..2983f9e77 --- /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,96 @@ +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.log.DeptRespondLogDTO; +import com.elink.esua.epdc.enums.DeptRespondTypeEnum; +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; + + /*** + * 转议题插入部门响应记录 + * 通过不通过 + * @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); + } + + /*** + * 议事处理审核/关闭 + * @param dto + * @return void + * @author qushutong + * @date 2019/10/22 14:51 + */ + @Async + public void saveIssueDeptRespond(IssueWaitHandleSubmitFormDTO dto) { + //组装插入数据 + 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); + } +} 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 de8ef79de..7f9551174 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 @@ -35,6 +35,9 @@ import com.elink.esua.epdc.dto.events.*; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; +import com.elink.esua.epdc.dto.log.DeptRespondLogDTO; +import com.elink.esua.epdc.enums.DeptRespondTypeEnum; +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; @@ -44,12 +47,16 @@ 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; 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.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; 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; @@ -74,6 +81,9 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl listOfPendingReviewEvents(Map params) { IPage page = getPage(params); @@ -88,9 +98,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); @@ -162,7 +172,7 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl listOfRejectEvents(Map params) { IPage page = getPage(params); @@ -213,7 +227,7 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl imp @Autowired private NewsTask newsTask; + @Autowired + private DeptRespondTask deptRespondTask; + + @Override public PageData listOfIssues(Map params) { IPage page = getPage(params); @@ -105,8 +110,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); @@ -169,7 +174,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()) { @@ -207,7 +212,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp informationFormDTO.setBusinessId(itemEntity.getId()); } } - + //插入绩效部门响应日志表 + deptRespondTask.saveIssueDeptRespond(dto); // 发送消息 newsTask.insertUserInformation(informationFormDTO); @@ -257,7 +263,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); @@ -291,7 +297,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); @@ -306,6 +312,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp /** * 初始化项目 + * * @Params: [issueEntity] * @Return: com.elink.esua.epdc.modules.item.entity.ItemEntity * @Author: liuchuang 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/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 From 45ce75e63b767546c9c8f635171ee69f6d41def5 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Tue, 22 Oct 2019 16:12:38 +0800 Subject: [PATCH 16/51] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BE=A4=E4=BB=8B?= =?UTF-8?q?=E7=BB=8D=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiGroupController.java | 15 ++++++++ .../esua/epdc/feign/GroupFeignClient.java | 13 +++++++ .../fallback/GroupFeignClientFallback.java | 6 +++ .../elink/esua/epdc/service/GroupService.java | 13 +++++++ .../epdc/service/impl/GroupServiceImpl.java | 14 +++++-- .../group/form/GroupIntroductionFormDTO.java | 38 +++++++++++++++++++ .../group/controller/AppGroupController.java | 16 ++++++++ .../modules/group/dao/UserGroupDao.java | 11 ++++++ .../modules/group/service/GroupService.java | 12 ++++++ .../group/service/UserGroupService.java | 11 ++++++ .../group/service/impl/GroupServiceImpl.java | 17 +++++++++ .../service/impl/UserGroupServiceImpl.java | 5 +++ .../resources/mapper/group/UserGroupDao.xml | 19 ++++++++++ 13 files changed, 186 insertions(+), 4 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupIntroductionFormDTO.java 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 index fdb58d47b..8db119091 100644 --- 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 @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; 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; @@ -98,4 +99,18 @@ public class ApiGroupController { 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); + } + } 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 index 8ae0507dc..9e1239629 100644 --- 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 @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; 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; @@ -86,4 +87,16 @@ public interface GroupFeignClient { */ @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); } 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 index c18b33695..90f3f604d 100644 --- 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 @@ -6,6 +6,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; 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; @@ -46,4 +47,9 @@ public class GroupFeignClientFallback implements GroupFeignClient { 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); + } } 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 index c0b2f9a18..ade3f5fa0 100644 --- 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 @@ -4,6 +4,7 @@ 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.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; 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; @@ -73,4 +74,16 @@ public interface GroupService { * @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); + } 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 index 41d0d9b35..bde71f1f7 100644 --- 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 @@ -7,10 +7,7 @@ import com.elink.esua.epdc.dto.CompleteDeptDTO; 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.GroupCreateFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.form.*; 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; @@ -111,4 +108,13 @@ public class GroupServiceImpl implements GroupService { 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); + } } 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-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 index 71095da44..6bcf1777c 100644 --- 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 @@ -6,6 +6,7 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; 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; @@ -113,4 +114,19 @@ public class AppGroupController { 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); + } + } 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 index acce862a9..43fd04123 100644 --- 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 @@ -56,5 +56,16 @@ public interface UserGroupDao extends BaseDao { * @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); } \ 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 index abe4b11fc..4bd12aa7e 100644 --- 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 @@ -26,6 +26,7 @@ import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; 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; @@ -168,4 +169,15 @@ public interface GroupService extends BaseService { * @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); } \ 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 index 53091dcbb..924e7065f 100644 --- 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 @@ -104,4 +104,15 @@ public interface UserGroupService extends BaseService { * @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); } \ 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 index 6a3ab9fee..455b442ba 100644 --- 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 @@ -31,6 +31,7 @@ import com.elink.esua.epdc.dto.enums.GroupStateEnum; import com.elink.esua.epdc.dto.enums.GroupUserStateEnum; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; 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.GroupUserListResultDTO; @@ -218,4 +219,20 @@ public class GroupServiceImpl extends BaseServiceImpl imp return baseDao.selectOneOfGroupDetailForMobileEnd(formDto); } + @Override + 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(); + } + } \ 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 index e52e92dc5..a9715c40f 100644 --- 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 @@ -100,4 +100,9 @@ public class UserGroupServiceImpl extends BaseServiceImpl + + \ No newline at end of file From 739ef6e8b6886a3b54ed3a30dcf6158dd793b042 Mon Sep 17 00:00:00 2001 From: qushutong <1976590620@qq.com> Date: Tue, 22 Oct 2019 16:25:33 +0800 Subject: [PATCH 17/51] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8F=92=E5=85=A5?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/modules/async/DeptRespondTask.java | 48 +++++++++++++++++-- .../item/service/impl/ItemServiceImpl.java | 7 ++- 2 files changed, 51 insertions(+), 4 deletions(-) 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 index 2983f9e77..7dd9776e8 100644 --- 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 @@ -7,8 +7,10 @@ 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; @@ -31,8 +33,7 @@ public class DeptRespondTask { private DeptRespondLogService deptRespondLogService; /*** - * 转议题插入部门响应记录 - * 通过不通过 + * 转议题插入部门响应记录 4-事件-审核通过 2-事件-驳回 * @param dto * @return void * @author qushutong @@ -63,7 +64,7 @@ public class DeptRespondTask { } /*** - * 议事处理审核/关闭 + * 议事处理审核/关闭 1-反馈,2-关闭,4-已转项目 不是这三种状态不作响应 * @param dto * @return void * @author qushutong @@ -71,6 +72,10 @@ public class DeptRespondTask { */ @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(); @@ -93,4 +98,41 @@ public class DeptRespondTask { 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/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 367f7b6d7..8a2a887b2 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 @@ -43,6 +43,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; @@ -91,6 +92,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( @@ -447,7 +451,8 @@ public class ItemServiceImpl extends BaseServiceImpl implem handleProcessEntity.setOutHandleAdvice(dto.getOutHandleAdvice()); handleProcessEntity.setHandlerDeptId(user.getDeptId()); itemHandleProcessService.insert(handleProcessEntity); - + //插入部门响应表 + deptRespondTask.saveItemDeptRespond(dto); // 发送消息 newsTask.insertUserInformation(informationFormDTO); } catch (Exception e) { From e52f2cf52a79b93d0c3d63b75a80ae4735291fe5 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Tue, 22 Oct 2019 17:35:30 +0800 Subject: [PATCH 18/51] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BE=A4=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiGroupController.java | 15 ++++++++ .../esua/epdc/feign/GroupFeignClient.java | 17 ++++++--- .../fallback/GroupFeignClientFallback.java | 10 +++--- .../elink/esua/epdc/service/GroupService.java | 12 +++++++ .../epdc/service/impl/GroupServiceImpl.java | 9 +++++ .../group/form/GroupModifyAvatarFormDTO.java | 36 +++++++++++++++++++ .../group/controller/AppGroupController.java | 20 ++++++++--- .../modules/group/service/GroupService.java | 16 ++++++--- .../group/service/impl/GroupServiceImpl.java | 23 +++++++++--- 9 files changed, 138 insertions(+), 20 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupModifyAvatarFormDTO.java 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 index 8db119091..e72a77bae 100644 --- 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 @@ -6,6 +6,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupModifyAvatarFormDTO; 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; @@ -113,4 +114,18 @@ public class ApiGroupController { 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); + } + } 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 index 9e1239629..bbf1a6a7f 100644 --- 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 @@ -3,10 +3,7 @@ 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.GroupSettingStateDTO; -import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.form.*; 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; @@ -99,4 +96,16 @@ public interface GroupFeignClient { */ @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); } 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 index 90f3f604d..ba32bac6e 100644 --- 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 @@ -4,10 +4,7 @@ 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.GroupSettingStateDTO; -import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.form.*; 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; @@ -52,4 +49,9 @@ public class GroupFeignClientFallback implements GroupFeignClient { 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); + } } 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 index ade3f5fa0..cb42aeb57 100644 --- 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 @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupModifyAvatarFormDTO; 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; @@ -86,4 +87,15 @@ public interface GroupService { */ 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); + } 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 index bde71f1f7..072244284 100644 --- 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 @@ -117,4 +117,13 @@ public class GroupServiceImpl implements GroupService { 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); + } } 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-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 index 6bcf1777c..b55112a10 100644 --- 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 @@ -4,10 +4,7 @@ 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.group.GroupSettingStateDTO; -import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.form.*; 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; @@ -129,4 +126,19 @@ public class AppGroupController { 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); + } + } 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 index 4bd12aa7e..0d00263a9 100644 --- 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 @@ -24,10 +24,7 @@ import com.elink.esua.epdc.dto.group.GroupDTO; import com.elink.esua.epdc.dto.group.GroupDetailDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; -import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.form.*; 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; @@ -180,4 +177,15 @@ public interface GroupService extends BaseService { * @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); } \ 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 index 455b442ba..024554ad3 100644 --- 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 @@ -29,10 +29,7 @@ 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.GroupCreateFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; +import com.elink.esua.epdc.dto.group.form.*; import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; @@ -220,6 +217,7 @@ public class GroupServiceImpl extends BaseServiceImpl imp } @Override + @Transactional(rollbackFor = Exception.class) public Result modifyIntroduction(GroupIntroductionFormDTO formDto) { // 获取群主信息 UserGroupDTO userGroupDTO = userGroupService.getLordInfoByGroupId(formDto.getId()); @@ -235,4 +233,21 @@ public class GroupServiceImpl extends BaseServiceImpl imp 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(); + } + } \ No newline at end of file From 51f8f8eee3fd82197d066a295b7981c79a918956 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Wed, 23 Oct 2019 09:43:21 +0800 Subject: [PATCH 19/51] =?UTF-8?q?=E7=BE=A4=E6=88=90=E5=91=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=88=E5=BE=85=E5=AE=A1=E6=A0=B8/=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E9=80=9A=E8=BF=87=EF=BC=89=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiGroupController.java | 16 ++++++++++ .../esua/epdc/feign/GroupFeignClient.java | 13 ++++++++ .../fallback/GroupFeignClientFallback.java | 6 ++++ .../elink/esua/epdc/service/GroupService.java | 13 ++++++++ .../epdc/service/impl/GroupServiceImpl.java | 6 ++++ .../dto/group/form/GroupUsersFormDTO.java | 31 +++++++++++++++++++ .../group/controller/AppGroupController.java | 16 ++++++++++ .../modules/group/service/GroupService.java | 12 +++++++ .../group/service/impl/GroupServiceImpl.java | 6 ++++ 9 files changed, 119 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUsersFormDTO.java 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 index e72a77bae..b9c146d90 100644 --- 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 @@ -7,7 +7,9 @@ import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; import com.elink.esua.epdc.dto.group.form.GroupModifyAvatarFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupUsersFormDTO; import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; import com.elink.esua.epdc.service.GroupService; @@ -128,4 +130,18 @@ public class ApiGroupController { 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); + } + } 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 index bbf1a6a7f..35a066e2d 100644 --- 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 @@ -5,6 +5,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.*; import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; import com.elink.esua.epdc.feign.fallback.GroupFeignClientFallback; @@ -108,4 +109,16 @@ public interface GroupFeignClient { */ @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); } 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 index ba32bac6e..fd4183168 100644 --- 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 @@ -6,6 +6,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.*; import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; import com.elink.esua.epdc.feign.GroupFeignClient; @@ -54,4 +55,9 @@ public class GroupFeignClientFallback implements GroupFeignClient { 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); + } } 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 index cb42aeb57..2b1f7b560 100644 --- 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 @@ -6,7 +6,9 @@ import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; import com.elink.esua.epdc.dto.group.form.GroupModifyAvatarFormDTO; +import com.elink.esua.epdc.dto.group.form.GroupUsersFormDTO; import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; @@ -98,4 +100,15 @@ public interface GroupService { */ 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); + } 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 index 072244284..6b9513152 100644 --- 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 @@ -9,6 +9,7 @@ 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.GroupDetailForMobileEndResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; import com.elink.esua.epdc.feign.AdminFeignClient; @@ -126,4 +127,9 @@ public class GroupServiceImpl implements GroupService { formDto.setUserId(userDetail.getUserId()); return groupFeignClient.modifyAvatar(formDto); } + + @Override + public Result> listOfMember(GroupUsersFormDTO formDto) { + return groupFeignClient.listOfMember(formDto); + } } 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-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 index b55112a10..a84c703e6 100644 --- 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 @@ -6,6 +6,7 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.*; import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; 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.service.GroupService; @@ -141,4 +142,19 @@ public class AppGroupController { 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); + } + } 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 index 0d00263a9..a353bb182 100644 --- 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 @@ -26,6 +26,7 @@ import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.*; import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; +import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; 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; @@ -188,4 +189,15 @@ public interface GroupService extends BaseService { * @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); } \ 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 index 024554ad3..4c2efcb77 100644 --- 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 @@ -250,4 +250,10 @@ public class GroupServiceImpl extends BaseServiceImpl imp return new Result(); } + @Override + public Result> listOfMember(GroupUsersFormDTO formDto) { + List data = userGroupService.listOfUserGroup(formDto.getGroupId(), formDto.getState()); + return new Result>().ok(data); + } + } \ No newline at end of file From 98d5827fde73f4e1d8d1dcebd6904f8d8fa903cc Mon Sep 17 00:00:00 2001 From: qushutong <1976590620@qq.com> Date: Wed, 23 Oct 2019 13:47:17 +0800 Subject: [PATCH 20/51] =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/time/DeptRespondTimeConfigDTO.java | 127 ++++++++++++++++++ .../DeptRespondTimeConfigController.java | 94 +++++++++++++ .../time/dao/DeptRespondTimeConfigDao.java | 33 +++++ .../entity/DeptRespondTimeConfigEntity.java | 97 +++++++++++++ .../excel/DeptRespondTimeConfigExcel.java | 90 +++++++++++++ .../redis/DeptRespondTimeConfigRedis.java | 47 +++++++ .../service/DeptRespondTimeConfigService.java | 95 +++++++++++++ .../DeptRespondTimeConfigServiceImpl.java | 104 ++++++++++++++ .../mapper/tiime/DeptRespondTimeConfigDao.xml | 28 ++++ 9 files changed, 715 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/time/DeptRespondTimeConfigDTO.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/controller/DeptRespondTimeConfigController.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/dao/DeptRespondTimeConfigDao.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/entity/DeptRespondTimeConfigEntity.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/excel/DeptRespondTimeConfigExcel.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/redis/DeptRespondTimeConfigRedis.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/service/DeptRespondTimeConfigService.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/time/service/impl/DeptRespondTimeConfigServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/tiime/DeptRespondTimeConfigDao.xml 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-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..30e9602b4 --- /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.DeptRespondTimeConfigDTO; +import com.elink.esua.epdc.excel.DeptRespondTimeConfigExcel; +import com.elink.esua.epdc.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/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 From 123b596cf35c543bdf692975ce58ff6b5ee0c10f Mon Sep 17 00:00:00 2001 From: liuchuang Date: Wed, 23 Oct 2019 14:05:32 +0800 Subject: [PATCH 21/51] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E7=BE=A4=E6=88=90?= =?UTF-8?q?=E5=91=98=E3=80=81=E9=80=80=E5=87=BA=E7=A4=BE=E7=BE=A4=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiGroupController.java | 33 +++++++++++++-- .../esua/epdc/feign/GroupFeignClient.java | 24 +++++++++++ .../fallback/GroupFeignClientFallback.java | 10 +++++ .../elink/esua/epdc/service/GroupService.java | 27 ++++++++++-- .../epdc/service/impl/GroupServiceImpl.java | 19 +++++++++ .../dto/constant/GroupNoticeConstant.java | 22 +++++++++- .../form/GroupUserRemoveOrQuitFormDTO.java | 39 +++++++++++++++++ .../group/controller/AppGroupController.java | 33 +++++++++++++++ .../modules/group/dao/UserGroupDao.java | 23 ++++++++++ .../modules/group/service/GroupService.java | 15 ++++++- .../group/service/UserGroupService.java | 24 +++++++++++ .../group/service/impl/GroupServiceImpl.java | 42 ++++++++++++++++++- .../service/impl/UserGroupServiceImpl.java | 14 +++++++ .../resources/mapper/group/UserGroupDao.xml | 8 ++++ 14 files changed, 321 insertions(+), 12 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserRemoveOrQuitFormDTO.java 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 index b9c146d90..34a4f019b 100644 --- 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 @@ -4,10 +4,7 @@ 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.group.GroupSettingStateDTO; -import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupModifyAvatarFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupUsersFormDTO; +import com.elink.esua.epdc.dto.group.form.*; import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; @@ -144,4 +141,32 @@ public class ApiGroupController { 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); + } + } 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 index 35a066e2d..1fbe60216 100644 --- 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 @@ -121,4 +121,28 @@ public interface GroupFeignClient { */ @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); } 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 index fd4183168..6ef342d05 100644 --- 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 @@ -60,4 +60,14 @@ public class GroupFeignClientFallback implements GroupFeignClient { 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); + } } 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 index 2b1f7b560..2a05cee3a 100644 --- 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 @@ -3,10 +3,7 @@ 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.GroupSettingStateDTO; -import com.elink.esua.epdc.dto.group.form.GroupCreateFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupIntroductionFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupModifyAvatarFormDTO; -import com.elink.esua.epdc.dto.group.form.GroupUsersFormDTO; +import com.elink.esua.epdc.dto.group.form.*; import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; @@ -111,4 +108,26 @@ public interface GroupService { */ 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); + } 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 index 6b9513152..5727ec1e3 100644 --- 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 @@ -132,4 +132,23 @@ public class GroupServiceImpl implements GroupService { 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); + } } diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java index 5d7b5c961..65e19c473 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java @@ -22,7 +22,17 @@ public interface GroupNoticeConstant { /** * 社群解散 */ - String NOTICE_GROUP_DISBAND = "你的社群【已解散】"; + String NOTICE_GROUP_DISBAND = "你加入的社群已被解散"; + + /** + * 删除社群成员 + */ + String NOTICE_GROUP_REMOVED_MEMBER = "你已被群主移除社群"; + + /** + * 退出社群 + */ + String NOTICE_GROUP_QUIT = "已退出社群"; /** * 我的消息类型:0审核通知 @@ -53,4 +63,14 @@ public interface GroupNoticeConstant { * 消息所属业务类型:社群审核未通过或解散 */ String NOTICE_BUSINESS_TYPE_GROUP_NOT_PASSED_OR_DISBAND = "groupNotPassedOrDisband"; + + /** + * 消息所属业务类型:移除社群成员 + */ + String NOTICE_BUSINESS_TYPE_GROUP_REMOVED_MEMBER = "groupRemovedMember"; + + /** + * 消息所属业务类型:退出社群 + */ + String NOTICE_BUSINESS_TYPE_GROUP_QUIT = "groupQuit"; } 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-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 index a84c703e6..8f99ff8e5 100644 --- 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 @@ -3,6 +3,7 @@ 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.GroupDetailForMobileEndResultDTO; @@ -157,4 +158,36 @@ public class AppGroupController { 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); + } + } 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 index 43fd04123..d083e17ce 100644 --- 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 @@ -19,6 +19,7 @@ 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.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; @@ -67,5 +68,27 @@ public interface UserGroupDao extends BaseDao { * @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); } \ 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 index a353bb182..f30a7be2f 100644 --- 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 @@ -181,7 +181,7 @@ public interface GroupService extends BaseService { /** * - * 修改群头像 + * 移动端-修改群头像 * * @params [formDto] * @return com.elink.esua.epdc.commons.tools.utils.Result @@ -192,7 +192,7 @@ public interface GroupService extends BaseService { /** * - * 社群成员列表(待审核/审核通过) + * 移动端-社群成员列表(待审核/审核通过) * * @params [formDto] * @return com.elink.esua.epdc.commons.tools.utils.Result @@ -200,4 +200,15 @@ public interface GroupService extends BaseService { * @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); } \ 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 index 924e7065f..48b6a0209 100644 --- 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 @@ -19,7 +19,9 @@ 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.UserGroupDTO; +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; @@ -115,4 +117,26 @@ public interface UserGroupService extends BaseService { * @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); } \ 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 index 4c2efcb77..7f1641578 100644 --- 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 @@ -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.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -157,7 +158,7 @@ public class GroupServiceImpl extends BaseServiceImpl imp // 组装发送消息内容 EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); - informationFormDTO.setContent("社群:《".concat(entity.getGroupName()).concat("》")); + 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()); @@ -256,4 +257,43 @@ public class GroupServiceImpl extends BaseServiceImpl imp 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_REMOVED_MEMBER); + informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_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_QUIT); + } + + // 更新社群成员状态 + userGroupService.modifyMemberState(formDto); + // 发送通知 + newsTask.insertUserInformation(informationFormDTO); + 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/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 index a9715c40f..f2d24e823 100644 --- 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 @@ -23,7 +23,9 @@ 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.commons.tools.utils.Result; import com.elink.esua.epdc.dto.group.UserGroupDTO; +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.dao.UserGroupDao; import com.elink.esua.epdc.modules.group.entity.UserGroupEntity; @@ -105,4 +107,16 @@ public class UserGroupServiceImpl extends BaseServiceImpl + + UPDATE epdc_user_group SET STATE = #{state} WHERE GROUP_ID = #{groupId} AND USER_ID = #{userId} AND DEL_FLAG = '0' + + + + \ No newline at end of file From a6b90e764437c9301e7b762accce77a1809e8d66 Mon Sep 17 00:00:00 2001 From: qushutong <1976590620@qq.com> Date: Wed, 23 Oct 2019 14:19:46 +0800 Subject: [PATCH 22/51] =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../time/controller/DeptRespondTimeConfigController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 index 30e9602b4..67a67eb81 100644 --- 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 @@ -25,9 +25,9 @@ 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.DeptRespondTimeConfigDTO; -import com.elink.esua.epdc.excel.DeptRespondTimeConfigExcel; -import com.elink.esua.epdc.service.DeptRespondTimeConfigService; +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.*; From 9e36bf47ca5606b741a9d128690a51c2054d7339 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Wed, 23 Oct 2019 17:22:35 +0800 Subject: [PATCH 23/51] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A5=BD=E5=8F=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiGroupController.java | 21 ++++++-- .../esua/epdc/feign/GroupFeignClient.java | 19 +++++-- .../fallback/GroupFeignClientFallback.java | 12 +++-- .../elink/esua/epdc/service/GroupService.java | 18 +++++-- .../epdc/service/impl/GroupServiceImpl.java | 16 ++++-- .../epdc-group/epdc-group-client/pom.xml | 5 ++ .../modules/feign/UserFeignClient.java | 34 ++++++++++++ .../fallback/UserFeignClientFallback.java | 24 +++++++++ .../group/controller/AppGroupController.java | 22 ++++++-- .../modules/group/dao/UserGroupDao.java | 11 ++++ .../modules/group/service/GroupService.java | 18 +++++-- .../group/service/UserGroupService.java | 11 ++++ .../group/service/impl/GroupServiceImpl.java | 21 ++++++-- .../service/impl/UserGroupServiceImpl.java | 5 ++ .../resources/mapper/group/UserGroupDao.xml | 14 +++++ .../epdc/form/EpdcUserGroupInviteFormDTO.java | 52 +++++++++++++++++++ .../result/EpdcUserGroupInviteResultDTO.java | 37 +++++++++++++ .../controller/EpdcAppUserController.java | 19 +++++++ .../java/com/elink/esua/epdc/dao/UserDao.java | 15 ++++++ .../elink/esua/epdc/service/UserService.java | 13 +++++ .../epdc/service/impl/UserServiceImpl.java | 7 +++ .../src/main/resources/mapper/UserDao.xml | 28 ++++++++++ 22 files changed, 390 insertions(+), 32 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/UserFeignClient.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/UserFeignClientFallback.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserGroupInviteFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/result/EpdcUserGroupInviteResultDTO.java 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 index 34a4f019b..0b8aa9918 100644 --- 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 @@ -3,12 +3,11 @@ 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.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.GroupDetailForMobileEndResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; +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.*; @@ -169,4 +168,18 @@ public class ApiGroupController { 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); + } + } 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 index 1fbe60216..7fe47eb57 100644 --- 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 @@ -2,12 +2,11 @@ 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.GroupDetailForMobileEndResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; +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; @@ -145,4 +144,16 @@ public interface GroupFeignClient { */ @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/group/getInviteList", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> getInviteList(EpdcUserGroupInviteFormDTO 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 index 6ef342d05..3d795943a 100644 --- 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 @@ -3,12 +3,11 @@ 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.GroupDetailForMobileEndResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; +import com.elink.esua.epdc.dto.group.result.*; import com.elink.esua.epdc.feign.GroupFeignClient; import org.springframework.stereotype.Component; @@ -70,4 +69,9 @@ public class GroupFeignClientFallback implements GroupFeignClient { 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); + } } 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 index 2a05cee3a..7d0620386 100644 --- 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 @@ -2,12 +2,11 @@ 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.GroupDetailForMobileEndResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; +import com.elink.esua.epdc.dto.group.result.*; import java.util.List; @@ -130,4 +129,15 @@ public interface GroupService { */ 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); + } 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 index 5727ec1e3..534b7c04e 100644 --- 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 @@ -4,14 +4,13 @@ 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.GroupDetailForMobileEndResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; +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; @@ -151,4 +150,13 @@ public class GroupServiceImpl implements GroupService { 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); + } } 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 index dff1e822e..c391b65fd 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/pom.xml @@ -27,6 +27,11 @@ epdc-news-client 1.0.0 + + com.esua.epdc + epdc-user-client + 1.0.0 + \ 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/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/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 index 8f99ff8e5..ebfce4028 100644 --- 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 @@ -4,12 +4,11 @@ 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.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.GroupDetailForMobileEndResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; +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.*; @@ -190,4 +189,19 @@ public class AppGroupController { return groupService.modifyMemberState(formDto); } + /** + * + * 添加成员列表 + * + * @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 groupService.listOfInviteUsers(formDto); + } + } 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 index d083e17ce..d7a3b4573 100644 --- 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 @@ -90,5 +90,16 @@ public interface UserGroupDao extends BaseDao { * @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); } \ 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 index f30a7be2f..e5bacb2a6 100644 --- 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 @@ -20,15 +20,14 @@ 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.GroupDTO; import com.elink.esua.epdc.dto.group.GroupDetailDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; import com.elink.esua.epdc.dto.group.form.*; -import com.elink.esua.epdc.dto.group.result.GroupDetailForMobileEndResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; +import com.elink.esua.epdc.dto.group.result.*; import com.elink.esua.epdc.modules.group.entity.GroupEntity; import java.util.List; @@ -211,4 +210,15 @@ public interface GroupService extends BaseService { * @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/10/23 16:37 + */ + Result> listOfInviteUsers(EpdcUserGroupInviteFormDTO 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/UserGroupService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/UserGroupService.java index 48b6a0209..c2aa0f25e 100644 --- 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 @@ -139,4 +139,15 @@ public interface UserGroupService extends BaseService { * @since 2019/10/23 13:46 */ UserGroupDTO getGroupUserInfo(String groupId, String userId, Integer state); + + /** + * + * 获取社群用户ID + * + * @params [groupId, states] + * @return java.util.List + * @author liuchuang + * @since 2019/10/23 15:04 + */ + List listOfGroupUserIdsByState(String groupId, int[] states); } \ 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 index 7f1641578..e33152360 100644 --- 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 @@ -27,15 +27,15 @@ 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.epdc.form.EpdcUserGroupInviteFormDTO; +import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; 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.GroupDetailForMobileEndResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfMineResultDTO; -import com.elink.esua.epdc.dto.group.result.GroupsOfRecommendResultDTO; +import com.elink.esua.epdc.dto.group.result.*; import com.elink.esua.epdc.modules.async.NewsTask; +import com.elink.esua.epdc.modules.feign.UserFeignClient; 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.service.GroupService; @@ -64,6 +64,9 @@ public class GroupServiceImpl extends BaseServiceImpl imp @Autowired private NewsTask newsTask; + @Autowired + private UserFeignClient userFeignClient; + @Override public PageData page(Map params) { IPage page = getPage(params); @@ -296,4 +299,14 @@ public class GroupServiceImpl extends BaseServiceImpl imp return new Result(); } + @Override + public Result> listOfInviteUsers(EpdcUserGroupInviteFormDTO formDto) { + // 获取社群当前待审核和审核通过的成员ID + int[] states = new int[]{GroupUserStateEnum.GROUP_USER_STATE_PENDING_REVIEW.getValue(), GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()}; + List userIds = userGroupService.listOfGroupUserIdsByState(formDto.getGroupId(), states); + formDto.setUserIds(userIds); + + return userFeignClient.getInviteUserList(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/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 index f2d24e823..a1f5bbd3e 100644 --- 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 @@ -119,4 +119,9 @@ public class UserGroupServiceImpl extends BaseServiceImpl listOfGroupUserIdsByState(String groupId, int[] states) { + return baseDao.selectListOfGroupUserIdsByState(groupId, states); + } + } \ 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 index df1de9203..dcba38ca7 100644 --- 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 @@ -57,4 +57,18 @@ SELECT * FROM epdc_user_group WHERE DEL_FLAG = '0' AND GROUP_ID = #{groupId} AND USER_ID = #{userId} AND STATE = #{state} + + \ 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/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..5574ea6ad --- /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,37 @@ +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; +} 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 91973dbf6..16c2c58bc 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,13 +3,17 @@ 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.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; + /** * 对移动端开放 * @@ -130,4 +134,19 @@ public class EpdcAppUserController { public Result getUserRegisterAuditResult(@PathVariable("userId") String userId) { return userService.getUserRegisterAuditResult(userId); } + + /** + * + * 社群添加好友列表 + * + * @params [formDto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + * @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/dao/UserDao.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserDao.java index 61b3e7d48..bd93a6410 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,12 +18,16 @@ 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.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; +import java.util.List; + /** * 用户信息表 * @@ -71,4 +75,15 @@ public interface UserDao extends BaseDao { * @date 2019/9/27 10:08 */ int deleteAuditFailureByOpenId(@Param("wxOpenId") String wxOpenId); + + /** + * + * 移动端-社群添加好友列表 + * + * @params [formDto] + * @return java.util.List + * @author liuchuang + * @since 2019/10/23 16:25 + */ + List selectListOfInviteUsers(EpdcUserGroupInviteFormDTO formDto); } \ 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 29ca14f88..4c2c44de4 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,9 +21,11 @@ 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.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; @@ -133,4 +135,15 @@ public interface UserService extends BaseService { * @date 2019/9/27 09:13 */ Result getUserRegisterAuditResult(String userId); + + /** + * + * 移动端-社群添加好友列表 + * + * @params [formDto] + * @return java.util.List + * @author liuchuang + * @since 2019/10/23 16:24 + */ + List listOfInviteUsers(EpdcUserGroupInviteFormDTO formDto); } \ 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 7df5517e5..8cf1e98b8 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 @@ -36,9 +36,11 @@ import com.elink.esua.epdc.dao.UserDao; import com.elink.esua.epdc.dto.PartyMembersDTO; import com.elink.esua.epdc.dto.UserDTO; import com.elink.esua.epdc.dto.UserTagRelationDTO; +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.entity.UserEntity; import com.elink.esua.epdc.enums.AppUserAuditStateEnum; import com.elink.esua.epdc.redis.UserRedis; @@ -296,4 +298,9 @@ public class UserServiceImpl extends BaseServiceImpl implem EpdcUserRegisterAuditMsgResultDTO dto = this.baseDao.getUserRegisterAuditResult(userId); return new Result().ok(dto); } + + @Override + public List listOfInviteUsers(EpdcUserGroupInviteFormDTO formDto) { + return baseDao.selectListOfInviteUsers(formDto); + } } \ 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 4257479ea..27869c9ba 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,4 +61,32 @@ LIMIT 1 + + \ No newline at end of file From d4ab445149cb4c82913b4134c481615dd1e4c067 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Thu, 24 Oct 2019 10:32:25 +0800 Subject: [PATCH 24/51] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=A5=BD=E5=8F=8B=E5=88=97=E8=A1=A8=E8=BF=94=E5=9B=9E=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=A2=9E=E5=8A=A0=E6=89=8B=E6=9C=BA=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/dto/epdc/result/EpdcUserGroupInviteResultDTO.java | 5 +++++ .../epdc-user-server/src/main/resources/mapper/UserDao.xml | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 index 5574ea6ad..382049724 100644 --- 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 @@ -34,4 +34,9 @@ public class EpdcUserGroupInviteResultDTO implements Serializable { * 党员标识(0:否,1:是) */ private String partyMember; + + /** + * 手机号 + */ + private String mobile; } 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 27869c9ba..e2637be97 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 @@ -66,7 +66,8 @@ ID AS userId, NICKNAME, FACE_IMG AS userAvatar, - PARTY_FLAG AS partyMember + PARTY_FLAG AS partyMember, + MOBILE FROM epdc_user WHERE From d224a412800a481471149db823ab296b51f0427f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=87=91=E9=B9=8F?= Date: Thu, 24 Oct 2019 14:08:22 +0800 Subject: [PATCH 25/51] =?UTF-8?q?=E7=A4=BE=E7=BE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ApiTopicCommentController.java | 50 +++++ .../epdc/feign/TopicCommentFeignClient.java | 35 ++++ .../TopicCommentFeignClientFallback.java | 32 +++ .../epdc/service/TopicCommentService.java | 34 ++++ .../service/impl/TopicCommentServiceImpl.java | 62 ++++++ .../controller/AppEventCommentController.java | 2 +- .../modules/events/dao/EpdcEventsDao.java | 2 +- .../dto/comment/TopicCommentDTO.java | 141 +++++++++++++ .../dto/comment/TopicCommentFormDTO.java | 48 +++++ .../comment/TopicCommentStatementFormDTO.java | 47 +++++ .../comment/TopicCommentUserAttitudeDTO.java | 86 ++++++++ .../dto/comment/TopicCommentsFormDTO.java | 45 +++++ .../dto/comment/TopicCommentsResultDTO.java | 27 +++ .../dto/constant/TopicNoticeConstant.java | 54 +++++ .../dto/topic/ReplyCommentDto.java | 24 +++ .../dto/topic/TopicCommentsDTO.java | 63 ++++++ .../dto/topic/UserBaseInfoDto.java | 28 +++ .../controller/AppTopicCommentController.java | 61 ++++++ .../controller/TopicCommentController.java | 94 +++++++++ .../TopicCommentUserAttitudeController.java | 94 +++++++++ .../modules/comment/dao/TopicCommentDao.java | 35 ++++ .../dao/TopicCommentUserAttitudeDao.java | 33 +++ .../comment/entity/TopicCommentEntity.java | 111 +++++++++++ .../TopicCommentUserAttitudeEntity.java | 56 ++++++ .../comment/excel/TopicCommentExcel.java | 98 +++++++++ .../excel/TopicCommentUserAttitudeExcel.java | 65 ++++++ .../comment/redis/TopicCommentRedis.java | 47 +++++ .../redis/TopicCommentUserAttitudeRedis.java | 47 +++++ .../comment/service/TopicCommentService.java | 110 ++++++++++ .../TopicCommentUserAttitudeService.java | 95 +++++++++ .../service/impl/TopicCommentServiceImpl.java | 188 ++++++++++++++++++ .../TopicCommentUserAttitudeServiceImpl.java | 104 ++++++++++ .../modules/topic/dao/TopicDao.java | 9 +- .../modules/topic/service/TopicService.java | 8 +- .../topic/service/impl/TopicServiceImpl.java | 7 +- .../mapper/comment/TopicCommentDao.xml | 37 ++++ .../comment/TopicCommentUserAttitudeDao.xml | 20 ++ .../main/resources/mapper/topic/TopicDao.xml | 9 +- 38 files changed, 2100 insertions(+), 8 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiTopicCommentController.java create mode 100644 esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/TopicCommentFeignClient.java create mode 100644 esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/TopicCommentFeignClientFallback.java create mode 100644 esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/TopicCommentService.java create mode 100644 esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicCommentServiceImpl.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentFormDTO.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentStatementFormDTO.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentUserAttitudeDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentsFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentsResultDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/TopicNoticeConstant.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/ReplyCommentDto.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicCommentsDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/UserBaseInfoDto.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/AppTopicCommentController.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/TopicCommentController.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/TopicCommentUserAttitudeController.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/dao/TopicCommentDao.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/dao/TopicCommentUserAttitudeDao.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/entity/TopicCommentEntity.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/entity/TopicCommentUserAttitudeEntity.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/excel/TopicCommentExcel.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/excel/TopicCommentUserAttitudeExcel.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/redis/TopicCommentRedis.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/redis/TopicCommentUserAttitudeRedis.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/TopicCommentService.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/TopicCommentUserAttitudeService.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentServiceImpl.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/service/impl/TopicCommentUserAttitudeServiceImpl.java create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/comment/TopicCommentDao.xml create mode 100755 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/comment/TopicCommentUserAttitudeDao.xml 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/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/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/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/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-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/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 c50228021..054d166c5 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-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/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..0dba41f08 --- /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 java.util.Date; +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 useId; + + private String userName; + + private String topicId; + + +} 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..00b52b119 --- /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; + +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..6e1c02a5a --- /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,45 @@ +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; + /** + * 项目ID + */ + 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/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..5a53e5d20 --- /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,54 @@ +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_TOPIC_APPROVE = "你的话题【有新的支持】"; + /** + * 话题反对 + */ + String NOTICE_TOPIC_OPPOSE = "你的话题【有新的反对】"; + /** + * 评论支持 + */ + 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"; + + + +} 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..ca6289bcf --- /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.events; + +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/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..23ad2c0b6 --- /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,63 @@ +package com.elink.esua.epdc.dto.topic; + +import com.elink.esua.epdc.dto.events.ReplyCommentDto; +import com.elink.esua.epdc.dto.events.UserBaseInfoDto; +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/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..298bd7127 --- /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.events; + +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-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..489c1e77b --- /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,61 @@ +/** + * 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); + } + + +} 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..d601d9d8a --- /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,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.TopicCommentDTO; +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); + } + +} 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..a76be530d --- /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.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..f483add1a --- /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,35 @@ +/** + * 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.TopicCommentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题评论表 话题评论表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-10-23 + */ +@Mapper +public interface TopicCommentDao extends BaseDao { + + void updateReplyCount(String commentId); + +} 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..e512616de --- /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,110 @@ +/** + * 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.TopicCommentDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentsResultDTO; +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); +} 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..a75d25453 --- /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,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.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.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); +} 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..a3ee66683 --- /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,188 @@ +/** + * 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.TopicCommentDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentsResultDTO; +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.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 TopicCommentRedis topicCommentRedis; + + @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()); + + // 组装发送消息内容 + EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); + informationFormDTO.setType(TopicNoticeConstant.NOTICE_TYPE_INTERACTIVE_NOTICE); + if (isComment) { + // 评论 + informationFormDTO.setUserId(commentEntity.getUserId()); + informationFormDTO.setContent(commentEntity.getContent()); + informationFormDTO.setTitle(TopicNoticeConstant.NOTICE_TOPIC_COMMENT); + informationFormDTO.setBusinessType(TopicNoticeConstant.NOTICE_BUSINESS_TYPE_TOPIC_COMMENT); + informationFormDTO.setBusinessId(commentEntity.getId()); + 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.setBusinessId(commentEntity.getId()); + informationFormDTO.setRelBusinessContent(parentComment.getContent()); + } + // 发送消息 + newsTask.insertUserInformation(informationFormDTO); + + return new Result(); + } + + + @Override + public Result listOfComments(TopicCommentsFormDTO formDto) { + return null; + } +} 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..caf12eb65 --- /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,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.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.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.TopicCommentUserAttitudeDTO; +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.redis.TopicCommentUserAttitudeRedis; +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 TopicCommentUserAttitudeRedis topicCommentUserAttitudeRedis; + + @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)); + } + +} 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 index e6d7e9c43..86adc36fb 100644 --- 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 @@ -29,5 +29,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface TopicDao extends BaseDao { - -} \ No newline at end of file + + /** + * 评论数+1 + */ + void updateCommentNum(String id); + +} diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java index 6e63b7df8..c725fa991 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java @@ -92,4 +92,10 @@ public interface TopicService extends BaseService { * @date 2019-10-10 */ void delete(String[] ids); -} \ No newline at end of file + + + /** + * 评论数+1 + */ + void updateCommentNum(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/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java index 388b99d45..432d0a81a 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -101,4 +101,9 @@ public class TopicServiceImpl extends BaseServiceImpl imp baseDao.deleteBatchIds(Arrays.asList(ids)); } -} \ No newline at end of file + @Override + public void updateCommentNum(String id) { + baseDao.updateCommentNum(id); + } + +} 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..db7cb2a55 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/comment/TopicCommentDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE epdc_topic_comment + SET REPLY_COUNT = REPLY_COUNT + 1 + WHERE ID = #{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/topic/TopicDao.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml index a5b72af95..57b2b51ee 100644 --- 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 @@ -1,7 +1,12 @@ - + - \ No newline at end of file + + UPDATE epdc_topic SET COMMENT_NUM = COMMENT_NUM + 1 WHERE ID = #{id} + + + + From 36dab19b7d9b16d7c8c1522f887d6516ac0b3cc6 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Wed, 6 Nov 2019 10:17:28 +0800 Subject: [PATCH 26/51] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=A5=BD=E5=8F=8B=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiGroupController.java | 14 +++++ .../esua/epdc/feign/GroupFeignClient.java | 14 ++++- .../fallback/GroupFeignClientFallback.java | 5 ++ .../elink/esua/epdc/service/GroupService.java | 11 ++++ .../epdc/service/impl/GroupServiceImpl.java | 5 ++ .../dto/group/form/GroupAddUserFormDTO.java | 28 +++++++++ .../dto/group/form/GroupUserFormDTO.java | 4 -- .../group/controller/AppGroupController.java | 17 ------ .../controller/AppUserGroupController.java | 58 +++++++++++++++++++ .../modules/group/service/GroupService.java | 12 ---- .../group/service/UserGroupService.java | 24 ++++++-- .../group/service/impl/GroupServiceImpl.java | 17 ------ .../service/impl/UserGroupServiceImpl.java | 47 ++++++++++++++- 13 files changed, 198 insertions(+), 58 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupAddUserFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/AppUserGroupController.java 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 index 0b8aa9918..afb48b04c 100644 --- 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 @@ -182,4 +182,18 @@ public class ApiGroupController { 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); + } + } 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 index 7fe47eb57..3fd2659d9 100644 --- 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 @@ -154,6 +154,18 @@ public interface GroupFeignClient { * @author liuchuang * @since 2019/10/23 16:38 */ - @GetMapping(value = "group/epdc-app/group/getInviteList", consumes = MediaType.APPLICATION_JSON_VALUE) + @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); } 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 index 3d795943a..41de46f20 100644 --- 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 @@ -74,4 +74,9 @@ public class GroupFeignClientFallback implements GroupFeignClient { 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); + } } 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 index 7d0620386..5b0429259 100644 --- 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 @@ -140,4 +140,15 @@ public interface GroupService { */ 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); + } 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 index 534b7c04e..745065470 100644 --- 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 @@ -159,4 +159,9 @@ public class GroupServiceImpl implements GroupService { formDto.setGridId(userDetail.getGridId()); return groupFeignClient.getInviteList(formDto); } + + @Override + public Result saveGroupUsers(GroupAddUserFormDTO formDto) { + return groupFeignClient.addMember(formDto); + } } 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/GroupUserFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserFormDTO.java index 2f1450feb..c508d5cc6 100644 --- 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 @@ -16,10 +16,6 @@ import java.io.Serializable; public class GroupUserFormDTO implements Serializable { private static final long serialVersionUID = -1532468675717622698L; - /** - * 社群ID - */ - private String groupId; /** * 用户ID */ 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 index ebfce4028..4e5743c27 100644 --- 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 @@ -4,8 +4,6 @@ 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.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.*; @@ -189,19 +187,4 @@ public class AppGroupController { return groupService.modifyMemberState(formDto); } - /** - * - * 添加成员列表 - * - * @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 groupService.listOfInviteUsers(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..c10999c1b --- /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,58 @@ +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.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); + } +} 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 index e5bacb2a6..aee980f11 100644 --- 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 @@ -20,8 +20,6 @@ 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.GroupDTO; import com.elink.esua.epdc.dto.group.GroupDetailDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; @@ -211,14 +209,4 @@ public interface GroupService extends BaseService { */ Result modifyMemberState(GroupUserRemoveOrQuitFormDTO formDto); - /** - * - * 移动端-添加成员列表 - * - * @params [formDto] - * @return com.elink.esua.epdc.commons.tools.utils.Result> - * @author liuchuang - * @since 2019/10/23 16:37 - */ - Result> listOfInviteUsers(EpdcUserGroupInviteFormDTO 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/UserGroupService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/service/UserGroupService.java index c2aa0f25e..7dbc9ada0 100644 --- 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 @@ -20,7 +20,10 @@ 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.GroupUserRemoveOrQuitFormDTO; import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; import com.elink.esua.epdc.modules.group.entity.UserGroupEntity; @@ -142,12 +145,23 @@ public interface UserGroupService extends BaseService { /** * - * 获取社群用户ID + * 移动端-添加成员列表 * - * @params [groupId, states] - * @return java.util.List + * @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/10/23 15:04 + * @since 2019/11/6 9:18 */ - List listOfGroupUserIdsByState(String groupId, int[] states); + Result saveGroupUsers(GroupAddUserFormDTO 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 index e33152360..9133bfb41 100644 --- 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 @@ -27,15 +27,12 @@ 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.epdc.form.EpdcUserGroupInviteFormDTO; -import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; 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.feign.UserFeignClient; 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.service.GroupService; @@ -64,9 +61,6 @@ public class GroupServiceImpl extends BaseServiceImpl imp @Autowired private NewsTask newsTask; - @Autowired - private UserFeignClient userFeignClient; - @Override public PageData page(Map params) { IPage page = getPage(params); @@ -298,15 +292,4 @@ public class GroupServiceImpl extends BaseServiceImpl imp newsTask.insertUserInformation(informationFormDTO); return new Result(); } - - @Override - public Result> listOfInviteUsers(EpdcUserGroupInviteFormDTO formDto) { - // 获取社群当前待审核和审核通过的成员ID - int[] states = new int[]{GroupUserStateEnum.GROUP_USER_STATE_PENDING_REVIEW.getValue(), GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()}; - List userIds = userGroupService.listOfGroupUserIdsByState(formDto.getGroupId(), states); - formDto.setUserIds(userIds); - - return userFeignClient.getInviteUserList(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/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 index a1f5bbd3e..2df76c7f5 100644 --- 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 @@ -20,20 +20,29 @@ 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.enums.GroupUserStateEnum; +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.GroupUserFormDTO; import com.elink.esua.epdc.dto.group.form.GroupUserRemoveOrQuitFormDTO; import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; +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.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; @@ -47,6 +56,9 @@ import java.util.Map; @Service public class UserGroupServiceImpl extends BaseServiceImpl implements UserGroupService { + @Autowired + private UserFeignClient userFeignClient; + @Override public PageData page(Map params) { IPage page = getPage(params); @@ -120,8 +132,39 @@ public class UserGroupServiceImpl extends BaseServiceImpl listOfGroupUserIdsByState(String groupId, int[] states) { - return baseDao.selectListOfGroupUserIdsByState(groupId, states); + 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_PENDING_REVIEW.getValue()); + + userGroupEntities.add(entity); + } + if (insertBatch(userGroupEntities)) { + return new Result(); + } + + return new Result().error(); } } \ No newline at end of file From 07d94887f2c5cdad6f52a35febe07f0d591ad5a6 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Wed, 6 Nov 2019 10:58:41 +0800 Subject: [PATCH 27/51] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=A5=BD=E5=8F=8B=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/constant/GroupNoticeConstant.java | 15 ++++++++++ .../service/impl/UserGroupServiceImpl.java | 30 ++++++++++++++++++- .../dto/epdc/form/EpdcInformationFormDTO.java | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java index 65e19c473..f0d0e7f21 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java @@ -29,6 +29,16 @@ public interface GroupNoticeConstant { */ String NOTICE_GROUP_REMOVED_MEMBER = "你已被群主移除社群"; + /** + * 邀请入群 + */ + String NOTICE_GROUP_INVITED = "您已加入社群"; + + /** + * 邀请入群内容 + */ + String NOTICE_GROUP_INVITED_CONTENT = "您已被群主邀请加入groupName社群,快进入社群看看吧。"; + /** * 退出社群 */ @@ -73,4 +83,9 @@ public interface GroupNoticeConstant { * 消息所属业务类型:退出社群 */ String NOTICE_BUSINESS_TYPE_GROUP_QUIT = "groupQuit"; + + /** + * 社群邀请 + */ + String NOTICE_BUSINESS_TYPE_GROUP_INVITED = "groupInvited"; } 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 index 2df76c7f5..783b429ff 100644 --- 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 @@ -25,17 +25,22 @@ 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.form.GroupAddUserFormDTO; import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; import com.elink.esua.epdc.dto.group.form.GroupUserRemoveOrQuitFormDTO; 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; @@ -59,6 +64,12 @@ public class UserGroupServiceImpl extends BaseServiceImpl page(Map params) { IPage page = getPage(params); @@ -156,11 +167,28 @@ public class UserGroupServiceImpl extends BaseServiceImpl Date: Wed, 6 Nov 2019 14:09:34 +0800 Subject: [PATCH 28/51] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E5=85=A5=E7=BE=A4?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiGroupController.java | 14 +++++ .../esua/epdc/feign/GroupFeignClient.java | 12 ++++ .../fallback/GroupFeignClientFallback.java | 5 ++ .../elink/esua/epdc/service/GroupService.java | 11 ++++ .../epdc/service/impl/GroupServiceImpl.java | 5 ++ .../dto/constant/GroupNoticeConstant.java | 42 +++++++++++-- .../dto/group/UserReviewDto.java | 29 +++++++++ .../group/form/GroupUserReviewFormDTO.java | 31 ++++++++++ .../group/result/GroupUserListResultDTO.java | 6 ++ .../controller/AppUserGroupController.java | 15 +++++ .../group/service/UserGroupService.java | 12 ++++ .../group/service/impl/GroupServiceImpl.java | 6 +- .../service/impl/UserGroupServiceImpl.java | 60 +++++++++++++++++-- .../resources/mapper/group/UserGroupDao.xml | 2 +- 14 files changed, 234 insertions(+), 16 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/UserReviewDto.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupUserReviewFormDTO.java 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 index afb48b04c..9738a5814 100644 --- 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 @@ -196,4 +196,18 @@ public class ApiGroupController { 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); + } + } 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 index 3fd2659d9..2a70bc837 100644 --- 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 @@ -168,4 +168,16 @@ public interface GroupFeignClient { */ @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); } 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 index 41de46f20..88472de61 100644 --- 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 @@ -79,4 +79,9 @@ public class GroupFeignClientFallback implements GroupFeignClient { 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); + } } 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 index 5b0429259..be68dc992 100644 --- 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 @@ -151,4 +151,15 @@ public interface GroupService { */ 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); + } 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 index 745065470..d0f165c38 100644 --- 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 @@ -164,4 +164,9 @@ public class GroupServiceImpl implements GroupService { public Result saveGroupUsers(GroupAddUserFormDTO formDto) { return groupFeignClient.addMember(formDto); } + + @Override + public Result updateGroupUsers(GroupUserReviewFormDTO formDto) { + return groupFeignClient.reviewApply(formDto); + } } diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java index f0d0e7f21..c7915a960 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java @@ -27,17 +27,37 @@ public interface GroupNoticeConstant { /** * 删除社群成员 */ - String NOTICE_GROUP_REMOVED_MEMBER = "你已被群主移除社群"; + String NOTICE_GROUP_USER_REMOVED_MEMBER = "你已被群主移除社群"; /** * 邀请入群 */ - String NOTICE_GROUP_INVITED = "您已加入社群"; + String NOTICE_GROUP_USER_INVITED = "您已加入社群"; /** * 邀请入群内容 */ - String NOTICE_GROUP_INVITED_CONTENT = "您已被群主邀请加入groupName社群,快进入社群看看吧。"; + 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"; /** * 退出社群 @@ -77,15 +97,25 @@ public interface GroupNoticeConstant { /** * 消息所属业务类型:移除社群成员 */ - String NOTICE_BUSINESS_TYPE_GROUP_REMOVED_MEMBER = "groupRemovedMember"; + String NOTICE_BUSINESS_TYPE_GROUP_USER_REMOVED_MEMBER = "groupRemovedMember"; /** * 消息所属业务类型:退出社群 */ - String NOTICE_BUSINESS_TYPE_GROUP_QUIT = "groupQuit"; + String NOTICE_BUSINESS_TYPE_GROUP_USER_QUIT = "groupQuit"; /** * 社群邀请 */ - String NOTICE_BUSINESS_TYPE_GROUP_INVITED = "groupInvited"; + 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"; } 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..f469d3fef --- /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,29 @@ +package com.elink.esua.epdc.dto.group; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +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/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/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 index ba65387b2..7d517e871 100644 --- 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 @@ -3,6 +3,7 @@ package com.elink.esua.epdc.dto.group.result; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @@ -36,4 +37,9 @@ public class GroupUserListResultDTO implements Serializable { * 群主标识 0:否,1:是 */ private String lordFlag; + + /** + * 申请时间 + */ + private Date createdTime; } 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 index c10999c1b..b84d68642 100644 --- 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 @@ -6,6 +6,7 @@ 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.GroupUserReviewFormDTO; import com.elink.esua.epdc.modules.group.service.UserGroupService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -55,4 +56,18 @@ public class AppUserGroupController { 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); + } } 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 index 7dbc9ada0..9461cf16d 100644 --- 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 @@ -25,6 +25,7 @@ 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.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; @@ -164,4 +165,15 @@ public interface UserGroupService extends BaseService { * @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); } \ 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 index 9133bfb41..834ca7397 100644 --- 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 @@ -274,8 +274,8 @@ public class GroupServiceImpl extends BaseServiceImpl imp return new Result().error("操作失败,只有群主可以删除社群成员"); } informationFormDTO.setUserId(formDto.getUserId()); - informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_REMOVED_MEMBER); - informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_REMOVED_MEMBER); + 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())) { @@ -283,7 +283,7 @@ public class GroupServiceImpl extends BaseServiceImpl imp } informationFormDTO.setUserId(lordGroupDto.getUserId()); informationFormDTO.setTitle(userGroupDto.getNickname().concat(GroupNoticeConstant.NOTICE_GROUP_QUIT)); - informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_QUIT); + informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_USER_QUIT); } // 更新社群成员状态 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 index 783b429ff..f9b6863dd 100644 --- 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 @@ -32,9 +32,11 @@ 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.GroupAddUserFormDTO; import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; 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.async.NewsTask; import com.elink.esua.epdc.modules.feign.UserFeignClient; @@ -172,19 +174,19 @@ public class UserGroupServiceImpl extends BaseServiceImpl 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(); + } + } \ 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 index dcba38ca7..14d2cb69a 100644 --- 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 @@ -27,7 +27,7 @@ + SELECT + COUNT( ID ) + + CASE + WHEN SUM( LIKE_COUNT + UN_LIKE_COUNT ) IS NULL THEN + 0 ELSE SUM( LIKE_COUNT + UN_LIKE_COUNT ) + END AS statementNum + FROM + epdc_topic_comment + WHERE + DEL_FLAG = '0' + AND TOPIC_ID = #{topicId} + + + + + From 056594d68df725a164febe78a802dfc797ca2f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=87=91=E9=B9=8F?= Date: Wed, 6 Nov 2019 16:20:09 +0800 Subject: [PATCH 30/51] =?UTF-8?q?=E8=B5=9E=E8=B8=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../comment/TopicCommentStatementFormDTO.java | 3 +- .../controller/AppTopicCommentController.java | 11 +++- .../modules/comment/dao/TopicCommentDao.java | 24 +++++++ .../comment/service/TopicCommentService.java | 25 ++++++++ .../TopicCommentUserAttitudeService.java | 8 +++ .../service/impl/TopicCommentServiceImpl.java | 20 ++++++ .../TopicCommentUserAttitudeServiceImpl.java | 63 +++++++++++++++++++ .../mapper/comment/TopicCommentDao.xml | 26 ++++++++ 8 files changed, 178 insertions(+), 2 deletions(-) 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 index 0dba41f08..3dec40053 100755 --- 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 @@ -37,11 +37,12 @@ public class TopicCommentStatementFormDTO implements Serializable { */ private String commentId; + private String topicId; + private String useId; private String userName; - private String topicId; } 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 index 489c1e77b..2ef2aa2c6 100755 --- 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 @@ -57,5 +57,14 @@ public class AppTopicCommentController { 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/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 index dddaa5e2c..33638edec 100755 --- 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 @@ -36,6 +36,30 @@ 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); 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 index e512616de..cf06ba5c0 100755 --- 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 @@ -107,4 +107,29 @@ public interface TopicCommentService extends BaseService { * 移动端评论列表 */ 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); } 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 index a75d25453..37d4d04f9 100755 --- 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 @@ -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.dto.TopicCommentUserAttitudeDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; import com.elink.esua.epdc.modules.comment.entity.TopicCommentUserAttitudeEntity; import java.util.List; @@ -92,4 +93,11 @@ public interface TopicCommentUserAttitudeService extends BaseService().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); + } } 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 index caf12eb65..3e9a50fad 100755 --- 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 @@ -24,9 +24,11 @@ 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.TopicCommentUserAttitudeDTO; +import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO; 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.redis.TopicCommentUserAttitudeRedis; +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; @@ -48,6 +50,8 @@ public class TopicCommentUserAttitudeServiceImpl extends BaseServiceImpl page(Map params) { @@ -101,4 +105,63 @@ public class TopicCommentUserAttitudeServiceImpl extends BaseServiceImpl 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); + + + if ("0".equals(formDto.getAttitude()) || "1".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 ("0".equals(formDto.getAttitude())){ + topicCommentService.updateApproveNumAdd(formDto.getCommentId()); + } + if ("1".equals(formDto.getAttitude())){ + topicCommentService.updateOpposeNumAdd(formDto.getCommentId()); + } + + }else { + if (!formDto.getAttitude().equals(topicCommentUserAttitudeEntity.getAttitudeFlag())){ + topicCommentUserAttitudeEntity.setAttitudeFlag(formDto.getAttitude()); + this.updateById(topicCommentUserAttitudeEntity); + + if ("0".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 ("2".equals(formDto.getAttitude())){ + //取消赞 + topicCommentService.updateApproveNumSubtract(formDto.getCommentId()); + } + if ("3".equals(formDto.getAttitude())){ + //取消踩 + topicCommentService.updateOpposeNumSubtract(formDto.getCommentId()); + } + } + + + + + } } 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 index 3af9a4443..b2da34c75 100755 --- 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 @@ -34,6 +34,32 @@ 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} + + + SELECT + tp.ID, + tp.TOPIC_CONTENT, + tp.TOPIC_ADDRESS, + tp.CREATED_TIME, + tp.NICKNAME, + tp.USER_FACE, + tp.PARTY_MEMBER, + tp.BROWSE_NUM, + img.IMG_URL, + CASE + gp.STATE + WHEN 10 THEN + TRUE ELSE FALSE + END AS operationalFlag, + CASE + WHEN gp.STATE = 20 + OR tp.STATE ]]> 0 THEN + FALSE ELSE TRUE + END AS closeFlag, + CASE + WHEN gp.STATE = 20 + OR tp.STATE ]]> 0 THEN + FALSE ELSE TRUE + END AS changeFlag + FROM + epdc_topic tp + LEFT JOIN epdc_topic_img img ON tp.ID = img.REFERENCE_ID + AND img.DEL_FLAG = '0' + LEFT JOIN epdc_group gp ON tp.GROUP_ID = gp.ID + AND gp.DEL_FLAG = '0' + WHERE + tp.DEL_FLAG = '0' + AND tp.ID = #{id} + ORDER BY + img.IMG_URL + + From 2712465d461cdaac470bf64aaaf79400b4578565 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Thu, 7 Nov 2019 16:00:23 +0800 Subject: [PATCH 33/51] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A4=BE=E7=BE=A4?= =?UTF-8?q?=E6=88=90=E5=91=98=E5=88=97=E8=A1=A8=E6=8E=92=E5=BA=8F=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/group/UserGroupDao.xml | 18 +++++++++++++++++- .../src/main/resources/mapper/UserDao.xml | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) 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 index 14d2cb69a..8e34bcb41 100644 --- 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 @@ -27,7 +27,23 @@ From 7d17cc0a4664ffde0231925c915b00739e64a127 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Thu, 7 Nov 2019 17:40:25 +0800 Subject: [PATCH 34/51] =?UTF-8?q?=E5=85=B3=E9=97=AD=E8=AF=9D=E9=A2=98?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiTopicController.java | 16 +++ .../esua/epdc/feign/TopicFeignClient.java | 13 +++ .../fallback/TopicFeignClientFallback.java | 6 ++ .../elink/esua/epdc/service/TopicService.java | 14 ++- .../epdc/service/impl/TopicServiceImpl.java | 10 ++ .../dto/constant/GroupNoticeConstant.java | 10 ++ .../dto/topic/TopicAuditRecordDTO.java | 86 +++++++++++++++ .../dto/topic/form/TopicCloseFormDTO.java | 37 +++++++ .../topic/controller/AppTopicController.java | 16 +++ .../topic/controller/TopicController.java | 17 +++ .../topic/dao/TopicAuditRecordDao.java | 33 ++++++ .../topic/entity/TopicAuditRecordEntity.java | 56 ++++++++++ .../service/TopicAuditRecordService.java | 95 +++++++++++++++++ .../modules/topic/service/TopicService.java | 12 +++ .../impl/TopicAuditRecordServiceImpl.java | 100 ++++++++++++++++++ .../topic/service/impl/TopicServiceImpl.java | 72 +++++++++++++ .../mapper/topic/TopicAuditRecordDao.xml | 20 ++++ 17 files changed, 612 insertions(+), 1 deletion(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicAuditRecordDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicCloseFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicAuditRecordDao.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/entity/TopicAuditRecordEntity.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicAuditRecordService.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicAuditRecordServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicAuditRecordDao.xml 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 index 6c8a4a68b..85e8beafe 100644 --- 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 @@ -4,6 +4,7 @@ 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.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.service.TopicService; @@ -52,4 +53,19 @@ public class ApiTopicController { 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); + } } 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 index 095719792..75ad641fd 100644 --- 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 @@ -2,6 +2,7 @@ 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.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.feign.fallback.TopicFeignClientFallback; @@ -44,4 +45,16 @@ public interface TopicFeignClient { */ @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/7 16:14 + */ + @PostMapping(value = "group/epdc-app/topic/close", consumes = MediaType.APPLICATION_JSON_VALUE) + Result close(TopicCloseFormDTO 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 index 8e4ce186c..ff9e8532e 100644 --- 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 @@ -3,6 +3,7 @@ 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.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.feign.TopicFeignClient; @@ -24,4 +25,9 @@ public class TopicFeignClientFallback implements TopicFeignClient { 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); + } } 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 index 45a6d6b95..1bc8a3555 100644 --- 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 @@ -2,6 +2,7 @@ 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.topic.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; @@ -27,7 +28,7 @@ public interface TopicService { /** * - * 移动端-话题详情 + * 话题详情 * * @params [id] * @return com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO @@ -35,4 +36,15 @@ public interface TopicService { * @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); } 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 index a3e005d0b..ef3960a28 100644 --- 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 @@ -4,6 +4,7 @@ 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.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.feign.AdminFeignClient; @@ -59,4 +60,13 @@ public class TopicServiceImpl implements TopicService { 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); + } } diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java index c7915a960..9d7baf898 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/constant/GroupNoticeConstant.java @@ -64,6 +64,11 @@ public interface GroupNoticeConstant { */ String NOTICE_GROUP_QUIT = "已退出社群"; + /** + * 话题关闭 + */ + String NOTICE_GROUP_TOPIC_CLOSED = "话题关闭"; + /** * 我的消息类型:0审核通知 */ @@ -118,4 +123,9 @@ public interface GroupNoticeConstant { * 入群申请未通过 */ String NOTICE_BUSINESS_TYPE_GROUP_USER_REVIEW_NOT_PASS = "groupUserReviewNotPass"; + + /** + * 话题关闭 + */ + String NOTICE_BUSINESS_TYPE_GROUP_TOPIC_CLOSED = "groupTopicClosed"; } 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/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-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 index 6c885920e..069610938 100644 --- 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 @@ -1,7 +1,9 @@ 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.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.modules.topic.service.TopicService; @@ -50,4 +52,18 @@ public class AppTopicController { 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); + } } diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java index 301c7a695..87ff1ce7c 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java @@ -17,6 +17,7 @@ package com.elink.esua.epdc.modules.topic.controller; +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; @@ -26,6 +27,7 @@ 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.form.TopicCloseFormDTO; 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; @@ -91,4 +93,19 @@ public class TopicController { 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); + } + } \ 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..05c275999 --- /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,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.TopicAuditRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题审核记录表 话题审核记录表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2019-11-07 + */ +@Mapper +public interface TopicAuditRecordDao 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/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..1a23bbb50 --- /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,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.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.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); +} \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java index 9dd9855db..471cf223f 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java @@ -21,6 +21,7 @@ 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.topic.TopicDTO; +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.modules.topic.entity.TopicEntity; @@ -123,4 +124,15 @@ public interface TopicService extends BaseService { * @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); } 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..3b40276c0 --- /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,100 @@ +/** + * 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.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)); + } + +} \ 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 index 825c8948c..d7d2a546e 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -21,15 +21,29 @@ 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.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.group.GroupDTO; +import com.elink.esua.epdc.dto.group.UserGroupDTO; import com.elink.esua.epdc.dto.topic.TopicDTO; +import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; +import com.elink.esua.epdc.modules.async.NewsTask; +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; @@ -53,6 +67,18 @@ public class TopicServiceImpl extends BaseServiceImpl imp @Autowired private TopicImgService topicImgService; + @Autowired + private UserGroupService userGroupService; + + @Autowired + private GroupService groupService; + + @Autowired + private TopicAuditRecordService topicAuditRecordService; + + @Autowired + private NewsTask newsTask; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -127,4 +153,50 @@ public class TopicServiceImpl extends BaseServiceImpl imp return baseDao.selectOneOfTopicDetailById(id); } + @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(); + } + } 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..912a5f133 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicAuditRecordDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 372c7e84743f47151d69295600443745bb74c074 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Fri, 8 Nov 2019 09:49:53 +0800 Subject: [PATCH 35/51] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiTopicController.java | 17 ++++++++++ .../esua/epdc/feign/TopicFeignClient.java | 15 +++++++++ .../fallback/TopicFeignClientFallback.java | 9 +++++ .../elink/esua/epdc/service/TopicService.java | 14 ++++++++ .../epdc/service/impl/TopicServiceImpl.java | 8 +++++ .../result/TopicAuditRecordResultDTO.java | 33 +++++++++++++++++++ .../topic/result/TopicDetailResultDTO.java | 3 +- .../topic/controller/AppTopicController.java | 18 ++++++++++ .../topic/dao/TopicAuditRecordDao.java | 15 ++++++++- .../service/TopicAuditRecordService.java | 12 +++++++ .../modules/topic/service/TopicService.java | 12 +++++++ .../impl/TopicAuditRecordServiceImpl.java | 6 ++++ .../topic/service/impl/TopicServiceImpl.java | 6 ++++ .../mapper/topic/TopicAuditRecordDao.xml | 25 +++++++------- 14 files changed, 179 insertions(+), 14 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/result/TopicAuditRecordResultDTO.java 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 index 85e8beafe..61dd20032 100644 --- 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 @@ -4,6 +4,7 @@ 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.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; @@ -11,6 +12,8 @@ import com.elink.esua.epdc.service.TopicService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * * 移动端接口-话题模块 @@ -68,4 +71,18 @@ public class ApiTopicController { 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); + } } 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 index 75ad641fd..900defe0e 100644 --- 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 @@ -2,6 +2,7 @@ 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.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; @@ -12,6 +13,8 @@ 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; + /** * * 社群-话题模块调用 @@ -57,4 +60,16 @@ public interface TopicFeignClient { */ @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); } 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 index ff9e8532e..721649a73 100644 --- 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 @@ -3,11 +3,15 @@ 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.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; 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 @@ -30,4 +34,9 @@ public class TopicFeignClientFallback implements TopicFeignClient { 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); + } } 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 index 1bc8a3555..8272c4ade 100644 --- 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 @@ -2,10 +2,13 @@ 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.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; +import java.util.List; + /** * * 话题模块 @@ -47,4 +50,15 @@ public interface TopicService { * @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); } 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 index ef3960a28..54f89daa6 100644 --- 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 @@ -4,6 +4,7 @@ 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.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; @@ -13,6 +14,8 @@ import com.elink.esua.epdc.service.TopicService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * * 话题模块 @@ -69,4 +72,9 @@ public class TopicServiceImpl implements TopicService { formDto.setUserId(userDetail.getUserId()); return topicFeignClient.close(formDto); } + + @Override + public Result> listOfTopicAuditRecord(String topicId) { + return topicFeignClient.auditRecord(topicId); + } } 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/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 index 238e80e89..7ae17a005 100644 --- 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 @@ -3,6 +3,7 @@ package com.elink.esua.epdc.dto.topic.result; import lombok.Data; import java.io.Serializable; +import java.util.Date; import java.util.List; /** @@ -34,7 +35,7 @@ public class TopicDetailResultDTO implements Serializable { /** * 发布时间 */ - private String createdTime; + private Date createdTime; /** * 发布人 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 index 069610938..9962c1298 100644 --- 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 @@ -3,6 +3,7 @@ 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.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; @@ -10,6 +11,8 @@ 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; + /** * * 移动端-话题模块 @@ -66,4 +69,19 @@ public class AppTopicController { 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); + } } 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 index 05c275999..1a4fe1c4e 100644 --- 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 @@ -18,9 +18,12 @@ 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; + /** * 话题审核记录表 话题审核记录表 * @@ -29,5 +32,15 @@ import org.apache.ibatis.annotations.Mapper; */ @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/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 index 1a23bbb50..e71170878 100644 --- 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 @@ -19,6 +19,7 @@ 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; @@ -92,4 +93,15 @@ public interface TopicAuditRecordService extends BaseService + * @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/TopicService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java index 471cf223f..689f26207 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java @@ -20,6 +20,7 @@ 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.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; @@ -135,4 +136,15 @@ public interface TopicService extends BaseService { * @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); } 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 index 3b40276c0..91893dedc 100644 --- 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 @@ -23,6 +23,7 @@ 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; @@ -97,4 +98,9 @@ public class TopicAuditRecordServiceImpl extends BaseServiceImpl 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/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java index d7d2a546e..4e7afa9af 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -33,6 +33,7 @@ import com.elink.esua.epdc.dto.enums.TopicStateEnum; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; 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.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; @@ -199,4 +200,9 @@ public class TopicServiceImpl extends BaseServiceImpl imp return new Result().error(); } + @Override + public List listOfTopicAuditRecord(String topicId) { + return topicAuditRecordService.listOfTopicAuditRecord(topicId); + } + } 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 index 912a5f133..63c988423 100644 --- 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 @@ -3,18 +3,19 @@ - - - - - - - - - - - - + \ No newline at end of file From 7aa505f0f16b255ee50244c172398ea49927f0bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=87=91=E9=B9=8F?= Date: Fri, 8 Nov 2019 14:49:46 +0800 Subject: [PATCH 36/51] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiTopicController.java | 7 +++ .../esua/epdc/feign/TopicFeignClient.java | 6 ++ .../fallback/TopicFeignClientFallback.java | 7 +++ .../elink/esua/epdc/service/TopicService.java | 6 ++ .../epdc/service/impl/TopicServiceImpl.java | 7 +++ .../dto/topic/TopicListDTO.java | 19 ++++++ .../dto/topic/result/TopicListResultDTO.java | 60 +++++++++++++++++++ .../topic/controller/AppTopicController.java | 8 +++ .../modules/topic/dao/TopicDao.java | 8 +++ .../modules/topic/service/TopicService.java | 4 ++ .../topic/service/impl/TopicServiceImpl.java | 6 ++ .../main/resources/mapper/topic/TopicDao.xml | 25 ++++++++ 12 files changed, 163 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicListDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/result/TopicListResultDTO.java 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 index 61dd20032..e49c29471 100644 --- 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 @@ -5,9 +5,11 @@ 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.TopicListDTO; 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.*; @@ -43,6 +45,11 @@ public class ApiTopicController { return topicService.saveTopic(userDetail, formDto); } + @GetMapping("list") + public Result> list(@RequestBody TopicListDTO topicListDTO) { + return topicService.apiList(topicListDTO); + } + /** * * 话题详情 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 index 900defe0e..50c29cc1e 100644 --- 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 @@ -3,9 +3,11 @@ 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.TopicListDTO; 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; @@ -49,6 +51,10 @@ public interface TopicFeignClient { @GetMapping(value = "group/epdc-app/topic/detail/{id}", consumes = MediaType.APPLICATION_JSON_VALUE) Result detail(@PathVariable("id") String id); + + @GetMapping(value = "group/epdc-app/topic/list", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> apiList(TopicListDTO topicListDTO); + /** * * 关闭话题 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 index 721649a73..4d11773ca 100644 --- 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 @@ -4,9 +4,11 @@ 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.TopicListDTO; 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; @@ -39,4 +41,9 @@ public class TopicFeignClientFallback implements TopicFeignClient { public Result> auditRecord(@PathVariable("topicId") String topicId) { return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "auditRecord", topicId); } + + @Override + public Result> apiList(TopicListDTO topicListDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "list", topicListDTO); + } } 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 index 8272c4ade..aaeb09d6e 100644 --- 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 @@ -3,9 +3,11 @@ 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.TopicListDTO; 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; @@ -61,4 +63,8 @@ public interface TopicService { * @since 2019/11/8 9:43 */ Result> listOfTopicAuditRecord(String topicId); + + + Result> apiList(TopicListDTO topicListDTO); + } 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 index 54f89daa6..743013e72 100644 --- 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 @@ -5,9 +5,11 @@ 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.TopicListDTO; 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; @@ -77,4 +79,9 @@ public class TopicServiceImpl implements TopicService { public Result> listOfTopicAuditRecord(String topicId) { return topicFeignClient.auditRecord(topicId); } + + @Override + public Result> apiList(TopicListDTO topicListDTO) { + return topicFeignClient.apiList(topicListDTO); + } } diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicListDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicListDTO.java new file mode 100644 index 000000000..ab470726b --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicListDTO.java @@ -0,0 +1,19 @@ +package com.elink.esua.epdc.dto.topic; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class TopicListDTO implements Serializable { + + + private Integer pageIndex; + + private Integer pageSize; + + private String timestamp; + + private String id; + +} 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..c8a4e2666 --- /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,60 @@ +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; + + private String issueId; + + private String itemId; + + /** + * 图片 + */ + private List images; + + + +} 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 index 9962c1298..1dbf246c9 100644 --- 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 @@ -4,9 +4,11 @@ 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.TopicListDTO; 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.*; @@ -41,6 +43,12 @@ public class AppTopicController { return topicService.saveTopic(formDto); } + @GetMapping("list") + public Result> list(@RequestBody TopicListDTO topicListDTO) { + List list = topicService.apiList(topicListDTO); + return new Result>().ok(list); + } + /** * * 话题详情 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 index 798665ada..6f5b35929 100644 --- 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 @@ -18,10 +18,14 @@ package com.elink.esua.epdc.modules.topic.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +import com.elink.esua.epdc.dto.topic.TopicListDTO; 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; + /** * 话题表 话题表 * @@ -47,4 +51,8 @@ public interface TopicDao extends BaseDao { */ TopicDetailResultDTO selectOneOfTopicDetailById(String id); + + List apiList(TopicListDTO topicListDTO); + + } diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java index 689f26207..67c6f71b3 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java @@ -22,9 +22,11 @@ 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.TopicListDTO; 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.entity.TopicEntity; import java.util.List; @@ -58,6 +60,8 @@ public interface TopicService extends BaseService { */ List list(Map params); + List apiList(TopicListDTO topicListDTO); + /** * 单条查询 * diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java index 4e7afa9af..7d20d04a6 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -35,9 +35,11 @@ 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.TopicListDTO; 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.async.NewsTask; import com.elink.esua.epdc.modules.group.service.GroupService; import com.elink.esua.epdc.modules.group.service.UserGroupService; @@ -205,4 +207,8 @@ public class TopicServiceImpl extends BaseServiceImpl imp return topicAuditRecordService.listOfTopicAuditRecord(topicId); } + @Override + public List apiList(TopicListDTO topicListDTO) { + return baseDao.apiList(topicListDTO); + } } 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 index 6b8db72cc..6788c2cc1 100644 --- 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 @@ -64,4 +64,29 @@ + + + + + + + + + + + + + + + + + + From 63b60492d89282410b5a52f9c91b434721e79b64 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Fri, 8 Nov 2019 15:51:03 +0800 Subject: [PATCH 37/51] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E8=AF=9D=E9=A2=98?= =?UTF-8?q?=E8=BD=AC=E8=AE=AE=E9=A2=98=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doc/db/dev_1010/esua_epdc_events.sql | 14 ++++ .../epdc/controller/ApiTopicController.java | 16 +++++ .../esua/epdc/feign/TopicFeignClient.java | 13 ++++ .../fallback/TopicFeignClientFallback.java | 6 ++ .../elink/esua/epdc/service/TopicService.java | 12 ++++ .../epdc/service/impl/TopicServiceImpl.java | 11 +++ .../events/form/EpdcEventSubmitFormDTO.java | 15 ++++ .../elink/esua/epdc/dto/issue/IssueDTO.java | 20 ++++-- .../com/elink/esua/epdc/dto/item/ItemDTO.java | 20 ++++-- .../events/entity/EpdcEventsEntity.java | 19 +++-- .../modules/events/excel/EpdcEventsExcel.java | 2 - .../service/impl/EpdcEventsServiceImpl.java | 3 +- .../modules/issue/entity/IssueEntity.java | 20 ++++-- .../epdc/modules/issue/excel/IssueExcel.java | 3 - .../issue/service/impl/IssueServiceImpl.java | 3 +- .../epdc/modules/item/entity/ItemEntity.java | 20 ++++-- .../epdc/modules/item/excel/ItemExcel.java | 3 - .../epdc-group/epdc-group-client/pom.xml | 5 ++ .../dto/topic/TopicDTO.java | 5 ++ .../topic/form/TopicChangeToIssueFormDTO.java | 29 ++++++++ .../dto/topic/form/TopicSubmitFormDTO.java | 5 ++ .../modules/feign/EventFeignClient.java | 32 +++++++++ .../fallback/EventFeignClientFallback.java | 21 ++++++ .../topic/controller/AppTopicController.java | 15 ++++ .../modules/topic/dao/TopicDao.java | 12 ++++ .../modules/topic/entity/TopicEntity.java | 5 ++ .../modules/topic/service/TopicService.java | 12 ++++ .../topic/service/impl/TopicServiceImpl.java | 72 ++++++++++++++++++- .../main/resources/mapper/topic/TopicDao.xml | 55 ++++++++++++++ 29 files changed, 433 insertions(+), 35 deletions(-) create mode 100644 esua-epdc/doc/db/dev_1010/esua_epdc_events.sql create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicChangeToIssueFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/EventFeignClient.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/fallback/EventFeignClientFallback.java 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..69182f922 --- /dev/null +++ b/esua-epdc/doc/db/dev_1010/esua_epdc_events.sql @@ -0,0 +1,14 @@ +------------------------------------------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----------------------------------------------- \ No newline at end of file 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 index e49c29471..85e87f284 100644 --- 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 @@ -6,6 +6,7 @@ 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.TopicListDTO; +import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; @@ -92,4 +93,19 @@ public class ApiTopicController { 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/TopicFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/TopicFeignClient.java index 50c29cc1e..5f6d2ab46 100644 --- 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 @@ -3,6 +3,7 @@ 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.TopicListDTO; import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; @@ -78,4 +79,16 @@ public interface TopicFeignClient { */ @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/TopicFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/TopicFeignClientFallback.java index 4d11773ca..af02fc3e1 100644 --- 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 @@ -4,6 +4,7 @@ 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.TopicListDTO; import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; @@ -46,4 +47,9 @@ public class TopicFeignClientFallback implements TopicFeignClient { public Result> apiList(TopicListDTO topicListDTO) { return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "list", topicListDTO); } + + @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/TopicService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/TopicService.java index aaeb09d6e..cc88182ee 100644 --- 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 @@ -4,6 +4,7 @@ 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.TopicListDTO; +import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; @@ -67,4 +68,15 @@ public interface TopicService { Result> apiList(TopicListDTO topicListDTO); + + /** + * + * 转议题 + * + * @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/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/TopicServiceImpl.java index 743013e72..93027ee96 100644 --- 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 @@ -5,6 +5,7 @@ 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.TopicListDTO; import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; @@ -56,6 +57,7 @@ public class TopicServiceImpl implements TopicService { 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); @@ -84,4 +86,13 @@ public class TopicServiceImpl implements TopicService { public Result> apiList(TopicListDTO topicListDTO) { return topicFeignClient.apiList(topicListDTO); } + + @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/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 2f7662872..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 @@ -95,4 +95,19 @@ public class EpdcEventSubmitFormDTO implements Serializable { * 党员标识 0:否、1:是 */ private String isPartyMember; + + /** + * 手机号 + */ + 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/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 65b959c13..fad6289e5 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 @@ -124,11 +124,6 @@ public class IssueDTO implements Serializable { */ private BigDecimal issueLongitude; - /** - * 友邻社区ID - */ - private String friendlyCommunityId; - /** * 议题状态 0-审核通过,2-已关闭,4-已转项目 */ @@ -164,4 +159,19 @@ public class IssueDTO implements Serializable { */ private Date updatedTime; + /** + * 手机号 + */ + 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/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 6e9d98c54..8d3d0e5a0 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 @@ -129,11 +129,6 @@ public class ItemDTO implements Serializable { */ private BigDecimal issueLongitude; - /** - * 友邻社区ID - */ - private String friendlyCommunityId; - /** * 评价打分 */ @@ -174,4 +169,19 @@ public class ItemDTO implements Serializable { */ private Date updatedTime; + /** + * 手机号 + */ + private String mobile; + + /** + * 社群ID + */ + private String groupId; + + /** + * 社群名称 + */ + private String groupName; + } 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 0f7f7de1f..b887847e9 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 @@ -110,10 +110,6 @@ public class EpdcEventsEntity extends BaseEpdcEntity { * 议题位置经度 */ private double issueLongitude; - /** - * 友邻社区ID - */ - private String friendlyCommunityId; /** * 事件状态 0-待审核,2-驳回,4-审核通过 */ @@ -139,4 +135,19 @@ public class EpdcEventsEntity extends BaseEpdcEntity { */ private Integer browseNum; + /** + * 手机号 + */ + private String mobile; + + /** + * 社群ID + */ + private String groupId; + + /** + * 社群名称 + */ + private String groupName; + } 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 7f9551174..9d4d87f9b 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 @@ -266,7 +266,8 @@ public class EpdcEventsServiceImpl 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); 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 51e8a2010..3ca0decdd 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 @@ -139,11 +139,6 @@ public class ItemEntity extends BaseEpdcEntity { */ private double issueLongitude; - /** - * 友邻社区ID - */ - private String friendlyCommunityId; - /** * 满意度评价得分 */ @@ -162,4 +157,19 @@ public class ItemEntity extends BaseEpdcEntity { */ private Integer itemState; + /** + * 手机号 + */ + private String mobile; + + /** + * 社群ID + */ + private String groupId; + + /** + * 社群名称 + */ + private String groupName; + } 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-group/epdc-group-client/pom.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-client/pom.xml index c391b65fd..0a7cc8b07 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/pom.xml @@ -32,6 +32,11 @@ 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/topic/TopicDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java index 8531b4b92..f40debda7 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDTO.java @@ -59,6 +59,11 @@ public class TopicDTO implements Serializable { */ private String partyMember; + /** + * 手机号 + */ + private String mobile; + /** * 话题内容 */ 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/TopicSubmitFormDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicSubmitFormDTO.java index 68496a150..e5fcca01f 100644 --- 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 @@ -78,6 +78,11 @@ public class TopicSubmitFormDTO implements Serializable { */ private String partyMember; + /** + * 手机号 + */ + private String mobile; + /** * 区 */ 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..180018a87 --- /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,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.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); +} 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..ca3ff7aa1 --- /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,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.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); + } +} 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 index 1dbf246c9..9a17379f6 100644 --- 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 @@ -4,6 +4,7 @@ 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.TopicListDTO; import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; @@ -92,4 +93,18 @@ public class AppTopicController { 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/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 index 6f5b35929..fbd741321 100644 --- 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 @@ -18,6 +18,7 @@ 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.TopicListDTO; import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO; import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO; @@ -55,4 +56,15 @@ public interface TopicDao extends BaseDao { List apiList(TopicListDTO topicListDTO); + /** + * + * 话题转议题详情数据 + * + * @params [id] + * @return com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO + * @author liuchuang + * @since 2019/11/8 15:11 + */ + EpdcEventSubmitFormDTO selectOneOfTopicForChangeToIssue(String id); + } 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 index f3bfc712c..5de270f3c 100644 --- 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 @@ -59,6 +59,11 @@ public class TopicEntity extends BaseEpdcEntity { */ private String partyMember; + /** + * 手机号 + */ + private String mobile; + /** * 话题内容 */ diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java index 67c6f71b3..098dc3478 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java @@ -22,6 +22,7 @@ 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.form.TopicChangeToIssueFormDTO; import com.elink.esua.epdc.dto.topic.TopicListDTO; import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicSubmitFormDTO; @@ -151,4 +152,15 @@ public interface TopicService extends BaseService { * @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); } diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java index 7d20d04a6..3b002d9f7 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -31,16 +31,19 @@ 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.TopicListDTO; +import com.elink.esua.epdc.dto.topic.form.TopicChangeToIssueFormDTO; import com.elink.esua.epdc.dto.topic.form.TopicCloseFormDTO; import com.elink.esua.epdc.dto.topic.form.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.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; @@ -82,6 +85,9 @@ public class TopicServiceImpl extends BaseServiceImpl imp @Autowired private NewsTask newsTask; + @Autowired + private EventFeignClient eventFeignClient; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -153,7 +159,15 @@ public class TopicServiceImpl extends BaseServiceImpl imp @Override public TopicDetailResultDTO getTopicDetailById(String id) { - return baseDao.selectOneOfTopicDetailById(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 @@ -211,4 +225,60 @@ public class TopicServiceImpl extends BaseServiceImpl imp public List apiList(TopicListDTO topicListDTO) { return baseDao.apiList(topicListDTO); } + + @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(); + } + + /** + * + * 话题转议题校验 + * + * @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(); + } + } 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 index 6788c2cc1..844cbe3ed 100644 --- 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 @@ -63,6 +63,61 @@ img.IMG_URL + + + + + + + + + + + + + + + + + + + + + + + + + + From a4038a8ead787018db910e3a21644e16c0bdfe94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=87=91=E9=B9=8F?= Date: Fri, 8 Nov 2019 17:21:36 +0800 Subject: [PATCH 38/51] no message --- .../resources/mapper/comment/TopicCommentDao.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 index b2da34c75..d994b7b69 100755 --- 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 @@ -75,6 +75,21 @@ AND TOPIC_ID = #{topicId} + + + + + + + + + + + + + + + + + UPDATE epdc_user_group SET PARTY_MEMBER = #{partyMember} WHERE USER_ID = #{userId} + + \ No newline at end of file From 7c51498367eabd693fb375b1df71af6d6fcaef27 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Mon, 11 Nov 2019 15:57:06 +0800 Subject: [PATCH 42/51] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=9D=E9=A2=98?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=20=E6=88=91=E7=9A=84?= =?UTF-8?q?=E8=AF=9D=E9=A2=98=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/controller/ApiTopicController.java | 31 +++++++++-- .../esua/epdc/feign/TopicFeignClient.java | 14 +++-- .../fallback/TopicFeignClientFallback.java | 6 +-- .../elink/esua/epdc/service/TopicService.java | 24 +++++++-- .../epdc/service/impl/TopicServiceImpl.java | 19 +++++-- .../dto/topic/TopicListDTO.java | 19 ------- .../dto/topic/form/TopicListFormDTO.java | 52 +++++++++++++++++++ .../dto/topic/result/TopicListResultDTO.java | 6 +++ .../topic/controller/AppTopicController.java | 17 ++++-- .../modules/topic/dao/TopicDao.java | 15 ++++-- .../modules/topic/service/TopicService.java | 13 ++++- .../topic/service/impl/TopicServiceImpl.java | 16 +++--- .../main/resources/mapper/topic/TopicDao.xml | 50 +++++++++++++++--- 13 files changed, 225 insertions(+), 57 deletions(-) delete mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicListDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicListFormDTO.java 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 index 85e87f284..401ee3294 100644 --- 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 @@ -5,7 +5,7 @@ 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.TopicListDTO; +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; @@ -46,9 +46,34 @@ public class ApiTopicController { 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> list(@RequestBody TopicListDTO topicListDTO) { - return topicService.apiList(topicListDTO); + 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); } /** 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 index 5f6d2ab46..2054ceb43 100644 --- 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 @@ -4,7 +4,7 @@ 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.TopicListDTO; +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; @@ -52,9 +52,17 @@ public interface TopicFeignClient { @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> apiList(TopicListDTO topicListDTO); + Result> listOfTopic(TopicListFormDTO 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 index af02fc3e1..2c332b2e1 100644 --- 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 @@ -5,7 +5,7 @@ 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.TopicListDTO; +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; @@ -44,8 +44,8 @@ public class TopicFeignClientFallback implements TopicFeignClient { } @Override - public Result> apiList(TopicListDTO topicListDTO) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "list", topicListDTO); + public Result> listOfTopic(TopicListFormDTO formDto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "listOfTopic", formDto); } @Override 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 index cc88182ee..b674e6400 100644 --- 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 @@ -3,7 +3,7 @@ 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.TopicListDTO; +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; @@ -65,9 +65,27 @@ public interface TopicService { */ 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); - Result> apiList(TopicListDTO topicListDTO); - + /** + * + * 我的话题列表 + * + * @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); /** * 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 index 93027ee96..86bf60786 100644 --- 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 @@ -6,7 +6,7 @@ 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.TopicListDTO; +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; @@ -83,8 +83,21 @@ public class TopicServiceImpl implements TopicService { } @Override - public Result> apiList(TopicListDTO topicListDTO) { - return topicFeignClient.apiList(topicListDTO); + 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 diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicListDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicListDTO.java deleted file mode 100644 index ab470726b..000000000 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicListDTO.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.elink.esua.epdc.dto.topic; - -import lombok.Data; - -import java.io.Serializable; - -@Data -public class TopicListDTO implements Serializable { - - - private Integer pageIndex; - - private Integer pageSize; - - private String timestamp; - - private String id; - -} 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..33b3cd778 --- /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,52 @@ +package com.elink.esua.epdc.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +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/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 index c8a4e2666..c6157522c 100644 --- 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 @@ -46,8 +46,14 @@ public class TopicListResultDTO implements Serializable { */ private Integer state; + /** + * 议题ID + */ private String issueId; + /** + * 项目ID + */ private String itemId; /** 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 index 9a17379f6..88102d089 100644 --- 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 @@ -5,7 +5,7 @@ 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.TopicListDTO; +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; @@ -44,10 +44,19 @@ public class AppTopicController { 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> list(@RequestBody TopicListDTO topicListDTO) { - List list = topicService.apiList(topicListDTO); - return new Result>().ok(list); + public Result> listOfTopic(@RequestBody TopicListFormDTO formDto) { + List data = topicService.listOfTopic(formDto); + return new Result>().ok(data); } /** 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 index fbd741321..b328d6c15 100644 --- 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 @@ -19,7 +19,7 @@ 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.TopicListDTO; +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; @@ -52,9 +52,16 @@ public interface TopicDao extends BaseDao { */ TopicDetailResultDTO selectOneOfTopicDetailById(String id); - - List apiList(TopicListDTO topicListDTO); - + /** + * + * 移动端-话题列表 + * + * @params [formDto] + * @return java.util.List + * @author liuchuang + * @since 2019/11/11 15:14 + */ + List selectListOfTopic(TopicListFormDTO formDto); /** * diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java index 89fdd7a63..f08365bc8 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java @@ -23,7 +23,7 @@ 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.form.TopicChangeToIssueFormDTO; -import com.elink.esua.epdc.dto.topic.TopicListDTO; +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; @@ -62,7 +62,16 @@ public interface TopicService extends BaseService { */ List list(Map params); - List apiList(TopicListDTO topicListDTO); + /** + * + * 移动端-话题列表 + * + * @params [formDto] + * @return java.util.List + * @author liuchuang + * @since 2019/11/11 15:08 + */ + List listOfTopic(TopicListFormDTO formDto); /** * 单条查询 diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java index 9896d7476..ca067305e 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -24,6 +24,7 @@ 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.constant.GroupNoticeConstant; import com.elink.esua.epdc.dto.constant.TopicImageConstant; @@ -36,7 +37,7 @@ 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.TopicListDTO; +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; @@ -58,10 +59,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; +import java.util.*; /** * 话题表 话题表 @@ -224,8 +222,12 @@ public class TopicServiceImpl extends BaseServiceImpl imp } @Override - public List apiList(TopicListDTO topicListDTO) { - return baseDao.apiList(topicListDTO); + 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 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 index 844cbe3ed..f2eacb919 100644 --- 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 @@ -134,14 +134,52 @@ - - + SELECT + topic.ID, + topic.TOPIC_CONTENT, + topic.CREATED_TIME, + topic.NICKNAME, + topic.USER_FACE, + topic.PARTY_MEMBER, + topic.STATE, + topic.ISSUE_ID, + topic.ITEM_ID, + img.IMG_URL + FROM + epdc_topic topic LEFT JOIN epdc_topic_img img ON topic.ID = img.REFERENCE_ID - WHERE topic.GROUP_ID = #{id} - #{timestamp} + AND img.DEL_FLAG = '0' + WHERE + topic.ID IN ( + SELECT + tmp.ID + FROM + ( + SELECT + t1.ID + FROM + epdc_topic t1 + WHERE + t1.DEL_FLAG = '0' + + and t1.userId = #{userId} + + + AND t1.STATE ]]> 20 + AND t1.GROUP_ID = #{groupId} + AND t1.GRID_ID = #{gridId} + = ]]> #{someMonthsAgo} + #{timestamp} + + ORDER BY + t1.CREATED_TIME DESC LIMIT #{pageIndex},#{pageSize} + ) tmp + ) + ORDER BY + topic.CREATED_TIME DESC, + img.IMG_URL From ac688b17e0749e87d075c984b16d6d6261df321a Mon Sep 17 00:00:00 2001 From: liuchuang Date: Tue, 12 Nov 2019 09:08:50 +0800 Subject: [PATCH 43/51] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E7=9A=84=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E5=9B=9E=E5=A4=8D=E3=80=81=E8=AF=84=E8=AE=BA=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=8F=8D=E5=AF=B9=E5=8F=91=E9=80=81=E6=B6=88?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/constant/TopicNoticeConstant.java | 18 ++++---- .../service/impl/TopicCommentServiceImpl.java | 11 +++-- .../TopicCommentUserAttitudeServiceImpl.java | 45 +++++++++++++------ 3 files changed, 47 insertions(+), 27 deletions(-) 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 index 5a53e5d20..a86d6702a 100644 --- 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 @@ -14,15 +14,6 @@ public interface TopicNoticeConstant { * 评论被回复 */ String NOTICE_TOPIC_COMMENT_REPLY = "你的评论【有新回复】"; - - /** - * 话题支持 - */ - String NOTICE_TOPIC_APPROVE = "你的话题【有新的支持】"; - /** - * 话题反对 - */ - String NOTICE_TOPIC_OPPOSE = "你的话题【有新的反对】"; /** * 评论支持 */ @@ -49,6 +40,13 @@ public interface TopicNoticeConstant { */ 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-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 index cf1ec5b9e..3eefc7772 100755 --- 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 @@ -32,6 +32,7 @@ import com.elink.esua.epdc.dto.comment.TopicCommentsResultDTO; 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.modules.async.NewsTask; import com.elink.esua.epdc.modules.comment.dao.TopicCommentDao; import com.elink.esua.epdc.modules.comment.entity.TopicCommentEntity; @@ -155,16 +156,19 @@ public class TopicCommentServiceImpl extends BaseServiceImpl implements TopicCommentUserAttitudeService { - @Autowired - private TopicCommentUserAttitudeRedis topicCommentUserAttitudeRedis; @Autowired private TopicCommentService topicCommentService; + @Autowired + private NewsTask newsTask; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -114,8 +119,14 @@ public class TopicCommentUserAttitudeServiceImpl extends BaseServiceImpl Date: Tue, 12 Nov 2019 11:15:02 +0800 Subject: [PATCH 44/51] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E8=AF=9D=E9=A2=98?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/comment/ReplyCommentDto.java | 24 ++++++ .../dto/comment/TopicCommentListDTO.java | 60 ++++++++++++++ .../comment/TopicDeleteCommentsFormDTO.java | 16 ++++ .../dto/comment/UserBaseInfoDto.java | 28 +++++++ .../dto/group/GroupListDTO.java | 24 ++++++ .../dto/topic/TopicDetailDTO.java | 69 ++++++++++++++++ .../controller/TopicCommentController.java | 31 ++++++++ .../modules/comment/dao/TopicCommentDao.java | 24 ++++++ .../comment/service/TopicCommentService.java | 27 ++++++- .../service/impl/TopicCommentServiceImpl.java | 22 ++++-- .../group/controller/GroupController.java | 21 ++++- .../modules/group/dao/GroupDao.java | 12 +++ .../modules/group/service/GroupService.java | 16 +++- .../group/service/impl/GroupServiceImpl.java | 5 ++ .../topic/controller/TopicController.java | 20 ++++- .../modules/topic/dao/TopicDao.java | 25 ++++++ .../modules/topic/service/TopicService.java | 23 ++++++ .../topic/service/impl/TopicServiceImpl.java | 13 +++ .../mapper/comment/TopicCommentDao.xml | 56 +++++++++++++ .../main/resources/mapper/group/GroupDao.xml | 12 +++ .../main/resources/mapper/topic/TopicDao.xml | 79 +++++++++++++++++++ 21 files changed, 587 insertions(+), 20 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/ReplyCommentDto.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentListDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicDeleteCommentsFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/UserBaseInfoDto.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupListDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/TopicDetailDTO.java diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/ReplyCommentDto.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/ReplyCommentDto.java new file mode 100644 index 000000000..aa4479148 --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/ReplyCommentDto.java @@ -0,0 +1,24 @@ +package com.elink.esua.epdc.dto.comment; + +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/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..5fb503127 --- /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,60 @@ +package com.elink.esua.epdc.dto.comment; + +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/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/comment/UserBaseInfoDto.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/UserBaseInfoDto.java new file mode 100644 index 000000000..f79ef27dc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/UserBaseInfoDto.java @@ -0,0 +1,28 @@ +package com.elink.esua.epdc.dto.comment; + +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/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/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-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 index d601d9d8a..04c3645a5 100755 --- 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 @@ -26,6 +26,8 @@ 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; @@ -91,4 +93,33 @@ public class TopicCommentController { 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/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 index 33638edec..e97b9616d 100755 --- 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 @@ -18,12 +18,15 @@ package com.elink.esua.epdc.modules.comment.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; +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.modules.comment.entity.TopicCommentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 话题评论表 话题评论表 @@ -66,5 +69,26 @@ public interface TopicCommentDao extends BaseDao { 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); } 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 index cf06ba5c0..97199ca55 100755 --- 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 @@ -20,10 +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.TopicCommentDTO; -import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO; -import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; -import com.elink.esua.epdc.dto.comment.TopicCommentsResultDTO; +import com.elink.esua.epdc.dto.comment.*; import com.elink.esua.epdc.modules.comment.entity.TopicCommentEntity; import java.util.List; @@ -132,4 +129,26 @@ public interface TopicCommentService extends BaseService { * @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); } 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 index 3eefc7772..8ca4230b6 100755 --- 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 @@ -25,10 +25,7 @@ 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.TopicCommentDTO; -import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO; -import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO; -import com.elink.esua.epdc.dto.comment.TopicCommentsResultDTO; +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; @@ -57,9 +54,6 @@ import java.util.Map; @Service public class TopicCommentServiceImpl extends BaseServiceImpl implements TopicCommentService { - @Autowired - private TopicCommentRedis topicCommentRedis; - @Autowired private TopicService topicService; @@ -219,4 +213,18 @@ public class TopicCommentServiceImpl extends BaseServiceImpl 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(); + } } 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 index 978de31df..8aaee74b4 100644 --- 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 @@ -19,6 +19,7 @@ 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; @@ -26,10 +27,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.group.GroupDTO; -import com.elink.esua.epdc.dto.group.GroupDetailDTO; -import com.elink.esua.epdc.dto.group.GroupManagementDTO; -import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; +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; @@ -136,4 +134,19 @@ public class GroupController { 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); + } + } \ 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 index 661c7f075..edd8c7cd0 100644 --- 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 @@ -19,6 +19,7 @@ package com.elink.esua.epdc.modules.group.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.group.GroupDetailDTO; +import com.elink.esua.epdc.dto.group.GroupListDTO; import com.elink.esua.epdc.dto.group.GroupManagementDTO; import com.elink.esua.epdc.dto.group.form.GroupDetailForMobileEndFormDTO; import com.elink.esua.epdc.dto.group.form.GroupsOfMineFormDTO; @@ -105,5 +106,16 @@ public interface GroupDao extends BaseDao { * @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); } \ 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 index 240fc2cec..94c0e767e 100644 --- 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 @@ -20,10 +20,7 @@ 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.GroupDTO; -import com.elink.esua.epdc.dto.group.GroupDetailDTO; -import com.elink.esua.epdc.dto.group.GroupManagementDTO; -import com.elink.esua.epdc.dto.group.GroupSettingStateDTO; +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; @@ -220,4 +217,15 @@ public interface GroupService extends BaseService { */ Result applyForGroup(GroupApplyFormDTO formDto); + /** + * + * 获取网格下所有社群 + * + * @params [deptId] + * @return java.util.List + * @author liuchuang + * @since 2019/11/12 9:33 + */ + List listOfGroupByGridId(Long deptId); + } \ 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 index 5dbb85c05..ace0350a9 100644 --- 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 @@ -306,4 +306,9 @@ public class GroupServiceImpl extends BaseServiceImpl imp return new Result().error(); } + + @Override + public List listOfGroupByGridId(Long deptId) { + return baseDao.selectListOfGroupByGridId(deptId); + } } \ 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/TopicController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java index bdcf2fb91..94a40b202 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java @@ -17,6 +17,7 @@ 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; @@ -27,6 +28,7 @@ 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; @@ -53,8 +55,9 @@ public class TopicController { private TopicService topicService; @GetMapping("page") + @DataFilter(tableAlias = "temp", deptId = "grid_id", prefix = "AND", isPendingCreator = false) public Result> page(@RequestParam Map params){ - PageData page = topicService.page(params); + PageData page = topicService.listTopic(params); return new Result>().ok(page); } @@ -138,4 +141,19 @@ public class TopicController { 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/TopicDao.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/dao/TopicDao.java index b328d6c15..ab96687f0 100644 --- 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 @@ -19,6 +19,8 @@ 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; @@ -26,6 +28,7 @@ import com.elink.esua.epdc.modules.topic.entity.TopicEntity; import org.apache.ibatis.annotations.Mapper; import java.util.List; +import java.util.Map; /** * 话题表 话题表 @@ -74,4 +77,26 @@ public interface TopicDao extends BaseDao { */ 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/service/TopicService.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java index f08365bc8..64a5bba20 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/TopicService.java @@ -22,6 +22,7 @@ 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; @@ -52,6 +53,17 @@ public interface TopicService extends BaseService { */ 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); + /** * 默认查询 * @@ -184,4 +196,15 @@ public interface TopicService extends BaseService { * @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/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java index ca067305e..b03d09a27 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -37,6 +37,7 @@ 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; @@ -97,6 +98,13 @@ public class TopicServiceImpl extends BaseServiceImpl imp 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)); @@ -315,6 +323,11 @@ public class TopicServiceImpl extends BaseServiceImpl imp return new Result(); } + @Override + public TopicDetailDTO getDetail(String id) { + return baseDao.selectOneOfTopic(id); + } + /** * * 话题转议题校验 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 index d994b7b69..ae0b97358 100755 --- 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 @@ -161,4 +161,60 @@ t2.CREATED_TIME DESC + + + + + + + + + + + + + + + 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/group/GroupDao.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/GroupDao.xml index a3a8f33f1..85835483f 100644 --- 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 @@ -164,5 +164,17 @@ AND gp.ID = #{id} + + \ 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 index f2eacb919..b401f16ac 100644 --- 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 @@ -182,4 +182,83 @@ img.IMG_URL + + + + + + + + + + + + + + + + + + From b548799b6259dd615894c4b75e43aad67752ef00 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Tue, 12 Nov 2019 14:39:45 +0800 Subject: [PATCH 45/51] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E6=8B=B7=E8=B4=9D=E8=AF=84=E8=AE=BA=E5=92=8C?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E8=A1=A8=E6=80=81=E5=88=B0=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...dcCommentsAndAttitudeFromTopicFormDTO.java | 28 ++++++++++ .../controller/EventCommentController.java | 15 ++++++ .../comment/service/EventCommentService.java | 12 +++++ .../service/impl/EventCommentServiceImpl.java | 32 +++++++++++ .../service/impl/EpdcEventsServiceImpl.java | 1 + .../dto/topic/form/TopicReviewFormDTO.java | 5 ++ .../modules/async/TopicChangeToIssueTask.java | 53 +++++++++++++++++++ .../modules/comment/dao/TopicCommentDao.java | 25 +++++++++ .../comment/service/TopicCommentService.java | 23 ++++++++ .../service/impl/TopicCommentServiceImpl.java | 11 ++++ .../modules/feign/EventFeignClient.java | 13 +++++ .../fallback/EventFeignClientFallback.java | 6 +++ .../topic/service/impl/TopicServiceImpl.java | 7 +++ .../mapper/comment/TopicCommentDao.xml | 50 +++++++++++++++++ 14 files changed, 281 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/comment/EpdcCommentsAndAttitudeFromTopicFormDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/async/TopicChangeToIssueTask.java 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-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/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 a584e6889..fd7cd6c1d 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 @@ -236,6 +236,7 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl comments = topicCommentService.listCommentForEvent(formDto); + // 获取话题下所有评论的表态 + List attitudes = topicCommentService.listCommentAttitudeForEvent(formDto.getTopicId()); + + EpdcCommentsAndAttitudeFromTopicFormDTO eventFormDto = new EpdcCommentsAndAttitudeFromTopicFormDTO(); + eventFormDto.setComments(comments); + eventFormDto.setAttitudes(attitudes); + + eventFeignClient.receiveTopicCommentAndAttitude(eventFormDto); + } +} 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 index e97b9616d..109ba8125 100755 --- 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 @@ -18,9 +18,12 @@ 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; @@ -91,4 +94,26 @@ public interface TopicCommentDao extends BaseDao { */ 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/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 index 97199ca55..3fb16066f 100755 --- 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 @@ -21,6 +21,7 @@ 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; @@ -151,4 +152,26 @@ public interface TopicCommentService extends BaseService { * @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/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 index 8ca4230b6..ad8b332d7 100755 --- 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 @@ -30,6 +30,7 @@ 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; @@ -227,4 +228,14 @@ public class TopicCommentServiceImpl extends BaseServiceImpl 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/feign/EventFeignClient.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/feign/EventFeignClient.java index 180018a87..d6e88e2e1 100644 --- 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 @@ -2,6 +2,7 @@ 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; @@ -29,4 +30,16 @@ public interface EventFeignClient { */ @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/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 index ca3ff7aa1..7b1a14a38 100644 --- 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 @@ -3,6 +3,7 @@ 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; @@ -18,4 +19,9 @@ public class EventFeignClientFallback implements EventFeignClient { 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/topic/service/impl/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java index b03d09a27..b94c16cd6 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -46,6 +46,7 @@ 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.feign.EventFeignClient; import com.elink.esua.epdc.modules.group.service.GroupService; import com.elink.esua.epdc.modules.group.service.UserGroupService; @@ -89,6 +90,9 @@ public class TopicServiceImpl extends BaseServiceImpl imp @Autowired private EventFeignClient eventFeignClient; + @Autowired + private TopicChangeToIssueTask topicChangeToIssueTask; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -304,6 +308,9 @@ public class TopicServiceImpl extends BaseServiceImpl imp topicUserNotice.setUserId(topicEntity.getUserId()); noticeList.add(topicUserNotice); + + // 拷贝评论、评论的支持反对到事件 + topicChangeToIssueTask.copyCommentsAndAttitudeToEvents(formDto); } else { auditRecordEntity.setState(NumConstant.ZERO); lordNotice.setTitle(GroupNoticeConstant.NOTICE_TOPIC_TO_ISSUE_NOT_PASS); 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 index ae0b97358..136b2a2a0 100755 --- 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 @@ -217,4 +217,54 @@ + + + + From 8648b20d3ae59da5020f49a16eafc2e7531dbddd Mon Sep 17 00:00:00 2001 From: liuchuang Date: Tue, 12 Nov 2019 17:21:56 +0800 Subject: [PATCH 46/51] =?UTF-8?q?=E7=A4=BE=E7=BE=A4=E6=8E=92=E8=A1=8C?= =?UTF-8?q?=E6=A6=9C=E5=90=8E=E5=8F=B0=E6=95=B0=E6=8D=AE=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/group/GroupActivityDTO.java | 27 +++++++ .../dto/group/GroupMemberDTO.java | 29 ++++++++ .../group/controller/GroupController.java | 32 ++++++++ .../modules/group/dao/GroupDao.java | 26 ++++++- .../modules/group/service/GroupService.java | 22 ++++++ .../group/service/impl/GroupServiceImpl.java | 14 ++++ .../main/resources/mapper/group/GroupDao.xml | 74 +++++++++++++++++++ 7 files changed, 221 insertions(+), 3 deletions(-) create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupActivityDTO.java create mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/GroupMemberDTO.java 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/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-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 index 8aaee74b4..ff7518ae6 100644 --- 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 @@ -149,4 +149,36 @@ public class GroupController { 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/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 index edd8c7cd0..5524f1baa 100644 --- 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 @@ -18,9 +18,7 @@ package com.elink.esua.epdc.modules.group.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; -import com.elink.esua.epdc.dto.group.GroupDetailDTO; -import com.elink.esua.epdc.dto.group.GroupListDTO; -import com.elink.esua.epdc.dto.group.GroupManagementDTO; +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; @@ -117,5 +115,27 @@ public interface GroupDao extends BaseDao { * @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/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 index 94c0e767e..0fb53fbd3 100644 --- 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 @@ -228,4 +228,26 @@ public interface GroupService extends BaseService { */ 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/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 index ace0350a9..c26dc6cba 100644 --- 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 @@ -311,4 +311,18 @@ public class GroupServiceImpl extends BaseServiceImpl imp 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/resources/mapper/group/GroupDao.xml b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/group/GroupDao.xml index 85835483f..8e6021827 100644 --- 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 @@ -176,5 +176,79 @@ AND GRID_ID = #{deptId} + + + \ No newline at end of file From 25e2140758f4002f3a6b6637a1412eb6b73d2ba8 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Wed, 13 Nov 2019 11:21:27 +0800 Subject: [PATCH 47/51] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc-events/epdc-events-client/pom.xml | 5 ---- .../service/impl/EpdcEventsServiceImpl.java | 16 +++++----- .../epdc/modules/feign/GroupFeignClient.java | 8 ++--- .../fallback/GroupFeignClientFallback.java | 12 ++++---- .../issue/service/impl/IssueServiceImpl.java | 15 ++++------ .../dto/comment/ReplyCommentDto.java | 24 --------------- .../dto/comment/TopicCommentListDTO.java | 2 ++ .../comment/TopicCommentStatementFormDTO.java | 1 - .../comment/TopicCommentUserAttitudeDTO.java | 2 +- .../dto/comment/UserBaseInfoDto.java | 28 ----------------- .../dto/group/UserReviewDto.java | 1 - .../dto/topic/ReplyCommentDto.java | 2 +- .../dto/topic/TopicCommentsDTO.java | 2 -- .../dto/topic/UserBaseInfoDto.java | 2 +- .../dto/topic/form/TopicListFormDTO.java | 1 - .../modules/async/TopicChangeToIssueTask.java | 14 +-------- .../TopicCommentUserAttitudeController.java | 2 +- .../TopicCommentUserAttitudeService.java | 2 +- .../TopicCommentUserAttitudeServiceImpl.java | 2 +- .../topic/controller/TopicController.java | 7 ++++- .../topic/service/impl/TopicServiceImpl.java | 30 ++++++++++++++++++- 21 files changed, 66 insertions(+), 112 deletions(-) delete mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/ReplyCommentDto.java delete mode 100644 esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/UserBaseInfoDto.java diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml b/esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml index fb435817c..0fee0b718 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml @@ -33,11 +33,6 @@ epdc-websocket-client 1.0.0 - - com.esua.epdc - epdc-group-client - 1.0.0 - diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-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 fd7cd6c1d..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 @@ -34,13 +34,11 @@ import com.elink.esua.epdc.constant.ImageConstant; import com.elink.esua.epdc.constants.MenuCodeConstant; import com.elink.esua.epdc.dto.MenuNoticeDTO; import com.elink.esua.epdc.dto.SysDeptDTO; -import com.elink.esua.epdc.dto.enums.TopicStateEnum; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; import com.elink.esua.epdc.dto.events.*; import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; import com.elink.esua.epdc.dto.events.form.EpdcEventsReviewFormDTO; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; -import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO; import com.elink.esua.epdc.modules.async.DeptRespondTask; import com.elink.esua.epdc.modules.async.NewsTask; import com.elink.esua.epdc.modules.events.dao.EpdcEventsDao; @@ -233,17 +231,17 @@ 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)) { - formDto.setState(TopicStateEnum.TOPIC_STATE_IN_CONVERSATION.getValue()); + callbackMap.put("state", NumConstant.ZERO_STR); } else if (dto.getEventState().equals(EventIssueItemState.EVENT_REVIEW_PASS)) { - formDto.setState(TopicStateEnum.TOPIC_STATE_CHANGED_ISSUE.getValue()); + callbackMap.put("state", "10"); } - groupFeignClient.reviewCallback(formDto); + groupFeignClient.reviewCallback(callbackMap); } @Override diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/GroupFeignClient.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/GroupFeignClient.java index 9d1fa4c4e..d4d92b0c7 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/GroupFeignClient.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/feign/GroupFeignClient.java @@ -2,13 +2,13 @@ package com.elink.esua.epdc.modules.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.topic.TopicDTO; -import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO; import com.elink.esua.epdc.modules.feign.fallback.GroupFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; +import java.util.Map; + /** * * 社群模块调用 @@ -29,7 +29,7 @@ public interface GroupFeignClient { * @since 2019/11/11 10:36 */ @PostMapping(value = "group/topic/reviewCallback", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) - Result reviewCallback(TopicReviewFormDTO formDto); + Result reviewCallback(Map callbackMap); /** * @@ -41,6 +41,6 @@ public interface GroupFeignClient { * @since 2019/11/11 13:31 */ @PostMapping(value = "group/topic/modifyState", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) - Result modifyTopicState(TopicDTO formDto); + 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 index 0d85f29e6..8ec25bf14 100644 --- 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 @@ -3,11 +3,11 @@ package com.elink.esua.epdc.modules.feign.fallback; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.topic.TopicDTO; -import com.elink.esua.epdc.dto.topic.form.TopicReviewFormDTO; import com.elink.esua.epdc.modules.feign.GroupFeignClient; import org.springframework.stereotype.Component; +import java.util.Map; + /** * @Author:liuchuang * @Date:2019/11/11 10:31 @@ -16,12 +16,12 @@ import org.springframework.stereotype.Component; public class GroupFeignClientFallback implements GroupFeignClient { @Override - public Result reviewCallback(TopicReviewFormDTO formDto) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "reviewCallback", formDto); + public Result reviewCallback(Map callbackMap) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "reviewCallback", callbackMap); } @Override - public Result modifyTopicState(TopicDTO formDto) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "modifyTopicState", formDto); + 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/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 6a41766b9..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 @@ -33,14 +33,12 @@ import com.elink.esua.epdc.constant.EventIssueItemState; import com.elink.esua.epdc.constant.EventsNoticeConstant; import com.elink.esua.epdc.constants.MenuCodeConstant; import com.elink.esua.epdc.dto.MenuNoticeDTO; -import com.elink.esua.epdc.dto.enums.TopicStateEnum; import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; import com.elink.esua.epdc.dto.events.EpdcEventsCommentsDTO; import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; import com.elink.esua.epdc.dto.issue.*; import com.elink.esua.epdc.dto.issue.form.*; import com.elink.esua.epdc.dto.issue.result.*; -import com.elink.esua.epdc.dto.topic.TopicDTO; import com.elink.esua.epdc.modules.async.DeptRespondTask; import com.elink.esua.epdc.modules.async.NewsTask; import com.elink.esua.epdc.modules.comment.service.EventCommentService; @@ -62,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.*; /** * 议题表 议题表 @@ -222,10 +217,10 @@ public class IssueServiceImpl extends BaseServiceImpl imp // 事件来源-友邻社群 if (StringUtils.isNotEmpty(entity.getGroupId())) { // 更新话题状态 - TopicDTO formDto = new TopicDTO(); - formDto.setId(entity.getTopicId()); - formDto.setState(TopicStateEnum.TOPIC_STATE_CHANGED_ITEM.getValue()); - groupFeignClient.modifyTopicState(formDto); + Map map = new HashMap<>(); + map.put("topicId", entity.getTopicId()); + map.put("state", "15"); + groupFeignClient.modifyTopicState(map); } // 发送菜单消息-待处理项目 itemService.sendItemHandleMenuNotice(itemEntity.getGridId(), null); diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/ReplyCommentDto.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/ReplyCommentDto.java deleted file mode 100644 index aa4479148..000000000 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/ReplyCommentDto.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.elink.esua.epdc.dto.comment; - -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/comment/TopicCommentListDTO.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/TopicCommentListDTO.java index 5fb503127..a13fcaa55 100644 --- 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 @@ -1,5 +1,7 @@ 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; 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 index 3dec40053..4e2e1fa0f 100755 --- 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 @@ -18,7 +18,6 @@ package com.elink.esua.epdc.dto.comment; import java.io.Serializable; -import java.util.Date; import lombok.Data; 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 index 00b52b119..df61b235c 100755 --- 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 @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.elink.esua.epdc.dto; +package com.elink.esua.epdc.dto.comment; import java.io.Serializable; import java.util.Date; diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/UserBaseInfoDto.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/UserBaseInfoDto.java deleted file mode 100644 index f79ef27dc..000000000 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/comment/UserBaseInfoDto.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.elink.esua.epdc.dto.comment; - -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/group/UserReviewDto.java b/esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/UserReviewDto.java index f469d3fef..f712861dc 100644 --- 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 @@ -2,7 +2,6 @@ package com.elink.esua.epdc.dto.group; import lombok.Data; -import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; 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 index ca6289bcf..c95459eed 100644 --- 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 @@ -1,4 +1,4 @@ -package com.elink.esua.epdc.dto.events; +package com.elink.esua.epdc.dto.topic; import lombok.Data; 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 index 23ad2c0b6..81e30103c 100644 --- 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 @@ -1,7 +1,5 @@ package com.elink.esua.epdc.dto.topic; -import com.elink.esua.epdc.dto.events.ReplyCommentDto; -import com.elink.esua.epdc.dto.events.UserBaseInfoDto; import lombok.Data; import java.io.Serializable; 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 index 298bd7127..0dc771654 100644 --- 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 @@ -1,4 +1,4 @@ -package com.elink.esua.epdc.dto.events; +package com.elink.esua.epdc.dto.topic; import lombok.Data; 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 index 33b3cd778..7be27cfe6 100644 --- 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 @@ -3,7 +3,6 @@ package com.elink.esua.epdc.dto.topic.form; import lombok.Data; import javax.validation.constraints.Min; -import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Date; 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 index 6d440cc32..10a4a832e 100644 --- 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 @@ -22,9 +22,6 @@ import java.util.List; @Component public class TopicChangeToIssueTask { - @Autowired - private TopicCommentService topicCommentService; - @Autowired private EventFeignClient eventFeignClient; @@ -38,16 +35,7 @@ public class TopicChangeToIssueTask { * @since 2019/11/12 13:32 */ @Async - public 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); - + 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/TopicCommentUserAttitudeController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/comment/controller/TopicCommentUserAttitudeController.java index a76be530d..12e54fdd0 100755 --- 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 @@ -25,7 +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.TopicCommentUserAttitudeDTO; +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; 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 index 37d4d04f9..03f5eae9e 100755 --- 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 @@ -19,8 +19,8 @@ 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.TopicCommentUserAttitudeDTO; 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; 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 index 8fd052268..10f97d91d 100755 --- 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 @@ -24,9 +24,9 @@ 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.TopicCommentUserAttitudeDTO; 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; diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java index 94a40b202..38fb4b3dd 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/controller/TopicController.java @@ -122,7 +122,12 @@ public class TopicController { * @since 2019/11/11 10:48 */ @PostMapping("reviewCallback") - public Result reviewCallback(@RequestBody TopicReviewFormDTO formDto) { + 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); } diff --git a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java index b94c16cd6..4e3858466 100644 --- a/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java @@ -26,6 +26,9 @@ 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; @@ -47,6 +50,7 @@ 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; @@ -90,6 +94,9 @@ public class TopicServiceImpl extends BaseServiceImpl imp @Autowired private EventFeignClient eventFeignClient; + @Autowired + private TopicCommentService topicCommentService; + @Autowired private TopicChangeToIssueTask topicChangeToIssueTask; @@ -310,7 +317,7 @@ public class TopicServiceImpl extends BaseServiceImpl imp noticeList.add(topicUserNotice); // 拷贝评论、评论的支持反对到事件 - topicChangeToIssueTask.copyCommentsAndAttitudeToEvents(formDto); + this.copyCommentsAndAttitudeToEvents(formDto); } else { auditRecordEntity.setState(NumConstant.ZERO); lordNotice.setTitle(GroupNoticeConstant.NOTICE_TOPIC_TO_ISSUE_NOT_PASS); @@ -363,4 +370,25 @@ public class TopicServiceImpl extends BaseServiceImpl imp 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); + } + } From 8b96a45fc61e57a6ea19ee8ce5c0a382e9b38f96 Mon Sep 17 00:00:00 2001 From: liuchuang Date: Thu, 14 Nov 2019 16:54:37 +0800 Subject: [PATCH 48/51] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- esua-epdc/doc/db/dev_1114/esua_epdc_admin.sql | 22 +++++++++++ .../doc/db/dev_1114/esua_epdc_events.sql | 18 +++++++++ esua-epdc/doc/db/dev_1114/esua_epdc_user.sql | 39 +++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 esua-epdc/doc/db/dev_1114/esua_epdc_admin.sql create mode 100644 esua-epdc/doc/db/dev_1114/esua_epdc_events.sql create mode 100644 esua-epdc/doc/db/dev_1114/esua_epdc_user.sql 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 From 2e9903a0b8af78289ed113bf7e99549d8b9d7f1a Mon Sep 17 00:00:00 2001 From: yinzuomei Date: Mon, 18 Nov 2019 10:51:30 +0800 Subject: [PATCH 49/51] =?UTF-8?q?=E6=97=A5=E5=BF=97=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=AC=AC=E4=B8=89=E6=96=B9=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=97=A5=E5=BF=97=E5=88=97=E8=A1=A8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/interfacelog/InterfaceLogDTO.java | 96 +++++++++++++++++ .../controller/InterfaceLogController.java | 94 ++++++++++++++++ .../interfacelog/dao/InterfaceLogDao.java | 42 ++++++++ .../entity/InterfaceLogEntity.java | 69 ++++++++++++ .../interfacelog/excel/InterfaceLogExcel.java | 71 ++++++++++++ .../interfacelog/redis/InterfaceLogRedis.java | 47 ++++++++ .../service/InterfaceLogService.java | 95 ++++++++++++++++ .../service/impl/InterfaceLogServiceImpl.java | 101 ++++++++++++++++++ .../mapper/interfacelog/InterfaceLogDao.xml | 61 +++++++++++ 9 files changed, 676 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/interfacelog/InterfaceLogDTO.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/controller/InterfaceLogController.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/dao/InterfaceLogDao.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/entity/InterfaceLogEntity.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/excel/InterfaceLogExcel.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/redis/InterfaceLogRedis.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/service/InterfaceLogService.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/interfacelog/service/impl/InterfaceLogServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/interfacelog/InterfaceLogDao.xml 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-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/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 @@ + + + + + + + + + + + + + + + + + + + + + + + From 77463874e19af877448809ac9c45e28d958712fb Mon Sep 17 00:00:00 2001 From: gupeng Date: Mon, 18 Nov 2019 14:05:28 +0800 Subject: [PATCH 50/51] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E5=85=9A=E5=91=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/PartyAuthenticationFailedDTO.java | 166 ++++++++++++++++++ .../PartyAuthenticationFailedController.java | 94 ++++++++++ .../dao/PartyAuthenticationFailedDao.java | 45 +++++ .../PartyAuthenticationFailedEntity.java | 136 ++++++++++++++ .../excel/PartyAuthenticationFailedExcel.java | 113 ++++++++++++ .../redis/PartyAuthenticationFailedRedis.java | 47 +++++ .../PartyAuthenticationFailedService.java | 95 ++++++++++ .../PartyAuthenticationFailedServiceImpl.java | 101 +++++++++++ .../mapper/PartyAuthenticationFailedDao.xml | 57 ++++++ 9 files changed, 854 insertions(+) create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/PartyAuthenticationFailedDTO.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/PartyAuthenticationFailedController.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/PartyAuthenticationFailedDao.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/PartyAuthenticationFailedEntity.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/PartyAuthenticationFailedExcel.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/PartyAuthenticationFailedRedis.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/PartyAuthenticationFailedService.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PartyAuthenticationFailedServiceImpl.java create mode 100644 esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/PartyAuthenticationFailedDao.xml 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-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/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/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/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 From c98d9b34fb7d77383c1b8e5ec38e728590b5188a Mon Sep 17 00:00:00 2001 From: yujintao Date: Mon, 18 Nov 2019 15:17:59 +0800 Subject: [PATCH 51/51] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epdc/commons/tools/enums/UserSexEnum.java | 38 +++++++++++ .../dto/form/EpdcCompleteUserInfoFormDTO.java | 6 ++ .../epdc/service/impl/AppUserServiceImpl.java | 3 - .../java/com/elink/esua/epdc/dto/UserDTO.java | 3 +- .../esua/epdc/enums/AppUserStatesEnum.java | 7 +- .../epdc/service/impl/UserServiceImpl.java | 64 ++++++++++--------- .../src/main/resources/mapper/UserDao.xml | 2 +- 7 files changed, 88 insertions(+), 35 deletions(-) create mode 100644 esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/enums/UserSexEnum.java 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-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/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 b194fb544..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 @@ -750,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-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/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/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 441c36db3..58b849898 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,12 +24,14 @@ 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; @@ -43,6 +45,7 @@ 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.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; @@ -411,14 +414,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); @@ -431,6 +426,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) { @@ -440,9 +438,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(); @@ -454,30 +449,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/UserDao.xml b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDao.xml index 00c33957c..1938249af 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