From 654039601fc5d07b4e34d52db764d8f533aec030 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 3 Nov 2020 10:37:57 +0800 Subject: [PATCH 001/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/2020-11-03_badege.sql | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/2020-11-03_badege.sql diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/2020-11-03_badege.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/2020-11-03_badege.sql new file mode 100644 index 0000000000..0e605aa9ab --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/2020-11-03_badege.sql @@ -0,0 +1,199 @@ +/* + Navicat Premium Data Transfer + + Source Server : 亿联开发 + Source Server Type : MySQL + Source Server Version : 50728 + Source Host : 192.168.1.130:3306 + Source Schema : epmet_user + + Target Server Type : MySQL + Target Server Version : 50728 + File Encoding : 65001 + + Date: 03/11/2020 10:36:00 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for badege +-- ---------------------------- +DROP TABLE IF EXISTS `badege`; +CREATE TABLE `badege` +( + `ID` varchar(64) NOT NULL COMMENT '主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default', + `BADEGE_NAME` varchar(32) NOT NULL COMMENT '徽章名称', + `BADEGE_ICON` varchar(256) NOT NULL COMMENT '徽章图标url', + `FIXATION_BADEGE_TYPE` varchar(32) NOT NULL DEFAULT 'none' COMMENT '固有徽章类型 前端页面跳转标识,党员徽章:party;无:none', + `BADEGE_STATUS` varchar(16) NOT NULL COMMENT '状态 上线:online;下线:offline;', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除', + `REVISION` int(11) NOT NULL 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 '更新时间', + PRIMARY KEY (`ID`, `CUSTOMER_ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='徽章'; + +-- ---------------------------- +-- Records of badege +-- ---------------------------- +BEGIN; +INSERT INTO `badege` +VALUES ('1', 'default', '党员徽章', + 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20200909/e4935b1f790b4d4e91ac9190a47120bb.jpg', + 'party', 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:52', 'APP_USER', '2020-11-03 10:34:00'); +INSERT INTO `badege` +VALUES ('2', 'default', '人大代表徽章', + 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20200909/e4935b1f790b4d4e91ac9190a47120bb.jpg', + 'none', 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:52', 'APP_USER', '2020-11-03 10:34:00'); +INSERT INTO `badege` +VALUES ('3', 'default', '政协委员徽章', + 'https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20200909/e4935b1f790b4d4e91ac9190a47120bb.jpg', + 'none', 'online', '0', 0, 'APP_USER', '2020-11-03 10:33:52', 'APP_USER', '2020-11-03 10:34:00'); +COMMIT; + +-- ---------------------------- +-- Table structure for badege_certification_config +-- ---------------------------- +DROP TABLE IF EXISTS `badege_certification_config`; +CREATE TABLE `badege_certification_config` +( + `ID` varchar(64) NOT NULL COMMENT '主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default', + `BADEGE_ID` varchar(64) NOT NULL COMMENT '徽章ID', + `CERTIFICATION_TYPE` varchar(16) NOT NULL COMMENT '认证信息类型 手机号:mobile;全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除', + `REVISION` int(11) NOT NULL 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 '更新时间', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='徽章认证配置'; + +-- ---------------------------- +-- Records of badege_certification_config +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for badege_certification_config_field +-- ---------------------------- +DROP TABLE IF EXISTS `badege_certification_config_field`; +CREATE TABLE `badege_certification_config_field` +( + `ID` varchar(64) NOT NULL, + `CN_NAME` varchar(64) NOT NULL COMMENT '中文名', + `EN_NAME` varchar(64) NOT NULL COMMENT '英文名(字段名)', + `FIELD_TYPE` varchar(32) NOT NULL COMMENT '字段类型 img:图片,text:文本', + `IS_REQUIRED` tinyint(1) NOT NULL COMMENT '是否必填', + `CERTIFICATION_TYPE` varchar(255) NOT NULL COMMENT '认证信息类型', + `SORT` int(10) NOT NULL COMMENT '字段排序', + `DEL_FLAG` int(11) DEFAULT NULL COMMENT '删除标识 1删除0未删除', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT =' 徽章认证配置字段表\n'; + +-- ---------------------------- +-- Records of badege_certification_config_field +-- ---------------------------- +BEGIN; +INSERT INTO `badege_certification_config_field` +VALUES ('a5be5d931cf411eb8dcfc03fd56f7847', '手机号', 'mobile', 'text', 1, 'mobile', 3, 0, 0, 'APP_USER', + '2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06'); +INSERT INTO `badege_certification_config_field` +VALUES ('a5c01dd81cf411eb8dcfc03fd56f7847', '姓', 'subName', 'text', 1, 'fullName', 0, 0, 0, 'APP_USER', + '2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06'); +INSERT INTO `badege_certification_config_field` +VALUES ('a5c01de81cf411eb8dcfc03fd56f7847', '名', 'name', 'text', 1, 'fullName', 1, 0, 0, 'APP_USER', + '2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06'); +INSERT INTO `badege_certification_config_field` +VALUES ('a5c22e511cf411eb8dcfc03fd56f7847', '身份证', 'idcard', 'text', 1, 'idcard', 2, 0, 0, 'APP_USER', + '2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06'); +INSERT INTO `badege_certification_config_field` +VALUES ('a5c4c2c11cf411eb8dcfc03fd56f7847', '认证证件', 'certificate', 'img', 1, 'certificate', 4, 0, 0, 'APP_USER', + '2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06'); +INSERT INTO `badege_certification_config_field` +VALUES ('a5c608301cf411eb8dcfc03fd56f7847', '认证说明(备注)', 'remark', 'text', 1, 'remark', 5, 0, 0, 'APP_USER', + '2020-11-02 18:14:02', 'APP_USER', '2020-11-02 18:14:06'); +COMMIT; + +-- ---------------------------- +-- Table structure for resi_user_badege +-- ---------------------------- +DROP TABLE IF EXISTS `resi_user_badege`; +CREATE TABLE `resi_user_badege` +( + `ID` varchar(64) NOT NULL COMMENT '主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id 默认配置id:default', + `GRID_ID` varchar(64) NOT NULL COMMENT '用户注册网格ID', + `USER_ID` varchar(64) NOT NULL COMMENT '用户ID', + `BADEGE_ID` varchar(64) NOT NULL COMMENT '徽章ID', + `IS_OPENED` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开启(点亮) 1:点亮;0:未点亮', + `CERTIFICATION_AUTID_STATUS` varchar(16) NOT NULL DEFAULT 'auditing' COMMENT '认证(审核)状态 待审核:auditing;审核通过:pass;驳回:rejected;', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除', + `REVISION` int(11) NOT NULL 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 '更新时间', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='用户徽章关系表'; + +-- ---------------------------- +-- Records of resi_user_badege +-- ---------------------------- +BEGIN; +COMMIT; + +-- ---------------------------- +-- Table structure for user_badege_certificate_record +-- ---------------------------- +DROP TABLE IF EXISTS `user_badege_certificate_record`; +CREATE TABLE `user_badege_certificate_record` +( + `ID` varchar(64) NOT NULL COMMENT '主键ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id ', + `GRID_ID` varchar(64) NOT NULL COMMENT '用户注册网格ID', + `USER_ID` varchar(64) NOT NULL COMMENT '用户ID', + `BADEGE_ID` varchar(64) NOT NULL COMMENT '徽章ID', + `SURNAME` varchar(8) DEFAULT NULL COMMENT '姓', + `NAME` varchar(16) DEFAULT NULL COMMENT '名', + `ID_NUM` varchar(32) DEFAULT NULL COMMENT '身份证号 网格内去重', + `CERTIFICATION_IMG` varchar(512) DEFAULT NULL COMMENT '认证证件图片', + `REMAEK` varchar(128) DEFAULT NULL COMMENT '认证说明(备注)', + `AUDIT_STATUS` varchar(32) NOT NULL DEFAULT 'auditing' COMMENT '审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中', + `AUDIT_REMARK` varchar(128) DEFAULT NULL COMMENT '审核意见', + `STAFF_ID` varchar(32) DEFAULT NULL COMMENT '审核人 审核人Id', + `AUDIT_TIME` datetime DEFAULT NULL COMMENT '审核时间', + `DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除', + `REVISION` int(11) NOT NULL 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 '更新时间', + PRIMARY KEY (`ID`), + KEY `IDX_USER_ID` (`USER_ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='用户认证徽章记录表'; + +-- ---------------------------- +-- Records of user_badege_certificate_record +-- ---------------------------- +BEGIN; +COMMIT; + +SET FOREIGN_KEY_CHECKS = 1; From d4037cae2e9992dd0a95e77e7c6389b770329f92 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 3 Nov 2020 11:01:19 +0800 Subject: [PATCH 002/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0controller=EF=BC=8Cse?= =?UTF-8?q?rvice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/badege/controller/BadgeController.java | 13 +++++++++++++ .../epmet/modules/badege/service/BadgeService.java | 8 ++++++++ .../badege/service/impl/BadgeServiceImpl.java | 14 ++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java new file mode 100644 index 0000000000..9d98bfa74a --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java @@ -0,0 +1,13 @@ +package com.epmet.modules.badege.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author zxc + * @DateTime 2020/11/3 10:42 上午 + */ +@RestController +@RequestMapping("badge") +public class BadgeController { +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java new file mode 100644 index 0000000000..18c5f38926 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java @@ -0,0 +1,8 @@ +package com.epmet.modules.badege.service; + +/** + * @Author zxc + * @DateTime 2020/11/3 10:52 上午 + */ +public interface BadgeService { +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java new file mode 100644 index 0000000000..6a848eb868 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java @@ -0,0 +1,14 @@ +package com.epmet.modules.badege.service.impl; + +import com.epmet.modules.badege.service.BadgeService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @DateTime 2020/11/3 10:53 上午 + */ +@Service +@Slf4j +public class BadgeServiceImpl implements BadgeService { +} From 854e23d32c8a38802b7648176a870aa802a23a1e Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 3 Nov 2020 14:35:51 +0800 Subject: [PATCH 003/125] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83-?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mine/dto/result/InitInfoResultDTO.java | 39 +++++++++++++ .../controller/PersonalCenterController.java | 55 +++++++++++++++++++ .../mine/service/PersonalCenterService.java | 17 ++++++ .../impl/PersonalCenterServiceImpl.java | 51 +++++++++++++++++ .../com/epmet/dto/form/EditInfoFormDTO.java | 52 ++++++++++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 10 ++++ .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../controller/UserResiInfoController.java | 18 ++++-- .../java/com/epmet/dao/UserResiInfoDao.java | 9 +++ .../epmet/service/UserResiInfoService.java | 14 +++-- .../service/impl/UserResiInfoServiceImpl.java | 18 ++++++ .../main/resources/mapper/UserResiInfoDao.xml | 10 ++++ 12 files changed, 290 insertions(+), 8 deletions(-) create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/PersonalCenterService.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java new file mode 100644 index 0000000000..f89028a9dd --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/InitInfoResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.resi.mine.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/3 9:58 + */ +@Data +public class InitInfoResultDTO implements Serializable { + private static final long serialVersionUID = 144944007101324497L; + /** + * 头像 + */ + private String headImgUrl; + /** + * 姓 + */ + private String surname; + /** + * 名 + */ + private String name; + /** + * 路牌号 + */ + private String street; + /** + * 小区名称 + */ + private String district; + /** + * 详细地址 + */ + private String buildingAddress; +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java new file mode 100644 index 0000000000..61c538fbdc --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java @@ -0,0 +1,55 @@ +package com.epmet.modules.mine.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.EditInfoFormDTO; +import com.epmet.modules.mine.service.PersonalCenterService; +import com.epmet.resi.mine.dto.result.InitInfoResultDTO; +import lombok.extern.slf4j.Slf4j; +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 zhaoqifeng + * @date 2020/11/3 9:48 + */ +@Slf4j +@RestController +@RequestMapping("personalcenter") +public class PersonalCenterController { + @Autowired + private PersonalCenterService personalCenterService; + + /** + * 修改信息页面初始化 + * @author zhaoqifeng + * @date 2020/11/3 10:03 + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("initinfo") + public Result initInfo(@LoginUser TokenDto tokenDto) { + InitInfoResultDTO resultDTO = personalCenterService.initInfo(tokenDto); + return new Result().ok(resultDTO); + + } + + /** + * 修改信息 + * @author zhaoqifeng + * @date 2020/11/3 10:03 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("editinfo") + public Result editInfo(@LoginUser TokenDto tokenDto, @RequestBody EditInfoFormDTO formDTO) { + personalCenterService.editInfo(tokenDto, formDTO); + return new Result(); + } +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/PersonalCenterService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/PersonalCenterService.java new file mode 100644 index 0000000000..219edb8c86 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/PersonalCenterService.java @@ -0,0 +1,17 @@ +package com.epmet.modules.mine.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.EditInfoFormDTO; +import com.epmet.resi.mine.dto.result.InitInfoResultDTO; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/3 9:50 + */ +public interface PersonalCenterService { + + InitInfoResultDTO initInfo(TokenDto tokenDto); + + void editInfo(TokenDto tokenDto, EditInfoFormDTO formDTO); +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java new file mode 100644 index 0000000000..142d82d6dd --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java @@ -0,0 +1,51 @@ +package com.epmet.modules.mine.service.impl; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.EditInfoFormDTO; +import com.epmet.dto.result.ResiUserBaseInfoResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.modules.mine.service.PersonalCenterService; +import com.epmet.resi.mine.dto.result.InitInfoResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/3 9:50 + */ +@Slf4j +@Service +public class PersonalCenterServiceImpl implements PersonalCenterService { + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Override + public InitInfoResultDTO initInfo(TokenDto tokenDto) { + Result baseInfoResult = epmetUserOpenFeignClient.selectUserBaseInfo(tokenDto); + if (!baseInfoResult.success()) { + throw new RenException(baseInfoResult.getCode(), baseInfoResult.getMsg()); + } + InitInfoResultDTO resultDTO = new InitInfoResultDTO(); + resultDTO.setHeadImgUrl(baseInfoResult.getData().getHeadImgUrl()); + resultDTO.setSurname(baseInfoResult.getData().getSurname()); + resultDTO.setName(baseInfoResult.getData().getName()); + resultDTO.setStreet(baseInfoResult.getData().getStreet()); + resultDTO.setDistrict(baseInfoResult.getData().getDistrict()); + resultDTO.setBuildingAddress(baseInfoResult.getData().getBuildingAddress()); + return resultDTO; + } + + @Override + public void editInfo(TokenDto tokenDto, EditInfoFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + Result result = epmetUserOpenFeignClient.editUserInfo(formDTO); + if (!result.success()) { + throw new RenException(result.getCode(), result.getMsg()); + } + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java new file mode 100644 index 0000000000..d6d9655b88 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/3 9:55 + */ +@NoArgsConstructor +@Data +public class EditInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 1280489016677129419L; + /** + * 头像 + */ + @NotBlank(message = "头像不能为空") + private String userId; + /** + * 头像 + */ + @NotBlank(message = "头像不能为空") + private String headImgUrl; + /** + * 姓 + */ + @NotBlank(message = "姓不能为空") + private String surname; + /** + * 名 + */ + @NotBlank(message = "名不能为空") + private String name; + /** + * 路牌号 + */ + @NotBlank(message = "路牌号不能为空") + private String street; + /** + * 小区名称 + */ + private String district; + /** + * 详细地址 + */ + private String buildingAddress; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 5f7c301ad0..2c7d2555cd 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -327,4 +327,14 @@ public interface EpmetUserOpenFeignClient { **/ @PostMapping(value = "epmetuser/staffagencyvisited/getstaffbasicinfo") Result getStaffBasicInfo(@RequestBody StaffBasicInfoFormDTO formDTO); + + /** + * 修改个人信息 + * @author zhaoqifeng + * @date 2020/11/3 10:28 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/epmetuser/userresiinfo/edituserinfo") + Result editUserInfo(@RequestBody EditInfoFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 64985eab15..a2de76e587 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -220,4 +220,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result getStaffBasicInfo(StaffBasicInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffBasicInfo", formDTO); } + + @Override + public Result editUserInfo(EditInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editUserInfo", formDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java index 56a75d64cc..68aea3d580 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java @@ -26,10 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.UserResiInfoDTO; -import com.epmet.dto.form.IssueInitiatorFormDTO; -import com.epmet.dto.form.UserResiInfoFormDTO; -import com.epmet.dto.form.UserResiInfoListFormDTO; -import com.epmet.dto.form.VerificationCodeFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.IssueInitiatorResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.excel.UserResiInfoExcel; @@ -163,4 +160,17 @@ public class UserResiInfoController { return new Result().ok(userResiInfoService.selectIssueInitiator(formDTO)); } + /** + * 修改个人信息 + * @author zhaoqifeng + * @date 2020/11/3 10:28 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("edituserinfo") + public Result editUserInfo(@RequestBody EditInfoFormDTO formDTO) { + userResiInfoService.editUserInfo(formDTO); + return new Result(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java index fee5c2730b..59d42dfc6e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java @@ -87,4 +87,13 @@ public interface UserResiInfoDao extends BaseDao { * @Date 2020/7/22 10:58 **/ UserResiInfoDTO selectByUserId(String userId); + + /** + * 根据用户ID更新 + * @author zhaoqifeng + * @date 2020/11/3 14:16 + * @param entity + * @return void + */ + void updateByUserId(UserResiInfoEntity entity); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java index d01c706fd5..11fff3816b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java @@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserResiInfoDTO; -import com.epmet.dto.form.IssueInitiatorFormDTO; -import com.epmet.dto.form.UserResiInfoFormDTO; -import com.epmet.dto.form.UserResiInfoListFormDTO; -import com.epmet.dto.form.VerificationCodeFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.IssueInitiatorResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.entity.UserResiInfoEntity; @@ -151,4 +148,13 @@ public interface UserResiInfoService extends BaseService { * @date 2020/5/11 10:59 */ IssueInitiatorResultDTO selectIssueInitiator(IssueInitiatorFormDTO formDTO); + + /** + * 修改个人信息 + * @author zhaoqifeng + * @date 2020/11/3 10:29 + * @param formDTO + * @return void + */ + void editUserInfo(EditInfoFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index e8148b7418..c86ed47eaf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -325,4 +325,22 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl + + update user_resi_info set + SURNAME = #{surname}, + NAME = #{name}, + STREET = #{street}, + DISTRICT = #{district}, + BUILDING_ADDRESS = #{buildingAddress} + where USER_ID = #{userId} + and DEL_FLAG = '0' + + SELECT + ub.BADGE_ID, + ub.IS_OPENED + FROM + resi_user_badge ub + WHERE + ub.DEL_FLAG = 0 + AND ub.CERTIFICATION_AUTID_STATUS = 'pass' + AND ub.IS_OPENED = 1 + AND ub.CUSTOMER_ID = #{customerId} + AND ub.USER_ID = #{userId} + ORDER BY ub.UPDATED_TIME DESC + + + + + + + From c5dadab50bfeace1bdde0e85601256d064f1b08e Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 3 Nov 2020 16:03:57 +0800 Subject: [PATCH 005/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../badege/service/impl/BadgeServiceImpl.java | 17 ++++++++++++++++- .../epmet/feign/EpmetUserOpenFeignClient.java | 10 ++++++++++ .../EpmetUserOpenFeignClientFallback.java | 5 +++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java index 3d6c5f02d2..e78f745c40 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java @@ -1,5 +1,10 @@ package com.epmet.modules.badege.service.impl; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.UserBadgeListFormDTO; +import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.badege.service.BadgeService; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; @@ -8,6 +13,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -23,6 +29,15 @@ public class BadgeServiceImpl implements BadgeService { @Override public List getBadgeList(BadgeListFormDTO badgeListFormDTO) { - return null; + UserBadgeListFormDTO form = ConvertUtils.sourceToTarget(badgeListFormDTO, UserBadgeListFormDTO.class); + Result> listResult = epmetUserOpenFeignClient.selectBadgeList(form); + if (!listResult.success()){ + throw new RenException("获取徽章点亮列表失败......"); + } + if (null == listResult.getData()){ + return new ArrayList<>(); + } + List result = ConvertUtils.sourceToTarget(listResult.getData(), BadgeListResultDTO.class); + return result; } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 2c7d2555cd..e56d27287c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -337,4 +337,14 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/userresiinfo/edituserinfo") Result editUserInfo(@RequestBody EditInfoFormDTO formDTO); + + /** + * @Description 查询已经点亮的徽章 + * @Param userBadgeListFormDTO + * @author zxc + * @date 2020/11/3 1:33 下午 + */ + @PostMapping("/epmetuser/badge/badgelist") + Result> selectBadgeList(@RequestBody UserBadgeListFormDTO userBadgeListFormDTO); + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index a2de76e587..46fad76aa3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -225,4 +225,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result editUserInfo(EditInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editUserInfo", formDTO); } + + @Override + public Result> selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectBadgeList", userBadgeListFormDTO); + } } From 54219febb49dcc0b219f68a4b51be7769e772323 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 4 Nov 2020 11:02:10 +0800 Subject: [PATCH 006/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi/mine/dto/from/BadgeListFormDTO.java | 1 - .../resi/mine/dto/from/OperListFormDTO.java | 21 +++++++ .../mine/dto/result/BadgeListResultDTO.java | 2 + .../mine/dto/result/OperListResultDTO.java | 46 ++++++++++++++ .../badege/controller/BadgeController.java | 26 +++++++- .../modules/badege/service/BadgeService.java | 19 +++++- .../badege/service/impl/BadgeServiceImpl.java | 39 +++++++++++- .../com/epmet/constant/BadgeConstant.java | 8 +++ .../epmet/dto/form/UserBadgeListFormDTO.java | 11 +++- .../epmet/dto/form/UserOperListFormDTO.java | 28 +++++++++ .../dto/result/UserBadgeListResultDTO.java | 3 + .../dto/result/UserOperListResultDTO.java | 62 +++++++++++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 8 +++ .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../epmet/controller/UserBadgeController.java | 13 ++++ .../main/java/com/epmet/dao/UserBadgeDao.java | 18 ++++++ .../java/com/epmet/redis/UserBadgeRedis.java | 7 +-- .../com/epmet/service/UserBadgeService.java | 10 +++ .../service/impl/UserBadgeServiceImpl.java | 59 ++++++++++++++++-- .../main/resources/mapper/UserBadgeDao.xml | 41 +++++++++--- 20 files changed, 400 insertions(+), 27 deletions(-) create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/OperListFormDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/OperListResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserOperListFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/BadgeListFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/BadgeListFormDTO.java index ef8ef67308..c5ace2985f 100644 --- a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/BadgeListFormDTO.java +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/BadgeListFormDTO.java @@ -19,7 +19,6 @@ public class BadgeListFormDTO implements Serializable { /** * 用户ID */ - @NotBlank(message = "用户ID不能为空",groups = {BadgeList.class}) private String userId; /** diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/OperListFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/OperListFormDTO.java new file mode 100644 index 0000000000..a0f7b7f919 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/OperListFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.resi.mine.dto.from; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/3 4:18 下午 + */ +@Data +public class OperListFormDTO implements Serializable { + + private static final long serialVersionUID = -1872129597916414752L; + + public interface OperList{} + + @NotBlank(message = "客户ID不能为空",groups = {OperList.class}) + private String customerId; +} diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/BadgeListResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/BadgeListResultDTO.java index 41f82feed4..d32230501e 100644 --- a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/BadgeListResultDTO.java +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/BadgeListResultDTO.java @@ -27,4 +27,6 @@ public class BadgeListResultDTO implements Serializable { * 徽章是否点亮 */ private String isOpened; + + private String badgeType; } diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/OperListResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/OperListResultDTO.java new file mode 100644 index 0000000000..044d118a0f --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/OperListResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.resi.mine.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/3 4:20 下午 + */ +@Data +public class OperListResultDTO implements Serializable { + + private static final long serialVersionUID = -6185696177370545937L; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 徽章名字 + */ + private String badgeName; + + /** + * 点亮状态 yes:已点亮,no:未点亮 + */ + private String isLighted; + + /** + * 是否认证 yes 认证 no 已认证 + */ + private String isCertificated; + + /** + * 徽章图片地址 + */ + private String badgeIcon; + + /** + * 是否被驳回 true:已驳回,false:未驳回 + */ + private Boolean isReject; + +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java index 059f37972f..fe519e7cbb 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java @@ -1,10 +1,14 @@ package com.epmet.modules.badege.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.modules.badege.service.BadgeService; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; +import com.epmet.resi.mine.dto.from.OperListFormDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO; +import com.epmet.resi.mine.dto.result.OperListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -24,10 +28,28 @@ public class BadgeController { @Autowired private BadgeService badgeService; + /** + * @Description 个人中心-获取个人徽章点亮列表 + * @Param badgeListFormDTO + * @author zxc + * @date 2020/11/3 4:11 下午 + */ @PostMapping("list") - public Result> getBadgeList(@RequestBody BadgeListFormDTO badgeListFormDTO){ + public Result> getBadgeList(@LoginUser TokenDto tokenDto,@RequestBody BadgeListFormDTO badgeListFormDTO){ ValidatorUtils.validateEntity(badgeListFormDTO, BadgeListFormDTO.BadgeList.class); - return new Result>().ok(badgeService.getBadgeList(badgeListFormDTO)); + return new Result>().ok(badgeService.getBadgeList(tokenDto,badgeListFormDTO)); + } + + /** + * @Description 个人中心-获取徽章可操作列表(点亮,取消,认证) + * @Param operListFormDTO + * @author zxc + * @date 2020/11/3 4:28 下午 + */ + @PostMapping("operlist") + public Result> getOperList(@LoginUser TokenDto tokenDto,@RequestBody OperListFormDTO operListFormDTO){ + ValidatorUtils.validateEntity(operListFormDTO, OperListFormDTO.OperList.class); + return new Result>().ok(badgeService.getOperList(tokenDto,operListFormDTO)); } } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java index 1aa44135c9..fe1d1c140e 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java @@ -1,7 +1,10 @@ package com.epmet.modules.badege.service; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; +import com.epmet.resi.mine.dto.from.OperListFormDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO; +import com.epmet.resi.mine.dto.result.OperListResultDTO; import java.util.List; @@ -11,6 +14,20 @@ import java.util.List; */ public interface BadgeService { - List getBadgeList(BadgeListFormDTO badgeListFormDTO); + /** + * @Description 个人中心-获取个人徽章点亮列表 + * @Param badgeListFormDTO + * @author zxc + * @date 2020/11/3 4:11 下午 + */ + List getBadgeList(TokenDto tokenDto,BadgeListFormDTO badgeListFormDTO); + + /** + * @Description 个人中心-获取徽章可操作列表(点亮,取消,认证) + * @Param operListFormDTO + * @author zxc + * @date 2020/11/3 4:28 下午 + */ + List getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java index e78f745c40..6e1d3ae1e9 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java @@ -1,14 +1,19 @@ package com.epmet.modules.badege.service.impl; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.UserBadgeListFormDTO; +import com.epmet.dto.form.UserOperListFormDTO; import com.epmet.dto.result.UserBadgeListResultDTO; +import com.epmet.dto.result.UserOperListResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.badege.service.BadgeService; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; +import com.epmet.resi.mine.dto.from.OperListFormDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO; +import com.epmet.resi.mine.dto.result.OperListResultDTO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -27,9 +32,17 @@ public class BadgeServiceImpl implements BadgeService { @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + /** + * @Description 个人中心-获取个人徽章点亮列表 + * @Param badgeListFormDTO + * @author zxc + * @date 2020/11/3 4:11 下午 + */ @Override - public List getBadgeList(BadgeListFormDTO badgeListFormDTO) { - UserBadgeListFormDTO form = ConvertUtils.sourceToTarget(badgeListFormDTO, UserBadgeListFormDTO.class); + public List getBadgeList(TokenDto tokenDto,BadgeListFormDTO badgeListFormDTO) { + UserBadgeListFormDTO form = new UserBadgeListFormDTO(); + form.setCustomerId(badgeListFormDTO.getCustomerId()); + form.setUserId(tokenDto.getUserId()); Result> listResult = epmetUserOpenFeignClient.selectBadgeList(form); if (!listResult.success()){ throw new RenException("获取徽章点亮列表失败......"); @@ -40,4 +53,26 @@ public class BadgeServiceImpl implements BadgeService { List result = ConvertUtils.sourceToTarget(listResult.getData(), BadgeListResultDTO.class); return result; } + + /** + * @Description 个人中心-获取徽章可操作列表(点亮,取消,认证) + * @Param operListFormDTO + * @author zxc + * @date 2020/11/3 4:28 下午 + */ + @Override + public List getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO) { + UserOperListFormDTO userOperListFormDTO = new UserOperListFormDTO(); + userOperListFormDTO.setCustomerId(operListFormDTO.getCustomerId()); + userOperListFormDTO.setUserId(tokenDto.getUserId()); + Result> listResult = epmetUserOpenFeignClient.selectOperList(userOperListFormDTO); + if (!listResult.success()){ + throw new RenException("获取徽章列表失败......"); + } + if (null == listResult.getData()){ + return new ArrayList<>(); + } + List result = ConvertUtils.sourceToTarget(listResult.getData(), OperListResultDTO.class); + return result; + } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java index e95fc2a5c0..7c2a6313c2 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java @@ -12,4 +12,12 @@ public interface BadgeConstant { String DEFAULT_CUSTOMER = "default"; + String YES = "yes"; + + String NO = "no"; + + String REJECTED = "rejected"; + + String APPROVED = "approved"; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeListFormDTO.java index c77cee2d1f..2cb7f728dc 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeListFormDTO.java @@ -2,7 +2,6 @@ package com.epmet.dto.form; import lombok.Data; -import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -12,7 +11,7 @@ import java.io.Serializable; @Data public class UserBadgeListFormDTO implements Serializable { - private static final long serialVersionUID = 9082922684993474574L; + private static final long serialVersionUID = 9002922684993474574L; /** * 用户ID @@ -23,4 +22,12 @@ public class UserBadgeListFormDTO implements Serializable { * 客户ID */ private String customerId; + + public UserBadgeListFormDTO(String userId, String customerId) { + this.userId = userId; + this.customerId = customerId; + } + + public UserBadgeListFormDTO() { + } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserOperListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserOperListFormDTO.java new file mode 100644 index 0000000000..84578f7abb --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserOperListFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/3 4:18 下午 + */ +@Data +public class UserOperListFormDTO implements Serializable { + + private static final long serialVersionUID = -1872129597916414712L; + + private String userId; + + private String customerId; + + public UserOperListFormDTO(String userId, String customerId) { + this.userId = userId; + this.customerId = customerId; + } + + public UserOperListFormDTO() { + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java index a9db8612a2..19fce3bb3c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java @@ -28,6 +28,9 @@ public class UserBadgeListResultDTO implements Serializable { * 徽章是否点亮 */ private String isOpened; + + private String badgeType; + @JsonIgnore private String customerId; @JsonIgnore diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java new file mode 100644 index 0000000000..4e587fa5cd --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/3 4:20 下午 + */ +@Data +public class UserOperListResultDTO implements Serializable { + + private static final long serialVersionUID = -6185696177370545937L; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 徽章名字 + */ + private String badgeName; + + /** + * 点亮状态 yes:已点亮,no:未点亮 + */ + private String isLighted; + + /** + * 是否认证 yes 认证 no 已认证 + */ + private String isCertificated; + + /** + * 徽章图片地址 + */ + private String badgeIcon; + + /** + * 是否被驳回 true:已驳回,false:未驳回 + */ + private Boolean isReject; + + @JsonIgnore + private String customerId; + @JsonIgnore + private String isOpened; + @JsonIgnore + private String auditStatus; + + public UserOperListResultDTO() { + this.badgeId = ""; + this.badgeName = ""; + this.isLighted = "no"; + this.isCertificated = "no"; + this.badgeIcon = ""; + this.isReject = false; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index e56d27287c..8ab0fd12b2 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -347,4 +347,12 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/badge/badgelist") Result> selectBadgeList(@RequestBody UserBadgeListFormDTO userBadgeListFormDTO); + /** + * @Description 个人中心-获取徽章可操作列表(点亮,取消,认证) + * @Param operListFormDTO + * @author zxc + * @date 2020/11/3 4:28 下午 + */ + @PostMapping("/epmetuser/badge/badgeoperlist") + Result> selectOperList(@RequestBody UserOperListFormDTO userOperListFormDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 46fad76aa3..aa5db5968a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -230,4 +230,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectBadgeList", userBadgeListFormDTO); } + + @Override + public Result> selectOperList(UserOperListFormDTO userOperListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectOperList", userOperListFormDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java index a11fc74409..5b8f9d46e6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java @@ -2,7 +2,9 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.UserBadgeListFormDTO; +import com.epmet.dto.form.UserOperListFormDTO; import com.epmet.dto.result.UserBadgeListResultDTO; +import com.epmet.dto.result.UserOperListResultDTO; import com.epmet.service.UserBadgeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -34,4 +36,15 @@ public class UserBadgeController { return new Result>().ok(userBadgeService.selectBadgeList(userBadgeListFormDTO)); } + /** + * @Description 个人中心-获取徽章可操作列表(点亮,取消,认证) + * @Param userOperListFormDTO + * @author zxc + * @date 2020/11/3 4:42 下午 + */ + @PostMapping("badgeoperlist") + public Result> selectOperList(@RequestBody UserOperListFormDTO userOperListFormDTO){ + return new Result>().ok(userBadgeService.selectOperList(userOperListFormDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java index d836a2e510..65eec9d1ac 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java @@ -2,7 +2,9 @@ package com.epmet.dao; import com.epmet.dto.form.UserBadgeListFormDTO; import com.epmet.dto.result.UserBadgeListResultDTO; +import com.epmet.dto.result.UserOperListResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -29,4 +31,20 @@ public interface UserBadgeDao { */ List selectAllBadge(UserBadgeListFormDTO userBadgeListFormDTO); + /** + * @Description 查询徽章认证记录 + * @Param userId + * @author zxc + * @date 2020/11/3 5:25 下午 + */ + List selectAuthRecord(@Param("userId")String userId); + + /** + * @Description 根据UserId查询个人徽章点亮信息 + * @Param userId + * @author zxc + * @date 2020/11/4 9:32 上午 + */ + List selectBadgeByUserId(@Param("userId")String userId); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index 56492844b1..727c467e12 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -28,12 +28,9 @@ public class UserBadgeRedis { * @author zxc * @date 2020/11/3 2:50 下午 */ - public List getUserBadge(String customerId){ + public Object getUserBadge(String customerId){ Object userBadge = redisUtils.hGet(BadgeConstant.BADGE_KEY + customerId, BadgeConstant.BADGE); - if (null == userBadge){ - return new ArrayList<>(); - } - return JSON.parseArray(userBadge.toString(), UserBadgeListResultDTO.class); + return userBadge; } /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java index 367f16993b..fe5737a2d3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java @@ -1,7 +1,9 @@ package com.epmet.service; import com.epmet.dto.form.UserBadgeListFormDTO; +import com.epmet.dto.form.UserOperListFormDTO; import com.epmet.dto.result.UserBadgeListResultDTO; +import com.epmet.dto.result.UserOperListResultDTO; import java.util.List; @@ -19,4 +21,12 @@ public interface UserBadgeService { */ List selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO); + /** + * @Description 个人中心-获取徽章可操作列表(点亮,取消,认证) + * @Param userOperListFormDTO + * @author zxc + * @date 2020/11/3 4:42 下午 + */ + List selectOperList(UserOperListFormDTO userOperListFormDTO); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 7ee534b2f6..261f7e7bdc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -1,9 +1,14 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.BadgeConstant; import com.epmet.dao.UserBadgeDao; import com.epmet.dto.form.UserBadgeListFormDTO; +import com.epmet.dto.form.UserOperListFormDTO; import com.epmet.dto.result.UserBadgeListResultDTO; +import com.epmet.dto.result.UserOperListResultDTO; import com.epmet.redis.UserBadgeRedis; import com.epmet.service.UserBadgeService; import lombok.extern.slf4j.Slf4j; @@ -38,8 +43,8 @@ public class UserBadgeServiceImpl implements UserBadgeService { */ @Override public List selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO) { - List userBadge = userBadgeRedis.getUserBadge(userBadgeListFormDTO.getCustomerId()); - if (CollectionUtils.isEmpty(userBadge)){ + Object userBadge = userBadgeRedis.getUserBadge(userBadgeListFormDTO.getCustomerId()); + if (null == userBadge){ List resultUserBadge = new ArrayList<>(); List userBadgeListResultDTOS = userBadgeDao.selectAllBadge(userBadgeListFormDTO); if (!CollectionUtils.isEmpty(userBadgeListResultDTOS)){ @@ -54,14 +59,15 @@ public class UserBadgeServiceImpl implements UserBadgeService { }); }); userBadgeRedis.setUserBadge(resultUserBadge,userBadgeListFormDTO.getCustomerId()); + userBadge = userBadgeRedis.getUserBadge(userBadgeListFormDTO.getCustomerId()); } } - userBadge = userBadgeRedis.getUserBadge(userBadgeListFormDTO.getCustomerId()); + List redisUserBadgeList = JSON.parseArray(userBadge.toString(), UserBadgeListResultDTO.class); List userBadgeListResultDTOS = userBadgeDao.selectBadgeList(userBadgeListFormDTO); if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){ - return userBadge; + return redisUserBadgeList; } - userBadge.forEach(u -> { + redisUserBadgeList.forEach(u -> { userBadgeListResultDTOS.forEach(badge -> { if (u.getBadgeId().equals(badge.getBadgeId())){ badge.setBadgeIcon(u.getBadgeIcon()); @@ -69,11 +75,52 @@ public class UserBadgeServiceImpl implements UserBadgeService { } }); }); - userBadge.forEach(u -> { + redisUserBadgeList.forEach(u -> { if (!u.getStatus()){ userBadgeListResultDTOS.add(u); } }); return userBadgeListResultDTOS; } + + /** + * @Description 个人中心-获取徽章可操作列表(点亮,取消,认证) + * @Param userOperListFormDTO + * @author zxc + * @date 2020/11/3 4:42 下午 + */ + @Override + public List selectOperList(UserOperListFormDTO userOperListFormDTO) { + List userAuthBadgeList = userBadgeDao.selectAuthRecord(userOperListFormDTO.getUserId()); + Object userBadge = userBadgeRedis.getUserBadge(userOperListFormDTO.getCustomerId()); + List userOperListResultDTOS = JSON.parseArray(userBadge.toString(), UserOperListResultDTO.class); + // 没有任何记录 + if (CollectionUtils.isEmpty(userAuthBadgeList)){ + userOperListResultDTOS.forEach(u -> { + u.setIsLighted(u.getIsOpened().equals(NumConstant.ZERO_STR) ? BadgeConstant.NO : BadgeConstant.YES); + u.setIsCertificated(BadgeConstant.NO); + u.setIsReject(false); + }); + return userOperListResultDTOS; + } + List badgeIsOpenedList = userBadgeDao.selectBadgeByUserId(userOperListFormDTO.getUserId()); + userOperListResultDTOS.forEach(ub -> { + userAuthBadgeList.forEach(u -> { + if (ub.getBadgeId().equals(u.getBadgeId())){ + ub.setIsReject(u.getAuditStatus().equals(BadgeConstant.REJECTED) ? true : false); + ub.setIsCertificated(u.getAuditStatus().equals(BadgeConstant.APPROVED) ? BadgeConstant.YES : BadgeConstant.NO); + } + }); + if (CollectionUtils.isEmpty(badgeIsOpenedList)){ + ub.setIsLighted(BadgeConstant.NO); + }else { + badgeIsOpenedList.forEach(b -> { + if (ub.getBadgeId().equals(b.getBadgeId())){ + ub.setIsLighted(b.getIsOpened().equals(NumConstant.ZERO_STR) ? BadgeConstant.NO : BadgeConstant.YES); + } + }); + } + }); + return userOperListResultDTOS; + } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index b709353ce5..b9bcbad998 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -7,14 +7,14 @@ @@ -26,12 +26,37 @@ CUSTOMER_ID, BADGE_NAME, BADGE_ICON, - FIXATION_BADGE_TYPE + FIXATION_BADGE_TYPE AS badgeType FROM badge WHERE DEL_FLAG = '0' AND (CUSTOMER_ID = 'default' OR CUSTOMER_ID = 'zxc') + + + + + + From 1c8eca02dd3f6e46526beb03abfaa827077f16b0 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 4 Nov 2020 15:38:45 +0800 Subject: [PATCH 007/125] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=BE=BD=E7=AB=A0?= =?UTF-8?q?=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../badege/controller/BadgeController.java | 16 ++++ .../modules/badege/service/BadgeService.java | 10 +++ .../badege/service/impl/BadgeServiceImpl.java | 17 ++++ .../dto/UserBadgeCertificateRecordDTO.java | 44 +++++++++++ .../epmet/dto/form/BadgeSendCodeFormDTO.java | 22 ++++++ .../dto/form/CertificationAddFormDTO.java | 67 ++++++++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 3 + .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../epmet/controller/UserBadgeController.java | 28 +++++++ .../main/java/com/epmet/dao/UserBadgeDao.java | 18 +++++ .../java/com/epmet/redis/UserBadgeRedis.java | 15 ++++ .../com/epmet/service/UserBadgeService.java | 20 +++++ .../service/impl/UserBadgeServiceImpl.java | 79 ++++++++++++++++++- .../main/resources/mapper/UserBadgeDao.xml | 59 ++++++++++++++ 14 files changed, 401 insertions(+), 2 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeSendCodeFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java index fe519e7cbb..8d70e5d097 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.modules.badege.service.BadgeService; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; +import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.resi.mine.dto.from.OperListFormDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO; import com.epmet.resi.mine.dto.result.OperListResultDTO; @@ -52,4 +53,19 @@ public class BadgeController { return new Result>().ok(badgeService.getOperList(tokenDto,operListFormDTO)); } + /** + * @Description 个人中心-提交徽章认证 + * @Param tokenDto + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 11:16 上午 + */ + @PostMapping("certification/add") + public Result certificationAdd(@LoginUser TokenDto tokenDto,@RequestBody CertificationAddFormDTO certificationAddFormDTO){ + ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class); + badgeService.certificationAdd(tokenDto,certificationAddFormDTO); + return new Result(); + } + + } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java index fe1d1c140e..6d020bc286 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java @@ -2,6 +2,7 @@ package com.epmet.modules.badege.service; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; +import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.resi.mine.dto.from.OperListFormDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO; import com.epmet.resi.mine.dto.result.OperListResultDTO; @@ -30,4 +31,13 @@ public interface BadgeService { */ List getOperList(TokenDto tokenDto,OperListFormDTO operListFormDTO); + /** + * @Description 个人中心-提交徽章认证 + * @Param tokenDto + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 11:16 上午 + */ + void certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO); + } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java index 6e1d3ae1e9..259ffc23ae 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.dto.result.UserOperListResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.badege.service.BadgeService; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; +import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.resi.mine.dto.from.OperListFormDTO; import com.epmet.resi.mine.dto.result.BadgeListResultDTO; import com.epmet.resi.mine.dto.result.OperListResultDTO; @@ -75,4 +76,20 @@ public class BadgeServiceImpl implements BadgeService { List result = ConvertUtils.sourceToTarget(listResult.getData(), OperListResultDTO.class); return result; } + + /** + * @Description 个人中心-提交徽章认证 + * @Param tokenDto + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 11:16 上午 + */ + @Override + public void certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO) { + certificationAddFormDTO.setUserId(tokenDto.getUserId()); + Result result = epmetUserOpenFeignClient.authBadgeRecord(certificationAddFormDTO); + if (!result.success()){ + throw new RenException("提交徽章认证失败......"); + } + } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java new file mode 100644 index 0000000000..a398d6f2cc --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2020/11/4 1:46 下午 + */ +@Data +public class UserBadgeCertificateRecordDTO implements Serializable { + + private static final long serialVersionUID = 3207509834642386145L; + + private String customerId; + private String gridId; + private String userId; + private String badgeId; + private String surname; + private String name; + private String idNum; + private String certificationImg; + private String remark; + private String auditStatus; + private String auditRemark; + private String staffId; + private Date auditTime; + private String isLast; + private String delFlag; + private Integer revision; + private String createdBy; + private String updatedBy; + + public UserBadgeCertificateRecordDTO() { + this.auditStatus = "auditing"; + this.isLast = "yes"; + this.delFlag = "0"; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeSendCodeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeSendCodeFormDTO.java new file mode 100644 index 0000000000..14cb3c3333 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeSendCodeFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/4 3:11 下午 + */ +@Data +public class BadgeSendCodeFormDTO implements Serializable { + + private static final long serialVersionUID = -3926070129364657241L; + + public interface BadgeSendCode{} + + @NotBlank(message = "手机号不能为空", groups = {BadgeSendCode.class}) + private String mobile; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java new file mode 100644 index 0000000000..76583e9559 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/4 11:05 上午 + */ +@Data +public class CertificationAddFormDTO implements Serializable { + + private static final long serialVersionUID = 1330773325803513330L; + + public interface CertificationAdd{} + + private String userId; + + /** + * 客户ID + */ + @NotBlank(message = "客户ID不能为空",groups = {CertificationAdd.class}) + private String customerId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 姓 + */ + private String subName; + + /** + * 名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 认证证件图片url + */ + private String certificate; + + /** + * 认证说明 + */ + private String remark; + + /** + * 验证码 + */ + private String code; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 8ab0fd12b2..f356eb8b1a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -355,4 +355,7 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/badge/badgeoperlist") Result> selectOperList(@RequestBody UserOperListFormDTO userOperListFormDTO); + + @PostMapping("/epmetuser/badge/authbadgerecord") + Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index aa5db5968a..789acb75f4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -235,4 +235,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> selectOperList(UserOperListFormDTO userOperListFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectOperList", userOperListFormDTO); } + + @Override + public Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "authBadgeRecord", certificationAddFormDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java index 5b8f9d46e6..f29179b551 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java @@ -1,6 +1,9 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.BadgeSendCodeFormDTO; +import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.dto.form.UserBadgeListFormDTO; import com.epmet.dto.form.UserOperListFormDTO; import com.epmet.dto.result.UserBadgeListResultDTO; @@ -47,4 +50,29 @@ public class UserBadgeController { return new Result>().ok(userBadgeService.selectOperList(userOperListFormDTO)); } + /** + * @Description 个人中心-提交徽章认证 + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 1:36 下午 + */ + @PostMapping("authbadgerecord") + public Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO){ + userBadgeService.authBadgeRecord(certificationAddFormDTO); + return new Result(); + } + + /** + * @Description 发送验证码 + * @Param badgeSendCodeFormDTO + * @author zxc + * @date 2020/11/4 3:14 下午 + */ + @PostMapping("badgesendcode") + public Result badgeSendCode(@RequestBody BadgeSendCodeFormDTO badgeSendCodeFormDTO){ + ValidatorUtils.validateEntity(badgeSendCodeFormDTO, BadgeSendCodeFormDTO.BadgeSendCode.class); + userBadgeService.badgeSendCode(badgeSendCodeFormDTO); + return new Result(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java index 65eec9d1ac..fececff9d8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java @@ -1,5 +1,6 @@ package com.epmet.dao; +import com.epmet.dto.UserBadgeCertificateRecordDTO; import com.epmet.dto.form.UserBadgeListFormDTO; import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.dto.result.UserOperListResultDTO; @@ -47,4 +48,21 @@ public interface UserBadgeDao { */ List selectBadgeByUserId(@Param("userId")String userId); + /** + * @Description 用户认证徽章记录表插入 + * @Param userBadgeCertificateRecordDTO + * @author zxc + * @date 2020/11/4 2:13 下午 + */ + void insertUserBadgeCertificateRecord(UserBadgeCertificateRecordDTO userBadgeCertificateRecordDTO); + + /** + * @Description 更新认证徽章记录最新 + * @Param badgeId + * @Param userId + * @author zxc + * @date 2020/11/4 2:16 下午 + */ + void updateCertificateRecordIsLast(@Param("badgeId")String badgeId,@Param("userId")String userId); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index 727c467e12..1b209e7dee 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -1,6 +1,8 @@ package com.epmet.redis; import com.alibaba.fastjson.JSON; +import com.epmet.common.token.constant.LoginConstant; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.BadgeConstant; @@ -12,6 +14,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import static com.epmet.commons.tools.redis.RedisUtils.MINUTE_THIRTY_EXPIRE; + /** * @Author zxc * @DateTime 2020/11/3 2:21 下午 @@ -44,4 +48,15 @@ public class UserBadgeRedis { redisUtils.hSet(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE, JSON.toJSON(userBadge).toString(),-1); } + public void saveBadgeSmsCode(String mobile, String smsCode) { + String smsCodeKey = "epmet:smsCode:badge:" + mobile; + redisUtils.set(smsCodeKey, smsCode, MINUTE_THIRTY_EXPIRE); + } + + public String getBadgeSmsCode(String mobile) { + String smsCodeKey = "epmet:smsCode:badge:" + mobile; + String smsCode = (String) redisUtils.get(smsCodeKey); + return smsCode; + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java index fe5737a2d3..79334d2960 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java @@ -1,9 +1,13 @@ package com.epmet.service; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.BadgeSendCodeFormDTO; +import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.dto.form.UserBadgeListFormDTO; import com.epmet.dto.form.UserOperListFormDTO; import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.dto.result.UserOperListResultDTO; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -29,4 +33,20 @@ public interface UserBadgeService { */ List selectOperList(UserOperListFormDTO userOperListFormDTO); + /** + * @Description 个人中心-提交徽章认证 + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 1:36 下午 + */ + Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO); + + /** + * @Description 发送验证码 + * @Param badgeSendCodeFormDTO + * @author zxc + * @date 2020/11/4 3:14 下午 + */ + void badgeSendCode(BadgeSendCodeFormDTO badgeSendCodeFormDTO); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 261f7e7bdc..33ddb19b00 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -2,16 +2,27 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.constant.BadgeConstant; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.dao.UserBadgeDao; -import com.epmet.dto.form.UserBadgeListFormDTO; -import com.epmet.dto.form.UserOperListFormDTO; +import com.epmet.dto.UserBadgeCertificateRecordDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.dto.result.UserBadgeListResultDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.UserOperListResultDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.redis.UserBadgeRedis; +import com.epmet.service.CustomerStaffService; import com.epmet.service.UserBadgeService; +import com.epmet.service.UserBaseInfoService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -34,6 +45,12 @@ public class UserBadgeServiceImpl implements UserBadgeService { private UserBadgeDao userBadgeDao; @Autowired private UserBadgeRedis userBadgeRedis; + @Autowired + private UserBaseInfoService userBaseInfoService; + @Autowired + private CustomerStaffService customerStaffService; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; /** * @Description 查询已经点亮的徽章 @@ -123,4 +140,62 @@ public class UserBadgeServiceImpl implements UserBadgeService { }); return userOperListResultDTOS; } + + /** + * @Description 个人中心-提交徽章认证 + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 1:36 下午 + */ + @Override + public Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO) { + if (StringUtils.isNotBlank(certificationAddFormDTO.getMobile())){ + String smsCode = userBadgeRedis.getBadgeSmsCode(certificationAddFormDTO.getMobile()); + if (!StringUtils.isNotBlank(smsCode)){ + return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); + } + } + UserBadgeCertificateRecordDTO form = ConvertUtils.sourceToTarget(certificationAddFormDTO, UserBadgeCertificateRecordDTO.class); + List userIds = new ArrayList<>(); + userIds.add(certificationAddFormDTO.getUserId()); + List userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(userIds); + if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)){ + throw new RenException("查询用户基本信息集合为空......"); + } + userBadgeDao.updateCertificateRecordIsLast(form.getBadgeId(),form.getUserId()); + form.setGridId(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRegisteredGridId()); + form.setIdNum(certificationAddFormDTO.getIdCard()); + form.setCertificationImg(certificationAddFormDTO.getCertificate()); + form.setSurname(certificationAddFormDTO.getSubName()); + userBadgeDao.insertUserBadgeCertificateRecord(form); + return new Result(); + } + + /** + * @Description 发送验证码 + * @Param badgeSendCodeFormDTO + * @author zxc + * @date 2020/11/4 3:14 下午 + */ + @Override + public void badgeSendCode(BadgeSendCodeFormDTO badgeSendCodeFormDTO) { + //1、校验手机号是否符合规范 + if (!PhoneValidatorUtils.isMobile(badgeSendCodeFormDTO.getMobile())) { + log.error(String.format("发送短信验证码异常,手机号[%s],code[%s],msg[%s]", badgeSendCodeFormDTO.getMobile(), EpmetErrorCode.ERROR_PHONE.getCode(), EpmetErrorCode.ERROR_PHONE.getMsg())); + throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode()); + } + //3、发送短信验证码 + SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO(); + sendVerificationCodeFormDTO.setMobile(badgeSendCodeFormDTO.getMobile()); + sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.LGOIN_CONFIRM); + Result smsCodeResult=epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); + if (!smsCodeResult.success()) { + log.error(String.format("发送短信验证码异常,手机号[%s],code[%s],msg[%s]", badgeSendCodeFormDTO.getMobile(), smsCodeResult.getCode(), smsCodeResult.getMsg())); + throw new RenException(smsCodeResult.getCode()); + } + //4、保存短信验证码(删除现有短信验证码、将新的短信验证码存入Redis) + userBadgeRedis.saveBadgeSmsCode(badgeSendCodeFormDTO.getMobile(),smsCodeResult.getData().getCode()); + log.info(String.format("发送短信验证码成功,手机号[%s]", badgeSendCodeFormDTO.getMobile())); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index b9bcbad998..b6c688b331 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -3,6 +3,15 @@ + + + UPDATE user_badge_certificate_record + SET is_last = 'no' + WHERE DEL_FLAG = '0' + AND BADGE_ID = #{badgeId} + AND USER_ID = #{userId} + + + + + INSERT INTO user_badge_certificate_record ( + ID, + CUSTOMER_ID, + GRID_ID, + USER_ID, + BADGE_ID, + SURNAME, + NAME, + ID_NUM, + CERTIFICATION_IMG, + REMAEK, + AUDIT_STATUS, + AUDIT_REMARK, + STAFF_ID, + AUDIT_TIME, + IS_LAST, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{customerId}, + #{gridId}, + #{userId}, + #{badgeId}, + #{surname}, + #{name}, + #{idNum}, + #{certificationImg}, + #{remark}, + #{auditStatus}, + #{auditRemark}, + #{staffId}, + #{auditTime}, + #{isLast}, + #{delFlag}, + #{revision}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + From 67baaefff06e77e86fbbdee1ae15791441155177 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 4 Nov 2020 16:50:40 +0800 Subject: [PATCH 008/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/UserBadgeCertificateRecordDTO.java | 1 + .../dto/form/CertificationDetailFormDTO.java | 29 +++++++++ .../result/CertificationDetailResultDTO.java | 60 +++++++++++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 12 +++- .../epmet/controller/UserBadgeController.java | 23 +++++-- .../main/java/com/epmet/dao/UserBadgeDao.java | 9 +++ .../com/epmet/service/UserBadgeService.java | 17 ++++-- .../service/impl/UserBadgeServiceImpl.java | 19 ++++-- .../main/resources/mapper/UserBadgeDao.xml | 27 +++++++++ 9 files changed, 181 insertions(+), 16 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationDetailFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java index a398d6f2cc..ffa2be3013 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java @@ -20,6 +20,7 @@ public class UserBadgeCertificateRecordDTO implements Serializable { private String badgeId; private String surname; private String name; + private String mobile; private String idNum; private String certificationImg; private String remark; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationDetailFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationDetailFormDTO.java new file mode 100644 index 0000000000..1eea42f575 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationDetailFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/4 3:51 下午 + */ +@Data +public class CertificationDetailFormDTO implements Serializable { + + private static final long serialVersionUID = -398879254354767770L; + + public interface CertificationDetail{} + + @NotBlank(message = "客户ID不能为空",groups = {CertificationDetail.class}) + private String customerId; + + @NotBlank(message = "徽章ID不能为空",groups = {CertificationDetail.class}) + private String badgeId; + + /** + * 客户ID + */ + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java new file mode 100644 index 0000000000..4e7298c1b9 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java @@ -0,0 +1,60 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/4 3:51 下午 + */ +@Data +public class CertificationDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 6538150132908927308L; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 是否认证 yes 认证 no 已认证 + */ + private String isCertificated; + + /** + * 手机号 + */ + private String mobile; + + /** + * 认证图片地址 + */ + private String certificationImg; + + /** + * 备注 + */ + private String remark; + + /** + * 审核结果 + */ + private String authResult; + + /** + * 驳回原因 + */ + private String authReason; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index f356eb8b1a..f5f531b656 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -344,7 +344,7 @@ public interface EpmetUserOpenFeignClient { * @author zxc * @date 2020/11/3 1:33 下午 */ - @PostMapping("/epmetuser/badge/badgelist") + @PostMapping("/epmetuser/more/badge/badgelist") Result> selectBadgeList(@RequestBody UserBadgeListFormDTO userBadgeListFormDTO); /** @@ -353,9 +353,15 @@ public interface EpmetUserOpenFeignClient { * @author zxc * @date 2020/11/3 4:28 下午 */ - @PostMapping("/epmetuser/badge/badgeoperlist") + @PostMapping("/epmetuser/more/badge/badgeoperlist") Result> selectOperList(@RequestBody UserOperListFormDTO userOperListFormDTO); - @PostMapping("/epmetuser/badge/authbadgerecord") + /** + * @Description 徽章认证提交 + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 4:30 下午 + */ + @PostMapping("/epmetuser/more/badge/authbadgerecord") Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java index f29179b551..ff5767867e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java @@ -1,11 +1,11 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.BadgeSendCodeFormDTO; -import com.epmet.dto.form.CertificationAddFormDTO; -import com.epmet.dto.form.UserBadgeListFormDTO; -import com.epmet.dto.form.UserOperListFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.CertificationDetailResultDTO; import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.dto.result.UserOperListResultDTO; import com.epmet.service.UserBadgeService; @@ -22,7 +22,7 @@ import java.util.List; * @DateTime 2020/11/3 11:16 上午 */ @RestController -@RequestMapping("badge") +@RequestMapping("more/badge") public class UserBadgeController { @Autowired @@ -75,4 +75,17 @@ public class UserBadgeController { return new Result(); } + /** + * @Description 个人中心-获取徽章认证页面详情 + * @Param tokenDto + * @Param certificationDetailFormDTO + * @author zxc + * @date 2020/11/4 4:03 下午 + */ + @PostMapping("certification/detail") + public Result certificationDetail(@LoginUser TokenDto tokenDto,@RequestBody CertificationDetailFormDTO certificationDetailFormDTO){ + ValidatorUtils.validateEntity(certificationDetailFormDTO); + return new Result().ok(userBadgeService.certificationDetail(tokenDto,certificationDetailFormDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java index fececff9d8..7025c1870c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java @@ -2,6 +2,7 @@ package com.epmet.dao; import com.epmet.dto.UserBadgeCertificateRecordDTO; import com.epmet.dto.form.UserBadgeListFormDTO; +import com.epmet.dto.result.CertificationDetailResultDTO; import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.dto.result.UserOperListResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -65,4 +66,12 @@ public interface UserBadgeDao { */ void updateCertificateRecordIsLast(@Param("badgeId")String badgeId,@Param("userId")String userId); + /** + * @Description 查询单个徽章的认证记录 + * @Param userId + * @Param badgeId + * @author zxc + * @date 2020/11/4 4:09 下午 + */ + CertificationDetailResultDTO selectBadgeAuthRecord(@Param("userId")String userId, @Param("badgeId")String badgeId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java index 79334d2960..e9cc979c91 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java @@ -1,10 +1,10 @@ package com.epmet.service; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.BadgeSendCodeFormDTO; -import com.epmet.dto.form.CertificationAddFormDTO; -import com.epmet.dto.form.UserBadgeListFormDTO; -import com.epmet.dto.form.UserOperListFormDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.CertificationDetailResultDTO; import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.dto.result.UserOperListResultDTO; import org.springframework.web.bind.annotation.RequestBody; @@ -49,4 +49,13 @@ public interface UserBadgeService { */ void badgeSendCode(BadgeSendCodeFormDTO badgeSendCodeFormDTO); + /** + * @Description 个人中心-获取徽章认证页面详情 + * @Param tokenDto + * @Param certificationDetailFormDTO + * @author zxc + * @date 2020/11/4 4:03 下午 + */ + CertificationDetailResultDTO certificationDetail(TokenDto tokenDto, CertificationDetailFormDTO certificationDetailFormDTO); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 33ddb19b00..2d96216eaa 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.PhoneValidatorUtils; @@ -12,10 +13,7 @@ import com.epmet.constant.SmsTemplateConstant; import com.epmet.dao.UserBadgeDao; import com.epmet.dto.UserBadgeCertificateRecordDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.SendVerificationCodeResultDTO; -import com.epmet.dto.result.UserBadgeListResultDTO; -import com.epmet.dto.result.UserBaseInfoResultDTO; -import com.epmet.dto.result.UserOperListResultDTO; +import com.epmet.dto.result.*; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.redis.UserBadgeRedis; import com.epmet.service.CustomerStaffService; @@ -198,4 +196,17 @@ public class UserBadgeServiceImpl implements UserBadgeService { log.info(String.format("发送短信验证码成功,手机号[%s]", badgeSendCodeFormDTO.getMobile())); } + /** + * @Description 个人中心-获取徽章认证页面详情 + * @Param tokenDto + * @Param certificationDetailFormDTO + * @author zxc + * @date 2020/11/4 4:03 下午 + */ + @Override + public CertificationDetailResultDTO certificationDetail(TokenDto tokenDto, CertificationDetailFormDTO certificationDetailFormDTO) { + certificationDetailFormDTO.setUserId(tokenDto.getUserId()); + return userBadgeDao.selectBadgeAuthRecord(certificationDetailFormDTO.getUserId(), certificationDetailFormDTO.getBadgeId()); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index b6c688b331..5d46734499 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -67,6 +67,31 @@ AND USER_ID = #{userId} + + + INSERT INTO user_badge_certificate_record ( @@ -77,6 +102,7 @@ BADGE_ID, SURNAME, NAME, + MOBILE, ID_NUM, CERTIFICATION_IMG, REMAEK, @@ -101,6 +127,7 @@ #{badgeId}, #{surname}, #{name}, + #{mobile}, #{idNum}, #{certificationImg}, #{remark}, From 8084fce2b4695806f11e269314b70f3da2b8ae62 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 4 Nov 2020 17:03:20 +0800 Subject: [PATCH 009/125] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=AB=AF-=E5=BE=BD?= =?UTF-8?q?=E7=AB=A0=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 5 + .../com/epmet/controller/OssController.java | 34 +++ .../com/epmet/constant/BadgeConstant.java | 2 + .../dto/BadgeCertificationConfigDTO.java | 86 ++++++ .../src/main/java/com/epmet/dto/BadgeDTO.java | 96 +++++++ .../com/epmet/dto/form/AddBadgeFormDTO.java | 42 +++ .../java/com/epmet/dto/form/BadgeFormDTO.java | 16 ++ .../com/epmet/dto/form/EditBadgeFormDTO.java | 40 +++ .../dto/result/BadgeDetailResultDTO.java | 26 ++ .../epmet/dto/result/BadgeListResultDTO.java | 31 +++ .../com/epmet/controller/BadgeController.java | 104 ++++++++ .../dao/BadgeCertificationConfigDao.java | 54 ++++ .../src/main/java/com/epmet/dao/BadgeDao.java | 108 ++++++++ .../BadgeCertificationConfigEntity.java | 56 ++++ .../java/com/epmet/entity/BadgeEntity.java | 66 +++++ .../java/com/epmet/redis/UserBadgeRedis.java | 5 - .../BadgeCertificationConfigService.java | 127 +++++++++ .../java/com/epmet/service/BadgeService.java | 150 +++++++++++ .../BadgeCertificationConfigServiceImpl.java | 149 +++++++++++ .../epmet/service/impl/BadgeServiceImpl.java | 248 ++++++++++++++++++ .../mapper/BadgeCertificationConfigDao.xml | 42 +++ .../src/main/resources/mapper/BadgeDao.xml | 116 ++++++++ 22 files changed, 1598 insertions(+), 5 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeCertificationConfigDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddBadgeFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditBadgeFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeDetailResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeCertificationConfigDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeCertificationConfigEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeCertificationConfigService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeCertificationConfigServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/BadgeCertificationConfigDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index e4832a1c8b..2242a9ef9c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -95,6 +95,9 @@ public enum EpmetErrorCode { SIGN_IN_TIME_NO(8513, "签到时间还未到~"), SIGN_IN_TIME_END(8514, "签到时间已结束~"), + //徽章管理 + DUPLICATE_BADGE_NAME(8515, "徽章名已存在"), + // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), @@ -110,6 +113,8 @@ public enum EpmetErrorCode { OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"), OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"), OPER_EXT_APP_SECRET_RESET_FAIL(8714, "秘钥更新失败"), + OPER_UPLOAD_IMG_TYPE_ERROR(8715, "请上传PNG格式的图片"), + OPER_UPLOAD_IMG_SIZE_ERROR(8716, "请上传200*200的图片"), // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 5b3e3bee6b..a7f37ab6e9 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -10,6 +10,7 @@ package com.epmet.controller; import com.epmet.cloud.CloudStorageConfig; import com.epmet.cloud.OssFactory; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; @@ -37,6 +38,9 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import springfox.documentation.annotations.ApiIgnore; +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.IOException; import java.util.Arrays; import java.util.Map; @@ -218,4 +222,34 @@ public class OssController { return ossService.uploadImg(file); } + + @PostMapping("uploadimg/badgeicon") + public Result badgeIcon(@RequestParam("file") MultipartFile file) throws IOException { + + // 校验文件类型 + if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType())) { + log.error("uploadArticleImg file type:{} is not support 2 upload", file.getContentType()); + throw new RenException(EpmetErrorCode.OPER_UPLOAD_IMG_TYPE_ERROR.getCode() + , EpmetErrorCode.OPER_UPLOAD_IMG_TYPE_ERROR.getMsg()); + } + + // 校验文件体积,不超过2m + long maxSize = 2 * 1024 * 1024; + long size = file.getSize(); + if (size > maxSize) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + } + + BufferedImage bufferedImage = ImageIO.read(file.getInputStream()); + int width = bufferedImage.getWidth(); + int height = bufferedImage.getHeight(); + if (width != 200 || height != 200) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_IMG_SIZE_ERROR.getCode() + , EpmetErrorCode.OPER_UPLOAD_IMG_SIZE_ERROR.getMsg()); + + } + return ossService.uploadImg(file); + } + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java index 7c2a6313c2..57661b4871 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java @@ -20,4 +20,6 @@ public interface BadgeConstant { String APPROVED = "approved"; + String NONE ="none"; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeCertificationConfigDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeCertificationConfigDTO.java new file mode 100644 index 0000000000..5eb6e95749 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeCertificationConfigDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 徽章认证配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Data +public class BadgeCertificationConfigDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 认证信息类型 手机号:mobile;全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark + */ + private String certificationType; + + /** + * 删除标识 1删除;0未删除 + */ + 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/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeDTO.java new file mode 100644 index 0000000000..dfeb6f055b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/BadgeDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 徽章 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Data +public class BadgeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 徽章名称 + */ + private String badgeName; + + /** + * 徽章图标url + */ + private String badgeIcon; + + /** + * 固有徽章类型 前端页面跳转标识,党员徽章:party;无:none + */ + private String fixationBadgeType; + + /** + * 状态 上线:online;下线:offline; + */ + private String badgeStatus; + + /** + * 删除标识 1删除;0未删除 + */ + 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/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddBadgeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddBadgeFormDTO.java new file mode 100644 index 0000000000..ceb07d1651 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddBadgeFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/4 9:47 + */ +@NoArgsConstructor +@Data +public class AddBadgeFormDTO implements Serializable { + + private static final long serialVersionUID = -5220529162950147825L; + /** + * 徽章名称 + */ + @NotBlank(message = "徽章名称不能为空") + private String badgeName; + /** + * 徽章图标 + */ + @NotBlank(message = "徽章图标不能为空") + private String badgeIcon; + /** + * 徽章状态 上线:online;下线:offline; + */ + @NotBlank(message = "徽章状态不能为空") + private String badgeStatus; + /** + * 认证信息类型数组 手机号:mobile;姓名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark + */ + @NotEmpty(message = "认证信息类型不能为空") + private List certificationTypes; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java new file mode 100644 index 0000000000..4b35497e8b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/4 14:22 + */ +@Data +public class BadgeFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + private String badgeId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditBadgeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditBadgeFormDTO.java new file mode 100644 index 0000000000..e11d2e107c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditBadgeFormDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/4 14:23 + */ +@Data +public class EditBadgeFormDTO implements Serializable { + private static final long serialVersionUID = 1578890423002035200L; + private String badgeId; + /** + * 徽章名称 + */ + @NotBlank(message = "徽章名称不能为空") + private String badgeName; + /** + * 徽章图标 + */ + @NotBlank(message = "徽章图标不能为空") + private String badgeIcon; + /** + * 徽章状态 上线:online;下线:offline; + */ + @NotBlank(message = "徽章状态不能为空") + private String badgeStatus; + /** + * 认证信息类型数组 手机号:mobile;姓名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark + */ + @NotEmpty(message = "认证信息类型不能为空") + private List certificationTypes; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeDetailResultDTO.java new file mode 100644 index 0000000000..311c78f460 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeDetailResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/4 14:17 + */ +@NoArgsConstructor +@Data +public class BadgeDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 7698898330565297328L; + + private String badgeId; + private String badgeName; + private String badgeIcon; + private String badgeStatus; + private List certificationTypes; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java new file mode 100644 index 0000000000..8d5d7c28ec --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeListResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/3 16:58 + */ +@NoArgsConstructor +@Data +public class BadgeListResultDTO { + + /** + * 徽章Id + */ + private String badgeId; + /** + * 徽章名称 + */ + private String badgeName; + /** + * 徽章图标url + */ + private String badgeIcon; + /** + * 徽章状态 上线:online;下线:offline; + */ + private String badgeStatus; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java new file mode 100644 index 0000000000..92a2621013 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java @@ -0,0 +1,104 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.AddBadgeFormDTO; +import com.epmet.dto.form.BadgeFormDTO; +import com.epmet.dto.form.EditBadgeFormDTO; +import com.epmet.dto.result.BadgeDetailResultDTO; +import com.epmet.dto.result.BadgeListResultDTO; +import com.epmet.service.BadgeService; +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 java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/3 16:09 + */ +@RestController +@RequestMapping("badge") +public class BadgeController { + @Autowired + private BadgeService badgeService; + + /** + * 徽章列表 + * @author zhaoqifeng + * @date 2020/11/4 14:27 + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("list") + public Result> list(@LoginUser TokenDto tokenDto) { + List result = badgeService.getList(tokenDto.getCustomerId()); + return new Result>().ok(result); + } + + /** + * 添加徽章 + * @author zhaoqifeng + * @date 2020/11/4 14:27 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("add") + public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddBadgeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + badgeService.add(tokenDto, formDTO); + return new Result(); + } + + /** + * 徽章详情 + * @author zhaoqifeng + * @date 2020/11/4 14:27 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) { + BadgeDetailResultDTO result = badgeService.detail(tokenDto, formDTO); + return new Result().ok(result); + } + + /** + * 修改 + * @author zhaoqifeng + * @date 2020/11/4 15:32 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditBadgeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + badgeService.edit(tokenDto, formDTO); + return new Result(); + } + + /** + * 删除徽章 + * @author zhaoqifeng + * @date 2020/11/4 15:34 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("delete") + public Result delete(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) { + badgeService.deleteBadge(tokenDto, formDTO); + return new Result(); + } + + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeCertificationConfigDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeCertificationConfigDao.java new file mode 100644 index 0000000000..e60ac24fc5 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeCertificationConfigDao.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.BadgeCertificationConfigEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 徽章认证配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Mapper +public interface BadgeCertificationConfigDao extends BaseDao { + /** + * 获取认证信息类型 + * @author zhaoqifeng + * @date 2020/11/4 14:42 + * @param customerId + * @param badgeId + * @return java.util.List + */ + List getCertificationType(@Param("customerId") String customerId, @Param("badgeId") String badgeId); + + /** + * 删除认证信息 + * @author zhaoqifeng + * @date 2020/11/4 14:43 + * @param customerId + * @param badgeId + * @return int + */ + int deleteConfig(@Param("customerId") String customerId, @Param("badgeId") String badgeId); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java new file mode 100644 index 0000000000..965f753b6e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -0,0 +1,108 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.BadgeDetailResultDTO; +import com.epmet.dto.result.BadgeListResultDTO; +import com.epmet.entity.BadgeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName; + +import java.util.List; + +/** + * 徽章 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Mapper +public interface BadgeDao extends BaseDao { + + /** + * 获取徽章列表 + * @author zhaoqifeng + * @date 2020/11/3 17:30 + * @param customerId + * @return java.util.List + */ + List selectList(@Param("customerId") String customerId); + + /** + * 重名校验 + * @author zhaoqifeng + * @date 2020/11/4 10:40 + * @param customerId + * @param badgeName + * @return java.util.List + */ + List getDuplicateName(@Param("customerId") String customerId, @Param("badgeName") String badgeName); + + /** + * 编辑重名校验 + * @author zhaoqifeng + * @date 2020/11/4 15:09 + * @param customerId + * @param badgeId + * @param badgeName + * @return java.util.List + */ + List getDuplicateNameForEdit(@Param("customerId") String customerId, @Param("badgeId") String badgeId, + @Param("badgeName") String badgeName); + + /** + * 获取徽章详情 + * @author zhaoqifeng + * @date 2020/11/4 14:30 + * @param customerId + * @param badgeId + * @return com.epmet.dto.result.BadgeDetailResultDTO + */ + BadgeDetailResultDTO selectDetail(@Param("customerId") String customerId, @Param("badgeId") String badgeId); + + /** + * 获取徽章信息 + * @author zhaoqifeng + * @date 2020/11/4 15:16 + * @param customerId + * @param badgeId + * @return com.epmet.entity.BadgeEntity + */ + BadgeEntity selectBadgeInfo(@Param("customerId") String customerId, @Param("badgeId") String badgeId); + + /** + * 更新徽章信息 + * @author zhaoqifeng + * @date 2020/11/4 15:38 + * @param entity + * @return void + */ + void updateBadge(BadgeEntity entity); + + /** + * 删除徽章信息 + * @author zhaoqifeng + * @date 2020/11/4 15:39 + * @param customerId + * @param badgeId + * @return void + */ + void deleteBadge(@Param("customerId") String customerId, @Param("badgeId") String badgeId); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeCertificationConfigEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeCertificationConfigEntity.java new file mode 100644 index 0000000000..90a6001940 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeCertificationConfigEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 徽章认证配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("badge_certification_config") +public class BadgeCertificationConfigEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 认证信息类型 手机号:mobile;全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark + */ + private String certificationType; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeEntity.java new file mode 100644 index 0000000000..c6aec0b820 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/BadgeEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 徽章 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("badge") +public class BadgeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 徽章名称 + */ + private String badgeName; + + /** + * 徽章图标url + */ + private String badgeIcon; + + /** + * 固有徽章类型 前端页面跳转标识,党员徽章:party;无:none + */ + private String fixationBadgeType; + + /** + * 状态 上线:online;下线:offline; + */ + private String badgeStatus; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index 1b209e7dee..cf1a34f871 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -1,18 +1,13 @@ package com.epmet.redis; import com.alibaba.fastjson.JSON; -import com.epmet.common.token.constant.LoginConstant; -import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.BadgeConstant; import com.epmet.dto.result.UserBadgeListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.util.ArrayList; import java.util.List; -import java.util.Map; import static com.epmet.commons.tools.redis.RedisUtils.MINUTE_THIRTY_EXPIRE; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeCertificationConfigService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeCertificationConfigService.java new file mode 100644 index 0000000000..5c14ca740a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeCertificationConfigService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.BadgeCertificationConfigDTO; +import com.epmet.entity.BadgeCertificationConfigEntity; + +import java.util.List; +import java.util.Map; + +/** + * 徽章认证配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +public interface BadgeCertificationConfigService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-11-03 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-11-03 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return BadgeCertificationConfigDTO + * @author generator + * @date 2020-11-03 + */ + BadgeCertificationConfigDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-03 + */ + void save(BadgeCertificationConfigDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-03 + */ + void update(BadgeCertificationConfigDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-11-03 + */ + void delete(String[] ids); + + /** + * 获取认证信息类型 + * @author zhaoqifeng + * @date 2020/11/4 14:39 + * @param customerId + * @param badgeId + * @return java.util.List + */ + List getCertificationType(String customerId, String badgeId); + + /** + * 保存认证信息配置 + * @author zhaoqifeng + * @date 2020/11/4 15:29 + * @param customerId + * @param badgeId + * @param list + * @return void + */ + void saveConfig(String customerId, String badgeId, List list); + + /** + * 删除配置 + * @author zhaoqifeng + * @date 2020/11/4 15:41 + * @param customerId + * @param badgeId + * @return void + */ + void deleteConfig(String customerId, String badgeId); + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java new file mode 100644 index 0000000000..7b73e28561 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java @@ -0,0 +1,150 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.BadgeDTO; +import com.epmet.dto.form.AddBadgeFormDTO; +import com.epmet.dto.form.BadgeFormDTO; +import com.epmet.dto.form.EditBadgeFormDTO; +import com.epmet.dto.result.BadgeDetailResultDTO; +import com.epmet.dto.result.BadgeListResultDTO; +import com.epmet.entity.BadgeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 徽章 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +public interface BadgeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-11-03 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-11-03 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return BadgeDTO + * @author generator + * @date 2020-11-03 + */ + BadgeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-03 + */ + void save(BadgeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-03 + */ + void update(BadgeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-11-03 + */ + void delete(String[] ids); + + /** + * 获取徽章列表 + * @author zhaoqifeng + * @date 2020/11/3 17:04 + * @param customerId + * @return java.util.List + */ + List getList(String customerId); + + /** + * 添加徽章 + * @author zhaoqifeng + * @date 2020/11/4 10:09 + * @param tokenDto + * @param formDTO + * @return void + */ + void add(TokenDto tokenDto, AddBadgeFormDTO formDTO); + + /** + * 徽章详情 + * @author zhaoqifeng + * @date 2020/11/4 14:25 + * @param tokenDto + * @param formDTO + * @return com.epmet.dto.result.BadgeDetailResultDTO + */ + BadgeDetailResultDTO detail(TokenDto tokenDto, BadgeFormDTO formDTO); + + /** + * 编辑徽章 + * @author zhaoqifeng + * @date 2020/11/4 14:28 + * @param tokenDto + * @param formDTO + * @return void + */ + void edit(TokenDto tokenDto, EditBadgeFormDTO formDTO); + + /** + * 删除徽章 + * @author zhaoqifeng + * @date 2020/11/4 15:34 + * @param tokenDto + * @param formDTO + * @return void + */ + void deleteBadge(TokenDto tokenDto, BadgeFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeCertificationConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeCertificationConfigServiceImpl.java new file mode 100644 index 0000000000..2af4587368 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeCertificationConfigServiceImpl.java @@ -0,0 +1,149 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.BadgeCertificationConfigDao; +import com.epmet.dto.BadgeCertificationConfigDTO; +import com.epmet.entity.BadgeCertificationConfigEntity; +import com.epmet.service.BadgeCertificationConfigService; +import org.apache.commons.collections4.CollectionUtils; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Service +public class BadgeCertificationConfigServiceImpl extends BaseServiceImpl implements BadgeCertificationConfigService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, BadgeCertificationConfigDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, BadgeCertificationConfigDTO.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 BadgeCertificationConfigDTO get(String id) { + BadgeCertificationConfigEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, BadgeCertificationConfigDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(BadgeCertificationConfigDTO dto) { + BadgeCertificationConfigEntity entity = ConvertUtils.sourceToTarget(dto, BadgeCertificationConfigEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(BadgeCertificationConfigDTO dto) { + BadgeCertificationConfigEntity entity = ConvertUtils.sourceToTarget(dto, BadgeCertificationConfigEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 获取认证信息类型 + * + * @param customerId + * @param badgeId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/4 14:39 + */ + @Override + public List getCertificationType(String customerId, String badgeId) { + List list = baseDao.getCertificationType(customerId, badgeId); + if (CollectionUtils.isEmpty(list)) { + list = baseDao.getCertificationType("default", badgeId); + } + return list; + } + + /** + * 保存认证信息配置 + * + * @param list + * @return void + * @author zhaoqifeng + * @date 2020/11/4 15:28 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveConfig(String customerId, String badgeId, List list) { + baseDao.deleteConfig(customerId, badgeId); + insertBatch(list); + } + + /** + * 删除配置 + * + * @param customerId + * @param badgeId + * @return void + * @author zhaoqifeng + * @date 2020/11/4 15:41 + */ + @Override + public void deleteConfig(String customerId, String badgeId) { + baseDao.deleteConfig(customerId, badgeId); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java new file mode 100644 index 0000000000..021b0c734a --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -0,0 +1,248 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.BadgeConstant; +import com.epmet.dao.BadgeDao; +import com.epmet.dto.BadgeDTO; +import com.epmet.dto.form.AddBadgeFormDTO; +import com.epmet.dto.form.BadgeFormDTO; +import com.epmet.dto.form.EditBadgeFormDTO; +import com.epmet.dto.result.BadgeDetailResultDTO; +import com.epmet.dto.result.BadgeListResultDTO; +import com.epmet.entity.BadgeCertificationConfigEntity; +import com.epmet.entity.BadgeEntity; +import com.epmet.service.BadgeCertificationConfigService; +import com.epmet.service.BadgeService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 徽章 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Service +public class BadgeServiceImpl extends BaseServiceImpl implements BadgeService { + + @Autowired + private BadgeCertificationConfigService badgeCertificationConfigService; + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, BadgeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, BadgeDTO.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 BadgeDTO get(String id) { + BadgeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, BadgeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(BadgeDTO dto) { + BadgeEntity entity = ConvertUtils.sourceToTarget(dto, BadgeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(BadgeDTO dto) { + BadgeEntity entity = ConvertUtils.sourceToTarget(dto, BadgeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 获取徽章列表 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/3 17:04 + */ + @Override + public List getList(String customerId) { + return baseDao.selectList(customerId); + } + + /** + * 添加徽章 + * + * @param tokenDto + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/11/4 10:09 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void add(TokenDto tokenDto, AddBadgeFormDTO formDTO) { + //重名校验 + List list = baseDao.getDuplicateName(tokenDto.getCustomerId(), formDTO.getBadgeName()); + if (CollectionUtils.isNotEmpty(list)) { + throw new RenException(EpmetErrorCode.DUPLICATE_BADGE_NAME.getCode()); + } + BadgeEntity entity = ConvertUtils.sourceToTarget(formDTO, BadgeEntity.class); + entity.setCustomerId(tokenDto.getCustomerId()); + entity.setFixationBadgeType(BadgeConstant.NONE); + insert(entity); + //保存徽章认证配置 + List badgeList = new ArrayList<>(); + formDTO.getCertificationTypes().forEach(item -> { + BadgeCertificationConfigEntity badge = new BadgeCertificationConfigEntity(); + badge.setBadgeId(entity.getId()); + badge.setCertificationType(item); + badge.setCustomerId(tokenDto.getCustomerId()); + badgeList.add(badge); + }); + badgeCertificationConfigService.insertBatch(badgeList); + } + + /** + * 徽章详情 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.dto.result.BadgeDetailResultDTO + * @author zhaoqifeng + * @date 2020/11/4 14:25 + */ + @Override + public BadgeDetailResultDTO detail(TokenDto tokenDto, BadgeFormDTO formDTO) { + BadgeDetailResultDTO result = baseDao.selectDetail(tokenDto.getCustomerId(), formDTO.getBadgeId()); + List types = badgeCertificationConfigService.getCertificationType(tokenDto.getCustomerId(), formDTO.getBadgeId()); + result.setCertificationTypes(types); + return result; + } + + /** + * 编辑徽章 + * + * @param tokenDto + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/11/4 14:28 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void edit(TokenDto tokenDto, EditBadgeFormDTO formDTO) { + //重名校验 + List list = baseDao.getDuplicateNameForEdit(tokenDto.getCustomerId(), formDTO.getBadgeId(), formDTO.getBadgeName()); + if (CollectionUtils.isNotEmpty(list)) { + throw new RenException(EpmetErrorCode.DUPLICATE_BADGE_NAME.getCode()); + } + + BadgeEntity badgeEntity = baseDao.selectBadgeInfo(tokenDto.getCustomerId(), formDTO.getBadgeId()); + if (null == badgeEntity) { + badgeEntity = baseDao.selectBadgeInfo("default", formDTO.getBadgeId()); + badgeEntity.setCustomerId(tokenDto.getCustomerId()); + badgeEntity.setBadgeName(formDTO.getBadgeName()); + badgeEntity.setBadgeIcon(formDTO.getBadgeIcon()); + badgeEntity.setBadgeStatus(formDTO.getBadgeStatus()); + baseDao.insert(badgeEntity); + } else { + badgeEntity.setBadgeName(formDTO.getBadgeName()); + badgeEntity.setBadgeIcon(formDTO.getBadgeIcon()); + badgeEntity.setBadgeStatus(formDTO.getBadgeStatus()); + baseDao.updateBadge(badgeEntity); + } + //保存徽章认证配置 + List badgeList = new ArrayList<>(); + formDTO.getCertificationTypes().forEach(item -> { + BadgeCertificationConfigEntity badge = new BadgeCertificationConfigEntity(); + badge.setBadgeId(formDTO.getBadgeId()); + badge.setCertificationType(item); + badge.setCustomerId(tokenDto.getCustomerId()); + badgeList.add(badge); + }); + badgeCertificationConfigService.saveConfig(tokenDto.getCustomerId(), formDTO.getBadgeId(), badgeList); + } + + /** + * 删除徽章 + * + * @param tokenDto + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/11/4 15:34 + */ + @Override + public void deleteBadge(TokenDto tokenDto, BadgeFormDTO formDTO) { + BadgeEntity badgeEntity = baseDao.selectBadgeInfo(tokenDto.getCustomerId(), formDTO.getBadgeId()); + if (null == badgeEntity) { + badgeEntity = baseDao.selectBadgeInfo("default", formDTO.getBadgeId()); + badgeEntity.setCustomerId(tokenDto.getCustomerId()); + badgeEntity.setDelFlag(NumConstant.ONE_STR); + baseDao.insert(badgeEntity); + } else { + baseDao.deleteBadge(tokenDto.getCustomerId(), formDTO.getBadgeId()); + } + badgeCertificationConfigService.deleteConfig(tokenDto.getCustomerId(), formDTO.getBadgeId()); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeCertificationConfigDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeCertificationConfigDao.xml new file mode 100644 index 0000000000..251523c8d3 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeCertificationConfigDao.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + DELETE a + FROM + badge_certification_config a + WHERE + EXISTS ( + SELECT + * + FROM + ( SELECT ID FROM badge_certification_config + WHERE CUSTOMER_ID = #{customerId} + AND BADGE_ID = #{badgeId} + AND DEL_FLAG = '0' ) b + WHERE + a.ID = b.ID) + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml new file mode 100644 index 0000000000..322604bc70 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + update badge set + BADGE_NAME = #{badgeName}, + BADGE_ICON = #{badgeIcon}, + BADGE_STATUS = #{badgeStatus} + where ID = #{id} AND CUSTOMER_ID = #{customerId} + + + + update badge set + DEL_FLAG = '1' + where ID = #{badgeId} AND CUSTOMER_ID = #{customerId} + + + + + + + + + \ No newline at end of file From 27268ab2b69c29cb6467027a43237c7788200301 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 4 Nov 2020 17:27:55 +0800 Subject: [PATCH 010/125] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/logback-spring.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml index f099678400..b2e0b7a9da 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml @@ -173,6 +173,13 @@ + + + + + + + From b34751518dba1d35de4473bffa6aa46fe42df0c3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 4 Nov 2020 17:36:43 +0800 Subject: [PATCH 011/125] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83-?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BE=BD=E7=AB=A0=E8=A6=81=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E8=AE=A4=E8=AF=81=E4=BF=A1=E6=81=AF=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/AuthFieldFormDTO.java | 24 +++++++++++ .../epmet/dto/result/AuthFieldResultDTO.java | 40 +++++++++++++++++++ .../epmet/controller/UserBadgeController.java | 13 ++++++ .../main/java/com/epmet/dao/UserBadgeDao.java | 10 +++++ .../com/epmet/service/UserBadgeService.java | 11 ++++- .../service/impl/UserBadgeServiceImpl.java | 18 ++++++++- .../main/resources/mapper/UserBadgeDao.xml | 17 ++++++++ 7 files changed, 129 insertions(+), 4 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AuthFieldFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AuthFieldResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AuthFieldFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AuthFieldFormDTO.java new file mode 100644 index 0000000000..b5c716470f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AuthFieldFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/4 4:54 下午 + */ +@Data +public class AuthFieldFormDTO implements Serializable { + + private static final long serialVersionUID = 1976515427065841752L; + + public interface AuthField{} + + @NotBlank(message = "客户ID不能为空",groups = {AuthField.class}) + private String customerId; + + @NotBlank(message = "徽章ID不能为空",groups = {AuthField.class}) + private String badgeId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AuthFieldResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AuthFieldResultDTO.java new file mode 100644 index 0000000000..9c68bf19af --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AuthFieldResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/4 4:54 下午 + */ +@Data +public class AuthFieldResultDTO implements Serializable { + + private static final long serialVersionUID = 1856490232343125419L; + + /** + * 中文名 + */ + private String cnName; + + /** + * 英文名【字段】 + */ + private String enName; + + /** + * 字段类型,text:文本,img:图片 + */ + private String fieldType; + + /** + * 是否必填 + */ + private String isRequired; + + /** + * 排序 + */ + private Integer sort; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java index ff5767867e..3a4a590a81 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; +import com.epmet.dto.result.AuthFieldResultDTO; import com.epmet.dto.result.CertificationDetailResultDTO; import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.dto.result.UserOperListResultDTO; @@ -88,4 +89,16 @@ public class UserBadgeController { return new Result().ok(userBadgeService.certificationDetail(tokenDto,certificationDetailFormDTO)); } + /** + * @Description 个人中心-查询徽章要显示的认证信息字段 + * @Param authFieldFormDTO + * @author zxc + * @date 2020/11/4 5:05 下午 + */ + @PostMapping("authfield") + public Result> authField(@RequestBody AuthFieldFormDTO authFieldFormDTO){ + ValidatorUtils.validateEntity(authFieldFormDTO, AuthFieldFormDTO.AuthField.class); + return new Result>().ok(userBadgeService.authField(authFieldFormDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java index 7025c1870c..6db7752cfd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java @@ -1,7 +1,9 @@ package com.epmet.dao; import com.epmet.dto.UserBadgeCertificateRecordDTO; +import com.epmet.dto.form.AuthFieldFormDTO; import com.epmet.dto.form.UserBadgeListFormDTO; +import com.epmet.dto.result.AuthFieldResultDTO; import com.epmet.dto.result.CertificationDetailResultDTO; import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.dto.result.UserOperListResultDTO; @@ -74,4 +76,12 @@ public interface UserBadgeDao { * @date 2020/11/4 4:09 下午 */ CertificationDetailResultDTO selectBadgeAuthRecord(@Param("userId")String userId, @Param("badgeId")String badgeId); + + /** + * @Description 个人中心-查询徽章要显示的认证信息字段 + * @Param authFieldFormDTO + * @author zxc + * @date 2020/11/4 5:05 下午 + */ + List selectAuthField(AuthFieldFormDTO authFieldFormDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java index e9cc979c91..b8bf156046 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java @@ -1,13 +1,12 @@ package com.epmet.service; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.*; +import com.epmet.dto.result.AuthFieldResultDTO; import com.epmet.dto.result.CertificationDetailResultDTO; import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.dto.result.UserOperListResultDTO; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -58,4 +57,12 @@ public interface UserBadgeService { */ CertificationDetailResultDTO certificationDetail(TokenDto tokenDto, CertificationDetailFormDTO certificationDetailFormDTO); + /** + * @Description 个人中心-查询徽章要显示的认证信息字段 + * @Param authFieldFormDTO + * @author zxc + * @date 2020/11/4 5:05 下午 + */ + List authField(AuthFieldFormDTO authFieldFormDTO); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 2d96216eaa..d1d8d1266f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -46,8 +46,6 @@ public class UserBadgeServiceImpl implements UserBadgeService { @Autowired private UserBaseInfoService userBaseInfoService; @Autowired - private CustomerStaffService customerStaffService; - @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; /** @@ -209,4 +207,20 @@ public class UserBadgeServiceImpl implements UserBadgeService { return userBadgeDao.selectBadgeAuthRecord(certificationDetailFormDTO.getUserId(), certificationDetailFormDTO.getBadgeId()); } + + /** + * @Description 个人中心-查询徽章要显示的认证信息字段 + * @Param authFieldFormDTO + * @author zxc + * @date 2020/11/4 5:05 下午 + */ + @Override + public List authField(AuthFieldFormDTO authFieldFormDTO) { + List authFieldResultDTOS = userBadgeDao.selectAuthField(authFieldFormDTO); + if (CollectionUtils.isEmpty(authFieldResultDTOS)){ + return new ArrayList<>(); + } + return authFieldResultDTOS; + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index 5d46734499..bbecca58ec 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -92,6 +92,23 @@ AND USER_ID = #{userId} + + + INSERT INTO user_badge_certificate_record ( From 28b1d13eea39d161872dc644a0edb09ec233c91a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 5 Nov 2020 09:49:43 +0800 Subject: [PATCH 012/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E7=82=B9=E4=BA=AE/?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=82=B9=E4=BA=AE=F0=9F=9B=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../badege/controller/BadgeController.java | 14 ++++++++++ .../modules/badege/service/BadgeService.java | 9 +++++++ .../badege/service/impl/BadgeServiceImpl.java | 16 ++++++++++++ .../epmet/dto/form/OpenedOrClosedFormDTO.java | 26 +++++++++++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 9 +++++++ .../EpmetUserOpenFeignClientFallback.java | 5 ++++ .../epmet/controller/UserBadgeController.java | 12 +++++++++ .../main/java/com/epmet/dao/UserBadgeDao.java | 8 ++++++ .../com/epmet/service/UserBadgeService.java | 8 ++++++ .../service/impl/UserBadgeServiceImpl.java | 12 ++++++++- .../main/resources/mapper/UserBadgeDao.xml | 10 +++++++ 11 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OpenedOrClosedFormDTO.java diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java index 8d70e5d097..da3bfca3d2 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.OpenedOrClosedFormDTO; import com.epmet.modules.badege.service.BadgeService; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; import com.epmet.dto.form.CertificationAddFormDTO; @@ -67,5 +68,18 @@ public class BadgeController { return new Result(); } + /** + * @Description 个人中心-取消/点亮徽章 + * @Param openedOrClosedFormDTO + * @author zxc + * @date 2020/11/5 9:23 上午 + */ + @PostMapping("openedorclosed") + public Result openedOrClosed(@LoginUser TokenDto tokenDto,@RequestBody OpenedOrClosedFormDTO openedOrClosedFormDTO){ + ValidatorUtils.validateEntity(openedOrClosedFormDTO, OpenedOrClosedFormDTO.OpenedOrClosed.class); + badgeService.openedOrClosed(tokenDto,openedOrClosedFormDTO); + return new Result(); + } + } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java index 6d020bc286..1b67df51f8 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java @@ -1,6 +1,7 @@ package com.epmet.modules.badege.service; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.OpenedOrClosedFormDTO; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.resi.mine.dto.from.OperListFormDTO; @@ -40,4 +41,12 @@ public interface BadgeService { */ void certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO); + /** + * @Description 个人中心-取消/点亮徽章 + * @Param openedOrClosedFormDTO + * @author zxc + * @date 2020/11/5 9:23 上午 + */ + void openedOrClosed(TokenDto tokenDto,OpenedOrClosedFormDTO openedOrClosedFormDTO); + } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java index 259ffc23ae..4abc5853b6 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.OpenedOrClosedFormDTO; import com.epmet.dto.form.UserBadgeListFormDTO; import com.epmet.dto.form.UserOperListFormDTO; import com.epmet.dto.result.UserBadgeListResultDTO; @@ -92,4 +93,19 @@ public class BadgeServiceImpl implements BadgeService { throw new RenException("提交徽章认证失败......"); } } + + /** + * @Description 个人中心-取消/点亮徽章 + * @Param openedOrClosedFormDTO + * @author zxc + * @date 2020/11/5 9:23 上午 + */ + @Override + public void openedOrClosed(TokenDto tokenDto,OpenedOrClosedFormDTO openedOrClosedFormDTO) { + openedOrClosedFormDTO.setUserId(tokenDto.getUserId()); + Result result = epmetUserOpenFeignClient.openedOrClosed(openedOrClosedFormDTO); + if (!result.success()){ + throw new RenException("取消/点亮徽章失败了......"); + } + } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OpenedOrClosedFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OpenedOrClosedFormDTO.java new file mode 100644 index 0000000000..15353d9685 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OpenedOrClosedFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/4 5:43 下午 + */ +@Data +public class OpenedOrClosedFormDTO implements Serializable { + + private static final long serialVersionUID = 483466676158603066L; + + public interface OpenedOrClosed{} + + @NotBlank(message = "客户ID不能为空",groups = {OpenedOrClosed.class}) + private String customerId; + + private String userId; + + @NotBlank(message = "徽章ID不能为空",groups = {OpenedOrClosed.class}) + private String badgeId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index f5f531b656..00397c89e1 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -364,4 +364,13 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/more/badge/authbadgerecord") Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO); + + /** + * @Description 个人中心-取消/点亮徽章 + * @Param openedOrClosedFormDTO + * @author zxc + * @date 2020/11/5 9:23 上午 + */ + @PostMapping("/epmetuser/more/badge/openedorclosed") + Result openedOrClosed(@RequestBody OpenedOrClosedFormDTO openedOrClosedFormDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 789acb75f4..6091c24821 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -240,4 +240,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "authBadgeRecord", certificationAddFormDTO); } + + @Override + public Result openedOrClosed(OpenedOrClosedFormDTO openedOrClosedFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "openedOrClosed", openedOrClosedFormDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java index 3a4a590a81..c0aa74d53e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java @@ -101,4 +101,16 @@ public class UserBadgeController { return new Result>().ok(userBadgeService.authField(authFieldFormDTO)); } + /** + * @Description 个人中心-取消/点亮徽章 + * @Param openedOrClosedFormDTO + * @author zxc + * @date 2020/11/4 5:47 下午 + */ + @PostMapping("openedorclosed") + public Result openedOrClosed(@RequestBody OpenedOrClosedFormDTO openedOrClosedFormDTO){ + userBadgeService.openedOrClosed(openedOrClosedFormDTO); + return new Result(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java index 6db7752cfd..a100a80ec2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java @@ -2,6 +2,7 @@ package com.epmet.dao; import com.epmet.dto.UserBadgeCertificateRecordDTO; import com.epmet.dto.form.AuthFieldFormDTO; +import com.epmet.dto.form.OpenedOrClosedFormDTO; import com.epmet.dto.form.UserBadgeListFormDTO; import com.epmet.dto.result.AuthFieldResultDTO; import com.epmet.dto.result.CertificationDetailResultDTO; @@ -84,4 +85,11 @@ public interface UserBadgeDao { * @date 2020/11/4 5:05 下午 */ List selectAuthField(AuthFieldFormDTO authFieldFormDTO); + /** + * @Description 个人中心-取消/点亮徽章 + * @Param openedOrClosedFormDTO + * @author zxc + * @date 2020/11/4 6:04 下午 + */ + void updateIsOpen(OpenedOrClosedFormDTO openedOrClosedFormDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java index b8bf156046..227584a101 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java @@ -65,4 +65,12 @@ public interface UserBadgeService { */ List authField(AuthFieldFormDTO authFieldFormDTO); + /** + * @Description 个人中心-取消/点亮徽章 + * @Param openedOrClosedFormDTO + * @author zxc + * @date 2020/11/4 5:47 下午 + */ + void openedOrClosed(OpenedOrClosedFormDTO openedOrClosedFormDTO); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index d1d8d1266f..24af3d436b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -16,7 +16,6 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.redis.UserBadgeRedis; -import com.epmet.service.CustomerStaffService; import com.epmet.service.UserBadgeService; import com.epmet.service.UserBaseInfoService; import lombok.extern.slf4j.Slf4j; @@ -223,4 +222,15 @@ public class UserBadgeServiceImpl implements UserBadgeService { return authFieldResultDTOS; } + /** + * @Description 个人中心-取消/点亮徽章 + * @Param openedOrClosedFormDTO + * @author zxc + * @date 2020/11/4 5:47 下午 + */ + @Override + public void openedOrClosed(OpenedOrClosedFormDTO openedOrClosedFormDTO) { + userBadgeDao.updateIsOpen(openedOrClosedFormDTO); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index bbecca58ec..436898cc61 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -12,6 +12,16 @@ AND USER_ID = #{userId} + + + UPDATE resi_user_badge + SET IS_OPENED = (case when IS_OPENED = 1 THEN 0 ELSE 1 END), + UPDATED_TIME = NOW() + WHERE DEL_FLAG = '0' + AND USER_ID = #{userId} + AND BADGE_ID = #{badgeId} + + @@ -49,7 +50,8 @@ FROM badge WHERE DEL_FLAG = '0' - AND (CUSTOMER_ID = 'default' OR CUSTOMER_ID = 'zxc') + AND (CUSTOMER_ID = 'default' OR CUSTOMER_ID = #{customerId}) + AND BADGE_STATUS = 'online' From c34e6a619c0dc11b7c5fe686bcdf27bde23e5304 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 5 Nov 2020 14:46:01 +0800 Subject: [PATCH 016/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/UserBadgeServiceImpl.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 33a4d0a922..f7ed9f2266 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -64,15 +64,20 @@ public class UserBadgeServiceImpl implements UserBadgeService { Map> groupByCustomer = userBadgeListResultDTOS.stream().collect(Collectors.groupingBy(UserBadgeListResultDTO::getCustomerId)); resultUserBadge.addAll(groupByCustomer.get(BadgeConstant.DEFAULT_CUSTOMER)); List badgeByCustomer = groupByCustomer.get(userBadgeListFormDTO.getCustomerId()); - resultUserBadge.forEach(r -> { - badgeByCustomer.forEach(b -> { - if (r.getBadgeId().equals(b.getBadgeId())){ - BeanUtils.copyProperties(b,r); - } + if (!CollectionUtils.isEmpty(badgeByCustomer)) { + resultUserBadge.forEach(r -> { + badgeByCustomer.forEach(b -> { + if (r.getBadgeId().equals(b.getBadgeId())) { + BeanUtils.copyProperties(b, r); + } + }); }); - }); - userBadgeRedis.setCustomerBadge(resultUserBadge,userBadgeListFormDTO.getCustomerId()); - userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId()); + userBadgeRedis.setCustomerBadge(resultUserBadge, userBadgeListFormDTO.getCustomerId()); + userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId()); + }else { + userBadgeRedis.setCustomerBadge(resultUserBadge, userBadgeListFormDTO.getCustomerId()); + userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId()); + } } } List redisUserBadgeList = JSON.parseArray(userBadge.toString(), UserBadgeListResultDTO.class); From 2171e513f845e5366e8e26f98839e3958db229e6 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 5 Nov 2020 14:53:06 +0800 Subject: [PATCH 017/125] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/CertificationDetailResultDTO.java | 5 +++++ .../src/main/resources/mapper/UserBadgeDao.xml | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java index 4e7298c1b9..2120fe7fb0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java @@ -57,4 +57,9 @@ public class CertificationDetailResultDTO implements Serializable { * 驳回原因 */ private String authReason; + + /** + * 审核记录ID + */ + private String recordId; } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index 1b4e6a0c78..022d95e7f8 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -94,7 +94,8 @@ CERTIFICATION_IMG, AUDIT_STATUS, AUDIT_STATUS AS authResult, - AUDIT_REMARK AS authReason + AUDIT_REMARK AS authReason, + ID AS recordId FROM user_badge_certificate_record WHERE From 4ab5801effd47a22ae50d474e7884767284856ba Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Thu, 5 Nov 2020 14:54:04 +0800 Subject: [PATCH 018/125] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=BB=BA=E8=AE=AEini?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mine/dto/from/MyAdviceListFormDTO.java | 10 ++ .../mine/dto/from/SubmitAdviceFormDTO.java | 13 ++ .../advice/controller/AdviceController.java | 53 +++++++++ .../modules/advice/service/AdviceService.java | 11 ++ .../service/impl/AdviceServiceImpl.java | 41 +++++++ .../java/com/epmet/dto/UserAdviceDTO.java | 111 ++++++++++++++++++ .../java/com/epmet/dto/UserAdviceImgDTO.java | 81 +++++++++++++ .../controller/UserAdviceController.java | 94 +++++++++++++++ .../controller/UserAdviceImgController.java | 94 +++++++++++++++ .../java/com/epmet/dao/UserAdviceDao.java | 33 ++++++ .../java/com/epmet/dao/UserAdviceImgDao.java | 33 ++++++ .../com/epmet/entity/UserAdviceEntity.java | 81 +++++++++++++ .../com/epmet/entity/UserAdviceImgEntity.java | 51 ++++++++ .../java/com/epmet/excel/UserAdviceExcel.java | 80 +++++++++++++ .../com/epmet/excel/UserAdviceImgExcel.java | 62 ++++++++++ .../com/epmet/redis/UserAdviceImgRedis.java | 47 ++++++++ .../java/com/epmet/redis/UserAdviceRedis.java | 47 ++++++++ .../epmet/service/UserAdviceImgService.java | 95 +++++++++++++++ .../com/epmet/service/UserAdviceService.java | 95 +++++++++++++++ .../impl/UserAdviceImgServiceImpl.java | 104 ++++++++++++++++ .../service/impl/UserAdviceServiceImpl.java | 104 ++++++++++++++++ .../main/resources/mapper/UserAdviceDao.xml | 25 ++++ .../resources/mapper/UserAdviceImgDao.xml | 19 +++ 23 files changed, 1384 insertions(+) create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyAdviceListFormDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/SubmitAdviceFormDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceImgDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceImgController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceImgDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceImgExcel.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceImgService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceImgDao.xml diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyAdviceListFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyAdviceListFormDTO.java new file mode 100644 index 0000000000..b8cf057c5c --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyAdviceListFormDTO.java @@ -0,0 +1,10 @@ +package com.epmet.resi.mine.dto.from; + +/** + * @description: 我的建议列表DTO + * @author: liushaowen + * @date: 2020/11/5 10:38 + */ + +public class MyAdviceListFormDTO { +} diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/SubmitAdviceFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/SubmitAdviceFormDTO.java new file mode 100644 index 0000000000..8ea37f2603 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/SubmitAdviceFormDTO.java @@ -0,0 +1,13 @@ +package com.epmet.resi.mine.dto.from; + +import lombok.Data; + +/** + * @description: 提交建议DTO + * @author: liushaowen + * @date: 2020/11/5 10:35 + */ + +@Data +public class SubmitAdviceFormDTO { +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java new file mode 100644 index 0000000000..b06c7b3592 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java @@ -0,0 +1,53 @@ +package com.epmet.modules.advice.controller; + +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.modules.advice.service.AdviceService; +import com.epmet.resi.mine.dto.from.MyAdviceListFormDTO; +import com.epmet.resi.mine.dto.from.SubmitAdviceFormDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @description: 用户建议controller + * @author: liushaowen + * @date: 2020/11/5 9:34 + */ +@RestController +@RequestMapping("advice") +public class AdviceController { + @Autowired + private AdviceService adviceService; + + @Autowired + private LoginUserUtil loginUserUtil; + + /** + * @Description 提交建议 + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/11/5 10:37 + */ + @PostMapping("submitadvice") + public Result submitAdvice(SubmitAdviceFormDTO dto){ + ValidatorUtils.validateEntity(dto); + return adviceService.submitAdvice(dto); + } + + /** + * @Description 我的建议列表 + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/11/5 13:26 + */ + @PostMapping("myadvicelist") + public Result getMyAdviceList(MyAdviceListFormDTO dto){ + ValidatorUtils.validateEntity(dto); + return adviceService.getMyAdviceList(dto); + } +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java new file mode 100644 index 0000000000..af9eabd547 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java @@ -0,0 +1,11 @@ +package com.epmet.modules.advice.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.mine.dto.from.MyAdviceListFormDTO; +import com.epmet.resi.mine.dto.from.SubmitAdviceFormDTO; + +public interface AdviceService { + Result submitAdvice(SubmitAdviceFormDTO dto); + + Result getMyAdviceList(MyAdviceListFormDTO dto); +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java new file mode 100644 index 0000000000..6f751622b1 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java @@ -0,0 +1,41 @@ +package com.epmet.modules.advice.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.modules.advice.service.AdviceService; +import com.epmet.resi.mine.dto.from.MyAdviceListFormDTO; +import com.epmet.resi.mine.dto.from.SubmitAdviceFormDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/5 10:27 + */ +@Service +public class AdviceServiceImpl implements AdviceService { + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + /*** + * 提交建议 + * @param dto + * @return + */ + @Override + public Result submitAdvice(SubmitAdviceFormDTO dto) { + return null; + } + + /** + * @Description 我的建议列表 + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/11/5 10:40 + */ + @Override + public Result getMyAdviceList(MyAdviceListFormDTO dto) { + return null; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java new file mode 100644 index 0000000000..5521fa02c4 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户建议 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-04 + */ +@Data +public class UserAdviceDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * userid + */ + private String userId; + + /** + * 建议描述 + */ + private String adviceContent; + + /** + * 手机号 + */ + private String phone; + + /** + * 问题分类(gov政府software软件,逗号分隔) + */ + private String adviceType; + + /** + * 回复内容 + */ + private String replyContent; + + /** + * 回复人 + */ + private String replyUser; + + /** + * 回复时间 + */ + private Date replyTime; + + /** + * 删除标志 + */ + 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/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceImgDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceImgDTO.java new file mode 100644 index 0000000000..37a50e3df6 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceImgDTO.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户建议图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-04 + */ +@Data +public class UserAdviceImgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 建议id + */ + private String adviceId; + + /** + * 图片url + */ + private String imgUrl; + + /** + * 删除标志 + */ + 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/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java new file mode 100644 index 0000000000..8237057e85 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.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.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.UserAdviceDTO; +import com.epmet.excel.UserAdviceExcel; +import com.epmet.service.UserAdviceService; +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 2020-11-04 + */ +@RestController +@RequestMapping("useradvice") +public class UserAdviceController { + + @Autowired + private UserAdviceService userAdviceService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = userAdviceService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + UserAdviceDTO data = userAdviceService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody UserAdviceDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + userAdviceService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody UserAdviceDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + userAdviceService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + userAdviceService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = userAdviceService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, UserAdviceExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceImgController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceImgController.java new file mode 100644 index 0000000000..2be0871e68 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceImgController.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.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.UserAdviceImgDTO; +import com.epmet.excel.UserAdviceImgExcel; +import com.epmet.service.UserAdviceImgService; +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 2020-11-04 + */ +@RestController +@RequestMapping("useradviceimg") +public class UserAdviceImgController { + + @Autowired + private UserAdviceImgService userAdviceImgService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = userAdviceImgService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + UserAdviceImgDTO data = userAdviceImgService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody UserAdviceImgDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + userAdviceImgService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody UserAdviceImgDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + userAdviceImgService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + userAdviceImgService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = userAdviceImgService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, UserAdviceImgExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java new file mode 100644 index 0000000000..6ee2c40017 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.UserAdviceEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户建议 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-04 + */ +@Mapper +public interface UserAdviceDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceImgDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceImgDao.java new file mode 100644 index 0000000000..2990eed0d9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceImgDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.UserAdviceImgEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户建议图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-04 + */ +@Mapper +public interface UserAdviceImgDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java new file mode 100644 index 0000000000..720692b778 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户建议 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_advice") +public class UserAdviceEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * userid + */ + private String userId; + + /** + * 建议描述 + */ + private String adviceContent; + + /** + * 手机号 + */ + private String phone; + + /** + * 问题分类(gov政府software软件,逗号分隔) + */ + private String adviceType; + + /** + * 回复内容 + */ + private String replyContent; + + /** + * 回复人 + */ + private String replyUser; + + /** + * 回复时间 + */ + private Date replyTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java new file mode 100644 index 0000000000..c899502c84 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpdcEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户建议图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_advice_img") +public class UserAdviceImgEntity extends BaseEpdcEntity { + + private static final long serialVersionUID = 1L; + + /** + * 建议id + */ + private String adviceId; + + /** + * 图片url + */ + private String imgUrl; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java new file mode 100644 index 0000000000..31581f4373 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 2020-11-04 + */ +@Data +public class UserAdviceExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "userid") + private String userId; + + @Excel(name = "建议描述") + private String adviceContent; + + @Excel(name = "手机号") + private String phone; + + @Excel(name = "问题分类(gov政府software软件,逗号分隔)") + private String adviceType; + + @Excel(name = "回复内容") + private String replyContent; + + @Excel(name = "回复人") + private String replyUser; + + @Excel(name = "回复时间") + private Date replyTime; + + @Excel(name = "删除标志") + 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/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceImgExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceImgExcel.java new file mode 100644 index 0000000000..55b27a6b7e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceImgExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 2020-11-04 + */ +@Data +public class UserAdviceImgExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "建议id") + private String adviceId; + + @Excel(name = "图片url") + private String imgUrl; + + @Excel(name = "删除标志") + 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/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.java new file mode 100644 index 0000000000..5c409ddb94 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceImgRedis.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.epmet.redis; + +import com.epmet.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 2020-11-04 + */ +@Component +public class UserAdviceImgRedis { + @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/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java new file mode 100644 index 0000000000..ab047022e7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.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.epmet.redis; + +import com.epmet.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 2020-11-04 + */ +@Component +public class UserAdviceRedis { + @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/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceImgService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceImgService.java new file mode 100644 index 0000000000..0e5cd1d5b5 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceImgService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.UserAdviceImgDTO; +import com.epmet.entity.UserAdviceImgEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户建议图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-04 + */ +public interface UserAdviceImgService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-11-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-11-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserAdviceImgDTO + * @author generator + * @date 2020-11-04 + */ + UserAdviceImgDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-04 + */ + void save(UserAdviceImgDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-04 + */ + void update(UserAdviceImgDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-11-04 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java new file mode 100644 index 0000000000..4e42bc095e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.UserAdviceDTO; +import com.epmet.entity.UserAdviceEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户建议 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-04 + */ +public interface UserAdviceService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-11-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-11-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserAdviceDTO + * @author generator + * @date 2020-11-04 + */ + UserAdviceDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-04 + */ + void save(UserAdviceDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-04 + */ + void update(UserAdviceDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-11-04 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.java new file mode 100644 index 0000000000..bb0828b9a2 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.UserAdviceImgDao; +import com.epmet.dto.UserAdviceImgDTO; +import com.epmet.entity.UserAdviceImgEntity; +import com.epmet.redis.UserAdviceImgRedis; +import com.epmet.service.UserAdviceImgService; +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 2020-11-04 + */ +@Service +public class UserAdviceImgServiceImpl extends BaseServiceImpl implements UserAdviceImgService { + + @Autowired + private UserAdviceImgRedis userAdviceImgRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserAdviceImgDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserAdviceImgDTO.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 UserAdviceImgDTO get(String id) { + UserAdviceImgEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserAdviceImgDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserAdviceImgDTO dto) { + UserAdviceImgEntity entity = ConvertUtils.sourceToTarget(dto, UserAdviceImgEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserAdviceImgDTO dto) { + UserAdviceImgEntity entity = ConvertUtils.sourceToTarget(dto, UserAdviceImgEntity.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/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java new file mode 100644 index 0000000000..41e1465a41 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.UserAdviceDao; +import com.epmet.dto.UserAdviceDTO; +import com.epmet.entity.UserAdviceEntity; +import com.epmet.redis.UserAdviceRedis; +import com.epmet.service.UserAdviceService; +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 2020-11-04 + */ +@Service +public class UserAdviceServiceImpl extends BaseServiceImpl implements UserAdviceService { + + @Autowired + private UserAdviceRedis userAdviceRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserAdviceDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserAdviceDTO.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 UserAdviceDTO get(String id) { + UserAdviceEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserAdviceDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserAdviceDTO dto) { + UserAdviceEntity entity = ConvertUtils.sourceToTarget(dto, UserAdviceEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserAdviceDTO dto) { + UserAdviceEntity entity = ConvertUtils.sourceToTarget(dto, UserAdviceEntity.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/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml new file mode 100644 index 0000000000..87d8addf9b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceImgDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceImgDao.xml new file mode 100644 index 0000000000..2af36ffe33 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceImgDao.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file From b9121b2cb0f1dc917f7ea9a1311b12ba6d79def3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 5 Nov 2020 15:13:55 +0800 Subject: [PATCH 019/125] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E7=BC=93=E5=AD=98=E5=BE=BD=E7=AB=A0?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dao/UserBadgeDao.java | 2 +- .../java/com/epmet/redis/UserBadgeRedis.java | 14 ++++- .../com/epmet/service/UserBadgeService.java | 8 +++ .../service/impl/UserBadgeServiceImpl.java | 53 +++++++++++-------- 4 files changed, 53 insertions(+), 24 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java index a100a80ec2..65910f22cd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java @@ -34,7 +34,7 @@ public interface UserBadgeDao { * @author zxc * @date 2020/11/3 3:11 下午 */ - List selectAllBadge(UserBadgeListFormDTO userBadgeListFormDTO); + List selectAllBadge(@Param("customerId") String customerId); /** * @Description 查询徽章认证记录 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index 5bc394a6ec..c9eaee4367 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -22,7 +22,7 @@ public class UserBadgeRedis { private RedisUtils redisUtils; /** - * @Description 获取徽章信息 + * @Description 获取客户徽章信息 * @Param customerId * @author zxc * @date 2020/11/3 2:50 下午 @@ -33,7 +33,7 @@ public class UserBadgeRedis { } /** - * @Description 存放徽章信息 + * @Description 存放客户徽章信息 * @Param userBadge * @Param customerId * @author zxc @@ -43,6 +43,16 @@ public class UserBadgeRedis { redisUtils.hSet(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE, JSON.toJSON(userBadge).toString(),-1); } + /** + * @Description 删除客户徽章信息 + * @Param customerId + * @author zxc + * @date 2020/11/5 3:06 下午 + */ + public void delCustomerBadge(String customerId){ + redisUtils.hDel(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE); + } + /** * @Description 存放徽章审核 手机验证码 * @Param mobile diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java index 227584a101..81213550b9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java @@ -73,4 +73,12 @@ public interface UserBadgeService { */ void openedOrClosed(OpenedOrClosedFormDTO openedOrClosedFormDTO); + /** + * @Description 客户徽章缓存初始化 + * @Param customerId + * @author zxc + * @date 2020/11/5 3:12 下午 + */ + void reloadCustomerBadge(String customerId); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index f7ed9f2266..c4f09a941a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -58,27 +58,8 @@ public class UserBadgeServiceImpl implements UserBadgeService { public List selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO) { Object userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId()); if (null == userBadge){ - List resultUserBadge = new ArrayList<>(); - List userBadgeListResultDTOS = userBadgeDao.selectAllBadge(userBadgeListFormDTO); - if (!CollectionUtils.isEmpty(userBadgeListResultDTOS)){ - Map> groupByCustomer = userBadgeListResultDTOS.stream().collect(Collectors.groupingBy(UserBadgeListResultDTO::getCustomerId)); - resultUserBadge.addAll(groupByCustomer.get(BadgeConstant.DEFAULT_CUSTOMER)); - List badgeByCustomer = groupByCustomer.get(userBadgeListFormDTO.getCustomerId()); - if (!CollectionUtils.isEmpty(badgeByCustomer)) { - resultUserBadge.forEach(r -> { - badgeByCustomer.forEach(b -> { - if (r.getBadgeId().equals(b.getBadgeId())) { - BeanUtils.copyProperties(b, r); - } - }); - }); - userBadgeRedis.setCustomerBadge(resultUserBadge, userBadgeListFormDTO.getCustomerId()); - userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId()); - }else { - userBadgeRedis.setCustomerBadge(resultUserBadge, userBadgeListFormDTO.getCustomerId()); - userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId()); - } - } + this.reloadCustomerBadge(userBadgeListFormDTO.getCustomerId()); + userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId()); } List redisUserBadgeList = JSON.parseArray(userBadge.toString(), UserBadgeListResultDTO.class); List userBadgeListResultDTOS = userBadgeDao.selectBadgeList(userBadgeListFormDTO); @@ -241,4 +222,34 @@ public class UserBadgeServiceImpl implements UserBadgeService { userBadgeDao.updateIsOpen(openedOrClosedFormDTO); } + /** + * @Description 客户徽章缓存初始化 + * @Param customerId + * @author zxc + * @date 2020/11/5 3:12 下午 + */ + @Override + public void reloadCustomerBadge(String customerId){ + userBadgeRedis.delCustomerBadge(customerId); + List resultUserBadge = new ArrayList<>(); + List userBadgeListResultDTOS = userBadgeDao.selectAllBadge(customerId); + if (!CollectionUtils.isEmpty(userBadgeListResultDTOS)){ + Map> groupByCustomer = userBadgeListResultDTOS.stream().collect(Collectors.groupingBy(UserBadgeListResultDTO::getCustomerId)); + resultUserBadge.addAll(groupByCustomer.get(BadgeConstant.DEFAULT_CUSTOMER)); + List badgeByCustomer = groupByCustomer.get(customerId); + if (!CollectionUtils.isEmpty(badgeByCustomer)) { + resultUserBadge.forEach(r -> { + badgeByCustomer.forEach(b -> { + if (r.getBadgeId().equals(b.getBadgeId())) { + BeanUtils.copyProperties(b, r); + } + }); + }); + userBadgeRedis.setCustomerBadge(resultUserBadge, customerId); + }else { + userBadgeRedis.setCustomerBadge(resultUserBadge, customerId); + } + } + } + } From fee41215cd6f7243ba09e2a1caf927f372d12c70 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 5 Nov 2020 15:22:25 +0800 Subject: [PATCH 020/125] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=BE=BD=E7=AB=A0?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/UserBadgeServiceImpl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index c4f09a941a..986d9eed7f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -245,10 +245,8 @@ public class UserBadgeServiceImpl implements UserBadgeService { } }); }); - userBadgeRedis.setCustomerBadge(resultUserBadge, customerId); - }else { - userBadgeRedis.setCustomerBadge(resultUserBadge, customerId); } + userBadgeRedis.setCustomerBadge(resultUserBadge, customerId); } } From f6fd212bf5d18872d732737d496be1259e56cebf Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Thu, 5 Nov 2020 15:30:12 +0800 Subject: [PATCH 021/125] fix --- .../src/main/java/com/epmet/entity/UserAdviceEntity.java | 7 ++++--- .../main/java/com/epmet/entity/UserAdviceImgEntity.java | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java index 720692b778..dcf168cc2d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java @@ -19,7 +19,8 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; -import com.epmet.commons.mybatis.entity.BaseEpdcEntity; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -34,7 +35,7 @@ import java.util.Date; @Data @EqualsAndHashCode(callSuper=false) @TableName("user_advice") -public class UserAdviceEntity extends BaseEpdcEntity { +public class UserAdviceEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; @@ -78,4 +79,4 @@ public class UserAdviceEntity extends BaseEpdcEntity { */ private Date replyTime; -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java index c899502c84..a507b96b38 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.java @@ -19,7 +19,7 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; -import com.epmet.commons.mybatis.entity.BaseEpdcEntity; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -34,7 +34,7 @@ import java.util.Date; @Data @EqualsAndHashCode(callSuper=false) @TableName("user_advice_img") -public class UserAdviceImgEntity extends BaseEpdcEntity { +public class UserAdviceImgEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; @@ -48,4 +48,4 @@ public class UserAdviceImgEntity extends BaseEpdcEntity { */ private String imgUrl; -} \ No newline at end of file +} From 6b8131766ade76b1ca2b2968bfff7afe756a926d Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 5 Nov 2020 17:42:04 +0800 Subject: [PATCH 022/125] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8B=8B=E7=AB=A0?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisUtils.java | 41 ++++++++- .../epmet/dto/form/UserBadgeUnitFormDTO.java | 48 ++++++++++ .../com/epmet/constant/UserRedisKeys.java | 10 ++ .../src/main/java/com/epmet/dao/BadgeDao.java | 10 ++ .../java/com/epmet/redis/UserBadgeRedis.java | 92 ++++++++++++++++--- .../src/main/resources/mapper/BadgeDao.xml | 39 ++++++++ 6 files changed, 227 insertions(+), 13 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index 27a081dacc..db65ca6e0d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -9,16 +9,23 @@ package com.epmet.commons.tools.redis; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.*; import org.springframework.data.redis.support.atomic.RedisAtomicLong; import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; import java.util.Collection; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; /** * Redis工具类 @@ -171,10 +178,40 @@ public class RedisUtils { } } - public Object lindex(String key,Long index){ - return redisTemplate.opsForList().index(key,index); + public Object lindex(String key,Long index){ return redisTemplate.opsForList().index(key,index); } + public List lrange(String key,long start,long end,Class clazz){ + List content = redisTemplate.opsForList().range(key,start,end); + if(CollectionUtils.isEmpty(content)) return null; + return content.stream().map( o -> { + try { + T target = clazz.newInstance(); + BeanUtils.copyProperties(o, target); + return target; + }catch (Exception e){throw new RenException("convert error");}finally{throw new RenException("convert error");} + }).collect(Collectors.toList()); + } + + /** + * @Description Redis lrem : + * 根据参数 count 的值,移除列表中与参数 value 相等的元素 + * COUNT 的值可以是以下几种 : + * count > 0 : 从表头开始向表尾搜索,移除与 value 相等的元素,数量为 count + * count < 0 : 从表尾开始向表头搜索,移除与 value 相等的元素,数量为 count 的绝对值 + * count = 0 : 移除表中所有与 value 相等的值 + * 返回值 : + * 被移除元素的数量 + * 列表不存在时返回 0 + * @param key + * @param count + * @param o 这里的Object需要重写equals(FIXME 注意序列化) + * @return long + * @author wangc + * @date 2020.11.05 10:22 + */ + public long lrem(String key,long count,Object o){ return redisTemplate.opsForList().remove(key,count,o);} + public Object rightPop(String key) { return redisTemplate.opsForList().rightPop(key); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java new file mode 100644 index 0000000000..406f527bb9 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Objects; + +/** + * @Description 用户-徽章缓存单元 + * @ClassName UserBadgeUnitFormDTO + * @Auth wangc + * @Date 2020-11-05 10:00 + */ +@Data +public class UserBadgeUnitFormDTO implements Serializable { + private static final long serialVersionUID = -4497394865738168850L; + + /** + * 徽章Id + */ + private String badgeId; + + /** + * 徽章图标 url + */ + private String badgeIcon; + + /** + * 徽章名称 + */ + private String badgeName; + + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UserBadgeUnitFormDTO that = (UserBadgeUnitFormDTO) o; + return badgeId.equals(that.badgeId) && + badgeIcon.equals(that.badgeIcon) && + badgeName.equals(that.badgeName); + } + + @Override + public int hashCode() { + return Objects.hash(badgeId, badgeIcon, badgeName); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java index f4fffb6975..599beea58f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java @@ -23,4 +23,14 @@ public class UserRedisKeys { public static String getResiUserKey(String userId){ return rootPrefix.concat("resi:user:").concat(userId); } + + /** + * @Description 用户勋章缓存 epmet:badge:user:[customerId]:[userId] + * @param userId + * @return epmet:badge:user:[customerId]:[userId] + * @author wangc + * @date 2020.11.05 13:34 + */ + public static String getResiUserBadgeKey(String customerId,String userId){ + return rootPrefix.concat("badge:user:").concat(customerId).concat(userId);} } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java index 965f753b6e..3b3fa6c596 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.result.BadgeDetailResultDTO; import com.epmet.dto.result.BadgeListResultDTO; +import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.entity.BadgeEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -105,4 +106,13 @@ public interface BadgeDao extends BaseDao { * @return void */ void deleteBadge(@Param("customerId") String customerId, @Param("badgeId") String badgeId); + + /** + * @Description 查询客户的徽章 + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.11.05 15:50 + */ + List selectCustomerBadgePool(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index c9eaee4367..0fc766cdf6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -1,13 +1,26 @@ package com.epmet.redis; + +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.BadgeConstant; +import com.epmet.constant.UserRedisKeys; +import com.epmet.dao.BadgeDao; +import com.epmet.dto.form.UserBadgeUnitFormDTO; +import com.epmet.dto.result.BadgeListResultDTO; import com.epmet.dto.result.UserBadgeListResultDTO; +import com.epmet.service.UserBadgeService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.List; +import java.util.Optional; import static com.epmet.commons.tools.redis.RedisUtils.MINUTE_THIRTY_EXPIRE; @@ -16,45 +29,50 @@ import static com.epmet.commons.tools.redis.RedisUtils.MINUTE_THIRTY_EXPIRE; * @DateTime 2020/11/3 2:21 下午 */ @Component +@Slf4j public class UserBadgeRedis { @Autowired private RedisUtils redisUtils; + @Autowired + private BadgeDao badgeDao; + @Autowired + private UserBadgeService badgeService; /** - * @Description 获取客户徽章信息 + * @Description 获取客户徽章信息 * @Param customerId * @author zxc * @date 2020/11/3 2:50 下午 */ - public Object getCustomerBadge(String customerId){ + public Object getCustomerBadge(String customerId) { Object userBadge = redisUtils.hGet(BadgeConstant.BADGE_KEY + customerId, BadgeConstant.BADGE); return userBadge; } /** - * @Description 存放客户徽章信息 + * @Description 存放客户徽章信息 * @Param userBadge * @Param customerId * @author zxc * @date 2020/11/3 2:51 下午 */ - public void setCustomerBadge(List userBadge, String customerId){ - redisUtils.hSet(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE, JSON.toJSON(userBadge).toString(),-1); + public void setCustomerBadge(List userBadge, String customerId) { + redisUtils.hSet(BadgeConstant.BADGE_KEY + customerId, BadgeConstant.BADGE, JSON.toJSON(userBadge).toString(), -1); } /** - * @Description 删除客户徽章信息 + * @Description 删除客户徽章信息 * @Param customerId * @author zxc * @date 2020/11/5 3:06 下午 */ - public void delCustomerBadge(String customerId){ - redisUtils.hDel(BadgeConstant.BADGE_KEY+customerId,BadgeConstant.BADGE); + public void delCustomerBadge(String customerId) { + redisUtils.hDel(BadgeConstant.BADGE_KEY + customerId, BadgeConstant.BADGE); } /** - * @Description 存放徽章审核 手机验证码 + * @Description 存放徽章审核 手机验证码 * @Param mobile * @author zxc * @date 2020/11/5 10:30 上午 @@ -65,7 +83,7 @@ public class UserBadgeRedis { } /** - * @Description 获取徽章审核 手机验证码 + * @Description 获取徽章审核 手机验证码 * @Param mobile * @author zxc * @date 2020/11/5 10:30 上午 @@ -76,4 +94,56 @@ public class UserBadgeRedis { return smsCode; } -} + /** + * @param userId + * @return java.util.List + * @Description 获取用户的全部勋章信息(点亮的 、 排序从前到后) + * @author wangc + * @date 2020.11.05 13:26 + */ + public List obtainUserBadge2List(String userId) { + //TODO 补偿 + return redisUtils.lrange(UserRedisKeys.getResiUserKey(userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); + } + + /** + * 用户点亮或取消徽章 + * @param + * @return int + * @Description 入栈时使用lpush 出栈时使用lrem + * @author wangc + * @date 2020.11.05 13:37 + */ + public long pushOrRemoveUserBadge4List(String userId, String badgeId, String customerId) { + List orient = obtainUserBadge2List(userId); + UserBadgeUnitFormDTO unit = null; + + if (!CollectionUtils.isEmpty(orient)) { + Optional opt = orient.stream().filter(badge -> StringUtils.equals(badgeId, badge.getBadgeId())).findFirst(); + if (opt.isPresent()) { + unit = opt.get(); + return redisUtils.lrem(UserRedisKeys.getResiUserBadgeKey(customerId, userId), NumConstant.ONE, unit); + } + } + + //徽章池 + List badgePool = + Optional.ofNullable(JSON.parseArray(getCustomerBadge(customerId).toString(), UserBadgeListResultDTO.class)) + .orElse(badgeDao.selectCustomerBadgePool(customerId)); + if (CollectionUtils.isEmpty(badgePool)) { + log.error("com.epmet.redis.UserBadgeRedis.pushOrRemoveUserBadge4List,缓存中客户{}下的徽章池为空", customerId); + return NumConstant.ZERO; + } + + if (null == unit) { + Optional poolOpt = + badgePool.stream().filter(badge -> StringUtils.equals(badge.getBadgeId(), badgeId)).findFirst(); + if (poolOpt.isPresent()) unit = ConvertUtils.sourceToTarget(poolOpt.get(), UserBadgeUnitFormDTO.class); + else return NumConstant.ZERO; + } + redisUtils.leftPush(UserRedisKeys.getResiUserBadgeKey(customerId, userId), unit); + return NumConstant.ONE; + } + + } + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index 322604bc70..d66bb7194a 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -112,5 +112,44 @@ select * from badge where DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND ID = #{badgeId} + + \ No newline at end of file From cca7e6eb309fdb7f9f7ad3ca2be377cabc6d56f8 Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 6 Nov 2020 09:11:51 +0800 Subject: [PATCH 023/125] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8B=8B=E7=AB=A0?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/BadgeController.java | 5 +++++ .../main/java/com/epmet/redis/UserBadgeRedis.java | 5 ++++- .../main/java/com/epmet/service/BadgeService.java | 2 ++ .../com/epmet/service/impl/BadgeServiceImpl.java | 12 ++++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java index 92a2621013..463fa4874a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java @@ -100,5 +100,10 @@ public class BadgeController { return new Result(); } + @PostMapping("test-cache") + public Result testCache(){ + badgeService.testCache(); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index 0fc766cdf6..da4eecfd5b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -127,8 +127,11 @@ public class UserBadgeRedis { } //徽章池 + Object badgeObj = getCustomerBadge(customerId); + List badgePool = - Optional.ofNullable(JSON.parseArray(getCustomerBadge(customerId).toString(), UserBadgeListResultDTO.class)) + null == badgeObj ? null : + Optional.ofNullable(JSON.parseArray(badgeObj.toString(), UserBadgeListResultDTO.class)) .orElse(badgeDao.selectCustomerBadgePool(customerId)); if (CollectionUtils.isEmpty(badgePool)) { log.error("com.epmet.redis.UserBadgeRedis.pushOrRemoveUserBadge4List,缓存中客户{}下的徽章池为空", customerId); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java index 7b73e28561..f041e19286 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java @@ -147,4 +147,6 @@ public interface BadgeService extends BaseService { * @return void */ void deleteBadge(TokenDto tokenDto, BadgeFormDTO formDTO); + + void testCache(); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 021b0c734a..21462c8b7d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -33,12 +33,15 @@ import com.epmet.dto.BadgeDTO; import com.epmet.dto.form.AddBadgeFormDTO; import com.epmet.dto.form.BadgeFormDTO; import com.epmet.dto.form.EditBadgeFormDTO; +import com.epmet.dto.form.UserBadgeUnitFormDTO; import com.epmet.dto.result.BadgeDetailResultDTO; import com.epmet.dto.result.BadgeListResultDTO; import com.epmet.entity.BadgeCertificationConfigEntity; import com.epmet.entity.BadgeEntity; +import com.epmet.redis.UserBadgeRedis; import com.epmet.service.BadgeCertificationConfigService; import com.epmet.service.BadgeService; +import com.epmet.service.UserBadgeService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -61,6 +64,8 @@ public class BadgeServiceImpl extends BaseServiceImpl imp @Autowired private BadgeCertificationConfigService badgeCertificationConfigService; + @Autowired + private UserBadgeRedis badgeRedis; @Override @@ -245,4 +250,11 @@ public class BadgeServiceImpl extends BaseServiceImpl imp badgeCertificationConfigService.deleteConfig(tokenDto.getCustomerId(), formDTO.getBadgeId()); } + @Override + public void testCache() { + badgeRedis.pushOrRemoveUserBadge4List("test-wc","1","45687aa479955f9d06204d415238f7cc"); + List cache = badgeRedis.obtainUserBadge2List("test-wc"); + System.out.println(cache); + } + } \ No newline at end of file From b4b2f872e839fb9cca9645c4e705e0c00c205920 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 6 Nov 2020 09:36:20 +0800 Subject: [PATCH 024/125] =?UTF-8?q?=E8=AE=A2=E9=98=85=E7=9B=B8=E5=90=8C?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=97=B6=E6=B7=BB=E5=8A=A0=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=AD=97=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 1 + .../com/epmet/constant/BadgeConstant.java | 6 + .../dto/UserBadgeCertificateRecordDTO.java | 2 +- .../com/epmet/dto/form/BadgeAuditFormDTO.java | 20 +++ .../java/com/epmet/dto/form/BadgeFormDTO.java | 8 ++ .../dto/result/BadgeAuditRecordResultDTO.java | 43 +++++++ .../dto/result/BadgeAuditingResultDTO.java | 43 +++++++ .../com/epmet/controller/BadgeController.java | 44 +++++++ .../src/main/java/com/epmet/dao/BadgeDao.java | 27 ++++ .../dao/UserBadgeCertificateRecordDao.java | 33 +++++ .../UserBadgeCertificateRecordEntity.java | 116 ++++++++++++++++++ .../java/com/epmet/service/BadgeService.java | 33 +++++ .../UserBadgeCertificateRecordService.java | 95 ++++++++++++++ .../epmet/service/impl/BadgeServiceImpl.java | 88 ++++++++++++- ...UserBadgeCertificateRecordServiceImpl.java | 100 +++++++++++++++ .../src/main/resources/mapper/BadgeDao.xml | 72 ++++++++++- .../mapper/UserBadgeCertificateRecordDao.xml | 32 +++++ 17 files changed, 754 insertions(+), 9 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeCertificateRecordDao.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 2242a9ef9c..e864c6b743 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -97,6 +97,7 @@ public enum EpmetErrorCode { //徽章管理 DUPLICATE_BADGE_NAME(8515, "徽章名已存在"), + DUPLICATE_PARTY_BADGE_NAME(8516, "不可删除党员徽章"), // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java index 315bf66a30..f8b6dcc2e5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java @@ -24,4 +24,10 @@ public interface BadgeConstant { String SMS_CODE_KEY = "epmet:smsCode:badge:"; + String PARTY ="party"; + + String ONLINE ="online"; + + String OFFLINE ="offline"; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java index ffa2be3013..820f0fa45c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java @@ -13,7 +13,7 @@ import java.util.Date; public class UserBadgeCertificateRecordDTO implements Serializable { private static final long serialVersionUID = 3207509834642386145L; - + private String id; private String customerId; private String gridId; private String userId; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java new file mode 100644 index 0000000000..f7d3deac7d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/5 11:06 + */ +@NoArgsConstructor +@Data +public class BadgeAuditFormDTO implements Serializable { + private static final long serialVersionUID = 2209535364555130964L; + private String recordId; + private String auditStatus; + private String auditRemark; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java index 4b35497e8b..e9702144f0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java @@ -13,4 +13,12 @@ import java.io.Serializable; public class BadgeFormDTO implements Serializable { private static final long serialVersionUID = 9156247659994638103L; private String badgeId; + /** + * 页码 + */ + private Integer pageNo; + /** + * 每页显示数量 + */ + private Integer pageSize; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java new file mode 100644 index 0000000000..363441ad46 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/5 10:57 + */ +@Data +public class BadgeAuditRecordResultDTO implements Serializable { + private static final long serialVersionUID = 6004101838042628105L; + /** + * 徽章Id + */ + private String badgeId; + /** + * 徽章名称 + */ + private String badgeName; + /** + * 徽章图标url + */ + private String badgeIcon; + /** + * 用户Id + */ + private String userId; + /** + * 用户名 + */ + private String userName; + /** + * 创建时间 + */ + private Long createTime; + /** + * 用户名 + */ + private String auditStatus; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java new file mode 100644 index 0000000000..bbf6381d82 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/5 9:34 + */ +@NoArgsConstructor +@Data +public class BadgeAuditingResultDTO implements Serializable { + + private static final long serialVersionUID = -361914591952483084L; + /** + * 徽章Id + */ + private String badgeId; + /** + * 徽章名称 + */ + private String badgeName; + /** + * 徽章图标url + */ + private String badgeIcon; + /** + * 用户Id + */ + private String userId; + /** + * 用户名 + */ + private String userName; + /** + * 创建时间 + */ + private Long createTime; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java index 463fa4874a..12042c4fbd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java @@ -5,8 +5,11 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.AddBadgeFormDTO; +import com.epmet.dto.form.BadgeAuditFormDTO; import com.epmet.dto.form.BadgeFormDTO; import com.epmet.dto.form.EditBadgeFormDTO; +import com.epmet.dto.result.BadgeAuditRecordResultDTO; +import com.epmet.dto.result.BadgeAuditingResultDTO; import com.epmet.dto.result.BadgeDetailResultDTO; import com.epmet.dto.result.BadgeListResultDTO; import com.epmet.service.BadgeService; @@ -105,5 +108,46 @@ public class BadgeController { badgeService.testCache(); return new Result(); } + /** + * 待审核列表 + * @author zhaoqifeng + * @date 2020/11/5 9:51 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("auditinglist") + public Result> auditingList(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) { + List result = badgeService.auditingList(tokenDto, formDTO); + return new Result>().ok(result); + } + + /** + * 审核历史列表 + * @author zhaoqifeng + * @date 2020/11/5 10:59 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("auditrecord") + public Result> auditRecord(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) { + List result = badgeService.auditRecord(tokenDto, formDTO); + return new Result>().ok(result); + } + + /** + * 审核 + * @author zhaoqifeng + * @date 2020/11/5 11:09 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("audit") + public Result audit(@LoginUser TokenDto tokenDto, @RequestBody BadgeAuditFormDTO formDTO) { + badgeService.audit(tokenDto, formDTO); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java index 3b3fa6c596..a0c2fb42b6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -18,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.BadgeAuditRecordResultDTO; +import com.epmet.dto.result.BadgeAuditingResultDTO; import com.epmet.dto.result.BadgeDetailResultDTO; import com.epmet.dto.result.BadgeListResultDTO; import com.epmet.dto.result.UserBadgeListResultDTO; @@ -107,6 +109,31 @@ public interface BadgeDao extends BaseDao { */ void deleteBadge(@Param("customerId") String customerId, @Param("badgeId") String badgeId); + + /** + * 待审核列表 + * @author zhaoqifeng + * @date 2020/11/5 10:01 + * @param customerId + * @param pageNo + * @param pageSize + * @return java.util.List + */ + List selectAuditingList(@Param("customerId") String customerId, @Param("pageNo") Integer pageNo, + @Param("pageSize") Integer pageSize); + + /** + * 审核历史列表 + * @author zhaoqifeng + * @date 2020/11/5 11:01 + * @param customerId + * @param pageNo + * @param pageSize + * @return java.util.List + */ + List selectAuditRecord(@Param("customerId") String customerId, @Param("pageNo") Integer pageNo, + @Param("pageSize") Integer pageSize); + /** * @Description 查询客户的徽章 * @param customerId diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.java new file mode 100644 index 0000000000..f7f4dba91c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeCertificateRecordDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.UserBadgeCertificateRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户认证徽章记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-05 + */ +@Mapper +public interface UserBadgeCertificateRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.java new file mode 100644 index 0000000000..867ae11bdb --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBadgeCertificateRecordEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户认证徽章记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-05 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_badge_certificate_record") +public class UserBadgeCertificateRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 用户注册网格ID + */ + private String gridId; + + /** + * 用户ID + */ + private String userId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 网格内去重 + */ + private String idNum; + + /** + * 认证证件图片 + */ + private String certificationImg; + + /** + * 认证说明(备注) + */ + private String remaek; + + /** + * 审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中 + */ + private String auditStatus; + + /** + * 审核意见 + */ + private String auditRemark; + + /** + * 审核人 审核人Id + */ + private String staffId; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 是否是最新纪录:yes:最新纪录,no:非最新纪录 + */ + private String isLast; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java index f041e19286..9b13682b6f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java @@ -22,8 +22,11 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.BadgeDTO; import com.epmet.dto.form.AddBadgeFormDTO; +import com.epmet.dto.form.BadgeAuditFormDTO; import com.epmet.dto.form.BadgeFormDTO; import com.epmet.dto.form.EditBadgeFormDTO; +import com.epmet.dto.result.BadgeAuditRecordResultDTO; +import com.epmet.dto.result.BadgeAuditingResultDTO; import com.epmet.dto.result.BadgeDetailResultDTO; import com.epmet.dto.result.BadgeListResultDTO; import com.epmet.entity.BadgeEntity; @@ -148,5 +151,35 @@ public interface BadgeService extends BaseService { */ void deleteBadge(TokenDto tokenDto, BadgeFormDTO formDTO); + /** + * 待审核列表 + * @author zhaoqifeng + * @date 2020/11/5 9:50 + * @param tokenDto + * @param formDTO + * @return java.util.List + */ + List auditingList(TokenDto tokenDto, BadgeFormDTO formDTO); + + /** + * 审核历史列表 + * @author zhaoqifeng + * @date 2020/11/5 10:59 + * @param tokenDto + * @param formDTO + * @return java.util.List + */ + List auditRecord(TokenDto tokenDto, BadgeFormDTO formDTO); + + /** + * 审核 + * @author zhaoqifeng + * @date 2020/11/5 11:08 + * @param tokenDto + * @param formDTO + * @return void + */ + void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO); + void testCache(); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.java new file mode 100644 index 0000000000..154c8685db --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeCertificateRecordService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.UserBadgeCertificateRecordDTO; +import com.epmet.entity.UserBadgeCertificateRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户认证徽章记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-05 + */ +public interface UserBadgeCertificateRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-11-05 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-11-05 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserBadgeCertificateRecordDTO + * @author generator + * @date 2020-11-05 + */ + UserBadgeCertificateRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-05 + */ + void save(UserBadgeCertificateRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-05 + */ + void update(UserBadgeCertificateRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-11-05 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 21462c8b7d..4f461457f8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -30,9 +30,13 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.constant.BadgeConstant; import com.epmet.dao.BadgeDao; import com.epmet.dto.BadgeDTO; +import com.epmet.dto.UserBadgeCertificateRecordDTO; import com.epmet.dto.form.AddBadgeFormDTO; +import com.epmet.dto.form.BadgeAuditFormDTO; import com.epmet.dto.form.BadgeFormDTO; import com.epmet.dto.form.EditBadgeFormDTO; +import com.epmet.dto.result.BadgeAuditRecordResultDTO; +import com.epmet.dto.result.BadgeAuditingResultDTO; import com.epmet.dto.form.UserBadgeUnitFormDTO; import com.epmet.dto.result.BadgeDetailResultDTO; import com.epmet.dto.result.BadgeListResultDTO; @@ -41,6 +45,7 @@ import com.epmet.entity.BadgeEntity; import com.epmet.redis.UserBadgeRedis; import com.epmet.service.BadgeCertificationConfigService; import com.epmet.service.BadgeService; +import com.epmet.service.UserBadgeCertificateRecordService; import com.epmet.service.UserBadgeService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -48,10 +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; +import java.util.*; /** * 徽章 @@ -65,6 +67,8 @@ public class BadgeServiceImpl extends BaseServiceImpl imp @Autowired private BadgeCertificationConfigService badgeCertificationConfigService; @Autowired + private UserBadgeCertificateRecordService userBadgeCertificateRecordService; + @Autowired private UserBadgeRedis badgeRedis; @@ -164,6 +168,9 @@ public class BadgeServiceImpl extends BaseServiceImpl imp badgeList.add(badge); }); badgeCertificationConfigService.insertBatch(badgeList); + if (BadgeConstant.ONLINE.equals(formDTO.getBadgeStatus())) { + //TODO 更新Redis + } } /** @@ -225,6 +232,9 @@ public class BadgeServiceImpl extends BaseServiceImpl imp badgeList.add(badge); }); badgeCertificationConfigService.saveConfig(tokenDto.getCustomerId(), formDTO.getBadgeId(), badgeList); + if (BadgeConstant.OFFLINE.equals(formDTO.getBadgeStatus())) { + //TODO 更新Redis + } } /** @@ -241,13 +251,83 @@ public class BadgeServiceImpl extends BaseServiceImpl imp BadgeEntity badgeEntity = baseDao.selectBadgeInfo(tokenDto.getCustomerId(), formDTO.getBadgeId()); if (null == badgeEntity) { badgeEntity = baseDao.selectBadgeInfo("default", formDTO.getBadgeId()); + if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { + throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode()); + } badgeEntity.setCustomerId(tokenDto.getCustomerId()); badgeEntity.setDelFlag(NumConstant.ONE_STR); baseDao.insert(badgeEntity); } else { + if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { + throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode()); + } baseDao.deleteBadge(tokenDto.getCustomerId(), formDTO.getBadgeId()); } badgeCertificationConfigService.deleteConfig(tokenDto.getCustomerId(), formDTO.getBadgeId()); + //TODO 更新Redis + } + + /** + * 待审核列表 + * + * @param tokenDto + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/5 9:50 + */ + @Override + public List auditingList(TokenDto tokenDto, BadgeFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + List list = baseDao.selectAuditingList(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); + list.forEach(item -> { + item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY); + }); + return list; + } + + /** + * 审核历史列表 + * + * @param tokenDto + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/5 10:59 + */ + @Override + public List auditRecord(TokenDto tokenDto, BadgeFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + List list = baseDao.selectAuditRecord(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); + list.forEach(item -> { + item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY); + }); + return list; + } + + /** + * 审核 + * + * @param tokenDto + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/11/5 11:08 + */ + @Override + public void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO) { + UserBadgeCertificateRecordDTO dto = new UserBadgeCertificateRecordDTO(); + dto.setId(formDTO.getRecordId()); + dto.setAuditStatus(formDTO.getAuditStatus()); + dto.setAuditRemark(formDTO.getAuditRemark()); + dto.setStaffId(tokenDto.getUserId()); + dto.setAuditTime(new Date()); + + userBadgeCertificateRecordService.update(dto); + + if(BadgeConstant.APPROVED.equals(formDTO.getAuditStatus())) { + //TODO 更新Redis + } } @Override diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.java new file mode 100644 index 0000000000..6f798abc79 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeCertificateRecordServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.UserBadgeCertificateRecordDao; +import com.epmet.dto.UserBadgeCertificateRecordDTO; +import com.epmet.entity.UserBadgeCertificateRecordEntity; +import com.epmet.service.UserBadgeCertificateRecordService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-11-05 + */ +@Service +public class UserBadgeCertificateRecordServiceImpl extends BaseServiceImpl implements UserBadgeCertificateRecordService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserBadgeCertificateRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserBadgeCertificateRecordDTO.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 UserBadgeCertificateRecordDTO get(String id) { + UserBadgeCertificateRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserBadgeCertificateRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserBadgeCertificateRecordDTO dto) { + UserBadgeCertificateRecordEntity entity = ConvertUtils.sourceToTarget(dto, UserBadgeCertificateRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserBadgeCertificateRecordDTO dto) { + UserBadgeCertificateRecordEntity entity = ConvertUtils.sourceToTarget(dto, UserBadgeCertificateRecordEntity.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/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index d66bb7194a..978a9cf13b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -44,7 +44,7 @@ SELECT * FROM badge a WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND NOT EXISTS - ( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME AND b.DEL_FLAG = '0')) t + ( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t ORDER BY CREATED_TIME DESC @@ -65,7 +65,7 @@ SELECT * FROM badge a WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND NOT EXISTS - ( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME AND b.DEL_FLAG = '0' )) t) a + ( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.BADGE_NAME = b.BADGE_NAME)) t) a WHERE BADGE_NAME = #{badgeName} + + - \ No newline at end of file + + + + + + + From a3ec6bacde0e8381db0423a656a5689eafb8857f Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Fri, 6 Nov 2020 15:29:08 +0800 Subject: [PATCH 030/125] =?UTF-8?q?url=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/CustomerAgencyController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 6701fc7bee..3d14c14ea7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -255,7 +255,7 @@ public class CustomerAgencyController { * @Author liushaowen * @Date 2020/11/6 13:51 */ - @PostMapping("getAgencyElementTree") + @PostMapping("getagencyelementtree") public Result getAgencyElementTree(String customerId){ if (StringUtils.isBlank(customerId)){ throw new RenException("customerId不能为空"); From 8b605530dff0b96658ef34bbe03393fce1cd9bda Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 6 Nov 2020 15:40:35 +0800 Subject: [PATCH 031/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/UserBadgeServiceImpl.java | 4 +--- .../src/main/resources/mapper/BadgeDao.xml | 2 +- .../src/main/resources/mapper/UserBadgeDao.xml | 15 ++++++++++----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 32b0cef882..e152d83c20 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -20,7 +20,6 @@ import com.epmet.service.UserBadgeService; import com.epmet.service.UserBaseInfoService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -28,8 +27,6 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; /** * @Author zxc @@ -251,6 +248,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { } userBadgeRedis.setCustomerBadge(resultUserBadge, customerId); } + userBadgeRedis.setCustomerBadge(userBadgeListResultDTOS, customerId); } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index 978a9cf13b..e7d0243bf8 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -42,7 +42,7 @@ WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0' UNION ALL SELECT * FROM badge a - WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' + WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND BADGE_STATUS = 'online' AND NOT EXISTS ( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t ORDER BY diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index 022d95e7f8..0f305f3303 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -47,11 +47,16 @@ BADGE_NAME, BADGE_ICON, FIXATION_BADGE_TYPE AS badgeType - FROM badge - WHERE - DEL_FLAG = '0' - AND (CUSTOMER_ID = 'default' OR CUSTOMER_ID = #{customerId}) - AND BADGE_STATUS = 'online' + FROM ( + SELECT * FROM badge + WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0' + UNION ALL + SELECT * FROM badge a + WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND BADGE_STATUS = 'online' + AND NOT EXISTS + ( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t + ORDER BY + CREATED_TIME DESC From 949a6046a174947c61a07ff499a2e4479305be93 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 6 Nov 2020 16:01:28 +0800 Subject: [PATCH 032/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/ResiUserBadgeDTO.java | 101 ++++++++++++++++++ .../src/main/java/com/epmet/dao/BadgeDao.java | 10 ++ .../java/com/epmet/dao/ResiUserBadgeDao.java | 33 ++++++ .../com/epmet/entity/ResiUserBadgeEntity.java | 71 ++++++++++++ .../epmet/service/ResiUserBadgeService.java | 95 ++++++++++++++++ .../epmet/service/impl/BadgeServiceImpl.java | 95 +++++++++------- .../impl/ResiUserBadgeServiceImpl.java | 101 ++++++++++++++++++ .../service/impl/UserBadgeServiceImpl.java | 3 + .../src/main/resources/mapper/BadgeDao.xml | 31 +++++- .../resources/mapper/ResiUserBadgeDao.xml | 23 ++++ 10 files changed, 521 insertions(+), 42 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ResiUserBadgeEntity.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/ResiUserBadgeService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ResiUserBadgeServiceImpl.java create mode 100644 epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.java new file mode 100644 index 0000000000..21e910101f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/ResiUserBadgeDTO.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.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户徽章关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +@Data +public class ResiUserBadgeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 用户注册网格ID + */ + private String gridId; + + /** + * 用户ID + */ + private String userId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 是否开启(点亮) 1:点亮;0:未点亮 + */ + private Integer isOpened; + + /** + * 认证(审核)状态 待审核:auditing;审核通过:pass;驳回:rejected; + */ + private String certificationAutidStatus; + + /** + * 删除标识 1删除;0未删除 + */ + 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/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java index a0c2fb42b6..e20fd8a523 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.BadgeDTO; import com.epmet.dto.result.BadgeAuditRecordResultDTO; import com.epmet.dto.result.BadgeAuditingResultDTO; import com.epmet.dto.result.BadgeDetailResultDTO; @@ -142,4 +143,13 @@ public interface BadgeDao extends BaseDao { * @date 2020.11.05 15:50 */ List selectCustomerBadgePool(@Param("customerId") String customerId); + + /** + * 插入数据 + * @author zhaoqifeng + * @date 2020/11/6 14:46 + * @param entity + * @return void + */ + void insertBadge(BadgeDTO dto); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.java new file mode 100644 index 0000000000..0448b16cee --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/ResiUserBadgeDao.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.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ResiUserBadgeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户徽章关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +@Mapper +public interface ResiUserBadgeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ResiUserBadgeEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ResiUserBadgeEntity.java new file mode 100644 index 0000000000..4087df8fc6 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/ResiUserBadgeEntity.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.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户徽章关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_user_badge") +public class ResiUserBadgeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 用户注册网格ID + */ + private String gridId; + + /** + * 用户ID + */ + private String userId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 是否开启(点亮) 1:点亮;0:未点亮 + */ + private Integer isOpened; + + /** + * 认证(审核)状态 待审核:auditing;审核通过:pass;驳回:rejected; + */ + private String certificationAutidStatus; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/ResiUserBadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/ResiUserBadgeService.java new file mode 100644 index 0000000000..b858776d51 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/ResiUserBadgeService.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.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ResiUserBadgeDTO; +import com.epmet.entity.ResiUserBadgeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户徽章关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +public interface ResiUserBadgeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-11-06 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-11-06 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ResiUserBadgeDTO + * @author generator + * @date 2020-11-06 + */ + ResiUserBadgeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-06 + */ + void save(ResiUserBadgeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-06 + */ + void update(ResiUserBadgeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-11-06 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 36ea72d2ff..89c6b72a75 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -30,23 +30,17 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.constant.BadgeConstant; import com.epmet.dao.BadgeDao; import com.epmet.dto.BadgeDTO; +import com.epmet.dto.ResiUserBadgeDTO; import com.epmet.dto.UserBadgeCertificateRecordDTO; -import com.epmet.dto.form.AddBadgeFormDTO; -import com.epmet.dto.form.BadgeAuditFormDTO; -import com.epmet.dto.form.BadgeFormDTO; -import com.epmet.dto.form.EditBadgeFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.BadgeAuditRecordResultDTO; import com.epmet.dto.result.BadgeAuditingResultDTO; -import com.epmet.dto.form.UserBadgeUnitFormDTO; import com.epmet.dto.result.BadgeDetailResultDTO; import com.epmet.dto.result.BadgeListResultDTO; import com.epmet.entity.BadgeCertificationConfigEntity; import com.epmet.entity.BadgeEntity; import com.epmet.redis.UserBadgeRedis; -import com.epmet.service.BadgeCertificationConfigService; -import com.epmet.service.BadgeService; -import com.epmet.service.UserBadgeCertificateRecordService; -import com.epmet.service.UserBadgeService; +import com.epmet.service.*; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -70,6 +64,10 @@ public class BadgeServiceImpl extends BaseServiceImpl imp private UserBadgeCertificateRecordService userBadgeCertificateRecordService; @Autowired private UserBadgeRedis badgeRedis; + @Autowired + private UserBadgeService userBadgeService; + @Autowired + private ResiUserBadgeService resiUserBadgeService; @Override @@ -127,7 +125,7 @@ public class BadgeServiceImpl extends BaseServiceImpl imp /** * 获取徽章列表 * - * @param customerId + * @param customerId 客户ID * @return java.util.List * @author zhaoqifeng * @date 2020/11/3 17:04 @@ -140,8 +138,8 @@ public class BadgeServiceImpl extends BaseServiceImpl imp /** * 添加徽章 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return void * @author zhaoqifeng * @date 2020/11/4 10:09 @@ -168,16 +166,17 @@ public class BadgeServiceImpl extends BaseServiceImpl imp badgeList.add(badge); }); badgeCertificationConfigService.insertBatch(badgeList); + //更新Redis if (BadgeConstant.ONLINE.equals(formDTO.getBadgeStatus())) { - //TODO 更新Redis + userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId()); } } /** * 徽章详情 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return com.epmet.dto.result.BadgeDetailResultDTO * @author zhaoqifeng * @date 2020/11/4 14:25 @@ -193,8 +192,8 @@ public class BadgeServiceImpl extends BaseServiceImpl imp /** * 编辑徽章 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return void * @author zhaoqifeng * @date 2020/11/4 14:28 @@ -232,16 +231,15 @@ public class BadgeServiceImpl extends BaseServiceImpl imp badgeList.add(badge); }); badgeCertificationConfigService.saveConfig(tokenDto.getCustomerId(), formDTO.getBadgeId(), badgeList); - if (BadgeConstant.OFFLINE.equals(formDTO.getBadgeStatus())) { - //TODO 更新Redis - } + //更新Redis + userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId()); } /** * 删除徽章 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return void * @author zhaoqifeng * @date 2020/11/4 15:34 @@ -254,9 +252,14 @@ public class BadgeServiceImpl extends BaseServiceImpl imp if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode()); } - badgeEntity.setCustomerId(tokenDto.getCustomerId()); - badgeEntity.setDelFlag(NumConstant.ONE_STR); - baseDao.insert(badgeEntity); + BadgeDTO badgeDTO = ConvertUtils.sourceToTarget(badgeEntity, BadgeDTO.class); + badgeDTO.setCustomerId(tokenDto.getCustomerId()); + badgeDTO.setDelFlag(NumConstant.ONE_STR); + badgeDTO.setCreatedBy(tokenDto.getUserId()); + badgeDTO.setCreatedTime(new Date()); + badgeDTO.setUpdatedBy(tokenDto.getUserId()); + badgeDTO.setUpdatedTime(new Date()); + baseDao.insertBadge(badgeDTO); } else { if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode()); @@ -264,14 +267,15 @@ public class BadgeServiceImpl extends BaseServiceImpl imp baseDao.deleteBadge(tokenDto.getCustomerId(), formDTO.getBadgeId()); } badgeCertificationConfigService.deleteConfig(tokenDto.getCustomerId(), formDTO.getBadgeId()); - //TODO 更新Redis + //更新Redis + userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId()); } /** * 待审核列表 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return java.util.List * @author zhaoqifeng * @date 2020/11/5 9:50 @@ -280,17 +284,15 @@ public class BadgeServiceImpl extends BaseServiceImpl imp public List auditingList(TokenDto tokenDto, BadgeFormDTO formDTO) { int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); List list = baseDao.selectAuditingList(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); - list.forEach(item -> { - item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY); - }); + list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); return list; } /** * 审核历史列表 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return java.util.List * @author zhaoqifeng * @date 2020/11/5 10:59 @@ -299,25 +301,22 @@ public class BadgeServiceImpl extends BaseServiceImpl imp public List auditRecord(TokenDto tokenDto, BadgeFormDTO formDTO) { int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); List list = baseDao.selectAuditRecord(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); - list.forEach(item -> { - item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY); - }); + list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); return list; } /** * 审核 * - * @param tokenDto - * @param formDTO + * @param tokenDto token + * @param formDTO 入参 * @return void * @author zhaoqifeng * @date 2020/11/5 11:08 */ @Override public void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO) { - UserBadgeCertificateRecordDTO dto = new UserBadgeCertificateRecordDTO(); - dto.setId(formDTO.getRecordId()); + UserBadgeCertificateRecordDTO dto = userBadgeCertificateRecordService.get(formDTO.getRecordId()); dto.setAuditStatus(formDTO.getAuditStatus()); dto.setAuditRemark(formDTO.getAuditRemark()); dto.setStaffId(tokenDto.getUserId()); @@ -325,8 +324,22 @@ public class BadgeServiceImpl extends BaseServiceImpl imp userBadgeCertificateRecordService.update(dto); + ResiUserBadgeDTO resiUserBadgeDTO = new ResiUserBadgeDTO(); + resiUserBadgeDTO.setCustomerId(dto.getCustomerId()); + resiUserBadgeDTO.setBadgeId(dto.getBadgeId()); + resiUserBadgeDTO.setGridId(dto.getGridId()); + resiUserBadgeDTO.setUserId(dto.getUserId()); + resiUserBadgeDTO.setIsOpened(NumConstant.ZERO); + resiUserBadgeDTO.setCertificationAutidStatus(dto.getAuditStatus()); + resiUserBadgeService.save(resiUserBadgeDTO); + if(BadgeConstant.APPROVED.equals(formDTO.getAuditStatus())) { - //TODO 更新Redis + //更新Redis + OpenedOrClosedFormDTO openedOrClosedFormDTO = new OpenedOrClosedFormDTO(); + openedOrClosedFormDTO.setCustomerId(dto.getCustomerId()); + openedOrClosedFormDTO.setUserId(dto.getUserId()); + openedOrClosedFormDTO.setBadgeId(dto.getBadgeId()); + userBadgeService.openedOrClosed(openedOrClosedFormDTO); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ResiUserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ResiUserBadgeServiceImpl.java new file mode 100644 index 0000000000..7c0730af71 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ResiUserBadgeServiceImpl.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.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ResiUserBadgeDao; +import com.epmet.dto.ResiUserBadgeDTO; +import com.epmet.entity.ResiUserBadgeEntity; +import com.epmet.service.ResiUserBadgeService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +@Service +public class ResiUserBadgeServiceImpl extends BaseServiceImpl implements ResiUserBadgeService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ResiUserBadgeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ResiUserBadgeDTO.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 ResiUserBadgeDTO get(String id) { + ResiUserBadgeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ResiUserBadgeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ResiUserBadgeDTO dto) { + ResiUserBadgeEntity entity = ConvertUtils.sourceToTarget(dto, ResiUserBadgeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ResiUserBadgeDTO dto) { + ResiUserBadgeEntity entity = ConvertUtils.sourceToTarget(dto, ResiUserBadgeEntity.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/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index e152d83c20..6b65ba600a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -20,6 +20,7 @@ import com.epmet.service.UserBadgeService; import com.epmet.service.UserBaseInfoService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -27,6 +28,8 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * @Author zxc diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index e7d0243bf8..91267d3a5b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -17,6 +17,35 @@ + + INSERT INTO badge + (`ID`, + `CUSTOMER_ID`, + `BADGE_NAME`, + `BADGE_ICON`, + `FIXATION_BADGE_TYPE`, + `BADGE_STATUS`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME`) + VALUES + (#{id}, + #{customerId}, + #{badgeName}, + #{badgeIcon}, + #{fixationBadgeType}, + #{badgeStatus}, + #{delFlag}, + #{revision}, + #{createdBy}, + #{createdTime}, + #{updatedBy}, + #{updatedTime}); + + update badge set BADGE_NAME = #{badgeName}, @@ -42,7 +71,7 @@ WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0' UNION ALL SELECT * FROM badge a - WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND BADGE_STATUS = 'online' + WHERE CUSTOMER_ID = 'default' AND a.DEL_FLAG = '0' AND NOT EXISTS ( SELECT ID FROM badge b WHERE CUSTOMER_ID = #{customerId} AND a.ID = b.ID)) t ORDER BY diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml new file mode 100644 index 0000000000..221c9c3d3f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/ResiUserBadgeDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 06f4e7634dfb0eea7aa5848217026ceff843b782 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Fri, 6 Nov 2020 16:19:05 +0800 Subject: [PATCH 033/125] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=88=86=E4=B8=BA=E4=B8=A4=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CustomerAgencyController.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 3d14c14ea7..3135924fdd 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -43,6 +43,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotBlank; import java.util.List; import java.util.Map; +import java.util.Set; /** @@ -255,11 +256,25 @@ public class CustomerAgencyController { * @Author liushaowen * @Date 2020/11/6 13:51 */ - @PostMapping("getagencyelementtree") - public Result getAgencyElementTree(String customerId){ + @PostMapping("getagencyelementtreelist") + public Result> getAgencyElementTreeList(String customerId){ if (StringUtils.isBlank(customerId)){ throw new RenException("customerId不能为空"); } - return new Result().ok(customerAgencyService.getAgencyElementTree(customerId)); + return new Result>().ok(customerAgencyService.getAgencyElementTree(customerId).getList()); + } + /** + * @Description 对外接口,根据customerId返回Element UI中Tree结构的agency keys + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/11/6 13:51 + */ + @PostMapping("getagencyelementtreekeys") + public Result> getAgencyElementTreeKeys(String customerId){ + if (StringUtils.isBlank(customerId)){ + throw new RenException("customerId不能为空"); + } + return new Result>().ok(customerAgencyService.getAgencyElementTree(customerId).getDefaultKeys()); } } From 0c482e3c6ded0527a961b2bebbb0fc65776e4b85 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Fri, 6 Nov 2020 17:12:11 +0800 Subject: [PATCH 034/125] =?UTF-8?q?user=5Fadvice=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/AgencyElementTreeResultDTO.java | 33 +++++++++++ .../java/com/epmet/dto/UserAdviceDTO.java | 55 ++++++++++++++++-- .../epmet/dto/form/OperAdviceListFormDTO.java | 33 +++++++++++ .../epmet/dto/form/ReplyAdviceFormDTO.java | 27 +++++++++ .../dto/result/AdviceDetailResultDTO.java | 55 ++++++++++++++++++ .../dto/result/OperAdviceListResultDTO.java | 44 +++++++++++++++ .../controller/UserAdviceController.java | 15 +++-- .../java/com/epmet/dao/UserAdviceDao.java | 12 ++-- .../com/epmet/entity/UserAdviceEntity.java | 56 +++++++++++++++++-- .../java/com/epmet/excel/UserAdviceExcel.java | 37 ++++++++++-- .../java/com/epmet/redis/UserAdviceRedis.java | 4 +- .../com/epmet/service/UserAdviceService.java | 29 +++++++--- .../service/impl/UserAdviceServiceImpl.java | 19 ++++++- .../main/resources/mapper/UserAdviceDao.xml | 25 ++++++++- 14 files changed, 404 insertions(+), 40 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java new file mode 100644 index 0000000000..90ee4f6f29 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyElementTreeResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Set; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/6 13:54 + */ +@Data +public class AgencyElementTreeResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private Set defaultKeys; + + private List list; + + @Data + public static class Agency{ + private String id; + + private String label; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children; + } + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java index 5521fa02c4..77e6494ee6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java @@ -23,10 +23,10 @@ import lombok.Data; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Data public class UserAdviceDTO implements Serializable { @@ -43,18 +43,53 @@ public class UserAdviceDTO implements Serializable { */ private String customerId; + /** + * 客户名 + */ + private String customerName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名 + */ + private String gridName; + /** * userid */ private String userId; + /** + * 用户姓名 + */ + private String userName; + + /** + * 用户注册手机号 + */ + private String regPhone; + /** * 建议描述 */ private String adviceContent; /** - * 手机号 + * 填写手机号 */ private String phone; @@ -69,15 +104,25 @@ public class UserAdviceDTO implements Serializable { private String replyContent; /** - * 回复人 + * 回复人id */ - private String replyUser; + private String replyUserId; + + /** + * 回复人姓名 + */ + private String replyUserName; /** * 回复时间 */ private Date replyTime; + /** + * 政府存证文字 + */ + private String govContent; + /** * 删除标志 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java new file mode 100644 index 0000000000..e4c046e53c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/OperAdviceListFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/5 17:25 + */ +@Data +public class OperAdviceListFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private String customerId; + + private String isReply; + + private String adviceType; + + private String startTime; + + private String endTime; + + @Min(1) + private Integer pageNo; + + @Min(1) + private Integer pageSize; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java new file mode 100644 index 0000000000..f353919247 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReplyAdviceFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @description:回复建议FormDTO + * @author: liushaowen + * @date: 2020/11/6 10:37 + */ +@Data +public class ReplyAdviceFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @NotBlank(message = "adviceId不能为空") + private String adviceId; + + @NotBlank(message = "回复内容不能为空") + private String replyContent; + + private List govImgList; + + private String govContent; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java new file mode 100644 index 0000000000..462f053373 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/5 17:37 + */ +@Data +public class AdviceDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 建议id + */ + private String adviceId; + + /** + * 建议内容 + */ + private String adviceContent; + + /** + * 电话 + */ + private String phone; + + /** + * 建议时间 + */ + private String adviceTime; + + /** + * 回复内容 + */ + private String replyContent; + + /** + * 回复时间 + */ + private String replyTime; + + /** + * 回复人 + */ + private String replyUser; + + /** + * 建议图片列表 + */ + private List imgList; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java new file mode 100644 index 0000000000..82f5aba850 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OperAdviceListResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/5 17:26 + */ +@Data +public class OperAdviceListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户名 + */ + private String customerName; + + /** + * 建议id + */ + private String adviceId; + + /** + * 是否回复 0否1是 + */ + private String isReply; + + /** + * 回复内容 + */ + private String adviceContent; + + /** + * 手机 空为* + */ + private String phone; + + /** + * 建议类型 空为* + */ + private String adviceType; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 8237057e85..b98d644940 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.UserAdviceDTO; +import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.excel.UserAdviceExcel; import com.epmet.service.UserAdviceService; import org.springframework.beans.factory.annotation.Autowired; @@ -37,15 +38,15 @@ import java.util.Map; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @RestController @RequestMapping("useradvice") public class UserAdviceController { - + @Autowired private UserAdviceService userAdviceService; @@ -91,4 +92,10 @@ public class UserAdviceController { ExcelUtils.exportExcelToTarget(response, null, list, UserAdviceExcel.class); } -} \ No newline at end of file + @PostMapping("replyadvice") + public Result replyAdvice(ReplyAdviceFormDTO dto){ + ValidatorUtils.validateEntity(dto); + userAdviceService.replyAdvice(dto,loginUserUtil.getLoginUserId()); + return new Result(); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java index 6ee2c40017..e198ef4b82 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java @@ -20,14 +20,18 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.UserAdviceEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Mapper public interface UserAdviceDao extends BaseDao { - -} \ No newline at end of file + void replyAdvice(@Param("adviceId") String adviceId, + @Param("replyContent") String replyContent, + @Param("govContent") String govContent, + @Param("replyUserId") String loginUserId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java index dcf168cc2d..78c246fa15 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java @@ -19,7 +19,6 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; @@ -27,10 +26,10 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Data @EqualsAndHashCode(callSuper=false) @@ -44,18 +43,53 @@ public class UserAdviceEntity extends BaseEpmetEntity { */ private String customerId; + /** + * 客户名 + */ + private String customerName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名 + */ + private String gridName; + /** * userid */ private String userId; + /** + * 用户姓名 + */ + private String userName; + + /** + * 用户注册手机号 + */ + private String regPhone; + /** * 建议描述 */ private String adviceContent; /** - * 手机号 + * 填写手机号 */ private String phone; @@ -70,13 +104,23 @@ public class UserAdviceEntity extends BaseEpmetEntity { private String replyContent; /** - * 回复人 + * 回复人id + */ + private String replyUserId; + + /** + * 回复人姓名 */ - private String replyUser; + private String replyUserName; /** * 回复时间 */ private Date replyTime; + /** + * 政府存证文字 + */ + private String govContent; + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java index 31581f4373..9e93cb6bfc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java @@ -23,10 +23,10 @@ import lombok.Data; import java.util.Date; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Data public class UserAdviceExcel { @@ -37,13 +37,34 @@ public class UserAdviceExcel { @Excel(name = "客户ID") private String customerId; + @Excel(name = "客户名") + private String customerName; + + @Excel(name = "组织ID") + private String agencyId; + + @Excel(name = "组织名") + private String agencyName; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "网格名") + private String gridName; + @Excel(name = "userid") private String userId; + @Excel(name = "用户姓名") + private String userName; + + @Excel(name = "用户注册手机号") + private String regPhone; + @Excel(name = "建议描述") private String adviceContent; - @Excel(name = "手机号") + @Excel(name = "填写手机号") private String phone; @Excel(name = "问题分类(gov政府software软件,逗号分隔)") @@ -52,12 +73,18 @@ public class UserAdviceExcel { @Excel(name = "回复内容") private String replyContent; - @Excel(name = "回复人") - private String replyUser; + @Excel(name = "回复人id") + private String replyUserId; + + @Excel(name = "回复人姓名") + private String replyUserName; @Excel(name = "回复时间") private Date replyTime; + @Excel(name = "政府存证文字") + private String govContent; + @Excel(name = "删除标志") private String delFlag; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java index ab047022e7..d35e8427b9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserAdviceRedis.java @@ -22,10 +22,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Component public class UserAdviceRedis { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java index 4e42bc095e..f13d6f9eda 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java @@ -20,16 +20,17 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.UserAdviceDTO; +import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.entity.UserAdviceEntity; import java.util.List; import java.util.Map; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ public interface UserAdviceService extends BaseService { @@ -39,7 +40,7 @@ public interface UserAdviceService extends BaseService { * @param params * @return PageData * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ PageData page(Map params); @@ -49,7 +50,7 @@ public interface UserAdviceService extends BaseService { * @param params * @return java.util.List * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ List list(Map params); @@ -59,7 +60,7 @@ public interface UserAdviceService extends BaseService { * @param id * @return UserAdviceDTO * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ UserAdviceDTO get(String id); @@ -69,7 +70,7 @@ public interface UserAdviceService extends BaseService { * @param dto * @return void * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ void save(UserAdviceDTO dto); @@ -79,7 +80,7 @@ public interface UserAdviceService extends BaseService { * @param dto * @return void * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ void update(UserAdviceDTO dto); @@ -89,7 +90,17 @@ public interface UserAdviceService extends BaseService { * @param ids * @return void * @author generator - * @date 2020-11-04 + * @date 2020-11-06 */ void delete(String[] ids); -} \ No newline at end of file + + /** + * @Description 回复建议 + * @param dto + * @param loginUserId + * @return void + * @Author liushaowen + * @Date 2020/11/6 16:44 + */ + void replyAdvice(ReplyAdviceFormDTO dto, String loginUserId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index 41e1465a41..ceae0d177c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.UserAdviceDao; import com.epmet.dto.UserAdviceDTO; +import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.entity.UserAdviceEntity; import com.epmet.redis.UserAdviceRedis; import com.epmet.service.UserAdviceService; @@ -38,10 +39,10 @@ import java.util.List; import java.util.Map; /** - * 用户建议 + * user_advice * * @author qu qu@elink-cn.com - * @since v1.0.0 2020-11-04 + * @since v1.0.0 2020-11-06 */ @Service public class UserAdviceServiceImpl extends BaseServiceImpl implements UserAdviceService { @@ -101,4 +102,16 @@ public class UserAdviceServiceImpl extends BaseServiceImpl + + + + + + + - + + + @@ -21,5 +30,17 @@ + + update user_advice + set + reply_content = #{replyContent}, + reply_user_id = #{replyUserId}, + reply_time = now(), + gov_content = #{govContent}, + reply_user_name = (select real_name from oper_user where user_id = #{replyUserId} and del_flag = 0), + updated_by = #{replyUserId}, + updated_time = now() + where id = #{adviceId} + - \ No newline at end of file + From 63d97ab7e960986543ffc855d8785fee0fce396b Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Fri, 6 Nov 2020 17:16:59 +0800 Subject: [PATCH 035/125] =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/UserAdviceController.java | 4 ++++ .../src/main/resources/mapper/UserAdviceDao.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index b98d644940..de9e8b00c6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -18,6 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -50,6 +51,9 @@ public class UserAdviceController { @Autowired private UserAdviceService userAdviceService; + @Autowired + private LoginUserUtil loginUserUtil; + @GetMapping("page") public Result> page(@RequestParam Map params){ PageData page = userAdviceService.page(params); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml index ce16199f8e..0f7d01cd50 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -40,7 +40,7 @@ reply_user_name = (select real_name from oper_user where user_id = #{replyUserId} and del_flag = 0), updated_by = #{replyUserId}, updated_time = now() - where id = #{adviceId} + where id = #{adviceId} and del_flag = 0 From 8c6b1f60ddd7dc7f3beb688eb0da130d8773702f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 6 Nov 2020 17:40:03 +0800 Subject: [PATCH 036/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/badege/controller/BadgeController.java | 3 +-- .../java/com/epmet/modules/badege/service/BadgeService.java | 3 ++- .../epmet/modules/badege/service/impl/BadgeServiceImpl.java | 6 ++---- .../java/com/epmet/dto/form/CertificationAddFormDTO.java | 4 ++-- .../com/epmet/dto/result/CertificationDetailResultDTO.java | 2 +- .../main/java/com/epmet/controller/UserBadgeController.java | 3 +-- .../java/com/epmet/service/impl/UserBadgeServiceImpl.java | 4 ++-- .../src/main/resources/mapper/UserBadgeDao.xml | 2 +- 8 files changed, 12 insertions(+), 15 deletions(-) diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java index da3bfca3d2..727e1ee1ae 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java @@ -64,8 +64,7 @@ public class BadgeController { @PostMapping("certification/add") public Result certificationAdd(@LoginUser TokenDto tokenDto,@RequestBody CertificationAddFormDTO certificationAddFormDTO){ ValidatorUtils.validateEntity(certificationAddFormDTO, CertificationAddFormDTO.CertificationAdd.class); - badgeService.certificationAdd(tokenDto,certificationAddFormDTO); - return new Result(); + return badgeService.certificationAdd(tokenDto,certificationAddFormDTO); } /** diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java index 1b67df51f8..c9da1f12ed 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java @@ -1,6 +1,7 @@ package com.epmet.modules.badege.service; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.OpenedOrClosedFormDTO; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; import com.epmet.dto.form.CertificationAddFormDTO; @@ -39,7 +40,7 @@ public interface BadgeService { * @author zxc * @date 2020/11/4 11:16 上午 */ - void certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO); + Result certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO); /** * @Description 个人中心-取消/点亮徽章 diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java index 4abc5853b6..53057f9492 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java @@ -86,12 +86,10 @@ public class BadgeServiceImpl implements BadgeService { * @date 2020/11/4 11:16 上午 */ @Override - public void certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO) { + public Result certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO) { certificationAddFormDTO.setUserId(tokenDto.getUserId()); Result result = epmetUserOpenFeignClient.authBadgeRecord(certificationAddFormDTO); - if (!result.success()){ - throw new RenException("提交徽章认证失败......"); - } + return result; } /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java index 76583e9559..ee9a71d7fc 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java @@ -37,7 +37,7 @@ public class CertificationAddFormDTO implements Serializable { /** * 姓 */ - private String subName; + private String surname; /** * 名 @@ -52,7 +52,7 @@ public class CertificationAddFormDTO implements Serializable { /** * 认证证件图片url */ - private String certificate; + private String certificationImg; /** * 认证说明 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java index 2120fe7fb0..cc17374704 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java @@ -26,7 +26,7 @@ public class CertificationDetailResultDTO implements Serializable { /** * 身份证号 */ - private String idNum; + private String idCard; /** * 是否认证 yes 认证 no 已认证 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java index c0aa74d53e..a901d9202f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java @@ -59,8 +59,7 @@ public class UserBadgeController { */ @PostMapping("authbadgerecord") public Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO){ - userBadgeService.authBadgeRecord(certificationAddFormDTO); - return new Result(); + return userBadgeService.authBadgeRecord(certificationAddFormDTO); } /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 6b65ba600a..2f3f51ed86 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -148,8 +148,8 @@ public class UserBadgeServiceImpl implements UserBadgeService { userBadgeDao.updateCertificateRecordIsLast(form.getBadgeId(),form.getUserId()); form.setGridId(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRegisteredGridId()); form.setIdNum(certificationAddFormDTO.getIdCard()); - form.setCertificationImg(certificationAddFormDTO.getCertificate()); - form.setSurname(certificationAddFormDTO.getSubName()); + form.setCertificationImg(certificationAddFormDTO.getCertificationImg()); + form.setSurname(certificationAddFormDTO.getSurname()); userBadgeDao.insertUserBadgeCertificateRecord(form); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index 0f305f3303..a20a9c0e61 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -89,7 +89,7 @@ SELECT SURNAME, NAME, - ID_NUM, + ID_NUM AS idCard, ( CASE WHEN AUDIT_STATUS = 'approved' THEN 'yes' ELSE 'no' END ) AS isCertificated, MOBILE, CERTIFICATION_IMG, From 602d79547c9ece1a53311235e835b2ac43b1a18e Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 9 Nov 2020 10:47:51 +0800 Subject: [PATCH 037/125] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=8B=8B=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/UserRedisKeys.java | 4 ++- .../java/com/epmet/redis/UserBadgeRedis.java | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java index 46f5ad1fa2..c21ba28c1f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserRedisKeys.java @@ -1,5 +1,7 @@ package com.epmet.constant; +import org.apache.commons.lang3.StringUtils; + /** * @Description * @ClassName UserRedisKeys @@ -32,5 +34,5 @@ public class UserRedisKeys { * @date 2020.11.05 13:34 */ public static String getResiUserBadgeKey(String customerId,String userId){ - return rootPrefix.concat("badge:user:").concat(customerId).concat(":").concat(userId);} + return rootPrefix.concat("badge:user:").concat(customerId).concat(":").concat( StringUtils.isBlank(userId) ? "*" : userId );} } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index 0b57fcbb9f..f5c22ca54a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -16,10 +16,13 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; import java.util.List; import java.util.Optional; +import java.util.Set; import static com.epmet.commons.tools.redis.RedisUtils.MINUTE_THIRTY_EXPIRE; @@ -37,6 +40,8 @@ public class UserBadgeRedis { private BadgeDao badgeDao; @Autowired private UserBadgeService badgeService; + @Autowired + private RedisTemplate redisTemplate; /** * @Description 获取客户徽章信息 @@ -146,5 +151,25 @@ public class UserBadgeRedis { return NumConstant.ONE; } + + /** + * @Description 批量清除用户徽章信息,用处:在客户取消点亮某个徽章后,批量清除该客户下所有用户的徽章缓存,当需要查取时再次初始化进缓存中 + * @param customerId + * @return void + * @author wangc + * @date 2020.11.09 10:02 + */ + public void batchClearUserBadgeCache(String customerId){ + redisTemplate.executePipelined((RedisCallback) connection ->{ + Set keys = + connection.keys(redisTemplate.getKeySerializer().serialize(UserRedisKeys.getResiUserBadgeKey(customerId, null))); + if(!CollectionUtils.isEmpty(keys)){ + keys.forEach( ser -> {connection.del(ser);}); + } + return null; + }); + + } + } From 01d3de94a77619dbdf82ba09d88ec2f8853018bd Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 9 Nov 2020 10:49:46 +0800 Subject: [PATCH 038/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/BadgeFormDTO.java | 4 +-- .../epmet/constant/BadgeMessageConstant.java | 23 ++++++++++++++ .../com/epmet/feign/MessageFeignClient.java | 14 +++++++++ .../fallback/MessageFeignClientFallback.java | 14 +++++++++ .../epmet/service/impl/BadgeServiceImpl.java | 30 +++++++++++++++++++ .../src/main/resources/mapper/BadgeDao.xml | 5 ++-- 6 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/constant/BadgeMessageConstant.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java index e9702144f0..fdd2969fb0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java @@ -16,9 +16,9 @@ public class BadgeFormDTO implements Serializable { /** * 页码 */ - private Integer pageNo; + private Integer pageNo = 1; /** * 每页显示数量 */ - private Integer pageSize; + private Integer pageSize = 20; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/BadgeMessageConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/BadgeMessageConstant.java new file mode 100644 index 0000000000..d0dc2a5529 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/BadgeMessageConstant.java @@ -0,0 +1,23 @@ +package com.epmet.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/9 10:32 + */ +public interface BadgeMessageConstant { + /** + * 消息标题 + */ + String TITLE = "您有一条认证消息"; + + + /** + * 审核通过消息模板 + */ + String APPROVED_MSG = "您好,您提交的%s申请已通过,请查看。"; + /** + * 审核驳回消息模板 + */ + String REJECTED_MSG = "您好,您提交的%s申请,由于%s,已被驳回。"; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/MessageFeignClient.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/MessageFeignClient.java index 0b2cb3c0ef..e0be305d7f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/MessageFeignClient.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/MessageFeignClient.java @@ -2,12 +2,17 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.feign.fallback.MessageFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; +import java.util.List; + @FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = MessageFeignClientFallback.class) public interface MessageFeignClient { @@ -18,4 +23,13 @@ public interface MessageFeignClient { @GetMapping(value = "message/sms/captcha/{mobile}") Result sendSmsCaptcha(@PathVariable("mobile") String mobile); + /** + * @param msgList + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 批量推送消息 + **/ + @PostMapping(value = "message/usermessage/saveusermessagelist", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveUserMessageList(List msgList); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java index 8af38c06aa..e7dbea7b95 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/feign/fallback/MessageFeignClientFallback.java @@ -3,9 +3,12 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.feign.MessageFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * 消息服务降级 */ @@ -17,4 +20,15 @@ public class MessageFeignClientFallback implements MessageFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendSmsCaptcha", mobile); } + /** + * @param msgList + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 批量推送消息 + **/ + @Override + public Result saveUserMessageList(List msgList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessageList", msgList); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 89c6b72a75..1f391e5aa9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -20,6 +20,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; @@ -28,6 +29,8 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.constant.BadgeConstant; +import com.epmet.constant.BadgeMessageConstant; +import com.epmet.constant.UserConstant; import com.epmet.dao.BadgeDao; import com.epmet.dto.BadgeDTO; import com.epmet.dto.ResiUserBadgeDTO; @@ -39,6 +42,7 @@ import com.epmet.dto.result.BadgeDetailResultDTO; import com.epmet.dto.result.BadgeListResultDTO; import com.epmet.entity.BadgeCertificationConfigEntity; import com.epmet.entity.BadgeEntity; +import com.epmet.feign.MessageFeignClient; import com.epmet.redis.UserBadgeRedis; import com.epmet.service.*; import org.apache.commons.collections4.CollectionUtils; @@ -68,6 +72,8 @@ public class BadgeServiceImpl extends BaseServiceImpl imp private UserBadgeService userBadgeService; @Autowired private ResiUserBadgeService resiUserBadgeService; + @Autowired + private MessageFeignClient messageFeignClient; @Override @@ -317,9 +323,11 @@ public class BadgeServiceImpl extends BaseServiceImpl imp @Override public void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO) { UserBadgeCertificateRecordDTO dto = userBadgeCertificateRecordService.get(formDTO.getRecordId()); + BadgeDetailResultDTO detail = baseDao.selectDetail(dto.getCustomerId(), dto.getBadgeId()); dto.setAuditStatus(formDTO.getAuditStatus()); dto.setAuditRemark(formDTO.getAuditRemark()); dto.setStaffId(tokenDto.getUserId()); + dto.setIsLast(BadgeConstant.YES); dto.setAuditTime(new Date()); userBadgeCertificateRecordService.update(dto); @@ -333,6 +341,7 @@ public class BadgeServiceImpl extends BaseServiceImpl imp resiUserBadgeDTO.setCertificationAutidStatus(dto.getAuditStatus()); resiUserBadgeService.save(resiUserBadgeDTO); + List msgList = new ArrayList<>(); if(BadgeConstant.APPROVED.equals(formDTO.getAuditStatus())) { //更新Redis OpenedOrClosedFormDTO openedOrClosedFormDTO = new OpenedOrClosedFormDTO(); @@ -340,7 +349,28 @@ public class BadgeServiceImpl extends BaseServiceImpl imp openedOrClosedFormDTO.setUserId(dto.getUserId()); openedOrClosedFormDTO.setBadgeId(dto.getBadgeId()); userBadgeService.openedOrClosed(openedOrClosedFormDTO); + //通知 + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(dto.getCustomerId()); + messageFormDTO.setApp(UserConstant.APP_RESI); + messageFormDTO.setGridId(dto.getGridId()); + messageFormDTO.setUserId(dto.getUserId()); + messageFormDTO.setTitle(BadgeMessageConstant.TITLE); + messageFormDTO.setMessageContent(String.format(BadgeMessageConstant.APPROVED_MSG, detail.getBadgeName())); + messageFormDTO.setReadFlag(Constant.UNREAD); + } else { + //通知 + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(dto.getCustomerId()); + messageFormDTO.setApp(UserConstant.APP_RESI); + messageFormDTO.setGridId(dto.getGridId()); + messageFormDTO.setUserId(dto.getUserId()); + messageFormDTO.setTitle(BadgeMessageConstant.TITLE); + messageFormDTO.setMessageContent(String.format(BadgeMessageConstant.REJECTED_MSG, detail.getBadgeName(), formDTO.getAuditRemark())); + messageFormDTO.setReadFlag(Constant.UNREAD); + msgList.add(messageFormDTO); } + messageFeignClient.saveUserMessageList(msgList); } @Override diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index 91267d3a5b..037711a570 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -142,7 +142,7 @@ + From c9c139dcd5a3c7a8ae2059f9084168ab86c91cc2 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 9 Nov 2020 13:25:25 +0800 Subject: [PATCH 041/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/UserBadgeServiceImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 95c2810750..6f2510ab6f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -152,7 +152,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { userBadgeDao.insertUserBadgeCertificateRecord(form); //TODO 站内信发送 您好,您的xxx徽章因认证失败未成功点亮,请查看 - + this.sendMessageByUser(form); return new Result(); } @@ -227,8 +227,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { public List authField(AuthFieldFormDTO authFieldFormDTO) { List authFieldResultDTOS = userBadgeDao.selectAuthField(authFieldFormDTO); if (CollectionUtils.isEmpty(authFieldResultDTOS)){ - authFieldFormDTO.setCustomerId(BadgeConstant.DEFAULT); - return userBadgeDao.selectAuthField(authFieldFormDTO); + return new ArrayList<>(); } return authFieldResultDTOS; } From 75e4427d79643d574e781d2d22f3731f33f46799 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 9 Nov 2020 13:32:44 +0800 Subject: [PATCH 042/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=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 --- .../service/impl/UserBadgeServiceImpl.java | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 6f2510ab6f..9fe158c415 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -254,24 +254,9 @@ public class UserBadgeServiceImpl implements UserBadgeService { @Override public void reloadCustomerBadge(String customerId){ userBadgeRedis.delCustomerBadge(customerId); - List resultUserBadge = new ArrayList<>(); List userBadgeListResultDTOS = userBadgeDao.selectAllBadge(customerId); - if (!CollectionUtils.isEmpty(userBadgeListResultDTOS)){ - Map> groupByCustomer = userBadgeListResultDTOS.stream().collect(Collectors.groupingBy(UserBadgeListResultDTO::getCustomerId)); - resultUserBadge.addAll(groupByCustomer.get(BadgeConstant.DEFAULT_CUSTOMER)); - List badgeByCustomer = groupByCustomer.get(customerId); - if (!CollectionUtils.isEmpty(badgeByCustomer)) { - resultUserBadge.forEach(r -> { - for (int i = NumConstant.ZERO; i < badgeByCustomer.size(); i++) { - if (r.getBadgeId().equals(badgeByCustomer.get(i).getBadgeId())) { - BeanUtils.copyProperties(badgeByCustomer.get(i), r); - badgeByCustomer.remove(badgeByCustomer.get(i)); - } - } - }); - resultUserBadge.addAll(badgeByCustomer); - } - userBadgeRedis.setCustomerBadge(resultUserBadge, customerId); + if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){ + throw new RenException("客户徽章缓存初始化未查到数据"); } userBadgeRedis.setCustomerBadge(userBadgeListResultDTOS, customerId); } From 1f4d8927b77788244b8046a330d0486cba636a14 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 9 Nov 2020 14:13:01 +0800 Subject: [PATCH 043/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E7=BD=91=E6=A0=BCId=20=E5=8F=82=E6=95=B0,?= =?UTF-8?q?=E7=BC=BA=E5=B0=91=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/fact/FactIndexController.java | 1 + .../java/com/epmet/dto/form/BadgeFormDTO.java | 4 ++ .../src/main/java/com/epmet/dao/BadgeDao.java | 69 ++++++++++--------- .../epmet/service/impl/BadgeServiceImpl.java | 6 +- .../src/main/resources/mapper/BadgeDao.xml | 2 + 5 files changed, 48 insertions(+), 34 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java index 2fe90dbce7..3a2f5cfebb 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java @@ -63,6 +63,7 @@ public class FactIndexController { * @Description 按月查询各项指标数据 * @author sun */ + @PostMapping("index/ablitylist") public Result> ablityList(@RequestBody AblityListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class); diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java index fdd2969fb0..5a40b86f0f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java @@ -21,4 +21,8 @@ public class BadgeFormDTO implements Serializable { * 每页显示数量 */ private Integer pageSize = 20; + /** + * 网格Id + */ + private String gridId; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java index e20fd8a523..9e669fd694 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -19,15 +19,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.BadgeDTO; -import com.epmet.dto.result.BadgeAuditRecordResultDTO; -import com.epmet.dto.result.BadgeAuditingResultDTO; -import com.epmet.dto.result.BadgeDetailResultDTO; -import com.epmet.dto.result.BadgeListResultDTO; -import com.epmet.dto.result.UserBadgeListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.BadgeEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName; import java.util.List; @@ -42,114 +37,126 @@ public interface BadgeDao extends BaseDao { /** * 获取徽章列表 - * @author zhaoqifeng - * @date 2020/11/3 17:30 + * * @param customerId * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/3 17:30 */ List selectList(@Param("customerId") String customerId); /** * 重名校验 - * @author zhaoqifeng - * @date 2020/11/4 10:40 + * * @param customerId * @param badgeName * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/4 10:40 */ List getDuplicateName(@Param("customerId") String customerId, @Param("badgeName") String badgeName); /** * 编辑重名校验 - * @author zhaoqifeng - * @date 2020/11/4 15:09 + * * @param customerId * @param badgeId * @param badgeName * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/4 15:09 */ List getDuplicateNameForEdit(@Param("customerId") String customerId, @Param("badgeId") String badgeId, - @Param("badgeName") String badgeName); + @Param("badgeName") String badgeName); /** * 获取徽章详情 - * @author zhaoqifeng - * @date 2020/11/4 14:30 + * * @param customerId * @param badgeId * @return com.epmet.dto.result.BadgeDetailResultDTO + * @author zhaoqifeng + * @date 2020/11/4 14:30 */ BadgeDetailResultDTO selectDetail(@Param("customerId") String customerId, @Param("badgeId") String badgeId); /** * 获取徽章信息 - * @author zhaoqifeng - * @date 2020/11/4 15:16 + * * @param customerId * @param badgeId * @return com.epmet.entity.BadgeEntity + * @author zhaoqifeng + * @date 2020/11/4 15:16 */ BadgeEntity selectBadgeInfo(@Param("customerId") String customerId, @Param("badgeId") String badgeId); /** * 更新徽章信息 - * @author zhaoqifeng - * @date 2020/11/4 15:38 + * * @param entity * @return void + * @author zhaoqifeng + * @date 2020/11/4 15:38 */ void updateBadge(BadgeEntity entity); /** * 删除徽章信息 - * @author zhaoqifeng - * @date 2020/11/4 15:39 + * * @param customerId * @param badgeId * @return void + * @author zhaoqifeng + * @date 2020/11/4 15:39 */ void deleteBadge(@Param("customerId") String customerId, @Param("badgeId") String badgeId); /** * 待审核列表 - * @author zhaoqifeng - * @date 2020/11/5 10:01 + * * @param customerId * @param pageNo * @param pageSize + * @param gridId * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/5 10:01 */ List selectAuditingList(@Param("customerId") String customerId, @Param("pageNo") Integer pageNo, - @Param("pageSize") Integer pageSize); + @Param("pageSize") Integer pageSize, @Param("gridId") String gridId); /** * 审核历史列表 - * @author zhaoqifeng - * @date 2020/11/5 11:01 + * * @param customerId * @param pageNo * @param pageSize + * @param gridId * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/5 11:01 */ List selectAuditRecord(@Param("customerId") String customerId, @Param("pageNo") Integer pageNo, - @Param("pageSize") Integer pageSize); + @Param("pageSize") Integer pageSize, @Param("gridId") String gridId); /** - * @Description 查询客户的徽章 * @param customerId * @return java.util.List + * @Description 查询客户的徽章 * @author wangc * @date 2020.11.05 15:50 - */ + */ List selectCustomerBadgePool(@Param("customerId") String customerId); /** * 插入数据 - * @author zhaoqifeng - * @date 2020/11/6 14:46 + * * @param entity * @return void + * @author zhaoqifeng + * @date 2020/11/6 14:46 */ void insertBadge(BadgeDTO dto); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 1f391e5aa9..b66faf5095 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -21,13 +21,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.constant.BadgeConstant; import com.epmet.constant.BadgeMessageConstant; import com.epmet.constant.UserConstant; @@ -289,7 +289,7 @@ public class BadgeServiceImpl extends BaseServiceImpl imp @Override public List auditingList(TokenDto tokenDto, BadgeFormDTO formDTO) { int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); - List list = baseDao.selectAuditingList(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); + List list = baseDao.selectAuditingList(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize(), formDTO.getGridId()); list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); return list; } @@ -306,7 +306,7 @@ public class BadgeServiceImpl extends BaseServiceImpl imp @Override public List auditRecord(TokenDto tokenDto, BadgeFormDTO formDTO) { int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); - List list = baseDao.selectAuditRecord(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize()); + List list = baseDao.selectAuditRecord(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize(), formDTO.getGridId()); list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); return list; } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index 037711a570..e482f95095 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -169,6 +169,7 @@ AUDIT_STATUS = 'auditing' AND ubcr.DEL_FLAG = '0' AND ubcr.CUSTOMER_ID = #{customerId} + AND ubcr.GRID_ID = #{gridId} ORDER BY ubcr.CREATED_TIME DESC LIMIT #{pageNo}, #{pageSize} @@ -202,6 +203,7 @@ AUDIT_STATUS != 'auditing' AND ubcr.DEL_FLAG = '0' AND ubcr.CUSTOMER_ID = #{customerId} + AND ubcr.GRID_ID = #{gridId} ORDER BY ubcr.CREATED_TIME DESC LIMIT #{pageNo}, #{pageSize} From 5055d35514d4c680152082e467e5498c8441f61f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 9 Nov 2020 14:15:33 +0800 Subject: [PATCH 044/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/CertificationAddFormDTO.java | 2 +- .../main/java/com/epmet/service/impl/UserBadgeServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java index ee9a71d7fc..feef1ee323 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationAddFormDTO.java @@ -47,7 +47,7 @@ public class CertificationAddFormDTO implements Serializable { /** * 身份证号 */ - private String idCard; + private String idcard; /** * 认证证件图片url diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 9fe158c415..c03dc8e726 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -146,7 +146,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { } userBadgeDao.updateCertificateRecordIsLast(form.getBadgeId(),form.getUserId()); form.setGridId(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRegisteredGridId()); - form.setIdNum(certificationAddFormDTO.getIdCard()); + form.setIdNum(certificationAddFormDTO.getIdcard()); form.setCertificationImg(certificationAddFormDTO.getCertificationImg()); form.setSurname(certificationAddFormDTO.getSurname()); userBadgeDao.insertUserBadgeCertificateRecord(form); From d4d233d78fcc6f8eeca6708a04f357d7ec668f1d Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 9 Nov 2020 15:22:43 +0800 Subject: [PATCH 045/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/CertificationDetailResultDTO.java | 2 +- .../java/com/epmet/service/impl/UserBadgeServiceImpl.java | 5 ++++- .../src/main/resources/mapper/UserBadgeDao.xml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java index cc17374704..95670ba7e8 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java @@ -26,7 +26,7 @@ public class CertificationDetailResultDTO implements Serializable { /** * 身份证号 */ - private String idCard; + private String idcard; /** * 是否认证 yes 认证 no 已认证 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index c03dc8e726..b071fa7339 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -205,6 +205,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { /** * @Description 个人中心-获取徽章认证页面详情 + * 先判断 userId存在不,不存在从tokenDto获取【工作端和居民端合用一个接口】 * @Param tokenDto * @Param certificationDetailFormDTO * @author zxc @@ -212,7 +213,9 @@ public class UserBadgeServiceImpl implements UserBadgeService { */ @Override public CertificationDetailResultDTO certificationDetail(TokenDto tokenDto, CertificationDetailFormDTO certificationDetailFormDTO) { - certificationDetailFormDTO.setUserId(tokenDto.getUserId()); + if (StringUtils.isEmpty(certificationDetailFormDTO.getUserId())){ + certificationDetailFormDTO.setUserId(tokenDto.getUserId()); + } return userBadgeDao.selectBadgeAuthRecord(certificationDetailFormDTO.getUserId(), certificationDetailFormDTO.getBadgeId()); } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index c62269205f..d886833fac 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -89,7 +89,7 @@ SELECT SURNAME, NAME, - ID_NUM AS idCard, + ID_NUM AS idcard, ( CASE WHEN AUDIT_STATUS = 'approved' THEN 'yes' ELSE 'no' END ) AS isCertificated, MOBILE, CERTIFICATION_IMG, From 806a9b7583b3def3c9f57452aedc5ff1b5218f0f Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Mon, 9 Nov 2020 15:54:52 +0800 Subject: [PATCH 046/125] =?UTF-8?q?advice=E8=BF=90=E8=90=A5=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3over?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/AdviceListResultDTO.java | 50 +++++++++++++++++++ .../controller/UserAdviceController.java | 10 ++-- .../com/epmet/entity/UserAdviceEntity.java | 5 ++ .../java/com/epmet/excel/UserAdviceExcel.java | 5 +- .../com/epmet/service/UserAdviceService.java | 3 +- .../service/impl/UserAdviceServiceImpl.java | 50 ++++++++++++++++--- 6 files changed, 111 insertions(+), 12 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceListResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceListResultDTO.java new file mode 100644 index 0000000000..f9be8de0b8 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceListResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.result; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/9 14:46 + */ +@Data +public class AdviceListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 建议id + */ + private String id; + + /** + * 客户名 + */ + private String customerName; + + /** + * 网格名 + */ + private String gridName; + + /** + * 建议类型 + */ + private String adviceType; + + /** + * 提交的电话 + */ + private String phone; + + /** + * 建议时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date adviceTime; + + private String adviceContent; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index b58cc793a3..f3bac40f4e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -31,6 +31,7 @@ import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.dto.result.AdviceDetailResultDTO; +import com.epmet.dto.result.AdviceListResultDTO; import com.epmet.excel.UserAdviceExcel; import com.epmet.service.UserAdviceService; import org.apache.commons.lang3.StringUtils; @@ -116,9 +117,12 @@ public class UserAdviceController { } @PostMapping("advicelist") - public Result> adviceList(AdviceListFormDTO dto){ + public Result> adviceList(AdviceListFormDTO dto){ ValidatorUtils.validateEntity(dto); - PageData page = userAdviceService.adviceList(dto); - return new Result>().ok(page); + if (dto.getStartTime().after(dto.getEndTime())){ + throw new RenException("开始时间不能大于结束时间"); + } + PageData page = userAdviceService.adviceList(dto); + return new Result>().ok(page); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java index 78c246fa15..51ddc1553d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java @@ -123,4 +123,9 @@ public class UserAdviceEntity extends BaseEpmetEntity { */ private String govContent; + /** + * 建议时间 + */ + private Date adviceTime; + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java index 9e93cb6bfc..f14ded9f03 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java @@ -61,6 +61,9 @@ public class UserAdviceExcel { @Excel(name = "用户注册手机号") private String regPhone; + @Excel(name = "建议时间") + private Date adviceTime; + @Excel(name = "建议描述") private String adviceContent; @@ -104,4 +107,4 @@ public class UserAdviceExcel { private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java index 8e018df061..31a63b3ffa 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java @@ -23,6 +23,7 @@ import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.dto.result.AdviceDetailResultDTO; +import com.epmet.dto.result.AdviceListResultDTO; import com.epmet.entity.UserAdviceEntity; import java.util.List; @@ -122,5 +123,5 @@ public interface UserAdviceService extends BaseService { * @Author liushaowen * @Date 2020/11/9 10:41 */ - PageData adviceList(AdviceListFormDTO dto); + PageData adviceList(AdviceListFormDTO dto); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index df0ca66996..135cf802c1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -32,6 +32,7 @@ import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.dto.result.AdviceDetailResultDTO; +import com.epmet.dto.result.AdviceListResultDTO; import com.epmet.entity.UserAdviceEntity; import com.epmet.entity.UserAdviceImgEntity; import com.epmet.redis.UserAdviceRedis; @@ -39,14 +40,11 @@ import com.epmet.service.UserAdviceImgService; import com.epmet.service.UserAdviceService; import io.jsonwebtoken.lang.Collections; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Resource; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -168,7 +166,6 @@ public class UserAdviceServiceImpl extends BaseServiceImpl adviceList(AdviceListFormDTO dto) { + public PageData adviceList(AdviceListFormDTO dto) { //page分页 Page page = new Page<>(dto.getPageNo(), dto.getPageSize()); //时间降序 @@ -215,9 +212,48 @@ public class UserAdviceServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); + //客户Id + wrapper.eq(StringUtils.isNotBlank(dto.getCustomerId()), "CUSTOMER_ID", dto.getCustomerId()); + //是否回复 + if ("1".equals(dto.getIsReply())) { + wrapper.ne("REPLY_USER_ID", ""); + wrapper.ne("REPLY_CONTENT", ""); + } else if ("0".equals(dto.getIsReply())) { + wrapper.eq("REPLY_USER_ID", ""); + wrapper.eq("REPLY_CONTENT", ""); + } + // 组织id + wrapper.eq(StringUtils.isNotBlank(dto.getAgencyId()), "AGENCY_ID", dto.getAgencyId()); + //建议类型 + wrapper.like(StringUtils.isNotBlank(dto.getAdviceType()), "ADVICE_TYPE", dto.getAdviceType()); + //开始时间 + wrapper.ge(dto.getStartTime() != null, "CREATED_TIME", dto.getStartTime()); + //结束时间 + wrapper.le(dto.getEndTime() != null, "CREATED_TIME", dto.getEndTime()); + + IPage result = baseDao.selectPage(page, wrapper); + + List records = result.getRecords(); + + //拼接type + for (int i = 0; i < records.size(); i++) { + if (!"*".equals(records.get(i).getAdviceType())) { + StringBuilder type = new StringBuilder(); + if (records.get(i).getAdviceType().contains("gov")) { + type.append(UserAdviceConstant.GOV_TYPE_TEXT); + } + if (records.get(i).getAdviceType().contains("software")) { + if (type.length() != 0) { + type.append("\\n"); + } + type.append(UserAdviceConstant.SOFTWARE_TYPE_TEXT); + } + records.get(i).setAdviceType(type.toString()); + } + } + result.setRecords(records); - IPage result = baseDao.selectPage(page,wrapper); - return null; + return getPageData(result, AdviceListResultDTO.class); } } From 7fb40dc779aacfff4979e5d318cce10222fd87b9 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 9 Nov 2020 16:08:42 +0800 Subject: [PATCH 047/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/UserBadgeDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index d886833fac..a40301a81f 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -80,7 +80,7 @@ FROM resi_user_badge WHERE DEL_FLAG = '0' - AND CERTIFICATION_AUTID_STATUS = 'pass' + AND CERTIFICATION_AUTID_STATUS = 'approved' AND USER_ID = #{userId} From bfbdc178a301f180e6ccb79d40ebac312bf0c24a Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Mon, 9 Nov 2020 16:26:35 +0800 Subject: [PATCH 048/125] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=BB=BA=E8=AE=AE=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A1=E6=A0=B8func?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/UserAdviceServiceImpl.java | 75 ++++++++++++++++++- 1 file changed, 71 insertions(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index 135cf802c1..58686403c4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -17,15 +17,24 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.scan.param.ImgScanParamDTO; +import com.epmet.commons.tools.scan.param.ImgTaskDTO; +import com.epmet.commons.tools.scan.param.TextScanParamDTO; +import com.epmet.commons.tools.scan.param.TextTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.UserAdviceConstant; import com.epmet.dao.UserAdviceDao; import com.epmet.dto.UserAdviceDTO; @@ -40,15 +49,15 @@ import com.epmet.service.UserAdviceImgService; import com.epmet.service.UserAdviceService; import io.jsonwebtoken.lang.Collections; import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; 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.*; /** * user_advice @@ -59,12 +68,20 @@ import java.util.Map; @Service public class UserAdviceServiceImpl extends BaseServiceImpl implements UserAdviceService { + private Logger logger = LogManager.getLogger(UserAdviceServiceImpl.class); @Autowired private UserAdviceRedis userAdviceRedis; @Autowired private UserAdviceImgService userAdviceImgService; + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -132,6 +149,10 @@ public class UserAdviceServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + logger.info("用户建议文字审核入参:"+JSON.toJSONString(textScanParamDTO)); + logger.info("用户建议文字审核返参:"+JSON.toJSONString(textSyncScanResult)); + if (!textSyncScanResult.success()) { + logger.warn("用户建议文字审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.warn("用户建议文字审核失败,文字:",text); + throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode()); + } + } + logger.info("用户建议文字审核成功"); + } + + private void auditPic(List imgList) { + if (null != imgList && imgList.size() > 0) { + //审核活动详情中的图片 + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + imgList.forEach(url -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(UUID.randomUUID().toString().replace("-", "")); + task.setUrl(url); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + logger.info("图片审核入参:" + JSON.toJSONString(imgScanParamDTO)); + logger.info("图片审核返参:" + JSON.toJSONString(imgScanResult)); + if (!imgScanResult.success()) { + logger.warn("图片审核接口失败,返参:", JSON.toJSONString(imgScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.ACT_CONTENT_IMG_SCAN_FAILED.getCode()); + } + } + logger.info("图片审核成功"); + } + } } From 7119330af5b095d5d11916a3ee3f4a5ad1272e12 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Mon, 9 Nov 2020 16:39:02 +0800 Subject: [PATCH 049/125] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-user/epmet-user-server/pom.xml | 4 ++++ .../epmet-user-server/src/main/resources/bootstrap.yml | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 61c5b17203..ee7aa35693 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -155,6 +155,7 @@ false + https://epmet-dev.elinkservice.cn/api/epmetscan/api @@ -187,6 +188,7 @@ false + https://epmet-dev.elinkservice.cn/api/epmetscan/api @@ -219,6 +221,7 @@ true + https://epmet-dev.elinkservice.cn/api/epmetscan/api @@ -248,6 +251,7 @@ true + https://epmet-open.elinkservice.cn/api/epmetscan/api diff --git a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml index 4f732d5ac9..b58644dbcc 100644 --- a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml +++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml @@ -131,4 +131,12 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +openapi: + scan: + server: + url: @openapi.scan.server.url@ + method: + imgSyncScan: /imgSyncScan + textSyncScan: /textSyncScan From a205829dfba4dbf4d7d36bf998f5d0a55745309a Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Mon, 9 Nov 2020 17:05:32 +0800 Subject: [PATCH 050/125] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/UserAdviceController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index f3bac40f4e..39679abddb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -119,8 +119,10 @@ public class UserAdviceController { @PostMapping("advicelist") public Result> adviceList(AdviceListFormDTO dto){ ValidatorUtils.validateEntity(dto); - if (dto.getStartTime().after(dto.getEndTime())){ - throw new RenException("开始时间不能大于结束时间"); + if (dto.getStartTime()!=null && dto.getEndTime()!=null){ + if (dto.getStartTime().after(dto.getEndTime())){ + throw new RenException("开始时间不能大于结束时间"); + } } PageData page = userAdviceService.adviceList(dto); return new Result>().ok(page); From b9a448c582fb87bf1514bed93a97e2b8aeb7459a Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Mon, 9 Nov 2020 17:13:56 +0800 Subject: [PATCH 051/125] bug --- .../main/java/com/epmet/controller/UserAdviceController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 39679abddb..3b7763b5fb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -117,7 +117,7 @@ public class UserAdviceController { } @PostMapping("advicelist") - public Result> adviceList(AdviceListFormDTO dto){ + public Result> adviceList(@RequestBody AdviceListFormDTO dto){ ValidatorUtils.validateEntity(dto); if (dto.getStartTime()!=null && dto.getEndTime()!=null){ if (dto.getStartTime().after(dto.getEndTime())){ From f9df6920ab2a207c265478268d97e7d669b30482 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 9 Nov 2020 17:23:27 +0800 Subject: [PATCH 052/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/UserBadgeDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index a40301a81f..f04f31eab8 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -32,7 +32,7 @@ LEFT JOIN badge b ON b.ID = ub.BADGE_ID WHERE ub.DEL_FLAG = '0' AND b.DEL_FLAG = 0 - AND ub.CERTIFICATION_AUTID_STATUS = 'pass' + AND ub.CERTIFICATION_AUTID_STATUS = 'approved' AND b.CUSTOMER_ID = 'default' AND b.BADGE_STATUS = 'online' AND ub.USER_ID = #{userId} From 079d9f2a26e2e4c665ec5e04bdff5b1f5accb834 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Mon, 9 Nov 2020 17:27:11 +0800 Subject: [PATCH 053/125] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF-=E6=88=91?= =?UTF-8?q?=E7=9A=84=E5=BB=BA=E8=AE=AE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/MyAdviceListResultDTO.java | 30 +++++++++++++++++++ .../controller/UserAdviceController.java | 30 +++++++++++-------- 2 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java new file mode 100644 index 0000000000..a451b24393 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/9 17:21 + */ +@Data +public class MyAdviceListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private String adviceContent; + + private List imgList; + + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date adviceTime; + + private String replyContent; + + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date replyTime; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 3b7763b5fb..38578093ea 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -32,6 +32,7 @@ import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.dto.result.AdviceDetailResultDTO; import com.epmet.dto.result.AdviceListResultDTO; +import com.epmet.dto.result.MyAdviceListResultDTO; import com.epmet.excel.UserAdviceExcel; import com.epmet.service.UserAdviceService; import org.apache.commons.lang3.StringUtils; @@ -60,19 +61,19 @@ public class UserAdviceController { private LoginUserUtil loginUserUtil; @GetMapping("page") - public Result> page(@RequestParam Map params){ + public Result> page(@RequestParam Map params) { PageData page = userAdviceService.page(params); return new Result>().ok(page); } @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ + public Result get(@PathVariable("id") String id) { UserAdviceDTO data = userAdviceService.get(id); return new Result().ok(data); } @PostMapping - public Result save(@RequestBody UserAdviceDTO dto){ + public Result save(@RequestBody UserAdviceDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); userAdviceService.save(dto); @@ -80,7 +81,7 @@ public class UserAdviceController { } @PutMapping - public Result update(@RequestBody UserAdviceDTO dto){ + public Result update(@RequestBody UserAdviceDTO dto) { //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); userAdviceService.update(dto); @@ -88,7 +89,7 @@ public class UserAdviceController { } @DeleteMapping - public Result delete(@RequestBody String[] ids){ + public Result delete(@RequestBody String[] ids) { //效验数据 AssertUtils.isArrayEmpty(ids, "id"); userAdviceService.delete(ids); @@ -102,29 +103,34 @@ public class UserAdviceController { } @PostMapping("replyadvice") - public Result replyAdvice(@RequestBody ReplyAdviceFormDTO dto){ + public Result replyAdvice(@RequestBody ReplyAdviceFormDTO dto) { ValidatorUtils.validateEntity(dto); - userAdviceService.replyAdvice(dto,loginUserUtil.getLoginUserId()); + userAdviceService.replyAdvice(dto, loginUserUtil.getLoginUserId()); return new Result(); } @PostMapping("advicedetail") - public Result adviceDetail(String adviceId){ - if (StringUtils.isBlank(adviceId)){ + public Result adviceDetail(String adviceId) { + if (StringUtils.isBlank(adviceId)) { throw new RenException("adviceId不能为空"); } return new Result().ok(userAdviceService.adviceDetail(adviceId)); } @PostMapping("advicelist") - public Result> adviceList(@RequestBody AdviceListFormDTO dto){ + public Result> adviceList(@RequestBody AdviceListFormDTO dto) { ValidatorUtils.validateEntity(dto); - if (dto.getStartTime()!=null && dto.getEndTime()!=null){ - if (dto.getStartTime().after(dto.getEndTime())){ + if (dto.getStartTime() != null && dto.getEndTime() != null) { + if (dto.getStartTime().after(dto.getEndTime())) { throw new RenException("开始时间不能大于结束时间"); } } PageData page = userAdviceService.adviceList(dto); return new Result>().ok(page); } + + @PostMapping("myadvicelist") + public Result> myAdviceList(String pageSize, String pageNo) { + return null; + } } From 31ea4f4f4120c5542159b42c0158bc3affbed2be Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Mon, 9 Nov 2020 18:09:51 +0800 Subject: [PATCH 054/125] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/MyAdviceListResultDTO.java | 4 ++-- .../controller/UserAdviceController.java | 13 ++++++++++-- .../java/com/epmet/dao/UserAdviceDao.java | 7 +++++++ .../com/epmet/service/UserAdviceService.java | 12 +++++++++++ .../service/impl/UserAdviceServiceImpl.java | 21 ++++++++++++++++--- .../main/resources/mapper/UserAdviceDao.xml | 21 +++++++++++++++++++ 6 files changed, 71 insertions(+), 7 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java index a451b24393..77a8e2c460 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java @@ -20,11 +20,11 @@ public class MyAdviceListResultDTO implements Serializable { private List imgList; - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8") private Date adviceTime; private String replyContent; - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8") private Date replyTime; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 38578093ea..1020c5d66a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -129,8 +129,17 @@ public class UserAdviceController { return new Result>().ok(page); } + /** + * @Description 居民端-我的建议列表 + * @param map ->pageSize,pageNo + * @return com.epmet.commons.tools.utils.Result> + * @Author liushaowen + * @Date 2020/11/9 17:35 + */ @PostMapping("myadvicelist") - public Result> myAdviceList(String pageSize, String pageNo) { - return null; + public Result> myAdviceList(@RequestBody Map map) { + int pageSize = map.get("pageSize"); + int pageNo = map.get("pageNo"); + return new Result>().ok(userAdviceService.myAdviceList(pageSize,pageNo,loginUserUtil.getLoginUserId())); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java index e198ef4b82..087b91f225 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java @@ -18,10 +18,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.MyAdviceListResultDTO; import com.epmet.entity.UserAdviceEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * user_advice * @@ -34,4 +37,8 @@ public interface UserAdviceDao extends BaseDao { @Param("replyContent") String replyContent, @Param("govContent") String govContent, @Param("replyUserId") String loginUserId); + + List myAdviceList(@Param("pageSize") int pageSize, + @Param("pageNo") int pageNo, + @Param("userId") String loginUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java index 31a63b3ffa..35a5e840ce 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java @@ -24,6 +24,7 @@ import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.dto.result.AdviceDetailResultDTO; import com.epmet.dto.result.AdviceListResultDTO; +import com.epmet.dto.result.MyAdviceListResultDTO; import com.epmet.entity.UserAdviceEntity; import java.util.List; @@ -124,4 +125,15 @@ public interface UserAdviceService extends BaseService { * @Date 2020/11/9 10:41 */ PageData adviceList(AdviceListFormDTO dto); + + /** + * @Description 居民端-我的建议列表 + * @param pageSize + * @param pageNo + * @param loginUserId + * @return java.util.List + * @Author liushaowen + * @Date 2020/11/9 17:39 + */ + List myAdviceList(int pageSize, int pageNo, String loginUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index 58686403c4..8973026d33 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -42,6 +42,7 @@ import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.dto.result.AdviceDetailResultDTO; import com.epmet.dto.result.AdviceListResultDTO; +import com.epmet.dto.result.MyAdviceListResultDTO; import com.epmet.entity.UserAdviceEntity; import com.epmet.entity.UserAdviceImgEntity; import com.epmet.redis.UserAdviceRedis; @@ -278,6 +279,20 @@ public class UserAdviceServiceImpl extends BaseServiceImpl + * @Description 居民端-我的建议列表 + * @Author liushaowen + * @Date 2020/11/9 17:39 + */ + @Override + public List myAdviceList(int pageSize, int pageNo, String loginUserId) { + return baseDao.myAdviceList(pageSize, pageNo, loginUserId); + } + private void auditText(String text) { TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); TextTaskDTO taskDTO = new TextTaskDTO(); @@ -285,14 +300,14 @@ public class UserAdviceServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - logger.info("用户建议文字审核入参:"+JSON.toJSONString(textScanParamDTO)); - logger.info("用户建议文字审核返参:"+JSON.toJSONString(textSyncScanResult)); + logger.info("用户建议文字审核入参:" + JSON.toJSONString(textScanParamDTO)); + logger.info("用户建议文字审核返参:" + JSON.toJSONString(textSyncScanResult)); if (!textSyncScanResult.success()) { logger.warn("用户建议文字审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult)); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } else { if (!textSyncScanResult.getData().isAllPass()) { - logger.warn("用户建议文字审核失败,文字:",text); + logger.warn("用户建议文字审核失败,文字:", text); throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode()); } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml index 0f7d01cd50..d787d73850 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -43,4 +43,25 @@ where id = #{adviceId} and del_flag = 0 + + + + + + + + + + + From 86ac79a366c93db2de6e54b2675403538d7051f9 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Mon, 9 Nov 2020 18:21:36 +0800 Subject: [PATCH 055/125] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF-=E6=88=91?= =?UTF-8?q?=E7=9A=84=E5=BB=BA=E8=AE=AE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/UserAdviceController.java | 6 ++++++ .../src/main/resources/mapper/UserAdviceDao.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 1020c5d66a..070b0030f4 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -140,6 +140,12 @@ public class UserAdviceController { public Result> myAdviceList(@RequestBody Map map) { int pageSize = map.get("pageSize"); int pageNo = map.get("pageNo"); + if (pageSize == 0){ + pageSize = 10; + } + if (pageNo == 0){ + pageNo = 1; + } return new Result>().ok(userAdviceService.myAdviceList(pageSize,pageNo,loginUserUtil.getLoginUserId())); } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml index d787d73850..42c4b57f44 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -59,7 +59,7 @@ order by created_time desc limit ${(pageNo-1)*pageSize},${pageSize}; - select img_url from user_advice_img where del_flag = 0 and advice_Id = #{id} and type = 'resi' From 6bb97351e1ffde3730de4efb9b89fabd1f50063f Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 9 Nov 2020 18:44:39 +0800 Subject: [PATCH 056/125] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8B=8B=E7=AB=A0=E5=A2=9E=E5=8A=A0=E8=A1=A5=E5=81=BF=EF=BC=8C?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E7=94=A8=E6=88=B7=E5=BE=BD?= =?UTF-8?q?=E7=AB=A0=EF=BC=8C=E5=B0=86keys=E6=93=8D=E4=BD=9C=E6=94=BE?= =?UTF-8?q?=E5=9C=A8=E7=AE=A1=E9=81=93=E5=A4=96=EF=BC=8C=E5=90=A6=E5=88=99?= =?UTF-8?q?=E8=BF=94=E5=9B=9Enull=EF=BC=8C=E5=85=B7=E4=BD=93=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E8=BF=98=E5=9C=A8=E6=9F=A5=E3=80=82=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisUtils.java | 8 ++++ .../epmet/dto/form/UserBadgeUnitFormDTO.java | 2 +- .../com/epmet/controller/BadgeController.java | 19 ++++++-- .../main/java/com/epmet/dao/UserBadgeDao.java | 11 +++++ .../java/com/epmet/redis/UserBadgeRedis.java | 32 ++++++++++--- .../com/epmet/service/UserBadgeService.java | 10 +++++ .../service/impl/UserBadgeServiceImpl.java | 14 ++++++ .../main/resources/mapper/UserBadgeDao.xml | 45 +++++++++++++++++++ 8 files changed, 129 insertions(+), 12 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index 19d8e73374..af891dc817 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -166,6 +166,14 @@ public class RedisUtils { redisTemplate.opsForHash().delete(key, fields); } + public void rightPush(String key, Object value, long expire){ + redisTemplate.opsForList().rightPush(key, value); + + if (expire != NOT_EXPIRE) { + expire(key, expire); + } + } + public void leftPush(String key, Object value) { leftPush(key, value, DEFAULT_EXPIRE); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java index 406f527bb9..a68dd2157e 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java @@ -6,7 +6,7 @@ import java.io.Serializable; import java.util.Objects; /** - * @Description 用户-徽章缓存单元 + * @Description 用户-徽章缓存单元(专为redis操作提供) 尽量不要使用这个DTO,因为重写了hashcode和equals!!!!!!! * @ClassName UserBadgeUnitFormDTO * @Auth wangc * @Date 2020-11-05 10:00 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java index 12042c4fbd..c284939571 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java @@ -12,12 +12,10 @@ import com.epmet.dto.result.BadgeAuditRecordResultDTO; import com.epmet.dto.result.BadgeAuditingResultDTO; import com.epmet.dto.result.BadgeDetailResultDTO; import com.epmet.dto.result.BadgeListResultDTO; +import com.epmet.redis.UserBadgeRedis; import com.epmet.service.BadgeService; 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; @@ -150,4 +148,17 @@ public class BadgeController { return new Result(); } + @Autowired + private UserBadgeRedis redis; + @PostMapping("compensation-mechanism") + public Result compensationMechanism(@RequestParam("userId")String userId,@RequestParam("customerId")String customerId,@RequestParam("b1")String b1, + @RequestParam("b2")String b2){ + redis.pushOrRemoveUserBadge4List(userId,b1,customerId); + redis.pushOrRemoveUserBadge4List(userId,b1,customerId); + redis.pushOrRemoveUserBadge4List(userId,b1,customerId); + redis.pushOrRemoveUserBadge4List(userId,b2,customerId); + redis.batchClearUserBadgeCache(customerId); + redis.obtainUserBadge2List(userId,customerId); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java index 65910f22cd..b304118d3d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java @@ -4,6 +4,7 @@ import com.epmet.dto.UserBadgeCertificateRecordDTO; import com.epmet.dto.form.AuthFieldFormDTO; import com.epmet.dto.form.OpenedOrClosedFormDTO; import com.epmet.dto.form.UserBadgeListFormDTO; +import com.epmet.dto.form.UserBadgeUnitFormDTO; import com.epmet.dto.result.AuthFieldResultDTO; import com.epmet.dto.result.CertificationDetailResultDTO; import com.epmet.dto.result.UserBadgeListResultDTO; @@ -92,4 +93,14 @@ public interface UserBadgeDao { * @date 2020/11/4 6:04 下午 */ void updateIsOpen(OpenedOrClosedFormDTO openedOrClosedFormDTO); + + /** + * @Description 查找用户全部的显示徽章(排序) + * @param userId + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.11.09 14:14 + */ + List selectUserSortedBadge(@Param("userId")String userId,@Param("customerId")String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index f5c22ca54a..759ae00192 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -16,10 +16,14 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.dao.DataAccessException; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.StringRedisConnection; import org.springframework.data.redis.core.RedisCallback; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; +import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.Set; @@ -106,8 +110,23 @@ public class UserBadgeRedis { * @date 2020.11.05 13:26 */ public List obtainUserBadge2List(String userId,String customerId) { - //TODO 补偿 - return redisUtils.lrange(UserRedisKeys.getResiUserBadgeKey(customerId,userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); + List cache = + redisUtils.lrange(UserRedisKeys.getResiUserBadgeKey(customerId,userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); + if(!CollectionUtils.isEmpty(cache)) return cache; + //补偿 + cache = badgeService.getUserSortedBadge(userId,customerId); + if(CollectionUtils.isEmpty(cache)) return cache; + final List sortedBadges = cache; + redisTemplate.executePipelined((RedisCallback>) connection ->{ + sortedBadges.forEach(badge -> { + + connection.listCommands().rPush(UserRedisKeys.getResiUserBadgeKey(customerId, userId).getBytes(), + redisTemplate.getValueSerializer().serialize(badge)); + }); + return null; + }); + + return cache; } /** @@ -160,12 +179,11 @@ public class UserBadgeRedis { * @date 2020.11.09 10:02 */ public void batchClearUserBadgeCache(String customerId){ + Set key = redisUtils.keys(UserRedisKeys.getResiUserBadgeKey(customerId, null)); + if(CollectionUtils.isEmpty(key)) return; + final Set keys = key; redisTemplate.executePipelined((RedisCallback) connection ->{ - Set keys = - connection.keys(redisTemplate.getKeySerializer().serialize(UserRedisKeys.getResiUserBadgeKey(customerId, null))); - if(!CollectionUtils.isEmpty(keys)){ - keys.forEach( ser -> {connection.del(ser);}); - } + keys.forEach( ser -> {connection.del(redisTemplate.getKeySerializer().serialize(ser));}); return null; }); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java index 81213550b9..65e9494cc8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java @@ -81,4 +81,14 @@ public interface UserBadgeService { */ void reloadCustomerBadge(String customerId); + /** + * @Description 得到用户全部的显示徽章(排序) + * @param userId + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.11.09 13:45 + */ + List getUserSortedBadge(String userId,String customerId); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 2f3f51ed86..4d71f25c04 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.constant.BadgeConstant; import com.epmet.constant.SmsTemplateConstant; +import com.epmet.dao.ResiUserBadgeDao; import com.epmet.dao.UserBadgeDao; import com.epmet.dto.UserBadgeCertificateRecordDTO; import com.epmet.dto.form.*; @@ -254,4 +255,17 @@ public class UserBadgeServiceImpl implements UserBadgeService { userBadgeRedis.setCustomerBadge(userBadgeListResultDTOS, customerId); } + /** + * @Description 得到用户全部的显示徽章(排序) + * @param userId + * @param customerId + * @return java.util.List + * @author wangc + * @date 2020.11.09 13:45 + */ + @Override + public List getUserSortedBadge(String userId, String customerId) { + return userBadgeDao.selectUserSortedBadge(userId,customerId); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index a20a9c0e61..33b3c4eabb 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -180,4 +180,49 @@ ) + + From 136c5e9c13d7ed834ca7518dc0613da3e037b293 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 10 Nov 2020 09:06:07 +0800 Subject: [PATCH 057/125] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/UserBadgeServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index b4fe0dbef6..74a1ddaddd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -158,6 +158,12 @@ public class UserBadgeServiceImpl implements UserBadgeService { return new Result(); } + /** + * @Description 站内信发送——提交徽章认证 + * @Param form + * @author zxc + * @date 2020/11/10 9:04 上午 + */ public void sendMessageByUser(UserBadgeCertificateRecordDTO form){ List msgList = new ArrayList<>(); UserMessageFormDTO formDTO = new UserMessageFormDTO(); From 6570ef98076536796de57ca00c72bdde1b149941 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 10 Nov 2020 09:31:53 +0800 Subject: [PATCH 058/125] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{badege => person}/controller/BadgeController.java | 4 ++-- .../modules/{badege => person}/service/BadgeService.java | 2 +- .../{badege => person}/service/impl/BadgeServiceImpl.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/{badege => person}/controller/BadgeController.java (97%) rename epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/{badege => person}/service/BadgeService.java (97%) rename epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/{badege => person}/service/impl/BadgeServiceImpl.java (97%) diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java similarity index 97% rename from epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java rename to epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java index 727e1ee1ae..f9f133bc02 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/controller/BadgeController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java @@ -1,11 +1,11 @@ -package com.epmet.modules.badege.controller; +package com.epmet.modules.person.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.OpenedOrClosedFormDTO; -import com.epmet.modules.badege.service.BadgeService; +import com.epmet.modules.person.service.BadgeService; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.resi.mine.dto.from.OperListFormDTO; diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java similarity index 97% rename from epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java rename to epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java index c9da1f12ed..2bd0869cbb 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/BadgeService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java @@ -1,4 +1,4 @@ -package com.epmet.modules.badege.service; +package com.epmet.modules.person.service; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java similarity index 97% rename from epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java rename to epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java index 53057f9492..0bcfd1fb8b 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java @@ -1,4 +1,4 @@ -package com.epmet.modules.badege.service.impl; +package com.epmet.modules.person.service.impl; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; @@ -10,7 +10,7 @@ import com.epmet.dto.form.UserOperListFormDTO; import com.epmet.dto.result.UserBadgeListResultDTO; import com.epmet.dto.result.UserOperListResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.modules.badege.service.BadgeService; +import com.epmet.modules.person.service.BadgeService; import com.epmet.resi.mine.dto.from.BadgeListFormDTO; import com.epmet.dto.form.CertificationAddFormDTO; import com.epmet.resi.mine.dto.from.OperListFormDTO; From 820e40e3b9cede0453ab065bd815518f8b389b61 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Tue, 10 Nov 2020 09:34:52 +0800 Subject: [PATCH 059/125] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A5=E5=8F=82?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/UserAdviceController.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 070b0030f4..0886a6a824 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -102,6 +102,13 @@ public class UserAdviceController { ExcelUtils.exportExcelToTarget(response, null, list, UserAdviceExcel.class); } + /** + * @Description 运营-回复建议 + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/11/10 9:34 + */ @PostMapping("replyadvice") public Result replyAdvice(@RequestBody ReplyAdviceFormDTO dto) { ValidatorUtils.validateEntity(dto); @@ -109,14 +116,29 @@ public class UserAdviceController { return new Result(); } + /** + * @Description 运营端-建议详情 + * @param map + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/11/10 9:33 + */ @PostMapping("advicedetail") - public Result adviceDetail(String adviceId) { + public Result adviceDetail(@RequestBody Map map) { + String adviceId = map.get("adviceId"); if (StringUtils.isBlank(adviceId)) { throw new RenException("adviceId不能为空"); } return new Result().ok(userAdviceService.adviceDetail(adviceId)); } + /** + * @Description 运营端-建议列表 + * @param dto + * @return com.epmet.commons.tools.utils.Result> + * @Author liushaowen + * @Date 2020/11/10 9:32 + */ @PostMapping("advicelist") public Result> adviceList(@RequestBody AdviceListFormDTO dto) { ValidatorUtils.validateEntity(dto); From d9f88b1116a7c4ccdd4dbebda459f96a4d1f52b6 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Tue, 10 Nov 2020 09:37:11 +0800 Subject: [PATCH 060/125] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A5=E5=8F=82?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/CustomerAgencyController.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 3135924fdd..1876fedb9b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -251,13 +251,14 @@ public class CustomerAgencyController { /** * @Description 对外接口,根据customerId返回Element UI中Tree结构的agency列表 - * @param customerId + * @param map * @return com.epmet.commons.tools.utils.Result * @Author liushaowen * @Date 2020/11/6 13:51 */ @PostMapping("getagencyelementtreelist") - public Result> getAgencyElementTreeList(String customerId){ + public Result> getAgencyElementTreeList(@RequestBody Map map){ + String customerId = map.get("customerId"); if (StringUtils.isBlank(customerId)){ throw new RenException("customerId不能为空"); } @@ -265,13 +266,14 @@ public class CustomerAgencyController { } /** * @Description 对外接口,根据customerId返回Element UI中Tree结构的agency keys - * @param customerId + * @param map * @return com.epmet.commons.tools.utils.Result * @Author liushaowen * @Date 2020/11/6 13:51 */ @PostMapping("getagencyelementtreekeys") - public Result> getAgencyElementTreeKeys(String customerId){ + public Result> getAgencyElementTreeKeys(@RequestBody Map map){ + String customerId = map.get("customerId"); if (StringUtils.isBlank(customerId)){ throw new RenException("customerId不能为空"); } From bd7685fb998985e9364a9536355d4c7a62912c0d Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 10 Nov 2020 10:11:24 +0800 Subject: [PATCH 061/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/BadgeAuditFormDTO.java | 3 + .../java/com/epmet/dto/form/BadgeFormDTO.java | 5 ++ .../com/epmet/dto/form/EditBadgeFormDTO.java | 1 + .../com/epmet/controller/BadgeController.java | 5 ++ .../epmet/service/impl/BadgeServiceImpl.java | 71 ++++++++++++++----- 5 files changed, 68 insertions(+), 17 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java index f7d3deac7d..c3748fe49f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.form; import lombok.Data; import lombok.NoArgsConstructor; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -14,7 +15,9 @@ import java.io.Serializable; @Data public class BadgeAuditFormDTO implements Serializable { private static final long serialVersionUID = 2209535364555130964L; + @NotBlank(message = "申请记录Id不能为空") private String recordId; + @NotBlank(message = "审核结果不能为空") private String auditStatus; private String auditRemark; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java index 5a40b86f0f..66384607cf 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.dto.form; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -12,6 +13,9 @@ import java.io.Serializable; @Data public class BadgeFormDTO implements Serializable { private static final long serialVersionUID = 9156247659994638103L; + public interface ManageGroup {} + public interface AuditGroup {} + @NotBlank(message = "徽章id不能为空", groups = {ManageGroup.class}) private String badgeId; /** * 页码 @@ -24,5 +28,6 @@ public class BadgeFormDTO implements Serializable { /** * 网格Id */ + @NotBlank(message = "网格id不能为空", groups = {AuditGroup.class}) private String gridId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditBadgeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditBadgeFormDTO.java index e11d2e107c..7b8cc1fb4a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditBadgeFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditBadgeFormDTO.java @@ -16,6 +16,7 @@ import java.util.List; @Data public class EditBadgeFormDTO implements Serializable { private static final long serialVersionUID = 1578890423002035200L; + @NotBlank(message = "徽章ID不能为空") private String badgeId; /** * 徽章名称 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java index c284939571..cabe4b0a98 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java @@ -68,6 +68,7 @@ public class BadgeController { */ @PostMapping("detail") public Result detail(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, BadgeFormDTO.ManageGroup.class); BadgeDetailResultDTO result = badgeService.detail(tokenDto, formDTO); return new Result().ok(result); } @@ -97,6 +98,7 @@ public class BadgeController { */ @PostMapping("delete") public Result delete(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, BadgeFormDTO.ManageGroup.class); badgeService.deleteBadge(tokenDto, formDTO); return new Result(); } @@ -116,6 +118,7 @@ public class BadgeController { */ @PostMapping("auditinglist") public Result> auditingList(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, BadgeFormDTO.AuditGroup.class); List result = badgeService.auditingList(tokenDto, formDTO); return new Result>().ok(result); } @@ -130,6 +133,7 @@ public class BadgeController { */ @PostMapping("auditrecord") public Result> auditRecord(@LoginUser TokenDto tokenDto, @RequestBody BadgeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, BadgeFormDTO.AuditGroup.class); List result = badgeService.auditRecord(tokenDto, formDTO); return new Result>().ok(result); } @@ -144,6 +148,7 @@ public class BadgeController { */ @PostMapping("audit") public Result audit(@LoginUser TokenDto tokenDto, @RequestBody BadgeAuditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); badgeService.audit(tokenDto, formDTO); return new Result(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index b66faf5095..b7f21c0845 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -25,9 +26,11 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.BadgeConstant; import com.epmet.constant.BadgeMessageConstant; import com.epmet.constant.UserConstant; @@ -42,9 +45,11 @@ import com.epmet.dto.result.BadgeDetailResultDTO; import com.epmet.dto.result.BadgeListResultDTO; import com.epmet.entity.BadgeCertificationConfigEntity; import com.epmet.entity.BadgeEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.MessageFeignClient; import com.epmet.redis.UserBadgeRedis; import com.epmet.service.*; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -60,6 +65,7 @@ import java.util.*; * @since v1.0.0 2020-11-03 */ @Service +@Slf4j public class BadgeServiceImpl extends BaseServiceImpl implements BadgeService { @Autowired @@ -74,6 +80,9 @@ public class BadgeServiceImpl extends BaseServiceImpl imp private ResiUserBadgeService resiUserBadgeService; @Autowired private MessageFeignClient messageFeignClient; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Override @@ -322,6 +331,11 @@ public class BadgeServiceImpl extends BaseServiceImpl imp */ @Override public void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO) { + if(BadgeConstant.REJECTED.equals(formDTO.getAuditStatus())) { + if (StringUtils.isEmpty(formDTO.getAuditRemark())) { + throw new ValidateException(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getCode(), "驳回理由不能为空"); + } + } UserBadgeCertificateRecordDTO dto = userBadgeCertificateRecordService.get(formDTO.getRecordId()); BadgeDetailResultDTO detail = baseDao.selectDetail(dto.getCustomerId(), dto.getBadgeId()); dto.setAuditStatus(formDTO.getAuditStatus()); @@ -329,48 +343,71 @@ public class BadgeServiceImpl extends BaseServiceImpl imp dto.setStaffId(tokenDto.getUserId()); dto.setIsLast(BadgeConstant.YES); dto.setAuditTime(new Date()); - userBadgeCertificateRecordService.update(dto); - ResiUserBadgeDTO resiUserBadgeDTO = new ResiUserBadgeDTO(); - resiUserBadgeDTO.setCustomerId(dto.getCustomerId()); - resiUserBadgeDTO.setBadgeId(dto.getBadgeId()); - resiUserBadgeDTO.setGridId(dto.getGridId()); - resiUserBadgeDTO.setUserId(dto.getUserId()); - resiUserBadgeDTO.setIsOpened(NumConstant.ZERO); - resiUserBadgeDTO.setCertificationAutidStatus(dto.getAuditStatus()); - resiUserBadgeService.save(resiUserBadgeDTO); - List msgList = new ArrayList<>(); + List wxmpMsgList = new ArrayList<>(); if(BadgeConstant.APPROVED.equals(formDTO.getAuditStatus())) { + + ResiUserBadgeDTO resiUserBadgeDTO = new ResiUserBadgeDTO(); + resiUserBadgeDTO.setCustomerId(dto.getCustomerId()); + resiUserBadgeDTO.setBadgeId(dto.getBadgeId()); + resiUserBadgeDTO.setGridId(dto.getGridId()); + resiUserBadgeDTO.setUserId(dto.getUserId()); + resiUserBadgeDTO.setIsOpened(NumConstant.ONE); + resiUserBadgeDTO.setCertificationAutidStatus(dto.getAuditStatus()); + resiUserBadgeService.save(resiUserBadgeDTO); //更新Redis - OpenedOrClosedFormDTO openedOrClosedFormDTO = new OpenedOrClosedFormDTO(); - openedOrClosedFormDTO.setCustomerId(dto.getCustomerId()); - openedOrClosedFormDTO.setUserId(dto.getUserId()); - openedOrClosedFormDTO.setBadgeId(dto.getBadgeId()); - userBadgeService.openedOrClosed(openedOrClosedFormDTO); + badgeRedis.pushOrRemoveUserBadge4List(dto.getUserId(),dto.getBadgeId(),dto.getCustomerId()); //通知 + String msg = String.format(BadgeMessageConstant.APPROVED_MSG, detail.getBadgeName()); UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); messageFormDTO.setCustomerId(dto.getCustomerId()); messageFormDTO.setApp(UserConstant.APP_RESI); messageFormDTO.setGridId(dto.getGridId()); messageFormDTO.setUserId(dto.getUserId()); messageFormDTO.setTitle(BadgeMessageConstant.TITLE); - messageFormDTO.setMessageContent(String.format(BadgeMessageConstant.APPROVED_MSG, detail.getBadgeName())); + messageFormDTO.setMessageContent(msg); messageFormDTO.setReadFlag(Constant.UNREAD); + //微信消息 + WxSubscribeMessageFormDTO wxmp = new WxSubscribeMessageFormDTO(); + wxmp.setCustomerId(dto.getCustomerId()); + wxmp.setClientType(UserConstant.APP_RESI); + wxmp.setUserId(dto.getUserId()); + wxmp.setBehaviorType("徽章消息"); + wxmp.setMessageContent(msg); + wxmp.setMessageTime(new Date()); + wxmp.setGridId(dto.getGridId()); + wxmpMsgList.add(wxmp); } else { //通知 + String msg = String.format(BadgeMessageConstant.REJECTED_MSG, detail.getBadgeName(), formDTO.getAuditRemark()); UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); messageFormDTO.setCustomerId(dto.getCustomerId()); messageFormDTO.setApp(UserConstant.APP_RESI); messageFormDTO.setGridId(dto.getGridId()); messageFormDTO.setUserId(dto.getUserId()); messageFormDTO.setTitle(BadgeMessageConstant.TITLE); - messageFormDTO.setMessageContent(String.format(BadgeMessageConstant.REJECTED_MSG, detail.getBadgeName(), formDTO.getAuditRemark())); + messageFormDTO.setMessageContent(msg); messageFormDTO.setReadFlag(Constant.UNREAD); msgList.add(messageFormDTO); + //微信消息 + WxSubscribeMessageFormDTO wxmp = new WxSubscribeMessageFormDTO(); + wxmp.setCustomerId(dto.getCustomerId()); + wxmp.setClientType(UserConstant.APP_RESI); + wxmp.setUserId(dto.getUserId()); + wxmp.setBehaviorType("徽章消息"); + wxmp.setMessageContent(msg); + wxmp.setMessageTime(new Date()); + wxmp.setGridId(dto.getGridId()); + wxmpMsgList.add(wxmp); } messageFeignClient.saveUserMessageList(msgList); + log.info("徽章消息,开始推送微信订阅消息"); + Result result = epmetMessageOpenFeignClient.sendWxSubscribeMessage(wxmpMsgList); + if (!result.success()) { + log.error("徽章消息,发送微信订阅消息失败" + JSON.toJSONString(result)); + } } @Override From 50230da5669408f211da9e23cf5bb163853ee27f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 10 Nov 2020 11:19:55 +0800 Subject: [PATCH 062/125] issue --- .../epmet/dto/form/MyPartIssuesFormDTO.java | 25 +++++++++++++ .../dto/result/MyPartIssuesResultDTO.java | 37 +++++++++++++++++++ .../resi-mine/resi-mine-server/pom.xml | 5 +++ .../person/controller/IssueController.java | 37 +++++++++++++++++++ .../modules/person/service/IssueService.java | 22 +++++++++++ .../person/service/impl/IssueServiceImpl.java | 32 ++++++++++++++++ 6 files changed, 158 insertions(+) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyPartIssuesFormDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPartIssuesResultDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyPartIssuesFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyPartIssuesFormDTO.java new file mode 100644 index 0000000000..249e3e62a2 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyPartIssuesFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/10 10:04 上午 + */ +@Data +public class MyPartIssuesFormDTO implements Serializable { + + private static final long serialVersionUID = 265005061427415836L; + + public interface MyPartIssues{} + + /** + * 用户ID + */ + @NotBlank(message = "userId不能为空",groups = MyPartIssues.class) + private String userId; + +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPartIssuesResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPartIssuesResultDTO.java new file mode 100644 index 0000000000..0f1b6b7d8b --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPartIssuesResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/10 9:50 上午 + */ +@Data +public class MyPartIssuesResultDTO implements Serializable { + + private static final long serialVersionUID = 2081387920547808112L; + + private String issueId; + + /** + * 建议 + */ + private String suggestion; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 转议题时间 + */ + private Long shiftIssueTime; + + /** + * 发表网格名称 + */ + private String topicReleaseGridName; +} diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 96597e773c..503a34030f 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -96,6 +96,11 @@ 2.0.0 compile + + com.epmet + gov-issue-client + 2.0.0 + diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java new file mode 100644 index 0000000000..5723725dfa --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java @@ -0,0 +1,37 @@ +package com.epmet.modules.person.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.MyPartIssuesResultDTO; +import com.epmet.modules.person.service.IssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/11/10 9:37 上午 + */ +@RestController +@RequestMapping("issue") +public class IssueController { + + @Autowired + private IssueService issueService; + + /** + * @Description 个人中心-我参与的议题列表 + * @Param tokenDto + * @author zxc + * @date 2020/11/10 10:01 上午 + */ + @PostMapping("my-part-issues") + public Result> myPartIssues(@LoginUser TokenDto tokenDto){ + return new Result>().ok(issueService.myPartIssues(tokenDto)); + } + +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java new file mode 100644 index 0000000000..4d2758c707 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java @@ -0,0 +1,22 @@ +package com.epmet.modules.person.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.result.MyPartIssuesResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/11/10 9:59 上午 + */ +public interface IssueService { + + /** + * @Description 个人中心-我参与的议题列表 + * @Param tokenDto + * @author zxc + * @date 2020/11/10 10:01 上午 + */ + List myPartIssues(TokenDto tokenDto); + +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java new file mode 100644 index 0000000000..386556e96e --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -0,0 +1,32 @@ +package com.epmet.modules.person.service.impl; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.MyPartIssuesFormDTO; +import com.epmet.dto.result.MyPartIssuesResultDTO; +import com.epmet.modules.person.service.IssueService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/11/10 10:00 上午 + */ +@Service +@Slf4j +public class IssueServiceImpl implements IssueService { + + /** + * @Description 个人中心-我参与的议题列表 + * @Param tokenDto + * @author zxc + * @date 2020/11/10 10:01 上午 + */ + @Override + public List myPartIssues(TokenDto tokenDto) { + MyPartIssuesFormDTO form = new MyPartIssuesFormDTO(); + form.setUserId(tokenDto.getUserId()); + return null; + } +} From 82cf902db85a8530894efeec30e3d27f20ed9928 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 10 Nov 2020 13:26:33 +0800 Subject: [PATCH 063/125] =?UTF-8?q?redis=20pipelined=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=8F=96=E5=80=BC=E5=8A=A0=E4=B8=8A=E8=A7=A3=E6=9E=90=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/BadgeController.java | 14 -------------- .../java/com/epmet/redis/UserBadgeRedis.java | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java index cabe4b0a98..faaf9c3d04 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java @@ -152,18 +152,4 @@ public class BadgeController { badgeService.audit(tokenDto, formDTO); return new Result(); } - - @Autowired - private UserBadgeRedis redis; - @PostMapping("compensation-mechanism") - public Result compensationMechanism(@RequestParam("userId")String userId,@RequestParam("customerId")String customerId,@RequestParam("b1")String b1, - @RequestParam("b2")String b2){ - redis.pushOrRemoveUserBadge4List(userId,b1,customerId); - redis.pushOrRemoveUserBadge4List(userId,b1,customerId); - redis.pushOrRemoveUserBadge4List(userId,b1,customerId); - redis.pushOrRemoveUserBadge4List(userId,b2,customerId); - redis.batchClearUserBadgeCache(customerId); - redis.obtainUserBadge2List(userId,customerId); - return new Result(); - } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java index 759ae00192..72a912f393 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -18,12 +18,11 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import org.springframework.data.redis.connection.RedisConnection; -import org.springframework.data.redis.connection.StringRedisConnection; import org.springframework.data.redis.core.RedisCallback; import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; -import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.Set; @@ -189,5 +188,19 @@ public class UserBadgeRedis { } + public List pipelinedReturnKeys(String customerId){ + List list = redisTemplate.executePipelined(new RedisCallback>() { + @Nullable + @Override + public List doInRedis(RedisConnection connection) throws DataAccessException { + connection.openPipeline(); + Set keys = connection.keys(redisTemplate.getKeySerializer().serialize(UserRedisKeys.getResiUserBadgeKey(customerId, null))); + return null; + } + },redisTemplate.getKeySerializer()); + + return list; + } + } From f86e6bb09c979aa951fceefce4ce3c62a0e074ad Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 10 Nov 2020 13:26:57 +0800 Subject: [PATCH 064/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=B7=BB=E5=8A=A0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/UserBadgeServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 74a1ddaddd..531b6fea47 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -268,6 +268,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){ throw new RenException("客户徽章缓存初始化未查到数据"); } + userBadgeRedis.batchClearUserBadgeCache(customerId); userBadgeRedis.setCustomerBadge(userBadgeListResultDTOS, customerId); } From a32606c1a4b0edeffafb5ccdd6280c20e9c9dc0b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 10 Nov 2020 14:06:57 +0800 Subject: [PATCH 065/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java | 5 +++++ .../java/com/epmet/dto/result/BadgeAuditingResultDTO.java | 5 +++++ .../epmet-user-server/src/main/resources/mapper/BadgeDao.xml | 2 ++ 3 files changed, 12 insertions(+) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java index 363441ad46..c37b11dcd0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java @@ -40,4 +40,9 @@ public class BadgeAuditRecordResultDTO implements Serializable { * 用户名 */ private String auditStatus; + + /** + * 用户头像 + */ + private String userAvatar; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java index bbf6381d82..8d57267eac 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java @@ -40,4 +40,9 @@ public class BadgeAuditingResultDTO implements Serializable { */ private Long createTime; + /** + * 用户头像 + */ + private String userAvatar; + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index e482f95095..4c9240dc29 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -147,6 +147,7 @@ badge.BADGE_ICON, ubcr.USER_ID, ubi.REAL_NAME AS "userName", + ubi.HEAD_IMG_URL AS userAvatar, unix_timestamp(ubcr.CREATED_TIME) AS "createTime" FROM user_badge_certificate_record ubcr @@ -181,6 +182,7 @@ ubcr.USER_ID, ubcr.AUDIT_STATUS, ubi.REAL_NAME AS "userName", + ubi.HEAD_IMG_URL AS userAvatar, unix_timestamp(ubcr.CREATED_TIME) AS "createTime" FROM user_badge_certificate_record ubcr From b938e5e0c39e6941b10ee03c927a4b95c738dfc6 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 10 Nov 2020 14:24:43 +0800 Subject: [PATCH 066/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/BadgeServiceImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index b7f21c0845..00b3e3bfb2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -299,7 +299,6 @@ public class BadgeServiceImpl extends BaseServiceImpl imp public List auditingList(TokenDto tokenDto, BadgeFormDTO formDTO) { int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); List list = baseDao.selectAuditingList(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize(), formDTO.getGridId()); - list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); return list; } @@ -316,7 +315,6 @@ public class BadgeServiceImpl extends BaseServiceImpl imp public List auditRecord(TokenDto tokenDto, BadgeFormDTO formDTO) { int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); List list = baseDao.selectAuditRecord(tokenDto.getCustomerId(), pageIndex, formDTO.getPageSize(), formDTO.getGridId()); - list.forEach(item -> item.setCreateTime(item.getCreateTime()/NumConstant.SIXTY)); return list; } From 61b9ac47d9630216a75fcd187408aeec24a2d711 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 10 Nov 2020 14:47:33 +0800 Subject: [PATCH 067/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/CertificationDetailFormDTO.java | 4 ++-- .../src/main/java/com/epmet/dao/UserBadgeDao.java | 2 +- .../java/com/epmet/service/impl/UserBadgeServiceImpl.java | 8 ++++---- .../src/main/resources/mapper/UserBadgeDao.xml | 7 ++++++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationDetailFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationDetailFormDTO.java index 1eea42f575..9618efac5d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationDetailFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CertificationDetailFormDTO.java @@ -23,7 +23,7 @@ public class CertificationDetailFormDTO implements Serializable { private String badgeId; /** - * 客户ID + * 审核记录ID */ - private String userId; + private String recordId; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java index c979c06d0a..082b0051cb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java @@ -86,7 +86,7 @@ public interface UserBadgeDao { * @author zxc * @date 2020/11/4 4:09 下午 */ - CertificationDetailResultDTO selectBadgeAuthRecord(@Param("userId")String userId, @Param("badgeId")String badgeId); + CertificationDetailResultDTO selectBadgeAuthRecord(@Param("userId")String userId, @Param("badgeId")String badgeId,@Param("recordId")String recordId); /** * @Description 个人中心-查询徽章要显示的认证信息字段 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 531b6fea47..7999e694b6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -212,7 +212,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { /** * @Description 个人中心-获取徽章认证页面详情 - * 先判断 userId存在不,不存在从tokenDto获取【工作端和居民端合用一个接口】 + * 先判断 recordId存在不,不存在是居民端,反之,工作端【工作端和居民端合用一个接口】 * @Param tokenDto * @Param certificationDetailFormDTO * @author zxc @@ -220,10 +220,10 @@ public class UserBadgeServiceImpl implements UserBadgeService { */ @Override public CertificationDetailResultDTO certificationDetail(TokenDto tokenDto, CertificationDetailFormDTO certificationDetailFormDTO) { - if (StringUtils.isEmpty(certificationDetailFormDTO.getUserId())){ - certificationDetailFormDTO.setUserId(tokenDto.getUserId()); + if (StringUtils.isNotBlank(certificationDetailFormDTO.getRecordId())){ + return userBadgeDao.selectBadgeAuthRecord(null, certificationDetailFormDTO.getBadgeId(),certificationDetailFormDTO.getRecordId()); } - return userBadgeDao.selectBadgeAuthRecord(certificationDetailFormDTO.getUserId(), certificationDetailFormDTO.getBadgeId()); + return userBadgeDao.selectBadgeAuthRecord(tokenDto.getUserId(), certificationDetailFormDTO.getBadgeId(),certificationDetailFormDTO.getRecordId()); } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index 7e46626d18..1ce902f6d2 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -107,7 +107,12 @@ DEL_FLAG = 0 AND IS_LAST = 'yes' AND BADGE_ID = #{badgeId} - AND USER_ID = #{userId} + + AND USER_ID = #{userId} + + + AND ID = #{recordId} + From 8f3878c9ac837c35092b8b533bb4e5003ee2407c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 10 Nov 2020 15:11:01 +0800 Subject: [PATCH 068/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/UserBadgeDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml index 1ce902f6d2..f7186b1424 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -105,10 +105,10 @@ user_badge_certificate_record WHERE DEL_FLAG = 0 - AND IS_LAST = 'yes' AND BADGE_ID = #{badgeId} AND USER_ID = #{userId} + AND IS_LAST = 'yes' AND ID = #{recordId} From c21527473372bee031908eb0217d05ebe1ee9173 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Tue, 10 Nov 2020 15:26:56 +0800 Subject: [PATCH 069/125] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF-=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=BB=BA=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/UserAdviceDTO.java | 7 +- .../epmet/dto/form/SubmitAdviceFormDTO.java | 51 ++++++++++ .../controller/UserAdviceController.java | 16 +++ .../java/com/epmet/dao/UserAdviceDao.java | 3 + .../com/epmet/service/UserAdviceService.java | 11 +++ .../service/impl/UserAdviceServiceImpl.java | 99 ++++++++++++++++++- .../main/resources/mapper/UserAdviceDao.xml | 45 +++++++++ 7 files changed, 228 insertions(+), 4 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SubmitAdviceFormDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java index 77e6494ee6..0cea243f87 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java @@ -98,6 +98,11 @@ public class UserAdviceDTO implements Serializable { */ private String adviceType; + /** + * 问题时间 + */ + private Date adviceTime; + /** * 回复内容 */ @@ -153,4 +158,4 @@ public class UserAdviceDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SubmitAdviceFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SubmitAdviceFormDTO.java new file mode 100644 index 0000000000..b4dae41cbd --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SubmitAdviceFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/10 10:42 + */ +@Data +public class SubmitAdviceFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空") + private String customerId; + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空") + private String gridId; + + /** + * 建议内容 + */ + @NotBlank(message = "建议内容不能为空") + private String adviceContent; + + /** + * 电话号码可为空 存*,不为空需校验 + */ + private String phone; + + /** + * 问题类型,可为空 存*,gov为政府问题,software为软件问题 + */ + + private String adviceType; + + /** + * 建议图片 + */ + private List imgList; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 0886a6a824..170b9188e5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -30,6 +30,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.form.ReplyAdviceFormDTO; +import com.epmet.dto.form.SubmitAdviceFormDTO; import com.epmet.dto.result.AdviceDetailResultDTO; import com.epmet.dto.result.AdviceListResultDTO; import com.epmet.dto.result.MyAdviceListResultDTO; @@ -42,6 +43,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; +import java.util.regex.Pattern; /** @@ -170,4 +172,18 @@ public class UserAdviceController { } return new Result>().ok(userAdviceService.myAdviceList(pageSize,pageNo,loginUserUtil.getLoginUserId())); } + + @PostMapping("submitadvice") + public Result submitAdvice(@RequestBody SubmitAdviceFormDTO dto){ + ValidatorUtils.validateEntity(dto); + if (StringUtils.isNotBlank(dto.getPhone())){ + if (!Pattern.matches("^1[3456789]\\d{9}$",dto.getPhone())){ + throw new RenException("手机号格式错误"); + } + }else { + dto.setPhone("*"); + } + userAdviceService.submitAdvice(dto,loginUserUtil.getLoginUserId()); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java index 087b91f225..3fd6a4f205 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.result.MyAdviceListResultDTO; import com.epmet.entity.UserAdviceEntity; import org.apache.ibatis.annotations.Mapper; @@ -41,4 +42,6 @@ public interface UserAdviceDao extends BaseDao { List myAdviceList(@Param("pageSize") int pageSize, @Param("pageNo") int pageNo, @Param("userId") String loginUserId); + + int saveUserAdvice(UserAdviceDTO dto); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java index 35a5e840ce..4bfc5d5307 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.form.ReplyAdviceFormDTO; +import com.epmet.dto.form.SubmitAdviceFormDTO; import com.epmet.dto.result.AdviceDetailResultDTO; import com.epmet.dto.result.AdviceListResultDTO; import com.epmet.dto.result.MyAdviceListResultDTO; @@ -136,4 +137,14 @@ public interface UserAdviceService extends BaseService { * @Date 2020/11/9 17:39 */ List myAdviceList(int pageSize, int pageNo, String loginUserId); + + /** + * @Description 居民端-回复建议 + * @param dto + * @param loginUserId + * @return void + * @Author liushaowen + * @Date 2020/11/10 10:57 + */ + void submitAdvice(SubmitAdviceFormDTO dto, String loginUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index 8973026d33..59038e0d91 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -37,17 +37,22 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.UserAdviceConstant; import com.epmet.dao.UserAdviceDao; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerDTO; import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.form.ReplyAdviceFormDTO; -import com.epmet.dto.result.AdviceDetailResultDTO; -import com.epmet.dto.result.AdviceListResultDTO; -import com.epmet.dto.result.MyAdviceListResultDTO; +import com.epmet.dto.form.SubmitAdviceFormDTO; +import com.epmet.dto.form.UserResiInfoFormDTO; +import com.epmet.dto.result.*; import com.epmet.entity.UserAdviceEntity; import com.epmet.entity.UserAdviceImgEntity; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.redis.UserAdviceRedis; import com.epmet.service.UserAdviceImgService; import com.epmet.service.UserAdviceService; +import com.epmet.service.UserResiInfoService; import io.jsonwebtoken.lang.Collections; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -76,6 +81,15 @@ public class UserAdviceServiceImpl extends BaseServiceImpl customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); + if (customerInfo.success()){ + userAdviceDTO.setCustomerName(customerInfo.getData().getCustomerName()); + }else { + logger.error("customerId:{},获取customerName失败",dto.getCustomerId()); + } + //获取gridName,agencyId + Result gridInfoResultDTOResult = govOrgOpenFeignClient.queryGridInfo(dto.getGridId()); + if (gridInfoResultDTOResult.success()){ + userAdviceDTO.setGridName(gridInfoResultDTOResult.getData().getGridName()); + userAdviceDTO.setAgencyId(gridInfoResultDTOResult.getData().getParentAgencyId()); + //获取agencyName + Result agencyById = govOrgOpenFeignClient.getAgencyById(gridInfoResultDTOResult.getData().getParentAgencyId()); + if (agencyById.success()){ + userAdviceDTO.setAgencyName(agencyById.getData().getAllParentName()); + }else { + logger.error("agencyId:{},获取组织详情失败",gridInfoResultDTOResult.getData().getParentAgencyId()); + } + }else { + logger.error("gridId:{},获取网格详情失败",dto.getGridId()); + } + + //获取userName,regPhone + UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO(); + userResiInfoFormDTO.setUserId(loginUserId); + userResiInfoFormDTO.setCustomerId(dto.getCustomerId()); + Result userResiInfoDTO = userResiInfoService.getUserResiInfoDTO(userResiInfoFormDTO); + if (userResiInfoDTO.success()){ + userAdviceDTO.setUserId(loginUserId); + userAdviceDTO.setUserName(userResiInfoDTO.getData().getSurname()+userResiInfoDTO.getData().getName()); + userAdviceDTO.setRegPhone(userResiInfoDTO.getData().getRegMobile()); + }else { + logger.error("userId:{},获取user注册信息失败",loginUserId); + } + //设置AdviceTime + userAdviceDTO.setAdviceTime(new Date()); + //设置adviceType + if (StringUtils.isBlank(dto.getAdviceType())){ + userAdviceDTO.setAdviceType("*"); + } + baseDao.saveUserAdvice(userAdviceDTO); + //如果imgList不为空,插入advice_img表 + List govImgList = dto.getImgList(); + if (!Collections.isEmpty(govImgList)) { + List userAdviceImgEntities = new ArrayList<>(); + for (int i = 0; i < govImgList.size(); i++) { + //最多存三张图片 + if (i == 3) { + break; + } + UserAdviceImgEntity entity = new UserAdviceImgEntity(); + entity.setImgUrl(govImgList.get(i)); + entity.setAdviceId(userAdviceDTO.getId()); + entity.setType("resi"); + userAdviceImgEntities.add(entity); + } + userAdviceImgService.insertBatch(userAdviceImgEntities); + } + } + private void auditText(String text) { TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); TextTaskDTO taskDTO = new TextTaskDTO(); diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml index 42c4b57f44..4f9aa8730c 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -64,4 +64,49 @@ from user_advice_img where del_flag = 0 and advice_Id = #{id} and type = 'resi' + + + + select md5(replace(UUID(),'-','')) + + insert into user_advice( + id, + customer_id, + customer_name, + agency_id, + agency_name, + grid_id, + grid_name, + user_id, + user_name, + reg_phone, + advice_content, + phone, + advice_time, + advice_type, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) + values ( + #{id}, + #{customerId}, + #{customerName}, + #{agencyId}, + #{agencyName}, + #{gridId}, + #{gridName}, + #{userId}, + #{userName}, + #{regPhone}, + #{adviceContent}, + #{phone}, + #{adviceTime}, + #{adviceType}, + 0,0,#{userId},#{adviceTime},#{userId},#{adviceTime} + ) + From 18508ba133ef5fb852f2b08d907fe156564618a3 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 10 Nov 2020 15:55:14 +0800 Subject: [PATCH 070/125] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83-=E6=88=91=E5=8F=91=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E8=AF=9D=E9=A2=98=E5=88=97=E8=A1=A8=EF=BC=8C=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E5=90=8D=E7=A7=B0=E6=9F=A5=E8=AF=A2TODO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resi/group/dto/topic/MyTopicsFormDTO.java | 14 ++++++++++++++ .../dto/topic/result/MyTopicsResultDTO.java | 14 ++++++++++++++ .../topic/controller/ResiTopicController.java | 18 ++++++++++++++++-- .../epmet/modules/topic/dao/ResiTopicDao.java | 1 + .../topic/service/ResiTopicService.java | 7 +++++++ .../service/impl/ResiTopicServiceImpl.java | 6 ++++++ .../src/main/resources/logback-spring.xml | 2 +- .../resources/mapper/topic/ResiTopicDao.xml | 11 +++++++++++ 8 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyTopicsFormDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyTopicsFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyTopicsFormDTO.java new file mode 100644 index 0000000000..002250e5b5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyTopicsFormDTO.java @@ -0,0 +1,14 @@ +package com.epmet.resi.group.dto.topic; + +import lombok.Data; + +@Data +public class MyTopicsFormDTO { + + private String customerId; + + private Integer pageSize = 10; + + private Integer pageNo = 1; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java new file mode 100644 index 0000000000..fd08497c00 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java @@ -0,0 +1,14 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +@Data +public class MyTopicsResultDTO { + + private String topicId; + private Long releaseTime; + private String topicContent; + private String releaseGroupName; + private String releaseGridName; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index bae7b455c8..de0f3a665d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -4,13 +4,12 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.VoteFormDTO; import com.epmet.modules.topic.service.ResiTopicService; +import com.epmet.resi.group.dto.topic.MyTopicsFormDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.TopicInfoDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.*; -import oracle.jdbc.proxy.annotation.Post; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -259,4 +258,19 @@ public class ResiTopicController { ValidatorUtils.validateEntity(formDTO); return new Result().ok(topicService.checkTopicPublisher(formDTO)); } + + /** + * @Description 我创建的话题列表 + * @return + * @author wxz + * @date 2020.11.10 14:58 + */ + @PostMapping("my-topics") + public Result listMyTopics(@RequestBody MyTopicsFormDTO formDTO, @LoginUser TokenDto tokenDto) { + ValidatorUtils.validateEntity(formDTO); + List myTopics = topicService.listMyTopics(formDTO.getCustomerId(), tokenDto.getUserId(), formDTO.getPageNo(), formDTO.getPageSize()); + return new Result().ok(myTopics); + } + + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java index 9c3b87d48f..80c3b4fb79 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java @@ -153,4 +153,5 @@ public interface ResiTopicDao extends BaseDao { */ CheckTopicPublisherResultDTO checkTopicPublisher(CheckTopicPublisherFormDTO formDTO); + List listMyTopics(@Param("userId") String userId, @Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index 08b8e89fd9..b366ac7109 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -264,4 +264,11 @@ public interface ResiTopicService extends BaseService { */ CheckTopicPublisherResultDTO checkTopicPublisher(CheckTopicPublisherFormDTO formDTO); + /** + * @Description 我发表的话题列表 + * @return + * @author wxz + * @date 2020.11.10 15:03 + */ + List listMyTopics(String customerId, String userId, Integer pageNo, Integer pageSize); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 1a5d8964a3..d16f7fb441 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -1275,6 +1275,12 @@ public class ResiTopicServiceImpl extends BaseServiceImpl listMyTopics(String customerId, String userId, Integer pageNo, Integer pageSize) { + List myTopics = resiTopicDao.listMyTopics(userId, customerId); + // todo 查询网格名称,赋值 + return myTopics; + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml index 40fb0f8615..a2cc2aa3c3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/logback-spring.xml @@ -134,7 +134,7 @@ - + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index c8420f242f..71c551541e 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -446,5 +446,16 @@ AND created_by = #{createdBy} AND id = #{topicId} + + From 121cf34f6101e48334087c64f3a89f2679040287 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 10 Nov 2020 15:57:02 +0800 Subject: [PATCH 071/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/BadgeAuditRecordResultDTO.java | 5 +++++ .../java/com/epmet/dto/result/BadgeAuditingResultDTO.java | 5 +++++ .../src/main/resources/mapper/BadgeDao.xml | 6 ++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java index c37b11dcd0..7ae47fdbca 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java @@ -45,4 +45,9 @@ public class BadgeAuditRecordResultDTO implements Serializable { * 用户头像 */ private String userAvatar; + + /** + * 审核记录ID + */ + private String recordId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java index 8d57267eac..58d322f8df 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java @@ -45,4 +45,9 @@ public class BadgeAuditingResultDTO implements Serializable { */ private String userAvatar; + /** + * 徽章审核记录ID + */ + private String recordId; + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index 4c9240dc29..5d762377cd 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -142,7 +142,8 @@ + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgInfoFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgInfoFormDTO.java new file mode 100644 index 0000000000..a46837a017 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgInfoFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/11/10 2:13 下午 + */ +@Data +public class OrgInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 4480485864711053393L; + + /** + * org的类型 agency:机关,grid:网格,dept:部门 + */ + private String orgType; + + /** + * orgId集合 + */ + private List orgIds; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgInfoResultDTO.java new file mode 100644 index 0000000000..bdf9d332e9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgInfoResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/10 2:15 下午 + */ +@Data +public class OrgInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 7478605833438304330L; + + private String orgId; + + private String orgName; + + /** + * orgType 为空时,此字段为空 + */ + private String agencyId; + + private String pid; + + private String pids; + + private String allParentName; + + private String organizationName; + + private String level; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 82c64c24eb..75ff263b54 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -275,4 +275,13 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/customeragency/organizetree/{agencyId}") Result organizeTree(@PathVariable("agencyId") String agencyId); + + /** + * @Description 查询org信息 + * @Param orgInfoFormDTO + * @author zxc + * @date 2020/11/10 2:55 下午 + */ + @PostMapping("/gov/org/grid/selectorginfo") + Result> selectOrgInfo(@RequestBody OrgInfoFormDTO orgInfoFormDTO); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index c3811eb323..0d164abfed 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -161,4 +161,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result organizeTree(String agencyId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "organizeTree", agencyId); } + + @Override + public Result> selectOrgInfo(OrgInfoFormDTO orgInfoFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectOrgInfo", orgInfoFormDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java index fe636fdcc2..4374038f6f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerGridConstant.java @@ -10,4 +10,10 @@ public interface CustomerGridConstant { * 根据网格Id未查询到网格信息 */ String SELECT_EXCEPTION = "根据网格Id未查询到网格信息"; + + String AGENCY = "agency"; + + String DEPT = "dept"; + + String GRID = "grid"; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java index 0a75e90b63..6d82530dfe 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -154,4 +154,15 @@ public class GridController { List grids = customerGridService.listGridsbystaffid(staffId); return new Result>().ok(grids); } + + /** + * @Description 查询org信息 + * @Param orgInfoFormDTO + * @author zxc + * @date 2020/11/10 2:55 下午 + */ + @PostMapping("selectorginfo") + public Result> selectOrgInfo(@RequestBody OrgInfoFormDTO orgInfoFormDTO){ + return new Result>().ok(customerGridService.selectOrgInfo(orgInfoFormDTO)); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index ec450bfa63..64274d1b69 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -242,4 +242,8 @@ public interface CustomerGridDao extends BaseDao { * @return java.util.List */ List selectGridByStaff(@Param("staffId") String staffId); + + List selectOrgInfoByAgency(@Param("orgIds")List orgIds); + List selectOrgInfoByGrid(@Param("orgIds")List orgIds); + List selectOrgInfoByDept(@Param("orgIds")List orgIds); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index f5b22e79ba..f9e8610778 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -33,6 +33,7 @@ import com.epmet.dto.result.SelectGridNameByGridIdResultDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerGridEntity; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -268,4 +269,12 @@ public interface CustomerGridService extends BaseService { * @return void */ void updateGrid(String staffId); + + /** + * @Description 查询org信息 + * @Param orgInfoFormDTO + * @author zxc + * @date 2020/11/10 2:55 下午 + */ + List selectOrgInfo(OrgInfoFormDTO orgInfoFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 140bd8cd43..1d6676e96f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -666,4 +666,26 @@ public class CustomerGridServiceImpl extends BaseServiceImpl selectOrgInfo(OrgInfoFormDTO orgInfoFormDTO) { + List result; + if (orgInfoFormDTO.getOrgType().equals(CustomerGridConstant.AGENCY)){ + // 机关 + result = baseDao.selectOrgInfoByAgency(orgInfoFormDTO.getOrgIds()); + }else if (orgInfoFormDTO.getOrgType().equals(CustomerGridConstant.GRID)){ + //网格 + result = baseDao.selectOrgInfoByGrid(orgInfoFormDTO.getOrgIds()); + }else { + // 部门 + result = baseDao.selectOrgInfoByDept(orgInfoFormDTO.getOrgIds()); + } + return result; + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 422984c415..d121ad399f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -490,4 +490,55 @@ AND g.DEL_FLAG = '0' AND sg.USER_ID = #{staffId} + + + + \ No newline at end of file diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java index 386556e96e..832ad74282 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -1,12 +1,18 @@ package com.epmet.modules.person.service.impl; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.MyPartIssuesFormDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; +import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.modules.person.service.IssueService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.List; /** @@ -17,6 +23,9 @@ import java.util.List; @Slf4j public class IssueServiceImpl implements IssueService { + @Autowired + private GovIssueOpenFeignClient issueOpenFeignClient; + /** * @Description 个人中心-我参与的议题列表 * @Param tokenDto @@ -27,6 +36,13 @@ public class IssueServiceImpl implements IssueService { public List myPartIssues(TokenDto tokenDto) { MyPartIssuesFormDTO form = new MyPartIssuesFormDTO(); form.setUserId(tokenDto.getUserId()); - return null; + Result> listResult = issueOpenFeignClient.myPartIssues(form); + if (!listResult.success()){ + throw new RenException("查询我参与的议题列表失败......"); + } + if (CollectionUtils.isEmpty(listResult.getData())){ + return new ArrayList<>(); + } + return listResult.getData(); } } From a2d7532595e25a3583c1bb54359a289eb5dc4485 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 10 Nov 2020 16:48:54 +0800 Subject: [PATCH 074/125] =?UTF-8?q?=E5=BE=BD=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/UserBadgeServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index 7999e694b6..4c60001f6a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -132,6 +132,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { @Override @Transactional(rollbackFor = Exception.class) public Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO) { + log.info(JSON.toJSONString(certificationAddFormDTO)); if (StringUtils.isNotBlank(certificationAddFormDTO.getMobile())){ String smsCode = userBadgeRedis.getBadgeSmsCode(certificationAddFormDTO.getMobile()); if (!StringUtils.isNotBlank(smsCode)){ @@ -150,6 +151,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { form.setIdNum(certificationAddFormDTO.getIdcard()); form.setCertificationImg(certificationAddFormDTO.getCertificationImg()); form.setSurname(certificationAddFormDTO.getSurname()); + log.info(JSON.toJSONString(form)); userBadgeDao.insertUserBadgeCertificateRecord(form); //TODO 站内信发送 您好,您的xxx徽章因认证失败未成功点亮,请查看 From 8545acc885985fef1c13a176086f36e032ec57b1 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 10 Nov 2020 17:20:44 +0800 Subject: [PATCH 075/125] =?UTF-8?q?=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/constant/OrgInfoConstant.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/OrgInfoConstant.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/OrgInfoConstant.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/OrgInfoConstant.java new file mode 100644 index 0000000000..c20cb98c6d --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/OrgInfoConstant.java @@ -0,0 +1,15 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2020/11/10 5:18 下午 + */ +public interface OrgInfoConstant { + + String AGENCY = "agency"; + + String GRID = "grid"; + + String DEPT = "dept"; + +} From fe99f824be27b9e3e4de2d38268e3aadce430523 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 10 Nov 2020 18:10:53 +0800 Subject: [PATCH 076/125] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83-?= =?UTF-8?q?=E6=88=91=E5=8F=82=E4=B8=8E=E7=9A=84=E9=A1=B9=E7=9B=AE=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/feign/GovOrgOpenFeignClient.java | 10 +++ .../GovOrgOpenFeignClientFallback.java | 5 ++ .../gov-project/gov-project-client/pom.xml | 6 ++ .../dto/result/MyPartProjectsResultDTO.java | 53 +++++++++++++ .../feign/GovProjectOpenFeignClient.java | 9 +++ .../GovProjectOpenFeignClientFallback.java | 7 ++ .../epmet/controller/ProjectController.java | 17 +++- .../main/java/com/epmet/dao/ProjectDao.java | 9 +++ .../com/epmet/service/ProjectService.java | 8 ++ .../service/impl/ProjectServiceImpl.java | 26 ++++++ .../src/main/resources/mapper/ProjectDao.xml | 20 +++++ .../resi-group/resi-group-client/pom.xml | 6 ++ .../dto/topic/result/IssueGridResultDTO.java | 28 +++++++ .../group/feign/ResiGroupOpenFeignClient.java | 14 ++++ .../ResiGroupOpenFeignClientFallback.java | 13 +++ .../controller/ResiCommentController.java | 11 +++ .../topic/dao/ResiTopicCommentDao.java | 8 ++ .../epmet/modules/topic/dao/ResiTopicDao.java | 7 ++ .../service/ResiTopicCommentService.java | 7 ++ .../impl/ResiTopicCommentServiceImpl.java | 21 +++++ .../mapper/topic/ResiTopicCommentDao.xml | 18 +++++ .../resources/mapper/topic/ResiTopicDao.xml | 16 ++++ .../mine/dto/from/MyPartProjectsFormDTO.java | 37 +++++++++ .../person/controller/IssueController.java | 18 +++++ .../modules/person/service/IssueService.java | 7 ++ .../person/service/impl/IssueServiceImpl.java | 79 +++++++++++++++++++ 26 files changed, 456 insertions(+), 4 deletions(-) create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPartProjectsResultDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/IssueGridResultDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyPartProjectsFormDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 75ff263b54..e0e5cb9608 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -284,4 +284,14 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/grid/selectorginfo") Result> selectOrgInfo(@RequestBody OrgInfoFormDTO orgInfoFormDTO); + + /** + * @param gridIdList + * @return + * @Description 根据网格Id集合获取网格列表信息 + * @Author sun + */ + @PostMapping("/gov/org/customergrid/getgridlistbygridids") + Result> getGridListByGridIds(List gridIdList); + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 0d164abfed..0a5cab1af6 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -166,4 +166,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> selectOrgInfo(OrgInfoFormDTO orgInfoFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectOrgInfo", orgInfoFormDTO); } + + @Override + public Result> getGridListByGridIds(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridListByGridIds", gridIdList); + } } diff --git a/epmet-module/gov-project/gov-project-client/pom.xml b/epmet-module/gov-project/gov-project-client/pom.xml index 4533eba408..6bf188e6e8 100644 --- a/epmet-module/gov-project/gov-project-client/pom.xml +++ b/epmet-module/gov-project/gov-project-client/pom.xml @@ -17,5 +17,11 @@ epmet-commons-tools 2.0.0 + + com.epmet + resi-mine-client + 2.0.0 + compile + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPartProjectsResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPartProjectsResultDTO.java new file mode 100644 index 0000000000..6375992bab --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPartProjectsResultDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 个人中心-我参与的项目列表-接口返参 + * @Auth sun + */ +@Data +public class MyPartProjectsResultDTO implements Serializable { + + private static final long serialVersionUID = 2081387920547808112L; + + /** + * 项目id + */ + private String projectId; + + /** + * 话题发表于哪个网格 + */ + private String topicReleaseGridName; + + /** + * 项目标题 + */ + private String projectTitle; + + /** + * 当前处理部门 + */ + private List departmentNameList; + + /** + * 转项目时间。时间戳 + */ + private Long shiftProjectTime; + + /** + * 议题Id,用户数据整合使用(项目出自哪个网格"组织-网格") + */ + @JsonIgnore + private String issueId; + /** + * 项目状态(待处理 pending,结案closed)用于查询当前处理部门信息 + */ + @JsonIgnore + private String status; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index 17bd06d5df..24123a18d6 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -4,9 +4,11 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.ProjectListFromDTO; +import com.epmet.dto.result.MyPartProjectsResultDTO; import com.epmet.dto.result.PendProjectListResultDTO; import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; import com.epmet.dto.result.ProcesslistResultDTO; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; import com.epmet.commons.tools.constant.ServiceConstant; @@ -46,4 +48,11 @@ public interface GovProjectOpenFeignClient { @PostMapping("gov/project/trace/processlistnotrule") Result getProcessList(@RequestBody ProcessListFormDTO fromDTO); + + /** + * @Description 根据议题Id集合查询对应的项目信息 + * @author sun + */ + @PostMapping("gov/project/project/issuetoprojectlist") + Result> issueToProjectList(MyPartProjectsFormDTO formDTO); } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index b0bb14a9eb..9326b0cdaa 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -6,10 +6,12 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.form.ProjectListFromDTO; +import com.epmet.dto.result.MyPartProjectsResultDTO; import com.epmet.dto.result.PendProjectListResultDTO; import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; import com.epmet.dto.result.ProcesslistResultDTO; import com.epmet.feign.GovProjectOpenFeignClient; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; import java.util.List; @@ -44,4 +46,9 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result getProcessList(ProcessListFormDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getProcessList", fromDTO); } + + @Override + public Result> issueToProjectList(MyPartProjectsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "issueToProjectList", formDTO); + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index 345fb495a3..d8309d93af 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -34,11 +34,9 @@ import com.epmet.dto.form.LatestListFormDTO; import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.form.ShiftProjectFormDTO; import com.epmet.dto.form.ShiftProjectsFromDTO; -import com.epmet.dto.result.IssueProjectResultDTO; -import com.epmet.dto.result.LatestListResultDTO; -import com.epmet.dto.result.PendProjectListResultDTO; -import com.epmet.dto.result.ShiftProjectResultDTO; +import com.epmet.dto.result.*; import com.epmet.excel.ProjectExcel; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import com.epmet.service.ProjectService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -183,4 +181,15 @@ public class ProjectController { projectService.projectProcessCostTimeDataCompensation(); return new Result(); } + + /** + * @param formDTO + * @Author sun + * @Description 根据议题Id集合查询对应的项目信息 + **/ + @PostMapping("issuetoprojectlist") + public Result> issueToProjectList(@RequestBody MyPartProjectsFormDTO formDTO) { + return new Result>().ok(projectService.issueToProjectList(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index 0584789909..5657589210 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.form.LatestListFormDTO; import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.form.ShiftProjectsFromDTO; import com.epmet.dto.result.LatestListResultDTO; +import com.epmet.dto.result.MyPartProjectsResultDTO; import com.epmet.dto.result.ProjectDetailResultDTO; import com.epmet.entity.ProjectEntity; import org.apache.ibatis.annotations.Mapper; @@ -130,4 +131,12 @@ public interface ProjectDao extends BaseDao { * @date 2020.10.26 11:20 */ List selectAllCustomerIds(); + + /** + * @Author sun + * @Description 根据议题ID集合查询对应的项目基本信息 + **/ + List selectIssueProjectList(@Param("customerId") String customerId, @Param("issueList") List issueList, + @Param("pageIndex") int pageIndex, @Param("pageSize") Integer pageSize); + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index 2050b5921e..4f339c3a3f 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -24,6 +24,7 @@ import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.ProjectEntity; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import java.util.List; import java.util.Map; @@ -216,4 +217,11 @@ public interface ProjectService extends BaseService { * @date 2020.10.26 10:54 */ void projectProcessCostTimeDataCompensation(); + + /** + * @param formDTO + * @Author sun + * @Description 根据议题Id集合查询对应的项目信息 + **/ + List issueToProjectList(MyPartProjectsFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 7808c44d57..f247526cff 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -42,6 +42,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.feign.*; import com.epmet.redis.ProjectRedis; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import com.epmet.service.*; import org.apache.commons.collections4.CollectionUtils; import lombok.extern.slf4j.Slf4j; @@ -1362,4 +1363,29 @@ public class ProjectServiceImpl extends BaseServiceImpl issueToProjectList(MyPartProjectsFormDTO formDTO) { + //1.根据议题ID集合查询对应的项目基本信息 + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + List list = baseDao.selectIssueProjectList(formDTO.getCustomerId(), formDTO.getIssueList(), pageIndex, formDTO.getPageSize()); + //2.使用已有方法查询项目当前处理部门信息 + list.forEach(l -> { + if (ProjectConstant.CLOSED.equals(l.getStatus())) { + l.setDepartmentNameList(new ArrayList()); + } else { + ProjectDTO dto = new ProjectDTO(); + dto.setId(l.getProjectId()); + l.setDepartmentNameList(baseDao.selectDepartmentNameList(dto)); + } + }); + + return list; + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index baf33ff218..985077a6ac 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -206,4 +206,24 @@ DEL_FLAG = '0' + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/pom.xml b/epmet-module/resi-group/resi-group-client/pom.xml index 47b577fe72..f61f543fd3 100644 --- a/epmet-module/resi-group/resi-group-client/pom.xml +++ b/epmet-module/resi-group/resi-group-client/pom.xml @@ -26,6 +26,12 @@ io.springfox springfox-swagger-ui + + com.epmet + resi-mine-client + 2.0.0 + compile + diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/IssueGridResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/IssueGridResultDTO.java new file mode 100644 index 0000000000..5be2656812 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/IssueGridResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.resi.group.dto.topic.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * @Description 话题对应的议题及所属网格数据 + * @Auth sun + */ +@Data +public class IssueGridResultDTO implements Serializable { + private static final long serialVersionUID = -3495808492616727671L; + + /** + * 网格Id + * */ + private String gridId; + + /** + * 议题Id + * */ + private String issueId; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 58ff87be1e..51cfb19675 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -1,9 +1,15 @@ package com.epmet.resi.group.feign; +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -13,4 +19,12 @@ import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; */ @FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupOpenFeignClientFallback.class) public interface ResiGroupOpenFeignClient { + + /** + * @Description 查询用户参与的且不是自己发表的话题对应的议题Id集合 + * @author sun + */ + @PostMapping(value = "/resi/group/comment/topictoissuelist") + Result> topicToIssueList(MyPartProjectsFormDTO formDTO); + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index df1c7bebf2..c64d520b77 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -1,8 +1,15 @@ package com.epmet.resi.group.feign.fallback; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -11,4 +18,10 @@ import org.springframework.stereotype.Component; */ @Component public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClient { + + @Override + public Result> topicToIssueList(MyPartProjectsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "topicToIssueList", formDTO); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java index 3c214ff828..8685514486 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/comment/controller/ResiCommentController.java @@ -8,6 +8,8 @@ import com.epmet.modules.topic.service.ResiTopicCommentService; import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO; +import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -70,4 +72,13 @@ public class ResiCommentController { ValidatorUtils.validateEntity(queryCommentFormDTO); return commentService.getCommentListGov(queryCommentFormDTO); } + + /** + * @Description 查询用户参与的且不是自己发表的话题对应的议题Id集合 + * @author sun + */ + @PostMapping("topictoissuelist") + public Result> topicToIssueList(@RequestBody MyPartProjectsFormDTO formDTO) { + return new Result>().ok(commentService.topicToIssueList(formDTO)); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentDao.java index 76ecd5dafd..fd96ebed32 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentDao.java @@ -22,7 +22,9 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.comment.entity.ResiTopicCommentEntity; import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -52,4 +54,10 @@ public interface ResiTopicCommentDao extends BaseDao { * @Date 2020.04.01 17:15 **/ List getCommentList(ResiQueryCommentFormDTO queryCommentFormDTO); + + /** + * @Description 查询用户参与的且不是自己发表的话题对应的议题Id集合 + * @author sun + */ + List selectTopicList(@Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java index 80c3b4fb79..1cc8f528fe 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java @@ -154,4 +154,11 @@ public interface ResiTopicDao extends BaseDao { CheckTopicPublisherResultDTO checkTopicPublisher(CheckTopicPublisherFormDTO formDTO); List listMyTopics(@Param("userId") String userId, @Param("customerId") String customerId); + + /** + * @Description 根据话题Id集合查询对应的已转成议题的议题Id集合 + * @author sun + */ + List selectIssueList(@Param("topicList") List topicList); + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentService.java index 107fffcc73..6aa26dbe80 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicCommentService.java @@ -26,6 +26,8 @@ import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; import com.epmet.resi.group.dto.topic.ResiTopicCommentDTO; import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO; +import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import java.util.List; @@ -128,4 +130,9 @@ public interface ResiTopicCommentService extends BaseService> getCommentListGov(ResiQueryCommentFormDTO commentFormDTO); + /** + * @Description 查询用户参与的且不是自己发表的话题对应的议题Id集合 + * @author sun + */ + List topicToIssueList(MyPartProjectsFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java index ae74578dcd..6f3b1557d3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java @@ -43,6 +43,7 @@ import com.epmet.modules.member.dao.ResiGroupMemberDao; import com.epmet.modules.member.redis.ResiGroupMemberRedis; import com.epmet.modules.member.service.ResiGroupMemberService; import com.epmet.modules.topic.dao.ResiTopicCommentDao; +import com.epmet.modules.topic.dao.ResiTopicDao; import com.epmet.modules.topic.service.ResiTopicCommentService; import com.epmet.modules.topic.service.ResiTopicService; import com.epmet.modules.utils.ModuleConstant; @@ -56,7 +57,9 @@ import com.epmet.resi.group.dto.member.result.ResiGroupMemberInfoRedisResultDTO; import com.epmet.resi.group.dto.topic.ResiTopicCommentDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO; +import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -94,6 +97,8 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl topicToIssueList(MyPartProjectsFormDTO formDTO) { + List list = new ArrayList<>(); + //1.查询用户评论过的切不是自己发起的话题列表 + List topicList = baseDao.selectTopicList(formDTO.getUserId()); + if (topicList.size() < NumConstant.ONE) { + return list; + } + //2.查询话题Id集合对应的已转成议题的议题Id集合 + return resiTopicdDao.selectIssueList(topicList); + } + } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml index c51f3cdf04..d154e20d6e 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml @@ -70,4 +70,22 @@ #{pageNo},#{pageSize} + + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index 71c551541e..a735f0f565 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -457,5 +457,21 @@ where t.CREATED_BY = #{userId} order by t.CREATED_TIME desc + + + diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyPartProjectsFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyPartProjectsFormDTO.java new file mode 100644 index 0000000000..6ff9ab13ec --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyPartProjectsFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.resi.mine.dto.from; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 个人中心-我参与的项目列表-接口入参 + * @Auth sun + */ +@Data +public class MyPartProjectsFormDTO implements Serializable { + private static final long serialVersionUID = -6534841370041338474L; + @NotBlank(message = "客户Id不能为空", groups = {MyPartProjectsFormDTO.MyProject.class}) + private String customerId; + /** + * 当前页 + * */ + @Min(value = 1) + private Integer pageNo; + /** + * 每页数量 + * */ + private Integer pageSize = 20; + /** + * token中用户Id + */ + private String userId; + /** + * 议题Id集合 + */ + private List issueList; + public interface MyProject {} +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java index 5723725dfa..ae2ef2eff6 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java @@ -2,11 +2,16 @@ package com.epmet.modules.person.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.result.MyPartIssuesResultDTO; +import com.epmet.dto.result.MyPartProjectsResultDTO; import com.epmet.modules.person.service.IssueService; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; 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; @@ -22,6 +27,8 @@ public class IssueController { @Autowired private IssueService issueService; + @Autowired + private LoginUserUtil loginUserUtil; /** * @Description 个人中心-我参与的议题列表 @@ -34,4 +41,15 @@ public class IssueController { return new Result>().ok(issueService.myPartIssues(tokenDto)); } + /** + * @Description 个人中心-我参与的项目列表 + * @author sun + */ + @PostMapping("my-part-projects") + public Result> myPartProjects(@RequestBody MyPartProjectsFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, MyPartProjectsFormDTO.MyProject.class); + formDTO.setUserId(loginUserUtil.getLoginUserId()); + return new Result>().ok(issueService.myPartProjects(formDTO)); + } + } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java index 4d2758c707..99377c2dba 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java @@ -2,6 +2,8 @@ package com.epmet.modules.person.service; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.result.MyPartIssuesResultDTO; +import com.epmet.dto.result.MyPartProjectsResultDTO; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import java.util.List; @@ -19,4 +21,9 @@ public interface IssueService { */ List myPartIssues(TokenDto tokenDto); + /** + * @Description 个人中心-我参与的项目列表 + * @author sun + */ + List myPartProjects(MyPartProjectsFormDTO formDTO); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java index 832ad74282..5d690daca8 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -1,19 +1,30 @@ package com.epmet.modules.person.service.impl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.MyPartIssuesFormDTO; +import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; +import com.epmet.dto.result.MyPartProjectsResultDTO; import com.epmet.feign.GovIssueOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.modules.person.service.IssueService; +import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * @Author zxc @@ -23,8 +34,16 @@ import java.util.List; @Slf4j public class IssueServiceImpl implements IssueService { + private final Log logger = LogFactory.getLog(getClass()); @Autowired private GovIssueOpenFeignClient issueOpenFeignClient; + @Autowired + private ResiGroupOpenFeignClient resiGroupOpenFeignClient; + @Autowired + private GovProjectOpenFeignClient govProjectOpenFeignClient; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + /** * @Description 个人中心-我参与的议题列表 @@ -45,4 +64,64 @@ public class IssueServiceImpl implements IssueService { } return listResult.getData(); } + + /** + * @Description 个人中心-我参与的项目列表 + * @author sun + */ + @Override + public List myPartProjects(MyPartProjectsFormDTO formDTO) { + List resultList = new ArrayList<>(); + //1.查询用户评论过的且以转成议题的议题信息,不包含自己发表的且已转成议题的话题 + Result> result = resiGroupOpenFeignClient.topicToIssueList(formDTO); + if (!result.success()) { + logger.error(String.format("我参与的项目列表->查询用户参与的议题数据失败,用户Id:%s", formDTO.getUserId())); + throw new RenException("获取用户参与的议题数据失败"); + } + List issueGridList = result.getData(); + if (issueGridList.size() < NumConstant.ONE) { + return resultList; + } + //议题Id集合 + List issueIdList = issueGridList.stream().map(IssueGridResultDTO::getIssueId).collect(Collectors.toList()); + issueIdList = issueIdList.stream().distinct().collect(Collectors.toList()); + //网格Id集合 + List gridIdList = issueGridList.stream().map(IssueGridResultDTO::getGridId).collect(Collectors.toList()); + gridIdList = gridIdList.stream().distinct().collect(Collectors.toList()); + + //2.根据议题Id集合查询对应的项目信息 + formDTO.setIssueList(issueIdList); + Result> projectResult = govProjectOpenFeignClient.issueToProjectList(formDTO); + if (!projectResult.success()) { + logger.error(String.format("我参与的项目列表->查询用户参与的项目数据失败,用户Id:%s", formDTO.getUserId())); + throw new RenException("获取用户参与的项目数据失败"); + } + if (projectResult.getData().size() < NumConstant.ONE) { + return resultList; + } + resultList = projectResult.getData(); + + //3.根据网格Id集合查询网格信息 + Result> gridResult = govOrgOpenFeignClient.getGridListByGridIds(gridIdList); + if (!gridResult.success()) { + logger.error("我参与的项目列表->获取网格信息失败"); + throw new RenException("获取用户参与的项目数据失败"); + } + List gridList = gridResult.getData(); + + //4.封装数据并返回 + resultList.forEach(re -> { + issueGridList.forEach(is -> { + if (re.getIssueId().equals(is.getIssueId())) { + gridList.forEach(g -> { + if (is.getGridId().equals(g.getGridId())) { + re.setTopicReleaseGridName(g.getGridName()); + } + }); + } + }); + }); + + return resultList; + } } From e834c9b967f4e152ca80890652e9ac68901d6bd6 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Wed, 11 Nov 2020 10:30:53 +0800 Subject: [PATCH 077/125] =?UTF-8?q?=E6=88=91=E7=9A=84=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0ifnull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/UserAdviceDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml index 4f9aa8730c..f54d2def99 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -53,7 +53,7 @@ + + From f5bb49acfedd2a027d9fbd8c582b00b233d04eb7 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Wed, 11 Nov 2020 14:50:21 +0800 Subject: [PATCH 087/125] =?UTF-8?q?=E6=B7=BB=E5=8A=A0dto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../advice/controller/AdviceController.java | 7 +++-- .../modules/advice/service/AdviceService.java | 3 +- .../service/impl/AdviceServiceImpl.java | 7 +++-- .../epmet/dto/form/MyAdviceListFormDTO.java | 28 +++++++++++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 4 +-- .../EpmetUserOpenFeignClientFallback.java | 4 +-- .../controller/UserAdviceController.java | 13 ++------- 7 files changed, 45 insertions(+), 21 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyAdviceListFormDTO.java diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java index d305e0bdef..b9af883a21 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java @@ -3,6 +3,7 @@ package com.epmet.modules.advice.controller; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.MyAdviceListFormDTO; import com.epmet.dto.form.SubmitAdviceFormDTO; import com.epmet.dto.result.MyAdviceListResultDTO; import com.epmet.modules.advice.service.AdviceService; @@ -44,13 +45,13 @@ public class AdviceController { /** * @Description 我的建议列表 - * @param map + * @param dto * @return com.epmet.commons.tools.utils.Result * @Author liushaowen * @Date 2020/11/5 13:26 */ @PostMapping("myadvicelist") - public Result> getMyAdviceList(@RequestBody Map map){ - return adviceService.getMyAdviceList(map); + public Result> getMyAdviceList(@RequestBody MyAdviceListFormDTO dto){ + return adviceService.getMyAdviceList(dto); } } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java index 516a4d4c0f..acf354f745 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java @@ -1,6 +1,7 @@ package com.epmet.modules.advice.service; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.MyAdviceListFormDTO; import com.epmet.dto.form.SubmitAdviceFormDTO; import com.epmet.dto.result.MyAdviceListResultDTO; @@ -10,5 +11,5 @@ import java.util.Map; public interface AdviceService { Result submitAdvice(SubmitAdviceFormDTO dto); - Result> getMyAdviceList(Map map); + Result> getMyAdviceList(MyAdviceListFormDTO dto); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java index a73d059738..2c11338e90 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.modules.advice.service.impl; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.MyAdviceListFormDTO; import com.epmet.dto.form.SubmitAdviceFormDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.advice.service.AdviceService; @@ -31,13 +32,13 @@ public class AdviceServiceImpl implements AdviceService { /** * @Description 我的建议列表 - * @param map + * @param dto * @return com.epmet.commons.tools.utils.Result * @Author liushaowen * @Date 2020/11/5 10:40 */ @Override - public Result getMyAdviceList(Map map) { - return epmetUserOpenFeignClient.myAdviceList(map); + public Result getMyAdviceList(MyAdviceListFormDTO dto) { + return epmetUserOpenFeignClient.myAdviceList(dto); } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyAdviceListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyAdviceListFormDTO.java new file mode 100644 index 0000000000..6188d44201 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyAdviceListFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/11 14:41 + */ +@Data +public class MyAdviceListFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 页码 + */ + @Min(1) + private int pageNo; + + /** + * 页大小 + */ + @Min(1) + private int pageSize; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 4049181d75..2d5df3ebbb 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -404,13 +404,13 @@ public interface EpmetUserOpenFeignClient { /** * @Description 个人中心-我的建议列表 - * @param map pageSize,pageNo + * @param dto * @return com.epmet.commons.tools.utils.Result * @Author liushaowen * @Date 2020/11/11 10:35 */ @PostMapping("/epmetuser/useradvice/myadvicelist") - Result> myAdviceList(@RequestBody Map map); + Result> myAdviceList(@RequestBody MyAdviceListFormDTO dto); /** * @Description 个人中心-提交建议 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 443c905f67..b58b3ae62c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -279,8 +279,8 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien } @Override - public Result> myAdviceList(Map map) { - return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "myAdviceList", map); + public Result> myAdviceList(MyAdviceListFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "myAdviceList", dto); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 170b9188e5..23ab0d7649 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -29,6 +29,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.form.AdviceListFormDTO; +import com.epmet.dto.form.MyAdviceListFormDTO; import com.epmet.dto.form.ReplyAdviceFormDTO; import com.epmet.dto.form.SubmitAdviceFormDTO; import com.epmet.dto.result.AdviceDetailResultDTO; @@ -161,16 +162,8 @@ public class UserAdviceController { * @Date 2020/11/9 17:35 */ @PostMapping("myadvicelist") - public Result> myAdviceList(@RequestBody Map map) { - int pageSize = map.get("pageSize"); - int pageNo = map.get("pageNo"); - if (pageSize == 0){ - pageSize = 10; - } - if (pageNo == 0){ - pageNo = 1; - } - return new Result>().ok(userAdviceService.myAdviceList(pageSize,pageNo,loginUserUtil.getLoginUserId())); + public Result> myAdviceList(@RequestBody MyAdviceListFormDTO dto) { + return new Result>().ok(userAdviceService.myAdviceList(dto.getPageSize(),dto.getPageNo(),loginUserUtil.getLoginUserId())); } @PostMapping("submitadvice") From e7b30034b059c5a18b4dc37e7949de7c73b16a8b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 11 Nov 2020 14:53:39 +0800 Subject: [PATCH 088/125] =?UTF-8?q?=E6=88=91=E5=8F=91=E8=B5=B7=E7=9A=84?= =?UTF-8?q?=E8=AE=AE=E9=A2=98-=E8=A1=A8=E5=86=B3=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/MyPubIssuesAuditingFormDTO.java | 5 ++- .../epmet/feign/GovIssueOpenFeignClient.java | 12 ++++++ .../GovIssueOpenFeignClientFallBack.java | 7 ++++ .../com/epmet/controller/IssueController.java | 14 +++++++ .../src/main/java/com/epmet/dao/IssueDao.java | 8 ++++ .../java/com/epmet/service/IssueService.java | 14 ++++--- .../epmet/service/impl/IssueServiceImpl.java | 37 +++++++++++++++++++ .../src/main/resources/mapper/IssueDao.xml | 15 ++++++++ .../com/epmet/dto/form/OrgInfoFormDTO.java | 4 ++ .../dto/group/form/GroupInfoFormDTO.java | 23 ++++++++++++ .../dto/group/result/GroupInfoResultDTO.java | 19 ++++++++++ .../group/feign/ResiGroupOpenFeignClient.java | 13 +++++++ .../ResiGroupOpenFeignClientFallback.java | 7 ++++ .../group/controller/ResiGroupController.java | 11 ++++++ .../epmet/modules/group/dao/ResiGroupDao.java | 8 ++++ .../group/service/ResiGroupService.java | 8 ++++ .../service/impl/ResiGroupServiceImpl.java | 11 ++++++ .../resources/mapper/group/ResiGroupDao.xml | 16 ++++++++ .../person/controller/IssueController.java | 15 ++++++++ .../modules/person/service/IssueService.java | 11 ++++++ .../person/service/impl/IssueServiceImpl.java | 19 ++++++++++ 21 files changed, 269 insertions(+), 8 deletions(-) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupInfoFormDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupInfoResultDTO.java diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyPubIssuesAuditingFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyPubIssuesAuditingFormDTO.java index 3aea64c926..4010c5f2c2 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyPubIssuesAuditingFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyPubIssuesAuditingFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -16,10 +17,10 @@ public class MyPubIssuesAuditingFormDTO implements Serializable { public interface MyPubIssuesAuditing{} - @NotBlank(message = "页码不能为空",groups = MyPubIssuesAuditing.class) + @NotNull(message = "页码不能为空",groups = MyPubIssuesAuditing.class) private Integer pageNo; - @NotBlank(message = "每页数量不能为空",groups = MyPubIssuesAuditing.class) + @NotNull(message = "每页数量不能为空",groups = MyPubIssuesAuditing.class) private Integer pageSize; private String userId; diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 19a0a94f37..35746d9c79 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -2,7 +2,9 @@ package com.epmet.feign; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.MyPartIssuesFormDTO; +import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; +import com.epmet.dto.result.MyPubIssuesAuditingResultDTO; import org.springframework.cloud.openfeign.FeignClient; import com.epmet.commons.tools.constant.ServiceConstant; @@ -31,4 +33,14 @@ public interface GovIssueOpenFeignClient { @PostMapping("/gov/issue/issuevotestatistical/mypartissues") Result> myPartIssues(@RequestBody MyPartIssuesFormDTO myPartIssuesFormDTO); + /** + * @Description 个人中心-我发起的议题列表-表决中 + * @Param tokenDto + * @Param myPubIssuesAuditingFormDTO + * @author zxc + * @date 2020/11/11 9:24 上午 + */ + @PostMapping("/gov/issue/issue/mypubissuesauditing") + Result> myPubIssuesAuditing(@RequestBody MyPubIssuesAuditingFormDTO myPubIssuesAuditingFormDTO); + } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java index b11e47b5fc..cd4eadc984 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -4,7 +4,9 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.MyPartIssuesFormDTO; +import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; +import com.epmet.dto.result.MyPubIssuesAuditingResultDTO; import com.epmet.feign.GovIssueOpenFeignClient; import org.springframework.stereotype.Component; @@ -22,4 +24,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient public Result> myPartIssues(MyPartIssuesFormDTO myPartIssuesFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER,"myPartIssues",myPartIssuesFormDTO); } + + @Override + public Result> myPubIssuesAuditing(MyPubIssuesAuditingFormDTO myPubIssuesAuditingFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER,"myPubIssuesAuditing",myPubIssuesAuditingFormDTO); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java index bedb47f25c..17b1e5924e 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java @@ -1,6 +1,8 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -151,5 +153,17 @@ public class IssueController { return new Result().ok(issueService.checkTopicShiftIssue(formDTO)); } + /** + * @Description 个人中心-我发起的议题列表-表决中 + * @Param myPubIssuesAuditingFormDTO + * @author zxc + * @date 2020/11/11 9:24 上午 + */ + @PostMapping("mypubissuesauditing") + public Result> myPubIssuesAuditing(@RequestBody MyPubIssuesAuditingFormDTO myPubIssuesAuditingFormDTO){ + return new Result>().ok(issueService.myPubIssuesAuditing(myPubIssuesAuditingFormDTO)); + } + + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java index 9dee92932c..38c597c029 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java @@ -144,4 +144,12 @@ public interface IssueDao extends BaseDao { * @author zxc */ Integer checkTopicShiftIssue(TopicInfoFormDTO formDTO); + + /** + * @Description 个人中心-我发起的议题列表-表决中 + * @Param myPubIssuesAuditingFormDTO + * @author zxc + * @date 2020/11/11 9:24 上午 + */ + List myPubIssuesAuditing(@Param("userId")String userId); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index d9f4417ec6..1ee227ad3d 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java @@ -2,7 +2,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IssueDTO; import com.epmet.dto.form.CloseIssueFormDTO; import com.epmet.dto.form.DepartmentStaffListFormDTO; @@ -14,15 +13,10 @@ import com.epmet.dto.result.GridVotingIssueCountResultDTO; import com.epmet.dto.result.IssueResultDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.dto.form.CloseIssueFormDTO; -import com.epmet.dto.form.DepartmentStaffListFormDTO; import com.epmet.dto.form.CommonIssueListFormDTO; -import com.epmet.dto.form.IssueDetailFormDTO; -import com.epmet.dto.result.*; import com.epmet.dto.form.IssueShiftedFromTopicFormDTO; import com.epmet.entity.IssueEntity; import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -232,4 +226,12 @@ public interface IssueService extends BaseService { * @author zxc */ Integer checkTopicShiftIssue(TopicInfoFormDTO formDTO); + + /** + * @Description 个人中心-我发起的议题列表-表决中 + * @Param myPubIssuesAuditingFormDTO + * @author zxc + * @date 2020/11/11 9:24 上午 + */ + List myPubIssuesAuditing(MyPubIssuesAuditingFormDTO myPubIssuesAuditingFormDTO); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 7743205c28..6b0f60ed80 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -17,6 +17,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.IssueConstant; +import com.epmet.constant.OrgInfoConstant; import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserMessageConstant; import com.epmet.dao.IssueDao; @@ -34,21 +35,27 @@ import com.epmet.entity.IssueProjectRelationEntity; import com.epmet.feign.*; import com.epmet.redis.GovIssueRedis; import com.epmet.redis.IssueVoteDetailRedis; +import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; +import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO; import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO; import com.epmet.resi.group.dto.topic.result.GovTopicIssueInfoResultDTO; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.IssueProcessService; import com.epmet.service.IssueProjectRelationService; import com.epmet.service.IssueService; import com.epmet.service.IssueVoteStatisticalService; import com.epmet.utils.ModuleConstants; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.*; import java.util.stream.Collectors; @@ -78,6 +85,10 @@ public class IssueServiceImpl extends BaseServiceImpl imp private IssueProjectRelationDao issueProjectRelationDao; @Autowired private IssueVoteDetailRedis issueVoteDetailRedis; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private ResiGroupOpenFeignClient resiGroupOpenFeignClient; protected static final Logger logger = LoggerFactory.getLogger(IssueServiceImpl.class); @@ -841,4 +852,30 @@ public class IssueServiceImpl extends BaseServiceImpl imp return baseDao.checkTopicShiftIssue(formDTO); } + /** + * @Description 个人中心-我发起的议题列表-表决中 + * @Param myPubIssuesAuditingFormDTO + * @author zxc + * @date 2020/11/11 9:24 上午 + */ + @Override + public List myPubIssuesAuditing(MyPubIssuesAuditingFormDTO form) { + List list = new ArrayList<>(); + PageInfo result = PageHelper.startPage(form.getPageNo(),form.getPageSize()).doSelectPageInfo(() -> baseDao.myPubIssuesAuditing(form.getUserId())); + if (!CollectionUtils.isEmpty(result.getList())){ + list = result.getList(); + Result> gridNameList = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.GRID, list.stream().map(m -> m.getGridId()).collect(Collectors.toList()))); + if (!gridNameList.success()){ + throw new RenException("查询议题来源网格名称失败......"); + } + list.forEach(l -> gridNameList.getData().stream().filter(o -> l.getGridId().equals(o.getOrgId())).forEach(o -> l.setTopicReleaseGridName(o.getOrgName()))); + Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(list.stream().map(m -> m.getTopicId()).collect(Collectors.toList()))); + if (!groupNameList.success()){ + throw new RenException("查询议题来源小组名称失败......"); + } + list.forEach(l -> groupNameList.getData().stream().filter(g -> l.getTopicId().equals(g.getTopicId())).forEach(g -> l.setTopicReleaseGroupName(g.getTopicGroupName()))); + } + return list; + } + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 31ee5952a0..118a15b690 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -378,4 +378,19 @@ AND source_id = #{topicId} + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgInfoFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgInfoFormDTO.java index a46837a017..4d60f07fe5 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgInfoFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgInfoFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import lombok.AllArgsConstructor; import lombok.Data; import java.io.Serializable; @@ -10,6 +11,7 @@ import java.util.List; * @DateTime 2020/11/10 2:13 下午 */ @Data +@AllArgsConstructor public class OrgInfoFormDTO implements Serializable { private static final long serialVersionUID = 4480485864711053393L; @@ -24,4 +26,6 @@ public class OrgInfoFormDTO implements Serializable { */ private List orgIds; + public OrgInfoFormDTO() { + } } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupInfoFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupInfoFormDTO.java new file mode 100644 index 0000000000..68278e3104 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/GroupInfoFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.resi.group.dto.group.form; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/11/11 1:30 下午 + */ +@Data +@AllArgsConstructor +public class GroupInfoFormDTO implements Serializable { + + private static final long serialVersionUID = -7940077760343241658L; + + private List topicIds; + + public GroupInfoFormDTO() { + } +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupInfoResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupInfoResultDTO.java new file mode 100644 index 0000000000..44b7924beb --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupInfoResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.resi.group.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/11 1:31 下午 + */ +@Data +public class GroupInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 5508197256307317314L; + + private String topicId; + + private String topicGroupName; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 51cfb19675..04c1978cc8 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -1,6 +1,8 @@ package com.epmet.resi.group.feign; import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; +import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; @@ -8,6 +10,7 @@ import org.springframework.cloud.openfeign.FeignClient; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -18,6 +21,7 @@ import java.util.List; * @date 2020/6/4 13:16 */ @FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupOpenFeignClientFallback.class) +//@FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupOpenFeignClientFallback.class,url = "localhost:8095") public interface ResiGroupOpenFeignClient { /** @@ -27,4 +31,13 @@ public interface ResiGroupOpenFeignClient { @PostMapping(value = "/resi/group/comment/topictoissuelist") Result> topicToIssueList(MyPartProjectsFormDTO formDTO); + /** + * @Description 查询话题所属小组名 + * @Param groupInfoFormDTO + * @author zxc + * @date 2020/11/11 1:36 下午 + */ + @PostMapping("resi/group/group/groupinfo") + Result> selectGroupInfo(@RequestBody GroupInfoFormDTO groupInfoFormDTO); + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index c64d520b77..f29e47292d 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -3,6 +3,8 @@ package com.epmet.resi.group.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; +import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; @@ -24,4 +26,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "topicToIssueList", formDTO); } + @Override + public Result> selectGroupInfo(GroupInfoFormDTO groupInfoFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectGroupInfo", groupInfoFormDTO); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index afdce31da0..e73d12fc0e 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -359,4 +359,15 @@ public class ResiGroupController { resiGroupStatisticalService.updateWhenAuditedResiRole(resiIdentityFormDTO); return new Result(); } + + /** + * @Description 查询话题所属小组名 + * @Param groupInfoFormDTO + * @author zxc + * @date 2020/11/11 1:36 下午 + */ + @PostMapping("groupinfo") + public Result> selectGroupInfo(@RequestBody GroupInfoFormDTO groupInfoFormDTO){ + return new Result>().ok(resiGroupService.selectGroupInfo(groupInfoFormDTO)); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java index 867a3d11ba..6d415d76c3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java @@ -188,4 +188,12 @@ public interface ResiGroupDao extends BaseDao { * @date 2020.05.22 09:54 **/ List selectGroupListByGridIds(@Param("gridIds") List gridIds); + + /** + * @Description 查询话题所属小组名 + * @Param groupInfoFormDTO + * @author zxc + * @date 2020/11/11 1:36 下午 + */ + List selectGroupInfo(@Param("topicIds")List userIds); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java index d410b4f391..0c05c0ac76 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java @@ -293,4 +293,12 @@ public interface ResiGroupService extends BaseService { * @return java.util.List */ List recommendedList(RecommendedListFormDTO formDTO); + + /** + * @Description 查询话题所属小组名 + * @Param groupInfoFormDTO + * @author zxc + * @date 2020/11/11 1:36 下午 + */ + List selectGroupInfo(GroupInfoFormDTO groupInfoFormDTO); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 14e71c03bc..60eefa77ce 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -1016,4 +1016,15 @@ public class ResiGroupServiceImpl extends BaseServiceImpl selectGroupInfo(GroupInfoFormDTO groupInfoFormDTO) { + return baseDao.selectGroupInfo(groupInfoFormDTO.getTopicIds()); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index 119db46b30..e34c859f8c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -397,4 +397,20 @@ GRID_ID = #{gridId} + + + diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java index 6479c87583..30ecfc0113 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java @@ -5,8 +5,10 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.MyPartProjectsResultDTO; +import com.epmet.dto.result.MyPubIssuesAuditingResultDTO; import com.epmet.modules.person.service.IssueService; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.beans.factory.annotation.Autowired; @@ -52,4 +54,17 @@ public class IssueController { return new Result>().ok(issueService.myPartProjects(formDTO)); } + /** + * @Description 个人中心-我发起的议题列表-表决中 + * @Param tokenDto + * @Param myPubIssuesAuditingFormDTO + * @author zxc + * @date 2020/11/11 9:24 上午 + */ + @PostMapping("my-pub-issues/auditing") + public Result> myPubIssuesAuditing(@LoginUser TokenDto tokenDto, @RequestBody MyPubIssuesAuditingFormDTO myPubIssuesAuditingFormDTO){ + ValidatorUtils.validateEntity(myPubIssuesAuditingFormDTO, MyPubIssuesAuditingFormDTO.MyPubIssuesAuditing.class); + return new Result>().ok(issueService.myPubIssuesAuditing(tokenDto,myPubIssuesAuditingFormDTO)); + } + } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java index 99377c2dba..2d3800bcf4 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java @@ -1,8 +1,10 @@ package com.epmet.modules.person.service; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.MyPartProjectsResultDTO; +import com.epmet.dto.result.MyPubIssuesAuditingResultDTO; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import java.util.List; @@ -26,4 +28,13 @@ public interface IssueService { * @author sun */ List myPartProjects(MyPartProjectsFormDTO formDTO); + + /** + * @Description 个人中心-我发起的议题列表-表决中 + * @Param tokenDto + * @Param myPubIssuesAuditingFormDTO + * @author zxc + * @date 2020/11/11 9:24 上午 + */ + List myPubIssuesAuditing(TokenDto tokenDto, MyPubIssuesAuditingFormDTO myPubIssuesAuditingFormDTO); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java index 5d690daca8..6d47d4c0fe 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -5,9 +5,11 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.MyPartIssuesFormDTO; +import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.MyPartProjectsResultDTO; +import com.epmet.dto.result.MyPubIssuesAuditingResultDTO; import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovProjectOpenFeignClient; @@ -124,4 +126,21 @@ public class IssueServiceImpl implements IssueService { return resultList; } + + /** + * @Description 个人中心-我发起的议题列表-表决中 + * @Param tokenDto + * @Param myPubIssuesAuditingFormDTO + * @author zxc + * @date 2020/11/11 9:24 上午 + */ + @Override + public List myPubIssuesAuditing(TokenDto tokenDto, MyPubIssuesAuditingFormDTO myPubIssuesAuditingFormDTO) { + myPubIssuesAuditingFormDTO.setUserId(tokenDto.getUserId()); + Result> listResult = issueOpenFeignClient.myPubIssuesAuditing(myPubIssuesAuditingFormDTO); + if (!listResult.success()){ + throw new RenException("查询我发起的议题列表-表决中失败......"); + } + return listResult.getData(); + } } From e9b5e61b2e8e4374f0330d7af5cf57bd2b79d48d Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Wed, 11 Nov 2020 15:15:40 +0800 Subject: [PATCH 089/125] =?UTF-8?q?=E6=88=91=E7=9A=84=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=96=B0=E5=A2=9E=E5=BB=BA=E8=AE=AE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/MyAdviceListResultDTO.java | 2 ++ .../main/java/com/epmet/controller/UserAdviceController.java | 2 +- .../src/main/resources/mapper/UserAdviceDao.xml | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java index 77a8e2c460..b6d12a12d4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java @@ -18,6 +18,8 @@ public class MyAdviceListResultDTO implements Serializable { private String adviceContent; + private String adviceType; + private List imgList; @JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8") diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index 23ab0d7649..ed52f4da9d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -156,7 +156,7 @@ public class UserAdviceController { /** * @Description 居民端-我的建议列表 - * @param map ->pageSize,pageNo + * @param dto * @return com.epmet.commons.tools.utils.Result> * @Author liushaowen * @Date 2020/11/9 17:35 diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml index f54d2def99..c9c804c0a2 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -46,6 +46,7 @@ + @@ -53,7 +54,7 @@ + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesClosedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesClosedResultDTO.java new file mode 100644 index 0000000000..46c2c9ff02 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesClosedResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 个人中心-我发起的议题列表-已关闭返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/11/11 13:39 + */ +@Data +public class MyPubIssuesClosedResultDTO implements Serializable { + private static final long serialVersionUID = -265465326846671555L; + /** + * 议题id + */ + private String issueId; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 建议 + */ + private String suggestion; + + /** + * 议题关闭时间。时间戳 + */ + private Long closedTime; + + /** + * 话题发表于哪个组 + */ + private String topicReleaseGroupName; + + /** + * 话题发表于哪个网格 + */ + private String topicReleaseGridName; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java new file mode 100644 index 0000000000..200a09e24e --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 个人中心-我发起的议题列表-已转项目 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/11/11 12:18 + */ +@Data +public class MyPubIssuesShiftProjectResultDTO implements Serializable { + private static final long serialVersionUID = -7183751225506622772L; + /** + * 项目id + */ + private String projectId; + + /** + * 话题发表网格id + */ + private String topicReleaseGridName; + + /** + * 当前处理部门名称列表 + */ + private List departmentNameList; + + /** + * 项目标题 + */ + private String projectTitle; + + /** + * 转项目时间。时间戳 + */ + private Long shiftProjectTime; + + /** + * 话题发表于哪个组 + */ + private String topicReleaseGroupName; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index 24123a18d6..ed9bbab6ed 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -1,18 +1,16 @@ package com.epmet.feign; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.ProjectDTO; +import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.result.MyPartProjectsResultDTO; import com.epmet.dto.result.PendProjectListResultDTO; import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; -import com.epmet.dto.result.ProcesslistResultDTO; +import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 51cfb19675..e1d5663e69 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -1,12 +1,11 @@ package com.epmet.resi.group.feign; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; +import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; import org.springframework.web.bind.annotation.PostMapping; import java.util.List; diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java index ae2ef2eff6..1062a6ef8c 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java @@ -5,8 +5,11 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.MyPartProjectsResultDTO; +import com.epmet.dto.result.MyPubIssuesClosedResultDTO; +import com.epmet.dto.result.MyPubIssuesShiftProjectResultDTO; import com.epmet.modules.person.service.IssueService; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.beans.factory.annotation.Autowired; @@ -52,4 +55,29 @@ public class IssueController { return new Result>().ok(issueService.myPartProjects(formDTO)); } + /** + * @param formDTO + * @author yinzuomei + * @description 个人中心-我发起的议题列表-已转项目 + * @Date 2020/11/11 13:33 + **/ + @PostMapping("my-pub-issues/shift-project") + public Result> getMyPubIssuesShiftProject(@RequestBody MyPubIssuesAuditingFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, MyPubIssuesAuditingFormDTO.MyPubIssuesAuditing.class); + formDTO.setUserId(loginUserUtil.getLoginUserId()); + return new Result>().ok(issueService.getMyPubIssuesShiftProject(formDTO)); + } + + /** + * @param formDTO + * @author yinzuomei + * @description 个人中心-我发起的议题列表-已关闭 + * @Date 2020/11/11 13:39 + **/ + @PostMapping("my-pub-issues/closed") + public Result> getMyPubIssuesClosed(@RequestBody MyPubIssuesAuditingFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, MyPubIssuesAuditingFormDTO.MyPubIssuesAuditing.class); + formDTO.setUserId(loginUserUtil.getLoginUserId()); + return new Result>().ok(issueService.getMyPubIssuesClosed(formDTO)); + } } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java index 99377c2dba..3e825c1d4f 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java @@ -1,8 +1,11 @@ package com.epmet.modules.person.service; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.MyPartProjectsResultDTO; +import com.epmet.dto.result.MyPubIssuesClosedResultDTO; +import com.epmet.dto.result.MyPubIssuesShiftProjectResultDTO; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import java.util.List; @@ -26,4 +29,20 @@ public interface IssueService { * @author sun */ List myPartProjects(MyPartProjectsFormDTO formDTO); + + /** + * @param formDTO + * @author yinzuomei + * @description 个人中心-我发起的议题列表-已转项目 + * @Date 2020/11/11 13:35 + **/ + List getMyPubIssuesShiftProject(MyPubIssuesAuditingFormDTO formDTO); + + /** + * @param formDTO + * @author yinzuomei + * @description 个人中心-我发起的议题列表-已关闭 + * @Date 2020/11/11 13:48 + **/ + List getMyPubIssuesClosed(MyPubIssuesAuditingFormDTO formDTO); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java index 5d690daca8..6cb778b42f 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -4,10 +4,11 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.IssueOpenConstant; +import com.epmet.dto.IssueDTO; import com.epmet.dto.form.MyPartIssuesFormDTO; -import com.epmet.dto.result.AllGridsByUserIdResultDTO; -import com.epmet.dto.result.MyPartIssuesResultDTO; -import com.epmet.dto.result.MyPartProjectsResultDTO; +import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; +import com.epmet.dto.result.*; import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovProjectOpenFeignClient; @@ -124,4 +125,34 @@ public class IssueServiceImpl implements IssueService { return resultList; } + + /** + * @param formDTO + * @author yinzuomei + * @description 个人中心-我发起的议题列表-已转项目 + * @Date 2020/11/11 13:35 + **/ + @Override + public List getMyPubIssuesShiftProject(MyPubIssuesAuditingFormDTO formDTO) { + //todo + return null; + } + + /** + * @param formDTO + * @author yinzuomei + * @description 个人中心-我发起的议题列表-已关闭 + * @Date 2020/11/11 13:48 + **/ + @Override + public List getMyPubIssuesClosed(MyPubIssuesAuditingFormDTO formDTO) { + //查询我发起的议题,并且 已关闭的 + formDTO.setIssueStatus(IssueOpenConstant.ISSUE_CLOSED); + Result> issueResult=issueOpenFeignClient.getMyPubIssues(formDTO); + if(null==issueResult||CollectionUtils.isEmpty(issueResult.getData())){ + return new ArrayList<>(); + } + //todo + return null; + } } From b1fadfc857f619cd93a88478276cc1ee6d78f478 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 11 Nov 2020 15:28:22 +0800 Subject: [PATCH 092/125] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B5=B0=E4=B8=A2=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/IssueController.java | 1 + .../epmet/modules/person/service/impl/IssueServiceImpl.java | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java index 4d5e40ae1f..6db4e14b23 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java @@ -2,6 +2,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.IssueDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO; diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java index a9986bea31..2cb0181662 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -8,11 +8,6 @@ import com.epmet.constant.IssueOpenConstant; import com.epmet.dto.IssueDTO; import com.epmet.dto.form.MyPartIssuesFormDTO; import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; -import com.epmet.dto.result.AllGridsByUserIdResultDTO; -import com.epmet.dto.result.MyPartIssuesResultDTO; -import com.epmet.dto.result.MyPartProjectsResultDTO; -import com.epmet.dto.result.MyPubIssuesAuditingResultDTO; -import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.*; import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; From e3540f13cd48be120fbd9881654d2fd65e9813f1 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 11 Nov 2020 15:39:51 +0800 Subject: [PATCH 093/125] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=9E=9A=E4=B8=BE=E5=A2=9E=E5=8A=A0=E5=BE=BD=E7=AB=A0?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/enums/RequirePermissionEnum.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index a918d000b0..156794af7b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -87,7 +87,8 @@ public enum RequirePermissionEnum { /** * 徽章 */ - WORK_GRASSROOTS_BADGE_AUDIT("work_grassroots_badge_audit","基层治理:徽章审核:徽章审核","徽章审核权限,目前这个模块的操作都用这一个权限控制,没有细分"), + WORK_GRASSROOTS_BADGE_AUDIT("work_grassroots_badge_audit","基层治理:徽章审核:徽章审核","徽章审核"), + WORK_GRASSROOTS_BADGE_AUDITING_LIST("work_grassroots_badge_auditing_list","基层治理:徽章审核:待审核列表","待审核徽章列表"), /** * 工作-项目跟踪 @@ -143,7 +144,15 @@ public enum RequirePermissionEnum { * 爱心互助-自定义配置 */ MORE_HEART_CUSTOMIZED_VIEW("more_heart_customized_view","更多:爱心互助:自定义配置:查看","更多-爱心互助-自定义配置-查看"), - MORE_HEART_CUSTOMIZED_SAVE("more_heart_customized_save","更多:爱心互助:自定义配置:保存修改","更多-爱心互助-自定义配置-保存修改"); + MORE_HEART_CUSTOMIZED_SAVE("more_heart_customized_save","更多:爱心互助:自定义配置:保存修改","更多-爱心互助-自定义配置-保存修改"), + + /** + * 徽章管理 + */ + MORE_BADGE_MANAGE_LIST("more_badge_manage_list","更多:徽章:徽章管理:列表","徽章列表"), + MORE_BADGE_MANAGE_CREATE("more_badge_manage_create","更多:徽章:徽章管理:添加","添加徽章"), + MORE_BADGE_MANAGE_EDIT("more_badge_manage_edit","更多:徽章:徽章管理:编辑","编辑徽章"), + MORE_BADGE_MANAGE_DELETE("more_badge_manage_delete","更多:徽章:徽章管理:删除","删除徽章"); private String key; private String name; From 76c94e18323a9f5be106bdd1166a1cf62217e68c Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 11 Nov 2020 16:27:55 +0800 Subject: [PATCH 094/125] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83-=E6=88=91=E7=9A=84=E8=AF=9D?= =?UTF-8?q?=E9=A2=98=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC=E5=A2=9E=E5=8A=A0releaseGridName=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/topic/result/MyTopicsResultDTO.java | 1 + .../service/impl/ResiTopicServiceImpl.java | 26 ++++++++++++++++++- .../resources/mapper/topic/ResiTopicDao.xml | 3 ++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java index fd08497c00..2a3573f726 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java @@ -9,6 +9,7 @@ public class MyTopicsResultDTO { private Long releaseTime; private String topicContent; private String releaseGroupName; + private String releaseGridId; private String releaseGridName; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 6e86d0221b..c4b77e453d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -37,12 +37,15 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.constant.OrgInfoConstant; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.CommonDataFilterResultDTO; import com.epmet.dto.result.IssueInitiatorResultDTO; +import com.epmet.dto.result.OrgInfoResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.modules.constant.GroupMemberConstant; import com.epmet.modules.constant.ResiGroupRedisKeys; import com.epmet.modules.feign.EpmetUserFeignClient; @@ -141,6 +144,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl listMyTopics(String customerId, String userId, Integer pageNo, Integer pageSize) { PageHelper.startPage(pageNo, pageSize); List myTopics = resiTopicDao.listMyTopics(userId, customerId); - // todo 查询网格名称,赋值 + + HashMap gridIdAndNames = new HashMap<>(); + Set gridIds = myTopics.stream().map(c -> c.getReleaseGridId()).collect(Collectors.toSet()); + + OrgInfoFormDTO form = new OrgInfoFormDTO(); + form.setOrgType(OrgInfoConstant.GRID); + form.setOrgIds(new ArrayList<>(gridIds)); + Result> gridInfoResult = govOrgOpenFeignClient.selectOrgInfo(form); + if (gridInfoResult.success()) { + List grids = gridInfoResult.getData(); + for (OrgInfoResultDTO grid : grids) { + gridIdAndNames.put(grid.getOrgId(), grid.getOrgName()); + } + } + + for (MyTopicsResultDTO myTopic : myTopics) { + myTopic.setReleaseGridName(gridIdAndNames.get(myTopic.getReleaseGridId())); + } + return myTopics; } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index cf570c9eda..5678bda9ea 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -451,7 +451,8 @@ select t.id as topicId, t.topic_content as topicContent, unix_timestamp(t.created_time) as releaseTime, - g.GROUP_NAME as releaseGroupName + g.GROUP_NAME as releaseGroupName, + g.GRID_ID as releaseGridId from resi_topic t inner join resi_group g on (t.GROUP_ID = g.ID and g.CUSTOMER_ID = #{customerId}) where t.CREATED_BY = #{userId} From 71958d8bfa63fb77f7a24c50f90c1cc483ade670 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 11 Nov 2020 17:13:59 +0800 Subject: [PATCH 095/125] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83-?= =?UTF-8?q?=E6=88=91=E5=8F=91=E8=B5=B7=E7=9A=84=E8=AE=AE=E9=A2=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8-=E5=B7=B2=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IssueOpenConstant.java | 5 +++ .../src/main/java/com/epmet/dto/IssueDTO.java | 13 ++++++- .../src/main/resources/mapper/IssueDao.xml | 4 ++- .../person/service/impl/IssueServiceImpl.java | 36 +++++++++++++++++-- 4 files changed, 54 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/constant/IssueOpenConstant.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/constant/IssueOpenConstant.java index 6d971c59d5..48a9cfc1f0 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/constant/IssueOpenConstant.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/constant/IssueOpenConstant.java @@ -27,4 +27,9 @@ public interface IssueOpenConstant { * 议题解决类型-未解决 */ String ISSUE_UNRESOLVED = "unresolved"; + + /** + * 议题来源类型 eg:resi_topic + */ + String SOURCE_TYPE_RT="resi_topic"; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java index 457a165fd6..960bf286a7 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -143,4 +144,14 @@ public class IssueDTO implements Serializable { */ private Date updatedTime; + /** + * 转项目日期 (服务间调用日期一致性) 戳 + */ + private Long shiftedTimeStamp; + + /** + * 关闭日期 戳 + */ + private Long closedTimeStamp; + } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index f69fccd5f3..14deb3403d 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -396,7 +396,9 @@ diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml index 865f3c8a3a..523dd1cb63 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteDetailDao.xml @@ -85,5 +85,6 @@ WHERE i.DEL_FLAG = '0' AND vd.DEL_FLAG = '0' AND vd.CREATED_BY = #{userId} + ORDER BY i.CREATED_TIME DESC \ No newline at end of file From 11c9ba0c073df7958bba544fa9017950628eab97 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 12 Nov 2020 09:09:45 +0800 Subject: [PATCH 099/125] =?UTF-8?q?=E6=88=91=E5=8F=82=E4=B8=8E=E8=BF=87?= =?UTF-8?q?=E7=9A=84=E8=AF=9D=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/topic/form/CustomerPageFormDTO.java | 30 +++++++++++++++++++ .../ParticipatedTopicUnitResultDTO.java | 26 ++++++++++++++++ .../group/feign/ResiGroupOpenFeignClient.java | 11 +++++++ .../ResiGroupOpenFeignClientFallback.java | 7 +++++ .../topic/controller/ResiTopicController.java | 13 ++++++++ .../epmet/modules/topic/dao/ResiTopicDao.java | 9 ++++++ .../topic/service/ResiTopicService.java | 9 ++++++ .../service/impl/ResiTopicServiceImpl.java | 27 +++++++++++++++++ .../resources/mapper/topic/ResiTopicDao.xml | 21 +++++++++++++ 9 files changed, 153 insertions(+) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CustomerPageFormDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CustomerPageFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CustomerPageFormDTO.java new file mode 100644 index 0000000000..5c824b35ff --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CustomerPageFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 客户Id 用户Id 分页 + * @ClassName CustomerPageFormDTO + * @Auth wangc + * @Date 2020-11-11 23:15 + */ +@Data +public class CustomerPageFormDTO implements Serializable { + private static final long serialVersionUID = 8678047078015445193L; + + @NotBlank(message = "客户Id不能为空") + private String customerId; + + @NotBlank(message = "用户Id不能为空") + private String userId; + + @Min(1) + private Integer pageNo; + + @Min(1) + private Integer pageSize; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java new file mode 100644 index 0000000000..d5c9f9bc24 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 个人中心 参与过的话题返参DTO + * @ClassName ParticipatedTopicUnitResultDTO + * @Auth wangc + * @Date 2020-11-11 23:00 + */ +@Data +public class ParticipatedTopicUnitResultDTO implements Serializable { + private static final long serialVersionUID = 1392205563783715932L; + + private String topicId; + + private String topicReleaseGridName; + + private String topicContent; + + private Long releaseTime; + + private String topicReleaseGroupName; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 92001cc862..8b5c663df6 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -4,7 +4,9 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; +import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; +import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; @@ -39,4 +41,13 @@ public interface ResiGroupOpenFeignClient { @PostMapping("resi/group/group/groupinfo") Result> selectGroupInfo(@RequestBody GroupInfoFormDTO groupInfoFormDTO); + /** + * @Description 个人中心-我参与过的话题 + * @param param + * @return java.util.List + * @author wangc + * @date 2020.11.11 23:20 + */ + @PostMapping("resi/group/topic/my-part-topics") + Result> myPartTopics(@RequestBody CustomerPageFormDTO param); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index f29e47292d..2300137e09 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -5,7 +5,9 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; +import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; +import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; @@ -31,4 +33,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectGroupInfo", groupInfoFormDTO); } + @Override + public Result> myPartTopics(CustomerPageFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "myPartTopics", param); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index de0f3a665d..917d3beab5 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -272,5 +272,18 @@ public class ResiTopicController { return new Result().ok(myTopics); } + /** + * @Description 个人中心-我参与过的话题 + * @param param + * @return java.util.List + * @author wangc + * @date 2020.11.11 23:20 + */ + @PostMapping("my-part-topics") + public Result> myPartTopics(@RequestBody CustomerPageFormDTO param){ + ValidatorUtils.validateEntity(param); + return new Result>().ok(topicService.getParticipatedTopics(param)); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java index 1cc8f528fe..e7cd14a7eb 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java @@ -161,4 +161,13 @@ public interface ResiTopicDao extends BaseDao { */ List selectIssueList(@Param("topicList") List topicList); + /** + * @Description 查询我参与过的话题 + * @param customerId + * @param userId + * @return java.util.List + * @author wangc + * @date 2020.11.11 23:08 + */ + List selectParticipatedTopics(@Param("customerId") String customerId,@Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index b366ac7109..4128358aa5 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -271,4 +271,13 @@ public interface ResiTopicService extends BaseService { * @date 2020.11.10 15:03 */ List listMyTopics(String customerId, String userId, Integer pageNo, Integer pageSize); + + /** + * @Description 个人中心-我参与过的话题 + * @param param + * @return java.util.List + * @author wangc + * @date 2020.11.11 23:20 + */ + List getParticipatedTopics(CustomerPageFormDTO param); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index c4b77e453d..c207a9f736 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -84,6 +84,7 @@ import com.epmet.resi.group.dto.topic.form.CheckTopicPublisherFormDTO; import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO; import com.epmet.resi.group.dto.topic.result.*; import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -1413,6 +1414,32 @@ public class ResiTopicServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2020.11.11 23:20 + */ + @Override + public List getParticipatedTopics(CustomerPageFormDTO param) { + + PageInfo page = + PageHelper.startPage(Optional.ofNullable(param.getPageNo()).orElse(NumConstant.ONE), + Optional.ofNullable(param.getPageSize()).orElse(NumConstant.ONE)).doSelectPageInfo(() -> + baseDao.selectParticipatedTopics(param.getCustomerId(),param.getUserId())); + List result = page.getList(); + if(CollectionUtils.isEmpty(result)) return Collections.EMPTY_LIST; + Result> gridR = govOrgOpenFeignClient.selectOrgInfo( + new OrgInfoFormDTO(OrgInfoConstant.GRID,result.stream().map(ParticipatedTopicUnitResultDTO :: getTopicReleaseGridName).distinct().collect(Collectors.toList()))); + if(gridR.success() && !CollectionUtils.isEmpty(gridR.getData())){ + return result.stream().flatMap(topic -> gridR.getData().stream() .filter(grid -> StringUtils.equals(grid.getOrgId(),topic.getTopicReleaseGridName())).map(orgInfo -> { + topic.setTopicReleaseGridName(orgInfo.getOrgId()); + return topic; + })).collect(Collectors.toList()); + } return Collections.EMPTY_LIST; + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index 5678bda9ea..cb4d75b345 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -474,5 +474,26 @@ + + From 03867938dcf4153c3ffc5175bdbdc0e6f0fe5020 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 12 Nov 2020 13:25:28 +0800 Subject: [PATCH 100/125] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83-?= =?UTF-8?q?=E6=88=91=E5=8F=91=E8=B5=B7=E7=9A=84=E8=AE=AE=E9=A2=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8-=E5=B7=B2=E5=85=B3=E9=97=AD+=E4=B8=80=E8=BD=AC?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IssueDTO.java | 4 ++ .../epmet/feign/GovIssueOpenFeignClient.java | 7 +-- .../src/main/resources/mapper/IssueDao.xml | 11 ++-- .../main/java/com/epmet/dto/ProjectDTO.java | 8 ++- .../feign/GovProjectOpenFeignClient.java | 11 ++++ .../GovProjectOpenFeignClientFallback.java | 13 ++++- .../epmet/controller/ProjectController.java | 10 ++-- .../com/epmet/service/ProjectService.java | 3 +- .../service/impl/ProjectServiceImpl.java | 43 +++++++++++----- .../person/service/impl/IssueServiceImpl.java | 50 +++++++++++++++++-- 10 files changed, 127 insertions(+), 33 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java index 960bf286a7..0da96662ee 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java @@ -154,4 +154,8 @@ public class IssueDTO implements Serializable { */ private Long closedTimeStamp; + /** + * 议题转项目后-对应的项目id + */ + private String projectId; } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 7b4878096a..72e517ba97 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -7,9 +7,6 @@ import com.epmet.dto.form.MyPartIssuesFormDTO; import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.MyPubIssuesAuditingResultDTO; -import org.springframework.cloud.openfeign.FeignClient; - -import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; @@ -24,8 +21,8 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:37 */ -@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) -//@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101") +// @FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) +@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101") public interface GovIssueOpenFeignClient { /** diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 14deb3403d..1277481b79 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -398,20 +398,23 @@ SELECT i.*, UNIX_TIMESTAMP(i.CLOSED_TIME) AS closedTimeStamp, - UNIX_TIMESTAMP(i.SHIFTED_TIME) AS shiftedTimeStamp + UNIX_TIMESTAMP(i.SHIFTED_TIME) AS shiftedTimeStamp, + m.PROJECT_ID FROM issue i + left join issue_project_relation m + on(i.id=m.ISSUE_ID and m.del_flag='0') WHERE i.DEL_FLAG = '0' AND i.CREATED_BY = #{userId} and i.ISSUE_STATUS=#{issueStatus} - + ORDER BY - i.SHIFTED_TIME DESC + m.CREATED_TIME DESC - + ORDER BY i.CLOSED_TIME DESC diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java index ef8c8f0d11..1d75e9adfe 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectDTO.java @@ -17,9 +17,11 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; +import java.util.List; /** @@ -113,4 +115,8 @@ public class ProjectDTO implements Serializable { */ private Date updatedTime; + /** + * 当前处理部门名称列表 + */ + private List currentDepartmentNameList; } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index ed9bbab6ed..fc0adf94cd 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -22,6 +22,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:32 */ +// @FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallback = GovProjectOpenFeignClientFallback.class,url = "localhost:8102") @FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallback = GovProjectOpenFeignClientFallback.class) public interface GovProjectOpenFeignClient { /** @@ -53,4 +54,14 @@ public interface GovProjectOpenFeignClient { */ @PostMapping("gov/project/project/issuetoprojectlist") Result> issueToProjectList(MyPartProjectsFormDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param projectIds 项目id数组 + * @author yinzuomei + * @description 根据项目id查询项目基本信息 + * @Date 2020/11/11 17:40 + **/ + @PostMapping("gov/project/project/queryprojectinfobyids") + Result> queryProjectInfoByIds(@RequestBody List projectIds); } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index 9326b0cdaa..05201b8e22 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -9,7 +9,6 @@ import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.result.MyPartProjectsResultDTO; import com.epmet.dto.result.PendProjectListResultDTO; import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; -import com.epmet.dto.result.ProcesslistResultDTO; import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; @@ -51,4 +50,16 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result> issueToProjectList(MyPartProjectsFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "issueToProjectList", formDTO); } + + /** + * @param projectIds 项目id数组 + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 根据项目id查询项目基本信息 + * @Date 2020/11/11 17:40 + **/ + @Override + public Result> queryProjectInfoByIds(List projectIds) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "queryProjectInfoByIds", projectIds); + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index d8309d93af..0261e4a7ba 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -17,18 +17,14 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.annotation.RequirePermission; -import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.LatestListFormDTO; import com.epmet.dto.form.ProjectListFromDTO; @@ -192,4 +188,8 @@ public class ProjectController { return new Result>().ok(projectService.issueToProjectList(formDTO)); } + @PostMapping("queryprojectinfobyids") + public Result> queryProjectInfoByIds(@RequestBody List projectIds){ + return new Result>().ok(projectService.queryProjectInfoByIds(projectIds)); + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index 4f339c3a3f..35f81839d8 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -19,7 +19,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -224,4 +223,6 @@ public interface ProjectService extends BaseService { * @Description 根据议题Id集合查询对应的项目信息 **/ List issueToProjectList(MyPartProjectsFormDTO formDTO); + + List queryProjectInfoByIds(List projectIds); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index f247526cff..fefc457aa8 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -688,6 +688,18 @@ public class ProjectServiceImpl extends BaseServiceImpl getClosedProjectList(LatestListFormDTO formDTO) { + + return baseDao.selectClosedProjectList(formDTO); + } + /** * @param formDTO * @return @@ -804,7 +816,7 @@ public class ProjectServiceImpl extends BaseServiceImpl projectStaffIds = entityList.stream().map(ProjectStaffEntity::getId).distinct().collect(Collectors.toList()); if(!CollectionUtils.isEmpty(projectStaffIds)){ List container = new LinkedList<>(); @@ -842,18 +854,6 @@ public class ProjectServiceImpl extends BaseServiceImpl getClosedProjectList(LatestListFormDTO formDTO) { - - return baseDao.selectClosedProjectList(formDTO); - } - @Override public void response(ProjectResponseFormDTO formDTO) { //公开回复内容审核 @@ -1388,4 +1388,21 @@ public class ProjectServiceImpl extends BaseServiceImpl queryProjectInfoByIds(List projectIds) { + List entityList=baseDao.selectBatchIds(projectIds); + List projectDTOList=ConvertUtils.sourceToTarget(entityList, ProjectDTO.class); + //2.使用已有方法查询项目当前处理部门信息 + projectDTOList.forEach(l -> { + if (ProjectConstant.CLOSED.equals(l.getStatus())) { + l.setCurrentDepartmentNameList(new ArrayList()); + } else { + ProjectDTO dto = new ProjectDTO(); + dto.setId(l.getId()); + l.setCurrentDepartmentNameList(baseDao.selectDepartmentNameList(dto)); + } + }); + return projectDTOList; + } + } \ No newline at end of file diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java index aaa6043612..8f321cceb9 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.IssueOpenConstant; import com.epmet.constant.OrgInfoConstant; import com.epmet.dto.IssueDTO; +import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.MyPartIssuesFormDTO; import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.form.OrgInfoFormDTO; @@ -151,13 +152,56 @@ public class IssueServiceImpl implements IssueService { /** * @param formDTO * @author yinzuomei - * @description 个人中心-我发起的议题列表-已转项目 + * @description 个人中心-我发起的议题列表-已转项目 按照转项目时间排序 * @Date 2020/11/11 13:35 **/ @Override public List getMyPubIssuesShiftProject(MyPubIssuesAuditingFormDTO formDTO) { - //todo - return null; + //查询我发起的议题,并且 已转项目 + formDTO.setIssueStatus(IssueOpenConstant.ISSUE_SHIFT_PROJECT); + Result> issueResult=issueOpenFeignClient.getMyPubIssues(formDTO); + if(null==issueResult||CollectionUtils.isEmpty(issueResult.getData())){ + return new ArrayList<>(); + } + //议题来源话题id集合 + List topicIds=new ArrayList<>(); + List projectIds=new ArrayList<>(); + issueResult.getData().forEach(issueDTO ->{ + if(IssueOpenConstant.SOURCE_TYPE_RT.equals(issueDTO.getSourceType())&& StringUtils.isNotBlank(issueDTO.getSourceId())){ + topicIds.add(issueDTO.getSourceId()); + projectIds.add(issueDTO.getProjectId()); + } + } ); + //查询网格名称 + Result> gridNameList = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.GRID, issueResult.getData().stream().map(m -> m.getGridId()).collect(Collectors.toList()))); + if (!gridNameList.success()){ + logger.error("查询议题来源网格名称失败......"); + } + //查询话题来源小组名称 + Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(topicIds)); + if (!groupNameList.success()){ + logger.error("查询议题来源小组名称失败......"); + } + //查询项目基本信息 + Result> projectRes=govProjectOpenFeignClient.queryProjectInfoByIds(projectIds); + if(!projectRes.success()){ + logger.error("查询项目信息失败......"); + } + List list=new ArrayList<>(); + for(IssueDTO issueDTO:issueResult.getData()){ + MyPubIssuesShiftProjectResultDTO resultDTO=new MyPubIssuesShiftProjectResultDTO(); + resultDTO.setProjectId(issueDTO.getProjectId()); + gridNameList.getData().stream().filter(o -> issueDTO.getGridId().equals(o.getOrgId())).forEach(o -> resultDTO.setTopicReleaseGridName(o.getOrgName())); + groupNameList.getData().stream().filter(g -> issueDTO.getSourceId().equals(g.getTopicId())).forEach(g -> resultDTO.setTopicReleaseGroupName(g.getTopicGroupName())); + resultDTO.setShiftProjectTime(issueDTO.getShiftedTimeStamp()); + + + projectRes.getData().stream().filter(p->issueDTO.getProjectId().equals(p.getId())).forEach(projectDTO -> resultDTO.setProjectTitle(projectDTO.getTitle())); + //当前处理部门名称列表 + projectRes.getData().stream().filter(p->issueDTO.getProjectId().equals(p.getId())).forEach(projectDTO -> resultDTO.setDepartmentNameList(projectDTO.getCurrentDepartmentNameList())); + list.add(resultDTO); + } + return list; } /** From 0f1ecd802813a9d560538dc6b452c8f39e4ca2b8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 12 Nov 2020 13:28:40 +0800 Subject: [PATCH 101/125] =?UTF-8?q?=E5=8E=BB=E9=99=A4url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/feign/GovIssueOpenFeignClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 72e517ba97..9e01905c9e 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -21,8 +21,8 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:37 */ -// @FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) -@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101") +@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class) +// @FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101") public interface GovIssueOpenFeignClient { /** From 1fd7ddbc38ab2389512e99b0a5ec125fa1e9686f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 12 Nov 2020 14:31:21 +0800 Subject: [PATCH 102/125] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BA=93-=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=9B=B8=E5=85=B3=E4=BA=BA=E5=91=98=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AF=9D=E9=A2=98=E8=AE=AE=E9=A2=98=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/AppClientConstant.java | 8 ++++++++ .../java/com/epmet/dto/ProjectRelatedPersonnelDTO.java | 10 ++++++++++ .../epmet/entity/ProjectRelatedPersonnelEntity.java | 10 ++++++++++ .../com/epmet/excel/ProjectRelatedPersonnelExcel.java | 6 ++++++ .../com/epmet/service/impl/ProjectServiceImpl.java | 4 ++++ .../V0.0.4__alter_project_related_personnel.sql | 5 +++++ 6 files changed, 43 insertions(+) create mode 100644 epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.4__alter_project_related_personnel.sql diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java index 2d12ab77ce..7b08e851d5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java @@ -54,4 +54,12 @@ public interface AppClientConstant { * app类型-工作端 */ String APP_WORK = "work"; + /** + * 来源类型-话题:topic + */ + String TOPIC = "topic"; + /** + * 来源类型-议题:issue + */ + String ISSUE = "issue"; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectRelatedPersonnelDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectRelatedPersonnelDTO.java index d01a0bc70d..4ac72f72cc 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectRelatedPersonnelDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectRelatedPersonnelDTO.java @@ -58,6 +58,16 @@ public class ProjectRelatedPersonnelDTO implements Serializable { */ private String userId; + /** + * 来源类型(话题:topic 议题:issue) + */ + private String sourceType; + + /** + * 来源Id(话题或议题Id) + */ + private String sourceId; + /** * 删除标识 */ diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectRelatedPersonnelEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectRelatedPersonnelEntity.java index b2ed014ced..6b99f72f4a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectRelatedPersonnelEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectRelatedPersonnelEntity.java @@ -58,4 +58,14 @@ public class ProjectRelatedPersonnelEntity extends BaseEpmetEntity { */ private String userId; + /** + * 来源类型(话题:topic 议题:issue) + */ + private String sourceType; + + /** + * 来源Id(话题或议题Id) + */ + private String sourceId; + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectRelatedPersonnelExcel.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectRelatedPersonnelExcel.java index 8cfb220d77..081bb9182d 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectRelatedPersonnelExcel.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectRelatedPersonnelExcel.java @@ -46,6 +46,12 @@ public class ProjectRelatedPersonnelExcel { @Excel(name = "用户ID") private String userId; + @Excel(name = "来源类型") + private String sourceType; + + @Excel(name = "来源ID") + private String sourceId; + @Excel(name = "删除标识") private String delFlag; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index fefc457aa8..c7a3d93804 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -839,8 +839,12 @@ public class ProjectServiceImpl extends BaseServiceImpl Date: Thu, 12 Nov 2020 14:58:27 +0800 Subject: [PATCH 103/125] =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0@JsonFormat=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/IssueProjectResultDTO.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectResultDTO.java index bcad9ff776..51ab9d952d 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; @@ -26,6 +27,7 @@ public class IssueProjectResultDTO implements Serializable { /** * 议题转项目时间(项目表创建时间) */ + @JsonFormat private Date shiftedTime; } From 19fae500d58ca7090033195654a24114f75dbe31 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 12 Nov 2020 15:18:01 +0800 Subject: [PATCH 104/125] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/IssueProjectResultDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectResultDTO.java index 51ab9d952d..44afcedae1 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectResultDTO.java @@ -27,7 +27,7 @@ public class IssueProjectResultDTO implements Serializable { /** * 议题转项目时间(项目表创建时间) */ - @JsonFormat + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date shiftedTime; } From 6020d198982da25a50ff7b24bfe2fc50ae72e106 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 12 Nov 2020 15:39:58 +0800 Subject: [PATCH 105/125] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=AB=AF=E8=AF=9D?= =?UTF-8?q?=E9=A2=98=E5=88=97=E8=A1=A8=20=E5=B1=85=E6=B0=91=E6=AE=B5?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E8=AF=9D=E9=A2=98=E5=88=97=E8=A1=A8=20?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83-=E6=88=91=E5=8F=82?= =?UTF-8?q?=E4=B8=8E=E8=BF=87=E7=9A=84=E8=AF=9D=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResiTopicServiceImpl.java | 1 + .../service/impl/ResiTopicServiceImpl.java | 31 ++++++++++++- .../person/controller/TopicController.java | 44 +++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java index 23dbd83fe9..a51eebbed6 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiTopicServiceImpl.java @@ -79,6 +79,7 @@ public class ResiTopicServiceImpl implements ResiTopicService { govTopic.setTopicRealseTime(top.getReleaseTime()); govTopic.setTopicFirstPhoto(top.getFirstPhoto()); govTopic.setTopicState(top.getStatus()); + govTopic.setBadgeList(top.getBadgeList()); topicsResult.add(govTopic); }); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index c207a9f736..a2dd0defc8 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -371,7 +371,36 @@ public class ResiTopicServiceImpl extends BaseServiceImpl>> badgeR + = userOpenFeignClient.userShowBadge( + new UserGroupFormDTO(group.getCustomerId(), + latestTenTopics.stream() + .filter(top -> StringUtils.equals("other",top.getReleaseUserFlag())) + .map(ResiTopicIncludeIssueInfoResultDTO::getUserId) + .distinct().collect(Collectors.toList()))); + if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){ + Map> badgeM = badgeR.getData(); + latestTenTopics.forEach(top -> { + if(StringUtils.equals("other",top.getReleaseUserFlag())){ + top.setBadgeList( + CollectionUtils.isEmpty(badgeM.get(top.getUserId())) ? + Collections.EMPTY_LIST : + badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO :: getBadgeIcon).collect(Collectors.toList()) + ); + }else top.setBadgeList(Collections.EMPTY_LIST); + }); + + }else latestTenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST)); + + } + + + } return new Result>().ok(latestTenTopics); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java new file mode 100644 index 0000000000..d49c9c3c52 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java @@ -0,0 +1,44 @@ +package com.epmet.modules.person.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; +import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +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 java.util.List; + +/** + * @Description 个人中心-话题 + * @ClassName TopicController + * @Auth wangc + * @Date 2020-11-12 14:33 + */ +@RestController +@RequestMapping("topic") +public class TopicController { + + @Autowired + private ResiGroupOpenFeignClient groupFeign; + + /** + * @Description 个人中心-我参与过的话题 + * @param param + * @return java.util.List + * @author wangc + * @date 2020.11.11 23:20 + */ + @PostMapping("my-part-topics") + Result> myPartTopics(@LoginUser TokenDto token , @RequestBody CustomerPageFormDTO param){ + param.setUserId(token.getUserId()); + ValidatorUtils.validateEntity(param); + return groupFeign.myPartTopics(param); + } +} From 578407e0685798d9b5fba7ad5b7db36b12bd4081 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Thu, 12 Nov 2020 18:02:37 +0800 Subject: [PATCH 106/125] =?UTF-8?q?user=5Fadvice=E6=B7=BB=E5=8A=A0pids?= =?UTF-8?q?=E5=92=8Callparentname=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/UserAdviceDTO.java | 10 ++++++++++ .../java/com/epmet/entity/UserAdviceEntity.java | 10 ++++++++++ .../java/com/epmet/excel/UserAdviceExcel.java | 6 ++++++ .../service/impl/UserAdviceServiceImpl.java | 17 +++++++++++++++-- .../db/migration/V0.0.7__add_useradvice.sql | 2 ++ .../src/main/resources/mapper/UserAdviceDao.xml | 2 ++ 6 files changed, 45 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java index 0cea243f87..6a26e01d39 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java @@ -53,6 +53,16 @@ public class UserAdviceDTO implements Serializable { */ private String agencyId; + /** + * 组织pids + */ + private String agencyPids; + + /** + * 组织parent name + */ + private String agencyAllParentName; + /** * 组织名 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java index 51ddc1553d..9340acd044 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java @@ -53,6 +53,16 @@ public class UserAdviceEntity extends BaseEpmetEntity { */ private String agencyId; + /** + * 组织pids + */ + private String agencyPids; + + /** + * 组织parent name + */ + private String agencyAllParentName; + /** * 组织名 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java index f14ded9f03..4f5f0896b5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java @@ -43,6 +43,12 @@ public class UserAdviceExcel { @Excel(name = "组织ID") private String agencyId; + @Excel(name = "组织PIDs") + private String agencyPids; + + @Excel(name = "组织ParentName") + private String agencyAllParentName; + @Excel(name = "组织名") private String agencyName; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index 59038e0d91..be97e8ae21 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -202,6 +202,10 @@ public class UserAdviceServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); + //del_flag + wrapper.eq("DEL_FLAG","0"); //客户Id wrapper.eq(StringUtils.isNotBlank(dto.getCustomerId()), "CUSTOMER_ID", dto.getCustomerId()); //是否回复 @@ -258,14 +264,19 @@ public class UserAdviceServiceImpl extends BaseServiceImplwrapper1.eq("AGENCY_ID", dto.getAgencyId()) + .or() + .like("AGENCY_PIDS", dto.getAgencyId())); + } + IPage result = baseDao.selectPage(page, wrapper); @@ -341,6 +352,8 @@ public class UserAdviceServiceImpl extends BaseServiceImpl agencyById = govOrgOpenFeignClient.getAgencyById(gridInfoResultDTOResult.getData().getParentAgencyId()); if (agencyById.success()){ userAdviceDTO.setAgencyName(agencyById.getData().getAllParentName()); + userAdviceDTO.setAgencyAllParentName(agencyById.getData().getAllParentName()); + userAdviceDTO.setAgencyPids(agencyById.getData().getPids()); }else { logger.error("agencyId:{},获取组织详情失败",gridInfoResultDTOResult.getData().getParentAgencyId()); } diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.7__add_useradvice.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.7__add_useradvice.sql index e2e4c2cf9b..5fe0e2651e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.7__add_useradvice.sql +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.7__add_useradvice.sql @@ -3,6 +3,8 @@ CREATE TABLE `user_advice` ( `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', `CUSTOMER_NAME` varchar(64) NOT NULL COMMENT '客户名', `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID', + `AGENCY_PIDS` varchar(1024) NOT NULL COMMENT '组织PIDs', + `AGENCY_ALL_PARENT_NAME` varchar(1024) COMMENT '组织parent name', `AGENCY_NAME` varchar(64) NOT NULL COMMENT '组织名', `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', `GRID_NAME` varchar(64) NOT NULL COMMENT '网格名', diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml index c9c804c0a2..1499c9581b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -8,6 +8,8 @@ + + From 0c49a2efde44258ddb3a6f4f87cf51bb4d57d498 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 13 Nov 2020 09:36:47 +0800 Subject: [PATCH 107/125] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E5=BE=BD=E7=AB=A0=E5=AE=A1=E6=A0=B8=E7=BA=A2=E7=82=B9=E6=8F=90?= =?UTF-8?q?=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-grid/gov-grid-server/pom.xml | 6 +++ .../WorkGrassRootsFunctionConstant.java | 7 ++++ .../epmet/service/impl/RemindServiceImpl.java | 42 +++++++++++++------ .../src/main/resources/logback-spring.xml | 2 +- .../GridAuditingBadgeCountResultDTO.java | 26 ++++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 9 ++++ .../EpmetUserOpenFeignClientFallback.java | 11 +++++ .../com/epmet/controller/BadgeController.java | 23 +++++++--- .../src/main/java/com/epmet/dao/BadgeDao.java | 8 ++++ .../java/com/epmet/service/BadgeService.java | 13 ++++-- .../epmet/service/impl/BadgeServiceImpl.java | 19 +++++++-- .../src/main/resources/mapper/BadgeDao.xml | 15 +++++++ 12 files changed, 154 insertions(+), 27 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridAuditingBadgeCountResultDTO.java diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index 494a417395..4972ba1e92 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-server/pom.xml @@ -63,6 +63,12 @@ 2.0.0 compile + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/constant/WorkGrassRootsFunctionConstant.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/constant/WorkGrassRootsFunctionConstant.java index 1e52667fff..772990f98d 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/constant/WorkGrassRootsFunctionConstant.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/constant/WorkGrassRootsFunctionConstant.java @@ -26,5 +26,12 @@ public class WorkGrassRootsFunctionConstant { * 议题管理 */ public static final String WORK_GRASSROOTS_ISSUE="work_grassroots_issue"; + + /** + * 徽章审核 + */ + public static final String WORK_GRASSROOTS_BADGE="work_grassroots_badge"; + + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java index e7cfdcbd6c..5ad942b434 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java @@ -1,19 +1,16 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.WorkGrassRootsFunctionConstant; import com.epmet.controller.TestFormDTO1; import com.epmet.controller.TestResultDTO1; import com.epmet.dto.form.RedDotFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.GridAuditingBadgeCountResultDTO; import com.epmet.dto.result.GridProcessingCountResultDTO; import com.epmet.dto.result.RedDotResultDTO; -import com.epmet.feign.GovIssueFeignClient; -import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.ResiGroupFeignClient; -import com.epmet.feign.ResiPartymemberFeignClient; +import com.epmet.feign.*; import com.epmet.service.RemindService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,6 +41,9 @@ public class RemindServiceImpl implements RemindService { @Autowired private GovIssueFeignClient govIssueFeignClient; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Override public RedDotResultDTO queryGridRedDot(RedDotFormDTO formDTO) { RedDotResultDTO redDotResultDTO = new RedDotResultDTO(); @@ -88,10 +88,14 @@ public class RemindServiceImpl implements RemindService { if (this.getWorkGrassRootsIssue(gridIdList)) { functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE); } + if(this.getWorkGrassRootsBadge(gridIdList)){ + functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_BADGE); + } return functionList; } + //群组管理: work_grassroots_group public Boolean getWorkGrassRootsGroup(List gridIdList) { Result> groupProcessingCountResult = resiGroupFeignClient.queryGroupProcessingCount(gridIdList); @@ -104,8 +108,7 @@ public class RemindServiceImpl implements RemindService { } } }else{ - logger.error(String.format("调用%s服务,查询网格%s待审核小组数失败code%s,msg:", ServiceConstant.RESI_GROUP_SERVER, gridIdList.get(0), groupProcessingCountResult.getCode(), - groupProcessingCountResult.getMsg())); + logger.error(String.format("查询网格内待审核小组数失败,%s",groupProcessingCountResult.getMsg())); } return false; } @@ -123,8 +126,7 @@ public class RemindServiceImpl implements RemindService { } } } else { - logger.error(String.format("调用%s服务,查询网格%s待审核热心居民数失败code%s,msg:", ServiceConstant.RESI_PARTYMEMBER_SERVER, gridIdList.get(0), resiGroupProcessingCountResult.getCode(), - resiGroupProcessingCountResult.getMsg())); + logger.error(String.format("查询网昂个内待审核热心居民数失败,%s",resiGroupProcessingCountResult.getMsg())); } return false; } @@ -142,8 +144,7 @@ public class RemindServiceImpl implements RemindService { } } }else{ - logger.error(String.format("调用%s服务,查询网格%s待审核党员数失败code%s,msg:", ServiceConstant.RESI_PARTYMEMBER_SERVER, gridIdList.get(0), partyMemberProcessingCountResult.getCode(), - partyMemberProcessingCountResult.getMsg())); + logger.error(String.format("查询网格内待审核党员总数失败,%s",partyMemberProcessingCountResult.getMsg())); } return false; } @@ -161,12 +162,27 @@ public class RemindServiceImpl implements RemindService { } } }else{ - logger.error(String.format("调用%s服务,查询网格%s表决中议题总数失败code%s,msg:", ServiceConstant.GOV_ISSUE_SERVER, gridIdList.get(0), issueResult.getCode(), - issueResult.getMsg())); + logger.error("查询网格表决中议题总数失败,%s",issueResult.getMsg()); } return false; } + //徽章审核 + private boolean getWorkGrassRootsBadge(List gridIdList) { + Result> badgeResult = epmetUserOpenFeignClient.queryGridAuditingBadgeCount(gridIdList); + if (badgeResult.success()) { + for (String gridId : gridIdList) { + for (GridAuditingBadgeCountResultDTO gridAuditingBadgeCountResultDTO : badgeResult.getData()) { + if (gridId.equals(gridAuditingBadgeCountResultDTO.getGridId()) && gridAuditingBadgeCountResultDTO.getCount() > 0) { + return true; + } + } + } + }else{ + logger.error(String.format("查询网格待审核徽章申请失败,%s",badgeResult.getMsg())); + } + return false; + } @Override public TestResultDTO1 test(TestFormDTO1 testFormDTO1) { Result resultDTO1Result = resiGroupFeignClient.test(testFormDTO1); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml index a8dbb17134..ef4cf50330 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/logback-spring.xml @@ -134,7 +134,7 @@ - + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridAuditingBadgeCountResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridAuditingBadgeCountResultDTO.java new file mode 100644 index 0000000000..d019754e4b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridAuditingBadgeCountResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 网格待审核徽章总数 + * + * @author yinzuomei@elink-cn.com + * @date 2020/11/12 15:39 + */ +@Data +public class GridAuditingBadgeCountResultDTO implements Serializable { + private static final long serialVersionUID = 5685272249935546444L; + + /** + * 网格id + */ + private String gridId; + + /** + * 待审核徽章申请单总数 + */ + private Long count; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 2d5df3ebbb..f58c03e801 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -431,4 +431,13 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping("/epmetuser/badge/usershowbadge") Result>> userShowBadge(@RequestBody UserGroupFormDTO param); + + /** + * @param gridIdList + * @author yinzuomei + * @description 根据网格id,查询每个网格有多少个徽章申请 + * @Date 2020/11/12 15:41 + **/ + @PostMapping(value = "/epmetuser/badge/querygridauditingbadgecount",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> queryGridAuditingBadgeCount(@RequestBody List gridIdList); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index b58b3ae62c..1a1da3db60 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -300,4 +300,15 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result>> userShowBadge(UserGroupFormDTO param) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "userShowBadge", param); } + + /** + * @param gridIdList + * @author yinzuomei + * @description 根据网格id, 查询每个网格有多少个徽章申请 + * @Date 2020/11/12 15:41 + **/ + @Override + public Result> queryGridAuditingBadgeCount(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "queryGridAuditingBadgeCount", gridIdList); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java index a18ad036fd..7a880540bd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java @@ -5,14 +5,14 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.*; -import com.epmet.dto.result.BadgeAuditRecordResultDTO; -import com.epmet.dto.result.BadgeAuditingResultDTO; -import com.epmet.dto.result.BadgeDetailResultDTO; -import com.epmet.dto.result.BadgeListResultDTO; +import com.epmet.dto.result.*; import com.epmet.redis.UserBadgeRedis; import com.epmet.service.BadgeService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +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 java.util.List; import java.util.Map; @@ -165,4 +165,17 @@ public class BadgeController { ValidatorUtils.validateEntity(param); return new Result>>().ok(badgeRedis.batchObtainUserBadge(param.getCustomerId(),param.getUserIds())); } + + /** + * @param gridIdList + * @author yinzuomei + * @description 根据网格id, 查询每个网格有多少个徽章申请单 + * @Date 2020/11/12 15:51 + **/ + @PostMapping("querygridauditingbadgecount") + public Result> queryGridAuditingBadgeCount(@RequestBody List gridIdList){ + return new Result>().ok(badgeService.queryGridAuditingBadgeCount(gridIdList)); + } + + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java index 9e669fd694..64356f9b56 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -159,4 +159,12 @@ public interface BadgeDao extends BaseDao { * @date 2020/11/6 14:46 */ void insertBadge(BadgeDTO dto); + + /** + * @param gridIdList + * @author yinzuomei + * @description 根据网格id, 查询每个网格有多少个徽章申请 + * @Date 2020/11/12 15:59 + **/ + List queryGridAuditingBadgeCount(@Param("gridIdList") List gridIdList); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java index 9b13682b6f..b409d5709b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java @@ -25,10 +25,7 @@ import com.epmet.dto.form.AddBadgeFormDTO; import com.epmet.dto.form.BadgeAuditFormDTO; import com.epmet.dto.form.BadgeFormDTO; import com.epmet.dto.form.EditBadgeFormDTO; -import com.epmet.dto.result.BadgeAuditRecordResultDTO; -import com.epmet.dto.result.BadgeAuditingResultDTO; -import com.epmet.dto.result.BadgeDetailResultDTO; -import com.epmet.dto.result.BadgeListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.BadgeEntity; import java.util.List; @@ -182,4 +179,12 @@ public interface BadgeService extends BaseService { void audit(TokenDto tokenDto, BadgeAuditFormDTO formDTO); void testCache(); + + /** + * @param gridIdList + * @author yinzuomei + * @description 根据网格id, 查询每个网格有多少个徽章申请 + * @Date 2020/11/12 15:56 + **/ + List queryGridAuditingBadgeCount(List gridIdList); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java index 00b3e3bfb2..0c52da11ba 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -39,10 +39,7 @@ import com.epmet.dto.BadgeDTO; import com.epmet.dto.ResiUserBadgeDTO; import com.epmet.dto.UserBadgeCertificateRecordDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.BadgeAuditRecordResultDTO; -import com.epmet.dto.result.BadgeAuditingResultDTO; -import com.epmet.dto.result.BadgeDetailResultDTO; -import com.epmet.dto.result.BadgeListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.BadgeCertificationConfigEntity; import com.epmet.entity.BadgeEntity; import com.epmet.feign.EpmetMessageOpenFeignClient; @@ -415,4 +412,18 @@ public class BadgeServiceImpl extends BaseServiceImpl imp System.out.println(cache); } + /** + * @param gridIdList + * @author yinzuomei + * @description 根据网格id, 查询每个网格有多少个徽章申请 + * @Date 2020/11/12 15:56 + **/ + @Override + public List queryGridAuditingBadgeCount(List gridIdList) { + if(CollectionUtils.isEmpty(gridIdList)){ + return new ArrayList<>(); + } + return baseDao.queryGridAuditingBadgeCount(gridIdList); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml index 5d762377cd..b5a72206b6 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -252,4 +252,19 @@ ) AS temp ORDER BY temp.UPDATED_TIME DESC + + \ No newline at end of file From 5057d5a5d6d762cc7ce30a098b69ccb021ad9157 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 13 Nov 2020 10:25:16 +0800 Subject: [PATCH 108/125] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BE=A4=E7=BB=84=E7=AE=A1=E7=90=86=E7=BA=A2=E7=82=B9=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=EF=BC=88+=E5=8F=98=E6=9B=B4=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8D=95=EF=BC=89=EF=BC=9A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=AA=E9=94=99=E5=88=AB=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/RemindServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java index 5ad942b434..fa007c0cd5 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java @@ -108,7 +108,7 @@ public class RemindServiceImpl implements RemindService { } } }else{ - logger.error(String.format("查询网格内待审核小组数失败,%s",groupProcessingCountResult.getMsg())); + logger.error(String.format("查询群组管理待办事项数失败,%s",groupProcessingCountResult.getMsg())); } return false; } @@ -126,7 +126,7 @@ public class RemindServiceImpl implements RemindService { } } } else { - logger.error(String.format("查询网昂个内待审核热心居民数失败,%s",resiGroupProcessingCountResult.getMsg())); + logger.error(String.format("查询网格内待审核热心居民数失败,%s",resiGroupProcessingCountResult.getMsg())); } return false; } From ff576771b79b04a3b9cd37eb08405aca7ce61147 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 13 Nov 2020 14:41:34 +0800 Subject: [PATCH 109/125] =?UTF-8?q?=E6=88=91=E5=8F=91=E8=B5=B7=E7=9A=84?= =?UTF-8?q?=E8=AE=AE=E9=A2=98=E5=8F=8D=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/person/service/impl/IssueServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java index 8f321cceb9..73fedceadd 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -146,6 +146,9 @@ public class IssueServiceImpl implements IssueService { if (!listResult.success()){ throw new RenException("查询我发起的议题列表-表决中失败......"); } + if (CollectionUtils.isEmpty(listResult.getData())){ + return new ArrayList<>(); + } return listResult.getData(); } From 3c389a646e7d9a2677d8c1401059a55bf122ae17 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 13 Nov 2020 15:20:31 +0800 Subject: [PATCH 110/125] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83-=E6=88=91=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=9A=84=E8=AF=9D=E9=A2=98=E5=88=97=E8=A1=A8=E3=80=81=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83-=E6=88=91=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=9A=84=E8=AF=9D=E9=A2=98=E5=88=97=E8=A1=A8(=E5=B7=B2?= =?UTF-8?q?=E8=BD=AC=E8=AE=AE=E9=A2=98)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ProjectByCreateTopicUserFormDTO.java | 20 +++++ .../ProjectOfCreateTopicUserResultDTO.java | 18 ++++ .../feign/GovProjectOpenFeignClient.java | 11 +++ .../GovProjectOpenFeignClientFallback.java | 7 ++ .../epmet/controller/ProjectController.java | 20 ++++- .../main/java/com/epmet/dao/ProjectDao.java | 9 ++ .../com/epmet/service/ProjectService.java | 8 ++ .../service/impl/ProjectServiceImpl.java | 13 +++ ...0.0.4__alter_project_related_personnel.sql | 9 ++ .../src/main/resources/mapper/ProjectDao.xml | 17 ++++ .../mapper/ProjectRelatedPersonnelDao.xml | 2 + .../dto/topic/MyCreateTopicsFormDTO.java | 20 +++++ ...tDTO.java => MyCreateTopicsResultDTO.java} | 2 +- .../group/feign/ResiGroupOpenFeignClient.java | 11 +++ .../ResiGroupOpenFeignClientFallback.java | 5 ++ .../topic/controller/ResiTopicController.java | 8 +- .../epmet/modules/topic/dao/ResiTopicDao.java | 2 +- .../topic/service/ResiTopicService.java | 2 +- .../service/impl/ResiTopicServiceImpl.java | 32 ++++--- .../resources/mapper/topic/ResiTopicDao.xml | 2 +- .../mine/dto/from/MyCreateTopicsFormDTO.java | 13 +++ .../from/MyShiftProjectTopicsFormDTO.java} | 8 +- .../dto/result/MyCreateTopicsResultDTO.java | 13 +++ .../result/MyShiftProjectTopicsResultDTO.java | 15 ++++ .../person/controller/TopicController.java | 35 ++++++++ .../modules/person/service/TopicService.java | 27 ++++++ .../person/service/impl/TopicServiceImpl.java | 83 +++++++++++++++++++ 27 files changed, 378 insertions(+), 34 deletions(-) create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectByCreateTopicUserFormDTO.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectOfCreateTopicUserResultDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyCreateTopicsFormDTO.java rename epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/{MyTopicsResultDTO.java => MyCreateTopicsResultDTO.java} (87%) create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyCreateTopicsFormDTO.java rename epmet-module/{resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyTopicsFormDTO.java => resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftProjectTopicsFormDTO.java} (61%) create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyCreateTopicsResultDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftProjectTopicsResultDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/TopicService.java create mode 100644 epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectByCreateTopicUserFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectByCreateTopicUserFormDTO.java new file mode 100644 index 0000000000..24364b8142 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectByCreateTopicUserFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class ProjectByCreateTopicUserFormDTO { + + public interface ListByUserGroup {} + + @NotBlank(message = "客户ID不能为空", groups = { ListByUserGroup.class }) + private String customerId; + + @NotBlank(message = "用户ID不能为空", groups = { ListByUserGroup.class }) + private String userId; + private Integer pageNo = 1; + private Integer pageSize = 10; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectOfCreateTopicUserResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectOfCreateTopicUserResultDTO.java new file mode 100644 index 0000000000..13b0fbfe1b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectOfCreateTopicUserResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.util.List; + +@Data +public class ProjectOfCreateTopicUserResultDTO { + + private String topicId; + private String projectId; + private String gridId; + private Long shiftProjectTime; + private List departmentNameList; + private String projectTitle; + private String releaseGridId; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index fc0adf94cd..2cd5f5f5fb 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -4,10 +4,12 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.ProcessListFormDTO; +import com.epmet.dto.form.ProjectByCreateTopicUserFormDTO; import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.result.MyPartProjectsResultDTO; import com.epmet.dto.result.PendProjectListResultDTO; import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; +import com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO; import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; @@ -64,4 +66,13 @@ public interface GovProjectOpenFeignClient { **/ @PostMapping("gov/project/project/queryprojectinfobyids") Result> queryProjectInfoByIds(@RequestBody List projectIds); + + /** + * @Description 根据话题创建人查询项目列表 + * @return + * @author wxz + * @date 2020.11.13 11:09 + */ + @PostMapping("gov/project/project/list-by-createtopic-userid") + Result> listProjectsByCreateTopicUserId(@RequestBody ProjectByCreateTopicUserFormDTO form); } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index 05201b8e22..fd478f1245 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -5,10 +5,12 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.ProcessListFormDTO; +import com.epmet.dto.form.ProjectByCreateTopicUserFormDTO; import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.result.MyPartProjectsResultDTO; import com.epmet.dto.result.PendProjectListResultDTO; import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; +import com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO; import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; @@ -62,4 +64,9 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result> queryProjectInfoByIds(List projectIds) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "queryProjectInfoByIds", projectIds); } + + @Override + public Result> listProjectsByCreateTopicUserId(ProjectByCreateTopicUserFormDTO form) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "listProjectsByCreateTopicUserId", form); + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index 0261e4a7ba..3c3641dac5 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -26,10 +28,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.ProjectDTO; -import com.epmet.dto.form.LatestListFormDTO; -import com.epmet.dto.form.ProjectListFromDTO; -import com.epmet.dto.form.ShiftProjectFormDTO; -import com.epmet.dto.form.ShiftProjectsFromDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.excel.ProjectExcel; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; @@ -192,4 +191,17 @@ public class ProjectController { public Result> queryProjectInfoByIds(@RequestBody List projectIds){ return new Result>().ok(projectService.queryProjectInfoByIds(projectIds)); } + + /** + * @Description + * @return + * @author wxz + * @date 2020.11.13 09:49 + */ + @PostMapping("list-by-createtopic-userid") + public Result> listProjectsByCreateTopicUserId(@RequestBody ProjectByCreateTopicUserFormDTO form) { + ValidatorUtils.validateEntity(form, ProjectByCreateTopicUserFormDTO.ListByUserGroup.class); + List projects = projectService.listProjectsByCreateTopicUserId(form.getUserId(), form.getCustomerId(), form.getPageNo(), form.getPageSize()); + return new Result().ok(projects); + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index 5657589210..e4dfd04800 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -26,6 +26,7 @@ import com.epmet.dto.form.ShiftProjectsFromDTO; import com.epmet.dto.result.LatestListResultDTO; import com.epmet.dto.result.MyPartProjectsResultDTO; import com.epmet.dto.result.ProjectDetailResultDTO; +import com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO; import com.epmet.entity.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -139,4 +140,12 @@ public interface ProjectDao extends BaseDao { List selectIssueProjectList(@Param("customerId") String customerId, @Param("issueList") List issueList, @Param("pageIndex") int pageIndex, @Param("pageSize") Integer pageSize); + /** + * @Description 根据话题创建人查询项目列表 + * @return + * @author wxz + * @date 2020.11.13 09:38 + */ + List listProjectsByCreateTopicUserId(@Param("userId") String userId, + @Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index 35f81839d8..03bb5fc584 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -225,4 +225,12 @@ public interface ProjectService extends BaseService { List issueToProjectList(MyPartProjectsFormDTO formDTO); List queryProjectInfoByIds(List projectIds); + + /** + * @Description 查询用户的项目列表 + * @return + * @author wxz + * @date 2020.11.13 09:12 + */ + List listProjectsByCreateTopicUserId(String userId, String customerId, Integer pageNo, Integer pageSize); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index c7a3d93804..7334c73c39 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -44,6 +44,7 @@ import com.epmet.feign.*; import com.epmet.redis.ProjectRedis; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import com.epmet.service.*; +import com.github.pagehelper.PageHelper; import org.apache.commons.collections4.CollectionUtils; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.ListUtils; @@ -1409,4 +1410,16 @@ public class ProjectServiceImpl extends BaseServiceImpl listProjectsByCreateTopicUserId(String userId, String customerId, Integer pageNo, Integer pageSize) { + PageHelper.startPage(pageNo, pageSize); + List projects = baseDao.listProjectsByCreateTopicUserId(userId, customerId); + projects.stream().forEach(p -> { + ProjectDTO dto = new ProjectDTO(); + dto.setId(p.getProjectId()); + List depts = baseDao.selectDepartmentNameList(dto); + p.setDepartmentNameList(depts); + }); + return projects; + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.4__alter_project_related_personnel.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.4__alter_project_related_personnel.sql index 9a3bbf1344..ceedfd85bb 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.4__alter_project_related_personnel.sql +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.4__alter_project_related_personnel.sql @@ -3,3 +3,12 @@ SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '来源类型(话题:topic ADD COLUMN `SOURCE_ID` VARCHAR (64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '来源Id(话题或议题Id)' AFTER `SOURCE_TYPE`; +-- 更改项目库的字符集 +alter table customer_project_parameter convert to character set utf8mb4 collate utf8mb4_general_ci; +alter table project convert to character set utf8mb4 collate utf8mb4_general_ci; +alter table project_org_relation convert to character set utf8mb4 collate utf8mb4_general_ci; +alter table project_process convert to character set utf8mb4 collate utf8mb4_general_ci; +alter table project_related_personnel convert to character set utf8mb4 collate utf8mb4_general_ci; +alter table project_satisfaction_detail convert to character set utf8mb4 collate utf8mb4_general_ci; +alter table project_satisfaction_statistics convert to character set utf8mb4 collate utf8mb4_general_ci; +alter table project_staff convert to character set utf8mb4 collate utf8mb4_general_ci; \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index 985077a6ac..8ef38d198a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -226,4 +226,21 @@ LIMIT #{pageIndex}, #{pageSize} + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectRelatedPersonnelDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectRelatedPersonnelDao.xml index 18257b67f4..419b8eae35 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectRelatedPersonnelDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectRelatedPersonnelDao.xml @@ -8,6 +8,8 @@ + + diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyCreateTopicsFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyCreateTopicsFormDTO.java new file mode 100644 index 0000000000..ea90db4413 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyCreateTopicsFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.resi.group.dto.topic; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class MyCreateTopicsFormDTO { + + @NotBlank(message = "客户id不能为空") + private String customerId; + + @NotBlank(message = "用户id不能为空") + private String userId; + + private Integer pageSize = 10; + + private Integer pageNo = 1; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyCreateTopicsResultDTO.java similarity index 87% rename from epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java rename to epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyCreateTopicsResultDTO.java index 2a3573f726..c96aa8e99e 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyTopicsResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyCreateTopicsResultDTO.java @@ -3,7 +3,7 @@ package com.epmet.resi.group.dto.topic.result; import lombok.Data; @Data -public class MyTopicsResultDTO { +public class MyCreateTopicsResultDTO { private String topicId; private Long releaseTime; diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 8b5c663df6..4355adc40f 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -4,8 +4,10 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; +import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; +import com.epmet.resi.group.dto.topic.result.MyCreateTopicsResultDTO; import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; @@ -50,4 +52,13 @@ public interface ResiGroupOpenFeignClient { */ @PostMapping("resi/group/topic/my-part-topics") Result> myPartTopics(@RequestBody CustomerPageFormDTO param); + + /** + * @Description 我创建的话题列表 + * @return + * @author wxz + * @date 2020.11.10 14:58 + */ + @PostMapping("resi/group/topic/my-create-topics") + Result> listMyCreateTopics(@RequestBody MyCreateTopicsFormDTO formDTO); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index 2300137e09..cf9833816f 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; +import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; @@ -38,4 +39,8 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "myPartTopics", param); } + @Override + public Result listMyCreateTopics(MyCreateTopicsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listMyTopics", formDTO); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index 917d3beab5..6dfc1a834f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -5,7 +5,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.modules.topic.service.ResiTopicService; -import com.epmet.resi.group.dto.topic.MyTopicsFormDTO; +import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.TopicInfoDTO; import com.epmet.resi.group.dto.topic.form.*; @@ -265,10 +265,10 @@ public class ResiTopicController { * @author wxz * @date 2020.11.10 14:58 */ - @PostMapping("my-topics") - public Result listMyTopics(@RequestBody MyTopicsFormDTO formDTO, @LoginUser TokenDto tokenDto) { + @PostMapping("my-create-topics") + public Result> listMyCreateTopics(@RequestBody MyCreateTopicsFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - List myTopics = topicService.listMyTopics(formDTO.getCustomerId(), tokenDto.getUserId(), formDTO.getPageNo(), formDTO.getPageSize()); + List myTopics = topicService.listMyCreateTopics(formDTO.getCustomerId(), formDTO.getUserId(), formDTO.getPageNo(), formDTO.getPageSize()); return new Result().ok(myTopics); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java index e7cd14a7eb..c1423b36dd 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java @@ -153,7 +153,7 @@ public interface ResiTopicDao extends BaseDao { */ CheckTopicPublisherResultDTO checkTopicPublisher(CheckTopicPublisherFormDTO formDTO); - List listMyTopics(@Param("userId") String userId, @Param("customerId") String customerId); + List listMyCreateTopics(@Param("userId") String userId, @Param("customerId") String customerId); /** * @Description 根据话题Id集合查询对应的已转成议题的议题Id集合 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index 4128358aa5..35ea013b11 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -270,7 +270,7 @@ public interface ResiTopicService extends BaseService { * @author wxz * @date 2020.11.10 15:03 */ - List listMyTopics(String customerId, String userId, Integer pageNo, Integer pageSize); + List listMyCreateTopics(String customerId, String userId, Integer pageNo, Integer pageSize); /** * @Description 个人中心-我参与过的话题 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index a2dd0defc8..6ce2433c37 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -40,10 +40,7 @@ import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.OrgInfoConstant; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.CommonDataFilterResultDTO; -import com.epmet.dto.result.IssueInitiatorResultDTO; -import com.epmet.dto.result.OrgInfoResultDTO; -import com.epmet.dto.result.UserResiInfoResultDTO; +import com.epmet.dto.result.*; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.modules.constant.GroupMemberConstant; @@ -83,6 +80,8 @@ import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.form.CheckTopicPublisherFormDTO; import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO; import com.epmet.resi.group.dto.topic.result.*; +import com.epmet.resi.group.dto.topic.result.CheckTopicPublisherResultDTO; +import com.epmet.resi.group.dto.topic.result.GovTopicIssueInfoResultDTO; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -1419,25 +1418,22 @@ public class ResiTopicServiceImpl extends BaseServiceImpl listMyTopics(String customerId, String userId, Integer pageNo, Integer pageSize) { + public List listMyCreateTopics(String customerId, String userId, Integer pageNo, Integer pageSize) { PageHelper.startPage(pageNo, pageSize); - List myTopics = resiTopicDao.listMyTopics(userId, customerId); + List myTopics = resiTopicDao.listMyCreateTopics(userId, customerId); HashMap gridIdAndNames = new HashMap<>(); - Set gridIds = myTopics.stream().map(c -> c.getReleaseGridId()).collect(Collectors.toSet()); - - OrgInfoFormDTO form = new OrgInfoFormDTO(); - form.setOrgType(OrgInfoConstant.GRID); - form.setOrgIds(new ArrayList<>(gridIds)); - Result> gridInfoResult = govOrgOpenFeignClient.selectOrgInfo(form); - if (gridInfoResult.success()) { - List grids = gridInfoResult.getData(); - for (OrgInfoResultDTO grid : grids) { - gridIdAndNames.put(grid.getOrgId(), grid.getOrgName()); - } + List gridIds = myTopics.stream().map(c -> c.getReleaseGridId()).collect(Collectors.toList()); + + Result> gridsResult = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + if (gridsResult.success()) { + List grids = gridsResult.getData(); + grids.stream().forEach(g -> gridIdAndNames.put(g.getGridId(), g.getGridName())); + } else { + log.error("【我创建的话题列表】,查询组织-网格名称出错,没有抛出,内部处理。内部消息:{},外部消息:{}", gridsResult.getInternalMsg(), gridsResult.getMsg()); } - for (MyTopicsResultDTO myTopic : myTopics) { + for (MyCreateTopicsResultDTO myTopic : myTopics) { myTopic.setReleaseGridName(gridIdAndNames.get(myTopic.getReleaseGridId())); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index cb4d75b345..04b2bb0e10 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -447,7 +447,7 @@ AND id = #{topicId} - select t.id as topicId, t.topic_content as topicContent, unix_timestamp(t.created_time) as releaseTime, diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyCreateTopicsFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyCreateTopicsFormDTO.java new file mode 100644 index 0000000000..91d04b2379 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyCreateTopicsFormDTO.java @@ -0,0 +1,13 @@ +package com.epmet.resi.mine.dto.from; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class MyCreateTopicsFormDTO { + @NotBlank(message = "客户id不能为空") + private String customerId; + private Integer pageNo = 1; + private Integer pageSize = 10; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyTopicsFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftProjectTopicsFormDTO.java similarity index 61% rename from epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyTopicsFormDTO.java rename to epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftProjectTopicsFormDTO.java index 002250e5b5..1aa779b9af 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/MyTopicsFormDTO.java +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftProjectTopicsFormDTO.java @@ -1,14 +1,14 @@ -package com.epmet.resi.group.dto.topic; +package com.epmet.resi.mine.dto.from; import lombok.Data; @Data -public class MyTopicsFormDTO { +public class MyShiftProjectTopicsFormDTO { private String customerId; - private Integer pageSize = 10; - private Integer pageNo = 1; + private Integer pageSize = 10; + } diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyCreateTopicsResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyCreateTopicsResultDTO.java new file mode 100644 index 0000000000..e79e29e6b2 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyCreateTopicsResultDTO.java @@ -0,0 +1,13 @@ +package com.epmet.resi.mine.dto.result; + +import lombok.Data; + +@Data +public class MyCreateTopicsResultDTO { + private String topicId; + private Long releaseTime; + private String topicContent; + private String releaseGroupName; + private String releaseGridId; + private String releaseGridName; +} diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftProjectTopicsResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftProjectTopicsResultDTO.java new file mode 100644 index 0000000000..c997cc9266 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftProjectTopicsResultDTO.java @@ -0,0 +1,15 @@ +package com.epmet.resi.mine.dto.result; + +import lombok.Data; + +import java.util.List; + +@Data +public class MyShiftProjectTopicsResultDTO { + private String topicId; + private String gridId; + private Long shiftProjectTime; + private List departmentNameList; + private String projectTitle; + private String releaseGridName; +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java index d49c9c3c52..6e79e8f11a 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java @@ -4,9 +4,14 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.modules.person.service.TopicService; import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +import com.epmet.resi.mine.dto.from.MyCreateTopicsFormDTO; +import com.epmet.resi.mine.dto.from.MyShiftProjectTopicsFormDTO; +import com.epmet.resi.mine.dto.result.MyCreateTopicsResultDTO; +import com.epmet.resi.mine.dto.result.MyShiftProjectTopicsResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -28,6 +33,9 @@ public class TopicController { @Autowired private ResiGroupOpenFeignClient groupFeign; + @Autowired + private TopicService topicService; + /** * @Description 个人中心-我参与过的话题 * @param param @@ -41,4 +49,31 @@ public class TopicController { ValidatorUtils.validateEntity(param); return groupFeign.myPartTopics(param); } + + /** + * @Description 查询我的已转项目的话题列表 + * @return + * @author wxz + * @date 2020.11.13 10:13 + */ + @PostMapping("my-shiftproject-topics") + public Result> listMyShiftProjectTopics(@RequestBody MyShiftProjectTopicsFormDTO form, @LoginUser TokenDto tokenDto) { + ValidatorUtils.validateEntity(form); + List topics = topicService.listMyShiftProjectTopics(tokenDto.getUserId(), form.getCustomerId(), form.getPageNo(), form.getPageSize()); + return new Result>().ok(topics); + } + + /** + * @Description 我创建的话题列表 + * @return + * @author wxz + * @date 2020.11.13 15:09 + */ + @PostMapping("my-create-topics") + public Result> listMyCreateTopics(@RequestBody MyCreateTopicsFormDTO form, @LoginUser TokenDto tokenDto) { + ValidatorUtils.validateEntity(form); + List topics = topicService.listMyCreateTopics(form.getCustomerId(), tokenDto.getUserId(), form.getPageNo(), form.getPageSize()); + return new Result>().ok(topics); + } + } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/TopicService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/TopicService.java new file mode 100644 index 0000000000..80fabace7b --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/TopicService.java @@ -0,0 +1,27 @@ +package com.epmet.modules.person.service; + +import com.epmet.resi.mine.dto.result.MyCreateTopicsResultDTO; +import com.epmet.resi.mine.dto.result.MyShiftProjectTopicsResultDTO; + +import java.util.List; + +/** + * 话题service + */ +public interface TopicService { + /** + * @Description 列出我的已转项目的话题列表 + * @return + * @author wxz + * @date 2020.11.13 10:17 + */ + List listMyShiftProjectTopics(String userId, String customerId, Integer pageNo, Integer pageSize); + + /** + * @Description 我创建的话题列表 + * @return + * @author wxz + * @date 2020.11.13 15:00 + */ + List listMyCreateTopics(String customerId, String userId, Integer pageNo, Integer pageSize); +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java new file mode 100644 index 0000000000..8799527751 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.modules.person.service.impl; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ProjectByCreateTopicUserFormDTO; +import com.epmet.dto.result.AllGridsByUserIdResultDTO; +import com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.GovProjectOpenFeignClient; +import com.epmet.modules.person.service.TopicService; +import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +import com.epmet.resi.mine.dto.result.MyCreateTopicsResultDTO; +import com.epmet.resi.mine.dto.result.MyShiftProjectTopicsResultDTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class TopicServiceImpl implements TopicService { + + private static Logger logger = LoggerFactory.getLogger(TopicServiceImpl.class); + + @Autowired + private GovProjectOpenFeignClient govProjectOpenFeignClient; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private ResiGroupOpenFeignClient resiGroupOpenFeignClient; + + @Override + public List listMyShiftProjectTopics(String userId, String customerId, Integer pageNo, Integer pageSize) { + ProjectByCreateTopicUserFormDTO form = new ProjectByCreateTopicUserFormDTO(); + form.setCustomerId(customerId); + form.setUserId(userId); + form.setPageNo(pageNo); + form.setPageSize(pageSize); + Result> result = govProjectOpenFeignClient.listProjectsByCreateTopicUserId(form); + if (!result.success()) { + throw new RenException(result.getCode(), result.getInternalMsg(), result.getMsg()); + } + + List projects = result.getData(); + + List projectTopics = ConvertUtils.sourceToTarget(projects, MyShiftProjectTopicsResultDTO.class); + List gridIds = projects.stream().map(p -> p.getGridId()).collect(Collectors.toList()); + + Result> rst = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + if (!rst.success()) { + logger.error("查询我创建的话题列表(已转议题),根据网格id查询网格名称失败, InternalMsg:{},Msg:{}", rst.getInternalMsg(), rst.getMsg()); + } else { + List gridInfos = rst.getData(); + HashMap gridIdAndNames = new HashMap<>(); + gridInfos.stream().forEach(g -> gridIdAndNames.put(g.getGridId(), g.getGridName())); + projectTopics.stream().forEach(pt -> pt.setReleaseGridName(gridIdAndNames.get(pt.getGridId()))); + } + + return projectTopics; + } + + @Override + public List listMyCreateTopics(String customerId, String userId, Integer pageNo, Integer pageSize) { + MyCreateTopicsFormDTO form = new MyCreateTopicsFormDTO(); + form.setCustomerId(customerId); + form.setUserId(userId); + form.setPageNo(pageNo); + form.setPageSize(pageSize); + Result> result = resiGroupOpenFeignClient.listMyCreateTopics(form); + if (!result.success()) { + throw new RenException(result.getCode(), result.getInternalMsg(), result.getMsg()); + } + List topics = result.getData(); + return ConvertUtils.sourceToTarget(topics, MyCreateTopicsResultDTO.class); + } +} From 19cb6936e7cc8580b49a6d534b388072ebfb99c7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 13 Nov 2020 17:20:02 +0800 Subject: [PATCH 111/125] =?UTF-8?q?=E6=88=91=E5=88=9B=E5=BB=BA=E7=9A=84?= =?UTF-8?q?=E8=AF=9D=E9=A2=98=E8=A2=AB=E8=BD=AC=E6=88=90=E8=AE=AE=E9=A2=98?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/MyShiftIssueTopicsFormDTO.java | 38 ++++++++++++++++ .../result/MyShiftIssueTopicsResultDTO.java | 43 +++++++++++++++++++ .../epmet/feign/GovIssueOpenFeignClient.java | 11 +++++ .../GovIssueOpenFeignClientFallBack.java | 7 +++ .../com/epmet/controller/IssueController.java | 12 ++++++ .../src/main/java/com/epmet/dao/IssueDao.java | 9 ++++ .../java/com/epmet/service/IssueService.java | 10 +++++ .../epmet/service/impl/IssueServiceImpl.java | 34 +++++++++++++++ .../src/main/resources/mapper/IssueDao.xml | 19 ++++++++ .../dto/topic/form/TopicIdListFormDTO.java | 14 ++++++ .../group/feign/ResiGroupOpenFeignClient.java | 10 +++++ .../ResiGroupOpenFeignClientFallback.java | 6 +++ .../topic/controller/ResiTopicController.java | 11 +++++ .../epmet/modules/topic/dao/ResiTopicDao.java | 9 ++++ .../topic/service/ResiTopicService.java | 9 +++- .../service/impl/ResiTopicServiceImpl.java | 11 +++++ .../resources/mapper/topic/ResiTopicDao.xml | 12 ++++++ .../dto/from/MyShiftIssueTopicsFormDTO.java | 38 ++++++++++++++++ .../result/MyShiftIssueTopicsResultDTO.java | 41 ++++++++++++++++++ .../person/controller/TopicController.java | 15 +++++++ .../modules/person/service/TopicService.java | 12 ++++++ .../person/service/impl/TopicServiceImpl.java | 29 +++++++++++++ 22 files changed, 399 insertions(+), 1 deletion(-) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyShiftIssueTopicsFormDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyShiftIssueTopicsResultDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicIdListFormDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftIssueTopicsFormDTO.java create mode 100644 epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftIssueTopicsResultDTO.java diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyShiftIssueTopicsFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyShiftIssueTopicsFormDTO.java new file mode 100644 index 0000000000..3340fc7d91 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyShiftIssueTopicsFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/13 3:30 下午 + */ +@Data +public class MyShiftIssueTopicsFormDTO implements Serializable { + + private static final long serialVersionUID = -3943178729586797400L; + + public interface MyShiftIssueTopics{} + + /** + * 页码 + */ + @NotNull(message = "页码不能为空",groups = {MyShiftIssueTopics.class}) + private Integer pageNo; + + /** + * 每页数量 + */ + @NotNull(message = "每页数量不能为空",groups = {MyShiftIssueTopics.class}) + private Integer pageSize; + + + @NotBlank(message = "客户ID不能为空",groups = {MyShiftIssueTopics.class}) + private String customerId; + + private String userId; + +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyShiftIssueTopicsResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyShiftIssueTopicsResultDTO.java new file mode 100644 index 0000000000..cf4951a35a --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyShiftIssueTopicsResultDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/13 3:31 下午 + */ +@Data +public class MyShiftIssueTopicsResultDTO implements Serializable { + + private static final long serialVersionUID = -703102629653169023L; + + /** + * 话题ID + */ + private String topicId; + + /** + * 转议题时间 + */ + private Long shiftIssueTime; + + /** + * 建议 + */ + private String suggestion; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 话题发表网格名称 + */ + private String releaseGridName; + + private String gridId; + +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 9e01905c9e..f30a67b891 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -8,6 +8,8 @@ import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.MyPubIssuesAuditingResultDTO; import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack; +import com.epmet.resi.mine.dto.from.MyShiftIssueTopicsFormDTO; +import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; @@ -53,4 +55,13 @@ public interface GovIssueOpenFeignClient { **/ @PostMapping(value = "/gov/issue/issue/getmypubissues", consumes = MediaType.APPLICATION_JSON_VALUE) Result> getMyPubIssues(@RequestBody MyPubIssuesAuditingFormDTO formDTO); + + /** + * @Description 个人中心-我发表的话题列表-已转议题列表 + * @Param myShiftIssueTopicsFormDTO + * @author zxc + * @date 2020/11/13 4:58 下午 + */ + @PostMapping("/gov/issue/issue/shiftissuetopic") + Result> myShiftIssueTopics(@RequestBody MyShiftIssueTopicsFormDTO myShiftIssueTopicsFormDTO); } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java index 0a33c50234..8fa91ff4f7 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -9,6 +9,8 @@ import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.MyPubIssuesAuditingResultDTO; import com.epmet.feign.GovIssueOpenFeignClient; +import com.epmet.resi.mine.dto.from.MyShiftIssueTopicsFormDTO; +import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO; import org.springframework.stereotype.Component; import java.util.List; @@ -35,4 +37,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient public Result> getMyPubIssues(MyPubIssuesAuditingFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER,"getMyPubIssues",formDTO); } + + @Override + public Result> myShiftIssueTopics(MyShiftIssueTopicsFormDTO myShiftIssueTopicsFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER,"myShiftIssueTopics",myShiftIssueTopicsFormDTO); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java index 6db4e14b23..f15de6e623 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java @@ -167,5 +167,17 @@ public class IssueController { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(issueService.getMyPubIssues(formDTO)); } + + /** + * @Description 个人中心-我发表的话题列表-已转议题列表 + * @Param myShiftIssueTopicsFormDTO + * @author zxc + * @date 2020/11/13 4:58 下午 + */ + @PostMapping("shiftissuetopic") + public Result> myShiftIssueTopics(@RequestBody MyShiftIssueTopicsFormDTO myShiftIssueTopicsFormDTO){ + ValidatorUtils.validateEntity(myShiftIssueTopicsFormDTO, MyShiftIssueTopicsFormDTO.MyShiftIssueTopics.class); + return new Result>().ok(issueService.myShiftIssueTopics(myShiftIssueTopicsFormDTO)); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java index f396db4136..a39266ee76 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java @@ -167,4 +167,13 @@ public interface IssueDao extends BaseDao { @Param("pageSize") Integer pageSize, @Param("userId") String userId, @Param("issueStatus") String issueStatus); + + /** + * @Description 个人中心-我发表的话题列表-已转议题列表 + * @Param tokenDto + * @Param myShiftIssueTopicsResultDTO + * @author zxc + * @date 2020/11/13 3:42 下午 + */ + List myShiftIssueTopics(@Param("topicIds") List topicIds,@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index 404549f119..ea8a572ef5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java @@ -235,4 +235,14 @@ public interface IssueService extends BaseService { * @Date 2020/11/11 14:57 **/ List getMyPubIssues(MyPubIssuesAuditingFormDTO formDTO); + + /** + * @Description 个人中心-我发表的话题列表-已转议题列表 + * @Param tokenDto + * @Param myShiftIssueTopicsResultDTO + * @author zxc + * @date 2020/11/13 3:42 下午 + */ + List myShiftIssueTopics(MyShiftIssueTopicsFormDTO myShiftIssueTopicsFormDTO); + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 54fdfd4908..6a7f5bd0c2 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -39,6 +39,7 @@ import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.GovTopicIssueInfoFormDTO; +import com.epmet.resi.group.dto.topic.form.TopicIdListFormDTO; import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO; import com.epmet.resi.group.dto.topic.result.GovTopicIssueInfoResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; @@ -893,4 +894,37 @@ public class IssueServiceImpl extends BaseServiceImpl imp return baseDao.selectMyPubIssues(formDTO.getPageNo(),formDTO.getPageSize(),formDTO.getUserId(),formDTO.getIssueStatus()); } + /** + * @Description 个人中心-我发表的话题列表-已转议题列表 + * @Param tokenDto + * @Param myShiftIssueTopicsResultDTO + * @author zxc + * @date 2020/11/13 3:42 下午 + */ + @Override + public List myShiftIssueTopics(MyShiftIssueTopicsFormDTO form) { + TopicIdListFormDTO formDTO = new TopicIdListFormDTO(); + formDTO.setUserId(form.getUserId()); + Result> listResult = resiGroupOpenFeignClient.selectMyCreateTopic(formDTO); + if (!listResult.success()){ + throw new RenException("查询我创建的话题失败......"); + } + if(CollectionUtils.isEmpty(listResult.getData())){ + logger.error("查询我创建的话题集合为空"); + return new ArrayList<>(); + } + List topicIds = listResult.getData(); + PageInfo resultPage = PageHelper.startPage(form.getPageNo(), form.getPageSize()).doSelectPageInfo(() -> baseDao.myShiftIssueTopics(topicIds, form.getCustomerId())); + if (CollectionUtils.isEmpty(resultPage.getList())){ + return new ArrayList<>(); + } + List result = resultPage.getList(); + Result> gridListByGridIds = govOrgOpenFeignClient.getGridListByGridIds(result.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + if (!gridListByGridIds.success()){ + throw new RenException("查询话题所属网格名称失败......"); + } + result.forEach(r -> gridListByGridIds.getData().stream().filter(f -> r.getGridId().equals(f.getGridId())).forEach(f -> r.setReleaseGridName(f.getGridName()))); + return result; + } + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index b68ac683ed..3ac7bf2bc5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -421,4 +421,23 @@ LIMIT #{pageNo}, #{pageSize} + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicIdListFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicIdListFormDTO.java new file mode 100644 index 0000000000..9ee2ddce8c --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicIdListFormDTO.java @@ -0,0 +1,14 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2020/11/13 4:27 下午 + */ +@Data +public class TopicIdListFormDTO{ + + private String userId; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 4355adc40f..ba705a5893 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -6,6 +6,7 @@ import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; +import com.epmet.resi.group.dto.topic.form.TopicIdListFormDTO; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.group.dto.topic.result.MyCreateTopicsResultDTO; import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; @@ -61,4 +62,13 @@ public interface ResiGroupOpenFeignClient { */ @PostMapping("resi/group/topic/my-create-topics") Result> listMyCreateTopics(@RequestBody MyCreateTopicsFormDTO formDTO); + + /** + * @Description 查询我创建的话题 + * @Param topicIdListFormDTO + * @author zxc + * @date 2020/11/13 4:32 下午 + */ + @PostMapping("resi/group/topic/select-my-create-topic") + Result> selectMyCreateTopic(@RequestBody TopicIdListFormDTO topicIdListFormDTO); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index cf9833816f..636acafb0e 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -7,6 +7,7 @@ import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; +import com.epmet.resi.group.dto.topic.form.TopicIdListFormDTO; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; @@ -43,4 +44,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien public Result listMyCreateTopics(MyCreateTopicsFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listMyTopics", formDTO); } + + @Override + public Result> selectMyCreateTopic(TopicIdListFormDTO topicIdListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectMyCreateTopic", topicIdListFormDTO); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index 6dfc1a834f..4c7d08ba93 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -285,5 +285,16 @@ public class ResiTopicController { return new Result>().ok(topicService.getParticipatedTopics(param)); } + /** + * @Description 查询我创建的话题 + * @Param topicIdListFormDTO + * @author zxc + * @date 2020/11/13 4:32 下午 + */ + @PostMapping("select-my-create-topic") + public Result> selectMyCreateTopic(@RequestBody TopicIdListFormDTO topicIdListFormDTO){ + return new Result>().ok(topicService.selectMyCreateTopic(topicIdListFormDTO)); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java index c1423b36dd..701661cac4 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java @@ -24,6 +24,7 @@ import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.TopicInfoDTO; import com.epmet.resi.group.dto.topic.form.CheckTopicPublisherFormDTO; import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO; +import com.epmet.resi.group.dto.topic.form.TopicIdListFormDTO; import com.epmet.resi.group.dto.topic.result.*; import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO; import org.apache.ibatis.annotations.Mapper; @@ -170,4 +171,12 @@ public interface ResiTopicDao extends BaseDao { * @date 2020.11.11 23:08 */ List selectParticipatedTopics(@Param("customerId") String customerId,@Param("userId") String userId); + + /** + * @Description 查询我创建的话题 + * @Param topicIdListFormDTO + * @author zxc + * @date 2020/11/13 4:32 下午 + */ + List selectMyCreateTopic(TopicIdListFormDTO topicIdListFormDTO); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index 35ea013b11..dbd533439e 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -30,7 +30,6 @@ import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.TopicInfoDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.*; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -280,4 +279,12 @@ public interface ResiTopicService extends BaseService { * @date 2020.11.11 23:20 */ List getParticipatedTopics(CustomerPageFormDTO param); + + /** + * @Description 查询我创建的话题 + * @Param topicIdListFormDTO + * @author zxc + * @date 2020/11/13 4:32 下午 + */ + List selectMyCreateTopic(TopicIdListFormDTO topicIdListFormDTO); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 6ce2433c37..a589c6e42a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -1465,6 +1465,17 @@ public class ResiTopicServiceImpl extends BaseServiceImpl selectMyCreateTopic(TopicIdListFormDTO topicIdListFormDTO) { + return baseDao.selectMyCreateTopic(topicIdListFormDTO); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index 04b2bb0e10..db2d2f5fdb 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -495,5 +495,17 @@ AND topic.created_by ]]> #{userId} ORDER BY topic.created_time desc + + + diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftIssueTopicsFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftIssueTopicsFormDTO.java new file mode 100644 index 0000000000..e4667c1ca7 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftIssueTopicsFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.resi.mine.dto.from; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/13 3:30 下午 + */ +@Data +public class MyShiftIssueTopicsFormDTO implements Serializable { + + private static final long serialVersionUID = -3943178729586797400L; + + public interface MyShiftIssueTopics{} + + /** + * 页码 + */ + @NotNull(message = "页码不能为空",groups = {MyShiftIssueTopics.class}) + private Integer pageNo; + + /** + * 每页数量 + */ + @NotNull(message = "每页数量不能为空",groups = {MyShiftIssueTopics.class}) + private Integer pageSize; + + + @NotBlank(message = "客户ID不能为空",groups = {MyShiftIssueTopics.class}) + private String customerId; + + private String userId; + +} diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftIssueTopicsResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftIssueTopicsResultDTO.java new file mode 100644 index 0000000000..933cfc2967 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftIssueTopicsResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.resi.mine.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/13 3:31 下午 + */ +@Data +public class MyShiftIssueTopicsResultDTO implements Serializable { + + private static final long serialVersionUID = -703102629653169023L; + + /** + * 话题ID + */ + private String topicId; + + /** + * 转议题时间 + */ + private Long shiftIssueTime; + + /** + * 建议 + */ + private String suggestion; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 话题发表网格名称 + */ + private String releaseGridName; + +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java index 6e79e8f11a..8ffdbeb5ea 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java @@ -9,8 +9,10 @@ import com.epmet.resi.group.dto.topic.form.CustomerPageFormDTO; import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.resi.mine.dto.from.MyCreateTopicsFormDTO; +import com.epmet.resi.mine.dto.from.MyShiftIssueTopicsFormDTO; import com.epmet.resi.mine.dto.from.MyShiftProjectTopicsFormDTO; import com.epmet.resi.mine.dto.result.MyCreateTopicsResultDTO; +import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO; import com.epmet.resi.mine.dto.result.MyShiftProjectTopicsResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -76,4 +78,17 @@ public class TopicController { return new Result>().ok(topics); } + /** + * @Description 个人中心-我发表的话题列表-已转议题列表 + * @Param tokenDto + * @Param myShiftIssueTopicsFormDTO + * @author zxc + * @date 2020/11/13 3:42 下午 + */ + @PostMapping("my-shiftissue-topics") + public Result> myShiftIssueTopics(@LoginUser TokenDto tokenDto, @RequestBody MyShiftIssueTopicsFormDTO myShiftIssueTopicsFormDTO){ + ValidatorUtils.validateEntity(myShiftIssueTopicsFormDTO, MyShiftIssueTopicsFormDTO.MyShiftIssueTopics.class); + return new Result>().ok(topicService.myShiftIssueTopics(tokenDto,myShiftIssueTopicsFormDTO)); + } + } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/TopicService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/TopicService.java index 80fabace7b..1f920dc64b 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/TopicService.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/TopicService.java @@ -1,6 +1,9 @@ package com.epmet.modules.person.service; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.resi.mine.dto.from.MyShiftIssueTopicsFormDTO; import com.epmet.resi.mine.dto.result.MyCreateTopicsResultDTO; +import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO; import com.epmet.resi.mine.dto.result.MyShiftProjectTopicsResultDTO; import java.util.List; @@ -24,4 +27,13 @@ public interface TopicService { * @date 2020.11.13 15:00 */ List listMyCreateTopics(String customerId, String userId, Integer pageNo, Integer pageSize); + + /** + * @Description 个人中心-我发表的话题列表-已转议题列表 + * @Param tokenDto + * @Param myShiftIssueTopicsResultDTO + * @author zxc + * @date 2020/11/13 3:42 下午 + */ + List myShiftIssueTopics(TokenDto tokenDto, MyShiftIssueTopicsFormDTO myShiftIssueTopicsFormDTO); } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java index 8799527751..fbedfd388c 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java @@ -1,23 +1,29 @@ package com.epmet.modules.person.service.impl; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.ProjectByCreateTopicUserFormDTO; import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO; +import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.modules.person.service.TopicService; import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +import com.epmet.resi.mine.dto.from.MyShiftIssueTopicsFormDTO; import com.epmet.resi.mine.dto.result.MyCreateTopicsResultDTO; +import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO; import com.epmet.resi.mine.dto.result.MyShiftProjectTopicsResultDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -36,6 +42,9 @@ public class TopicServiceImpl implements TopicService { @Autowired private ResiGroupOpenFeignClient resiGroupOpenFeignClient; + @Autowired + private GovIssueOpenFeignClient govIssueOpenFeignClient; + @Override public List listMyShiftProjectTopics(String userId, String customerId, Integer pageNo, Integer pageSize) { ProjectByCreateTopicUserFormDTO form = new ProjectByCreateTopicUserFormDTO(); @@ -80,4 +89,24 @@ public class TopicServiceImpl implements TopicService { List topics = result.getData(); return ConvertUtils.sourceToTarget(topics, MyCreateTopicsResultDTO.class); } + + /** + * @Description 个人中心-我发表的话题列表-已转议题列表 + * @Param tokenDto + * @Param myShiftIssueTopicsResultDTO + * @author zxc + * @date 2020/11/13 3:42 下午 + */ + @Override + public List myShiftIssueTopics(TokenDto tokenDto, MyShiftIssueTopicsFormDTO myShiftIssueTopicsFormDTO) { + myShiftIssueTopicsFormDTO.setUserId(tokenDto.getUserId()); + Result> listResult = govIssueOpenFeignClient.myShiftIssueTopics(myShiftIssueTopicsFormDTO); + if (!listResult.success()){ + throw new RenException("查询我发表的话题列表-已转议题列表失败......"); + } + if (CollectionUtils.isEmpty(listResult.getData())){ + return new ArrayList<>(); + } + return listResult.getData(); + } } From 90f93ba05073a176b6c1789d593c2564e13e7a59 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 13 Nov 2020 17:27:23 +0800 Subject: [PATCH 112/125] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=80=E5=B1=9E?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=90=8D=E7=A7=B0=20=E6=88=91=E5=8F=82?= =?UTF-8?q?=E4=B8=8E=E7=9A=84=E8=AE=AE=E9=A2=98=EF=BC=8C=E6=88=91=E5=8F=91?= =?UTF-8?q?=E8=B5=B7=E7=9A=84=E8=AE=AE=E9=A2=98=E8=A1=A8=E5=86=B3=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/IssueServiceImpl.java | 4 ++-- .../service/impl/IssueVoteStatisticalServiceImpl.java | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 6a7f5bd0c2..2d071344c4 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -865,11 +865,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp PageInfo result = PageHelper.startPage(form.getPageNo(),form.getPageSize()).doSelectPageInfo(() -> baseDao.myPubIssuesAuditing(form.getUserId())); if (!CollectionUtils.isEmpty(result.getList())){ list = result.getList(); - Result> gridNameList = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.GRID, list.stream().map(m -> m.getGridId()).collect(Collectors.toList()))); + Result> gridNameList = govOrgOpenFeignClient.getGridListByGridIds(list.stream().map(m -> m.getGridId()).collect(Collectors.toList())); if (!gridNameList.success()){ throw new RenException("查询议题来源网格名称失败......"); } - list.forEach(l -> gridNameList.getData().stream().filter(o -> l.getGridId().equals(o.getOrgId())).forEach(o -> l.setTopicReleaseGridName(o.getOrgName()))); + list.forEach(l -> gridNameList.getData().stream().filter(o -> l.getGridId().equals(o.getGridId())).forEach(o -> l.setTopicReleaseGridName(o.getGridName()))); Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(list.stream().map(m -> m.getTopicId()).collect(Collectors.toList()))); if (!groupNameList.success()){ throw new RenException("查询议题来源小组名称失败......"); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index e79808657c..7f678ba465 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -549,14 +549,11 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl(); } List orgIds = myPartIssuesResult.stream().map(m -> m.getGridId()).collect(Collectors.toList()); - OrgInfoFormDTO form = new OrgInfoFormDTO(); - form.setOrgIds(orgIds); - form.setOrgType(IssueConstant.GRID); - Result> listResult = govOrgOpenFeignClient.selectOrgInfo(form); + Result> listResult = govOrgOpenFeignClient.getGridListByGridIds(orgIds); if (!listResult.success()){ throw new RenException("查询议题来源网格名称失败......"); } - myPartIssuesResult.forEach(m -> listResult.getData().stream().filter(l -> m.getGridId().equals(l.getOrgId())).forEach(l -> m.setTopicReleaseGridName(l.getOrgName()))); + myPartIssuesResult.forEach(m -> listResult.getData().stream().filter(l -> m.getGridId().equals(l.getGridId())).forEach(l -> m.setTopicReleaseGridName(l.getGridName()))); return myPartIssuesResult; } From a3ff8aea25742b55214ca9dd5ca7c749ebf43aa6 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 13 Nov 2020 17:57:18 +0800 Subject: [PATCH 113/125] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83-=E6=88=91=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=9A=84=E8=AF=9D=E9=A2=98(=E5=B7=B2=E8=BD=AC=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE)=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-project-server/src/main/resources/mapper/ProjectDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index 8ef38d198a..61585d7407 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -241,6 +241,7 @@ and p.CUSTOMER_ID=#{customerId} and p.DEL_FLAG=0 and SOURCE_TYPE = 'topic' + order by p.CREATED_TIME desc \ No newline at end of file From 683dc95e9135f48f2cd5610bd6d486900c2e4593 Mon Sep 17 00:00:00 2001 From: wxz Date: Sat, 14 Nov 2020 13:43:58 +0800 Subject: [PATCH 114/125] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=96=B0=E7=9A=84=E5=BC=82=E5=B8=B8=E6=8A=9B=E5=87=BA?= =?UTF-8?q?=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/person/service/impl/TopicServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java index fbedfd388c..fe816108c1 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java @@ -54,7 +54,7 @@ public class TopicServiceImpl implements TopicService { form.setPageSize(pageSize); Result> result = govProjectOpenFeignClient.listProjectsByCreateTopicUserId(form); if (!result.success()) { - throw new RenException(result.getCode(), result.getInternalMsg(), result.getMsg()); + throw new RenException(result.getCode(), result.getInternalMsg(), result.getMsg(), RenException.MessageMode.CODE_INTERNAL_EXTERNAL); } List projects = result.getData(); @@ -84,7 +84,7 @@ public class TopicServiceImpl implements TopicService { form.setPageSize(pageSize); Result> result = resiGroupOpenFeignClient.listMyCreateTopics(form); if (!result.success()) { - throw new RenException(result.getCode(), result.getInternalMsg(), result.getMsg()); + throw new RenException(result.getCode(), result.getInternalMsg(), result.getMsg(), RenException.MessageMode.CODE_INTERNAL_EXTERNAL); } List topics = result.getData(); return ConvertUtils.sourceToTarget(topics, MyCreateTopicsResultDTO.class); From ce64aba21fdd713101090006fe752a1f8621c3df Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 16 Nov 2020 09:26:46 +0800 Subject: [PATCH 115/125] =?UTF-8?q?=E6=88=91=E5=8F=91=E8=B5=B7=E7=9A=84?= =?UTF-8?q?=E8=AE=AE=E9=A2=98-=E5=B7=B2=E8=BD=AC=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E8=BF=94=E5=8F=82issueId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/MyPubIssuesShiftProjectResultDTO.java | 2 ++ .../person/service/impl/IssueServiceImpl.java | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java index 200a09e24e..8397d64b69 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java @@ -43,4 +43,6 @@ public class MyPubIssuesShiftProjectResultDTO implements Serializable { * 话题发表于哪个组 */ private String topicReleaseGroupName; + + private String issueId; } diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java index 8f321cceb9..8ad4c79d59 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -5,12 +5,10 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.IssueOpenConstant; -import com.epmet.constant.OrgInfoConstant; import com.epmet.dto.IssueDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.MyPartIssuesFormDTO; import com.epmet.dto.form.MyPubIssuesAuditingFormDTO; -import com.epmet.dto.form.OrgInfoFormDTO; import com.epmet.dto.result.*; import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; @@ -166,14 +164,16 @@ public class IssueServiceImpl implements IssueService { //议题来源话题id集合 List topicIds=new ArrayList<>(); List projectIds=new ArrayList<>(); + List gridIds=new ArrayList<>(); issueResult.getData().forEach(issueDTO ->{ if(IssueOpenConstant.SOURCE_TYPE_RT.equals(issueDTO.getSourceType())&& StringUtils.isNotBlank(issueDTO.getSourceId())){ topicIds.add(issueDTO.getSourceId()); projectIds.add(issueDTO.getProjectId()); + gridIds.add(issueDTO.getGridId()); } } ); //查询网格名称 - Result> gridNameList = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.GRID, issueResult.getData().stream().map(m -> m.getGridId()).collect(Collectors.toList()))); + Result> gridNameList = govOrgOpenFeignClient.getGridListByGridIds(gridIds); if (!gridNameList.success()){ logger.error("查询议题来源网格名称失败......"); } @@ -190,8 +190,9 @@ public class IssueServiceImpl implements IssueService { List list=new ArrayList<>(); for(IssueDTO issueDTO:issueResult.getData()){ MyPubIssuesShiftProjectResultDTO resultDTO=new MyPubIssuesShiftProjectResultDTO(); + resultDTO.setIssueId(issueDTO.getId()); resultDTO.setProjectId(issueDTO.getProjectId()); - gridNameList.getData().stream().filter(o -> issueDTO.getGridId().equals(o.getOrgId())).forEach(o -> resultDTO.setTopicReleaseGridName(o.getOrgName())); + gridNameList.getData().stream().filter(o -> issueDTO.getGridId().equals(o.getGridId())).forEach(o -> resultDTO.setTopicReleaseGridName(o.getGridName())); groupNameList.getData().stream().filter(g -> issueDTO.getSourceId().equals(g.getTopicId())).forEach(g -> resultDTO.setTopicReleaseGroupName(g.getTopicGroupName())); resultDTO.setShiftProjectTime(issueDTO.getShiftedTimeStamp()); @@ -220,13 +221,15 @@ public class IssueServiceImpl implements IssueService { } //议题来源话题id集合 List topicIds=new ArrayList<>(); + List gridIds=new ArrayList<>(); issueResult.getData().forEach(issueDTO ->{ if(IssueOpenConstant.SOURCE_TYPE_RT.equals(issueDTO.getSourceType())&& StringUtils.isNotBlank(issueDTO.getSourceId())){ topicIds.add(issueDTO.getSourceId()); + gridIds.add(issueDTO.getGridId()); } } ); //查询网格名称 - Result> gridNameList = govOrgOpenFeignClient.selectOrgInfo(new OrgInfoFormDTO(OrgInfoConstant.GRID, issueResult.getData().stream().map(m -> m.getGridId()).collect(Collectors.toList()))); + Result> gridNameList = govOrgOpenFeignClient.getGridListByGridIds(gridIds); if (!gridNameList.success()){ logger.error("查询议题来源网格名称失败......"); } @@ -242,7 +245,7 @@ public class IssueServiceImpl implements IssueService { resultDTO.setIssueTitle(issueDTO.getIssueTitle()); resultDTO.setSuggestion(issueDTO.getSuggestion()); resultDTO.setClosedTime(issueDTO.getClosedTimeStamp()); - gridNameList.getData().stream().filter(o -> issueDTO.getGridId().equals(o.getOrgId())).forEach(o -> resultDTO.setTopicReleaseGridName(o.getOrgName())); + gridNameList.getData().stream().filter(o -> issueDTO.getGridId().equals(o.getGridId())).forEach(o -> resultDTO.setTopicReleaseGridName(o.getGridName())); groupNameList.getData().stream().filter(g -> issueDTO.getSourceId().equals(g.getTopicId())).forEach(g -> resultDTO.setTopicReleaseGroupName(g.getTopicGroupName())); resultDTOList.add(resultDTO); } From f6b6e86921704c68dcc7deef3b7c57a1193e00ed Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 16 Nov 2020 09:30:36 +0800 Subject: [PATCH 116/125] =?UTF-8?q?log=E7=BA=A7=E5=88=AB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/IssueServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 2d071344c4..94e8afc4cc 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -910,7 +910,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp throw new RenException("查询我创建的话题失败......"); } if(CollectionUtils.isEmpty(listResult.getData())){ - logger.error("查询我创建的话题集合为空"); + logger.debug("查询我创建的话题集合为空"); return new ArrayList<>(); } List topicIds = listResult.getData(); From 045706d25eb6ed0f7fcf963521602153e06856ff Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 16 Nov 2020 10:16:00 +0800 Subject: [PATCH 117/125] =?UTF-8?q?=E6=B7=BB=E5=8A=A0issueID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/MyShiftIssueTopicsResultDTO.java | 7 +++++++ .../src/main/resources/mapper/IssueDao.xml | 1 + 2 files changed, 8 insertions(+) diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyShiftIssueTopicsResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyShiftIssueTopicsResultDTO.java index cf4951a35a..6595c75f86 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyShiftIssueTopicsResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyShiftIssueTopicsResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -38,6 +39,12 @@ public class MyShiftIssueTopicsResultDTO implements Serializable { */ private String releaseGridName; + /** + * 议题ID + */ + private String issueId; + + @JsonIgnore private String gridId; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 3ac7bf2bc5..21a7eddace 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -425,6 +425,7 @@ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyCreateTopicsResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyCreateTopicsResultDTO.java index c96aa8e99e..d5dc12d887 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyCreateTopicsResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyCreateTopicsResultDTO.java @@ -6,6 +6,7 @@ import lombok.Data; public class MyCreateTopicsResultDTO { private String topicId; + private String groupId; private Long releaseTime; private String topicContent; private String releaseGroupName; diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index db2d2f5fdb..ec3a974876 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -452,7 +452,8 @@ t.topic_content as topicContent, unix_timestamp(t.created_time) as releaseTime, g.GROUP_NAME as releaseGroupName, - g.GRID_ID as releaseGridId + g.GRID_ID as releaseGridId, + t.GROUP_ID as groupId from resi_topic t inner join resi_group g on (t.GROUP_ID = g.ID and g.CUSTOMER_ID = #{customerId}) where t.CREATED_BY = #{userId} diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyCreateTopicsResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyCreateTopicsResultDTO.java index e79e29e6b2..0be06a0eed 100644 --- a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyCreateTopicsResultDTO.java +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyCreateTopicsResultDTO.java @@ -5,6 +5,7 @@ import lombok.Data; @Data public class MyCreateTopicsResultDTO { private String topicId; + private String groupId; private Long releaseTime; private String topicContent; private String releaseGroupName; diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftProjectTopicsResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftProjectTopicsResultDTO.java index c997cc9266..af2e1b80e7 100644 --- a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftProjectTopicsResultDTO.java +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftProjectTopicsResultDTO.java @@ -8,6 +8,7 @@ import java.util.List; public class MyShiftProjectTopicsResultDTO { private String topicId; private String gridId; + private String issueId; private Long shiftProjectTime; private List departmentNameList; private String projectTitle; From 2f9dcb47972b6259fb844dc129b2db7313c06df8 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 16 Nov 2020 13:39:09 +0800 Subject: [PATCH 119/125] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=20?= =?UTF-8?q?=E6=88=91=E5=8F=82=E4=B8=8E=E7=9A=84=E8=AF=9D=E9=A2=98=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=84Id=E8=BF=94=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/DemoController.java | 9 --------- .../dto/topic/result/ParticipatedTopicUnitResultDTO.java | 2 ++ .../src/main/resources/mapper/topic/ResiTopicDao.xml | 4 ++-- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 37d715980c..a22a573819 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -740,13 +740,4 @@ public class DemoController { log.info("影响行数="+updateNum); return new Result(); } - - @Autowired - private ScreenGrassrootsGovernDataAbsorptionService wc; - - @PostMapping("wc") - public Result wc(@RequestBody ScreenCentralZoneDataFormDTO param){ - wc.difficultyDataHub(param); - return new Result(); - } } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java index d5c9f9bc24..2011d24943 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ParticipatedTopicUnitResultDTO.java @@ -16,6 +16,8 @@ public class ParticipatedTopicUnitResultDTO implements Serializable { private String topicId; + private String groupId; + private String topicReleaseGridName; private String topicContent; diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index ec3a974876..5f68af2e92 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -482,8 +482,8 @@ topic.topic_content, UNIX_TIMESTAMP(topic.created_time) AS releaseTime, groupp.group_name AS topicReleaseGroupName, - groupp.grid_id AS topicReleaseGridName - + groupp.grid_id AS topicReleaseGridName, + topic.GROUP_ID FROM resi_topic topic LEFT JOIN resi_group groupp ON topic.group_id = groupp.ID AND groupp.del_flag = '0' AND groupp.customer_id = #{customerId} WHERE From 794f8b2ee48c2e1d496a0d49a8d5747e1ee12d0e Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 16 Nov 2020 14:24:17 +0800 Subject: [PATCH 120/125] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E8=AF=9D=E9=A2=98?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=20=E5=BE=BD=E7=AB=A0=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E5=85=88=E6=9F=A5=E7=BC=93=E5=AD=98=20=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=86=8D=E8=B0=83=E7=94=A8user=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResiTopicServiceImpl.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index a589c6e42a..6816c22412 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -650,10 +650,10 @@ public class ResiTopicServiceImpl extends BaseServiceImpl userId = new LinkedList<>();userId.add(topicDetail.getCreatedBy()); + String customerId; + ResiGroupInfoRedisDTO groupCache = resiGroupRedis.get(topicDetail.getGroupId()); + if(null == groupCache || StringUtils.isBlank(groupCache.getCustomerId())){ + ResiGroupEntity groupEntity = resiGroupDao.selectById(topicDetail.getGroupId()); + if(null == groupEntity || StringUtils.isBlank(groupEntity.getCustomerId())){ + log.error("com.epmet.modules.topic.service.impl.ResiTopicServiceImpl.getTopicDetail,获取不到组信息,话题Id:{}小组Id:{}",topicId,topicDetail.getGroupId()); + throw new RenException(ModuleConstant.NO_SUCH_GROUP); + }else customerId = groupEntity.getCustomerId(); + }else customerId = groupCache.getCustomerId(); + Result>> badgeR - = userOpenFeignClient.userShowBadge(new UserGroupFormDTO(group.getCustomerId(), userId)); + = userOpenFeignClient.userShowBadge(new UserGroupFormDTO(customerId, userId)); + if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){ resultDTO.setBadgeList( CollectionUtils.isEmpty(badgeR.getData().get(topicDetail.getCreatedBy())) ? From 8705824e0ca6eabf43563dfad567098e5091e5af Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 16 Nov 2020 15:37:10 +0800 Subject: [PATCH 121/125] =?UTF-8?q?=E7=BD=91=E6=A0=BCid=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/person/service/impl/IssueServiceImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java index fb03179a0d..c5f6e6757d 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -28,7 +28,9 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; /** @@ -167,7 +169,7 @@ public class IssueServiceImpl implements IssueService { //议题来源话题id集合 List topicIds=new ArrayList<>(); List projectIds=new ArrayList<>(); - List gridIds=new ArrayList<>(); + Set gridIds=new HashSet<>(); issueResult.getData().forEach(issueDTO ->{ if(IssueOpenConstant.SOURCE_TYPE_RT.equals(issueDTO.getSourceType())&& StringUtils.isNotBlank(issueDTO.getSourceId())){ topicIds.add(issueDTO.getSourceId()); @@ -176,7 +178,7 @@ public class IssueServiceImpl implements IssueService { } } ); //查询网格名称 - Result> gridNameList = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + Result> gridNameList = govOrgOpenFeignClient.getGridListByGridIds(new ArrayList<>(gridIds)); if (!gridNameList.success()){ logger.error("查询议题来源网格名称失败......"); } @@ -224,7 +226,7 @@ public class IssueServiceImpl implements IssueService { } //议题来源话题id集合 List topicIds=new ArrayList<>(); - List gridIds=new ArrayList<>(); + Set gridIds=new HashSet<>(); issueResult.getData().forEach(issueDTO ->{ if(IssueOpenConstant.SOURCE_TYPE_RT.equals(issueDTO.getSourceType())&& StringUtils.isNotBlank(issueDTO.getSourceId())){ topicIds.add(issueDTO.getSourceId()); @@ -232,7 +234,7 @@ public class IssueServiceImpl implements IssueService { } } ); //查询网格名称 - Result> gridNameList = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + Result> gridNameList = govOrgOpenFeignClient.getGridListByGridIds(new ArrayList<>(gridIds)); if (!gridNameList.success()){ logger.error("查询议题来源网格名称失败......"); } From 7193932aa0fab1b24d0894c2879c17fd01e4628f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 16 Nov 2020 15:42:27 +0800 Subject: [PATCH 122/125] =?UTF-8?q?=E6=B7=BB=E5=8A=A0issueID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/resi/mine/dto/result/MyShiftIssueTopicsResultDTO.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftIssueTopicsResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftIssueTopicsResultDTO.java index 933cfc2967..b5dcb73645 100644 --- a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftIssueTopicsResultDTO.java +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftIssueTopicsResultDTO.java @@ -38,4 +38,6 @@ public class MyShiftIssueTopicsResultDTO implements Serializable { */ private String releaseGridName; + private String issueId; + } From b1ac7b1fde0338c773d7e76a12185486c562238f Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 17 Nov 2020 14:06:54 +0800 Subject: [PATCH 123/125] =?UTF-8?q?=E6=88=91=E5=8F=82=E4=B8=8E=E7=9A=84?= =?UTF-8?q?=E8=AF=9D=E9=A2=98=EF=BC=8C=E7=BD=91=E6=A0=BC=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/topic/service/impl/ResiTopicServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 6816c22412..dbdfc2f200 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -1471,7 +1471,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl gridR.getData().stream() .filter(grid -> StringUtils.equals(grid.getOrgId(),topic.getTopicReleaseGridName())).map(orgInfo -> { - topic.setTopicReleaseGridName(orgInfo.getOrgId()); + topic.setTopicReleaseGridName(orgInfo.getOrgName()); return topic; })).collect(Collectors.toList()); } return Collections.EMPTY_LIST; From 4e029a3c4ff23e5b05cc91cdfab4f4227ccc5710 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 18 Nov 2020 17:01:04 +0800 Subject: [PATCH 124/125] =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/ApplicationDetailFormDTO.java | 24 +++++ .../dto/form/ApplicationHistoryFormDTO.java | 24 +++++ .../dto/form/ApplicationListFormDTO.java | 43 +++++++++ .../result/ApplicationDetailResultDTO.java | 54 ++++++++++++ .../result/ApplicationHistoryResultDTO.java | 41 +++++++++ .../dto/result/ApplicationListResultDTO.java | 48 ++++++++++ .../epmet/dto/result/TopicInfoResultDTO.java | 50 +++++++++++ .../epmet/feign/GovIssueOpenFeignClient.java | 42 +++++++++ .../GovIssueOpenFeignClientFallBack.java | 23 +++++ .../IssueApplicationController.java | 39 +++++++++ .../com/epmet/dao/IssueApplicationDao.java | 11 +++ .../service/IssueApplicationService.java | 30 +++++++ .../impl/IssueApplicationServiceImpl.java | 40 +++++++++ .../resources/mapper/IssueApplicationDao.xml | 11 +++ .../ApplicationDetailCopyResultDTO.java | 48 ++++++++++ .../result/ApplicationDetailResultDTO.java | 8 ++ .../dto/group/result/TopicInfoResultDTO.java | 5 ++ .../controller/GroupIssueController.java | 12 ++- .../epmet/modules/group/dao/ResiGroupDao.java | 8 ++ .../group/service/GroupIssueService.java | 6 +- .../service/impl/GroupIssueServiceImpl.java | 87 ++++++++++++++++++- .../resources/mapper/group/ResiGroupDao.xml | 25 ++++++ 22 files changed, 672 insertions(+), 7 deletions(-) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationDetailFormDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationHistoryFormDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationListFormDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationDetailResultDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationHistoryResultDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationListResultDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/TopicInfoResultDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplicationDetailCopyResultDTO.java diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationDetailFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationDetailFormDTO.java new file mode 100644 index 0000000000..3cc1942473 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationDetailFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/17 10:10 上午 + */ +@Data +public class ApplicationDetailFormDTO implements Serializable { + + private static final long serialVersionUID = -1123940740606412101L; + + public interface ApplicationDetail{} + + /** + * 申请详情,在列表接口返参里有 + */ + @NotBlank(message = "issueApplicationId不能为空",groups = {ApplicationDetail.class}) + private String issueApplicationId; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationHistoryFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationHistoryFormDTO.java new file mode 100644 index 0000000000..bfdf5bdced --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationHistoryFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/17 10:10 上午 + */ +@Data +public class ApplicationHistoryFormDTO implements Serializable { + + private static final long serialVersionUID = -1123940740606412101L; + + public interface ApplicationHistory{} + + /** + * 申请详情,在列表接口返参里有 + */ + @NotBlank(message = "issueApplicationId不能为空",groups = {ApplicationHistory.class}) + private String issueApplicationId; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationListFormDTO.java new file mode 100644 index 0000000000..e26b2645b7 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ApplicationListFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/17 10:26 上午 + */ +@Data +public class ApplicationListFormDTO implements Serializable { + + private static final long serialVersionUID = -7535577263406351310L; + + public interface ApplicationList{} + + /** + * 小组id + */ + @NotBlank(message = "小组id不能为空",groups = {ApplicationList.class}) + private String groupId; + + /** + * under_auditing:审核中,rejected:驳回 + */ + @NotBlank(message = "审核状态不能为空",groups = {ApplicationList.class}) + private String applyStatus; + + /** + * 页码 + */ + @NotNull(message = "页码不能为空",groups = {ApplicationList.class}) + private Integer pageNo; + + /** + * 每页数量 + */ + @NotNull(message = "每页数量不能为空",groups = {ApplicationList.class}) + private Integer pageSize; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationDetailResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationDetailResultDTO.java new file mode 100644 index 0000000000..ef84d338e0 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationDetailResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/17 10:12 上午 + */ +@Data +public class ApplicationDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 1121268898544759693L; + + /** + * 申请ID + */ + private String issueApplicationId; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 所属网格名称 + */ + private String gridName; + + /** + * 议题发起人 + */ + private String issuePublisher; + + /** + * 话题相关信息 + */ + private TopicInfoResultDTO topicInfo; + + private String gridId; + + private String topicId; + + private String userId; + + public ApplicationDetailResultDTO() { + this.issueTitle = ""; + this.gridName = ""; + this.issuePublisher = ""; + this.topicInfo = new TopicInfoResultDTO(); + } +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationHistoryResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationHistoryResultDTO.java new file mode 100644 index 0000000000..b61c75415f --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationHistoryResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/17 10:21 上午 + */ +@Data +public class ApplicationHistoryResultDTO implements Serializable { + + private static final long serialVersionUID = 3235513565728092491L; + + /** + * 审核历史表id + */ + private String historyId; + + /** + * under_auditing:待审核; approved:已通过, rejected:已驳回 + */ + private String actionType; + + /** + * 操作时间戳 + */ + private Long operateTime; + + /** + * 驳回理由或者审核通过理由 + */ + private String reason; + + /** + * 工作人员姓名;居民端不展示此列 + */ + private String staffName; + +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationListResultDTO.java new file mode 100644 index 0000000000..12bec714dd --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ApplicationListResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/17 10:31 上午 + */ +@Data +public class ApplicationListResultDTO implements Serializable { + + private static final long serialVersionUID = -4042091778432048631L; + + /** + * 申请id + */ + private String issueApplicationId; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 建议 + */ + private String suggestion; + + /** + * 对应issue_application.UPDATED_TIME 对应的秒级时间戳 + */ + private Long time; + + /** + * 审核状态。under_auditing:审核中,approved:通过,rejected:驳回 + */ + private String applyStatus; + + public ApplicationListResultDTO() { + this.issueTitle = ""; + this.suggestion = ""; + this.time = NumConstant.ZERO_L; + this.applyStatus = ""; + } +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/TopicInfoResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/TopicInfoResultDTO.java new file mode 100644 index 0000000000..574d654891 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/TopicInfoResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/11/17 10:14 上午 + */ +@Data +public class TopicInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -3445869627210569553L; + + /** + * 话题id + */ + private String topicId; + + /** + * 话题发表人昵称 + */ + private String publishedUser; + + /** + * 话题发表时间戳 + */ + private Long publishedTime; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 话题图片集合 + */ + private List topicImgs; + + public TopicInfoResultDTO() { + this.publishedUser = ""; + this.publishedTime = NumConstant.ZERO_L; + this.topicContent = ""; + this.topicImgs = new ArrayList<>(); + } +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 7a107afd19..46264bfb65 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -1,5 +1,14 @@ package com.epmet.feign; +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; +import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO; +import com.epmet.resi.group.dto.group.form.ApplicationListFormDTO; +import com.epmet.resi.group.dto.group.result.ApplicationDetailResultDTO; +import com.epmet.resi.group.dto.group.result.ApplicationHistoryResultDTO; +import com.epmet.resi.group.dto.group.result.ApplicationListResultDTO; +import org.springframework.cloud.openfeign.FeignClient; + import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IssueDTO; @@ -14,6 +23,10 @@ import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.dto.form.UserIssueSuggestionFormDTO; import com.epmet.dto.result.SaveIssueSuggestionResultDTO; import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; import com.epmet.resi.mine.dto.from.MyShiftIssueTopicsFormDTO; import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO; import org.springframework.cloud.openfeign.FeignClient; @@ -43,6 +56,35 @@ import java.util.List; // @FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueOpenFeignClientFallBack.class,url = "localhost:8101") public interface GovIssueOpenFeignClient { + /** + * @Description 待审核||已驳回 申请详情 + * @Param applicationDetailFormDTO + * @author zxc + * @date 2020/11/17 10:45 上午 + */ + @PostMapping("/gov/issue/issueapplication/applicationdetail") + Result applicationDetail(@RequestBody ApplicationDetailFormDTO applicationDetailFormDTO); + + /** + * @Description 话题转议题申请详情- 审核历史查询 + * @Param applicationHistoryFormDTO + * @author zxc + * @date 2020/11/17 10:45 上午 + */ + @PostMapping("/gov/issue/issueapplication/applicationhistory") + Result applicationHistory(@RequestBody ApplicationHistoryFormDTO applicationHistoryFormDTO); + + /** + * @Description 待审核||已驳回 申请列表 + * @Param applicationListFormDTO + * @author zxc + * @date 2020/11/17 10:45 上午 + */ + @PostMapping("/gov/issue/issueapplication/applicationlist") + Result> applicationList(@RequestBody ApplicationListFormDTO applicationListFormDTO); + + + /** * @Description 个人中心-我参与的议题列表 * @Param myPartIssuesFormDTO diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java index de39ff5035..75f0492107 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -1,5 +1,8 @@ package com.epmet.feign.fallback; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; @@ -17,6 +20,12 @@ import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.dto.form.UserIssueSuggestionFormDTO; import com.epmet.dto.result.SaveIssueSuggestionResultDTO; import com.epmet.feign.GovIssueOpenFeignClient; +import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; +import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO; +import com.epmet.resi.group.dto.group.form.ApplicationListFormDTO; +import com.epmet.resi.group.dto.group.result.ApplicationDetailResultDTO; +import com.epmet.resi.group.dto.group.result.ApplicationHistoryResultDTO; +import com.epmet.resi.group.dto.group.result.ApplicationListResultDTO; import com.epmet.resi.mine.dto.from.MyShiftIssueTopicsFormDTO; import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO; import com.epmet.resi.group.dto.group.form.AllIssueFormDTO; @@ -35,6 +44,20 @@ import java.util.List; */ @Component public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient { + @Override + public Result applicationDetail(ApplicationDetailFormDTO applicationDetailFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER,"applicationDetail",applicationDetailFormDTO); + } + + @Override + public Result applicationHistory(ApplicationHistoryFormDTO applicationHistoryFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER,"applicationHistory",applicationHistoryFormDTO); + } + + @Override + public Result> applicationList(ApplicationListFormDTO applicationListFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER,"applicationList",applicationListFormDTO); + } @Override public Result> myPartIssues(MyPartIssuesFormDTO myPartIssuesFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER,"myPartIssues",myPartIssuesFormDTO); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueApplicationController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueApplicationController.java index 83e494111d..8d06338bac 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueApplicationController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueApplicationController.java @@ -26,6 +26,12 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IssueApplicationDTO; import com.epmet.dto.form.IssueAppQueryFormDTO; +import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; +import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO; +import com.epmet.resi.group.dto.group.form.ApplicationListFormDTO; +import com.epmet.resi.group.dto.group.result.ApplicationDetailResultDTO; +import com.epmet.resi.group.dto.group.result.ApplicationHistoryResultDTO; +import com.epmet.resi.group.dto.group.result.ApplicationListResultDTO; import com.epmet.service.IssueApplicationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -83,6 +89,39 @@ public class IssueApplicationController { return new Result(); } + /** + * @Description 待审核||已驳回 申请详情 + * @Param applicationDetailFormDTO + * @author zxc + * @date 2020/11/17 10:45 上午 + */ + @PostMapping("applicationdetail") + public Result applicationDetail(@RequestBody ApplicationDetailFormDTO applicationDetailFormDTO){ + return new Result().ok(issueApplicationService.applicationDetail(applicationDetailFormDTO)); + } + + /** + * @Description 话题转议题申请详情- 审核历史查询 + * @Param applicationHistoryFormDTO + * @author zxc + * @date 2020/11/17 10:45 上午 + */ + @PostMapping("applicationhistory") + public Result applicationHistory(@RequestBody ApplicationHistoryFormDTO applicationHistoryFormDTO){ + return new Result().ok(issueApplicationService.applicationHistory(applicationHistoryFormDTO)); + } + + /** + * @Description 待审核||已驳回 申请列表 + * @Param applicationListFormDTO + * @author zxc + * @date 2020/11/17 10:45 上午 + */ + @PostMapping("applicationlist") + public Result> applicationList(@RequestBody ApplicationListFormDTO applicationListFormDTO){ + return new Result>().ok(issueApplicationService.applicationList(applicationListFormDTO)); + } + /** * @return com.epmet.commons.tools.utils.Result> * @param formDTO diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java index c45efec552..3dfa42b4b2 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java @@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IssueApplicationDTO; import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.entity.IssueApplicationEntity; +import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; +import com.epmet.resi.group.dto.group.result.ApplicationDetailResultDTO; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -34,6 +36,15 @@ import java.util.List; @Mapper public interface IssueApplicationDao extends BaseDao { + /** + * @Description 待审核||已驳回 申请详情 + * @Param applicationDetailFormDTO + * @author zxc + * @date 2020/11/17 10:45 上午 + */ + ApplicationDetailResultDTO applicationDetail(ApplicationDetailFormDTO applicationDetailFormDTO); + + /** * @param formDTO * @author yinzuomei diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java index ca1c383c2c..de018bdf59 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java @@ -22,6 +22,12 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IssueApplicationDTO; import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.entity.IssueApplicationEntity; +import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; +import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO; +import com.epmet.resi.group.dto.group.form.ApplicationListFormDTO; +import com.epmet.resi.group.dto.group.result.ApplicationDetailResultDTO; +import com.epmet.resi.group.dto.group.result.ApplicationHistoryResultDTO; +import com.epmet.resi.group.dto.group.result.ApplicationListResultDTO; import java.util.List; import java.util.Map; @@ -94,6 +100,30 @@ public interface IssueApplicationService extends BaseService applicationList(ApplicationListFormDTO applicationListFormDTO); + /** * @return java.util.List * @param formDTO diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java index b65cc575eb..4f66688834 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java @@ -27,6 +27,12 @@ import com.epmet.dao.IssueApplicationDao; import com.epmet.dto.IssueApplicationDTO; import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.entity.IssueApplicationEntity; +import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; +import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO; +import com.epmet.resi.group.dto.group.form.ApplicationListFormDTO; +import com.epmet.resi.group.dto.group.result.ApplicationDetailResultDTO; +import com.epmet.resi.group.dto.group.result.ApplicationHistoryResultDTO; +import com.epmet.resi.group.dto.group.result.ApplicationListResultDTO; import com.epmet.service.IssueApplicationService; import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.StringUtils; @@ -111,4 +117,38 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl applicationList(ApplicationListFormDTO applicationListFormDTO) { + return null; + } + } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml index 3ffa8f5f97..35123773a5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml @@ -3,6 +3,17 @@ + + + + + + + + + + + + + + From 5dcbe85c74b3f0ed20ee0d36da61ff5732b2be27 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 18 Nov 2020 17:06:45 +0800 Subject: [PATCH 125/125] =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/modules/group/service/impl/GroupIssueServiceImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java index 221e0cfd54..59e2cf3bde 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java @@ -55,8 +55,6 @@ public class GroupIssueServiceImpl implements GroupIssueService { @Autowired private ResiTopicService resiTopicService; - @Autowired - private GovIssueOpenFeignClient govIssueOpenFeignClient; /** * @Description 待审核||已驳回 申请详情