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-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 284ef67e74..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 @@ -84,6 +84,12 @@ public enum RequirePermissionEnum { WORK_GRASSROOTS_ISSUE_SHIFT_PROJECT("work_grassroots_issue_shift_project", "基层治理:议题管理:转项目","转项目(选择处理部门api也需要添加此校验)"), WORK_GRASSROOTS_ISSUE_CLOSE("work_grassroots_issue_close","基层治理:议题管理:关闭议题","关闭议题"), + /** + * 徽章 + */ + WORK_GRASSROOTS_BADGE_AUDIT("work_grassroots_badge_audit","基层治理:徽章审核:徽章审核","徽章审核"), + WORK_GRASSROOTS_BADGE_AUDITING_LIST("work_grassroots_badge_auditing_list","基层治理:徽章审核:待审核列表","待审核徽章列表"), + /** * 工作-项目跟踪 */ @@ -138,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; 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..00615c2f35 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 @@ -41,6 +41,7 @@ public enum EpmetErrorCode { MOBILE_GET_CODE_ERROR(8104,"获取验证码失败"), MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), NOT_DEL_GRID(8106,"该网格存在工作人员,不允许删除"), + THE_MOBILE_HAS_BEEN_USED(8207, "该手机号已注册,请更换手机号"), ORG_IS_NOT_NULL(8107,"党组织关系不能为空"), CANNOT_DELETE_PARTY_BRANCH(8108,"当前支部存在党员,不允许删除"), @@ -95,6 +96,10 @@ public enum EpmetErrorCode { SIGN_IN_TIME_NO(8513, "签到时间还未到~"), SIGN_IN_TIME_END(8514, "签到时间已结束~"), + //徽章管理 + DUPLICATE_BADGE_NAME(8515, "徽章名已存在"), + DUPLICATE_PARTY_BADGE_NAME(8516, "不可删除党员徽章"), + // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), @@ -110,6 +115,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-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..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 @@ -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工具类 @@ -159,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); } @@ -171,10 +186,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");} + }).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-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-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/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 @@ + + + + + + + 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 65cf6b2d2d..ff52e99ce4 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; @@ -39,6 +40,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.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -223,6 +227,36 @@ 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); + } + /** * @param byteFile fileName * @Description 外挂-文件上传 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..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 @@ -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-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/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 new file mode 100644 index 0000000000..48a9cfc1f0 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/constant/IssueOpenConstant.java @@ -0,0 +1,35 @@ +package com.epmet.constant; + +/** + * 议题相关常亮,其它服务可用 + * + * @author yinzuomei@elink-cn.com + * @date 2020/11/11 14:10 + */ +public interface IssueOpenConstant { + /** + * 议题状态-表决中 + */ + String ISSUE_VOTING = "voting"; + /** + * 议题状态-已转项目 + */ + String ISSUE_SHIFT_PROJECT = "shift_project"; + /** + * 议题状态-已关闭 + */ + String ISSUE_CLOSED = "closed"; + /** + * 议题解决类型-已解决 + */ + String ISSUE_RESOLVED = "resolved"; + /** + * 议题解决类型-未解决 + */ + 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..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 @@ -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,18 @@ public class IssueDTO implements Serializable { */ private Date updatedTime; + /** + * 转项目日期 (服务间调用日期一致性) 戳 + */ + private Long shiftedTimeStamp; + + /** + * 关闭日期 戳 + */ + 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/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/form/MyPubIssuesAuditingFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyPubIssuesAuditingFormDTO.java new file mode 100644 index 0000000000..0ede11f11d --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/MyPubIssuesAuditingFormDTO.java @@ -0,0 +1,35 @@ +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/11 9:06 上午 + */ +@Data +public class MyPubIssuesAuditingFormDTO implements Serializable { + + private static final long serialVersionUID = 8417818340366917358L; + + public interface MyPubIssuesAuditing{} + + @NotNull(message = "页码不能为空",groups = MyPubIssuesAuditing.class) + private Integer pageNo; + + @NotNull(message = "每页数量不能为空",groups = MyPubIssuesAuditing.class) + private Integer pageSize; + + /** + * 拓展参数:前端不传值,内部传输用 + */ + private String userId; + + /** + * 拓展参数:前端不传值,内部传输用 + */ + private String issueStatus; +} 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/IssueProjectResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectResultDTO.java index bcad9ff776..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 @@ -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(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date shiftedTime; } 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..fdce22e8f2 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPartIssuesResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +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; + + @JsonIgnore + private String gridId; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPubIssuesAuditingResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPubIssuesAuditingResultDTO.java new file mode 100644 index 0000000000..4af11fb3f2 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPubIssuesAuditingResultDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/11 9:17 上午 + */ +@Data +public class MyPubIssuesAuditingResultDTO implements Serializable { + + private static final long serialVersionUID = -659855213089511649L; + + /** + * 议题id + */ + private String issueId; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 议题建议 + */ + private String suggestion; + + /** + * 转议题时间 + */ + private Long shiftIssueTime; + + /** + * 议题来源的小组名 + */ + private String topicReleaseGroupName; + + /** + * 议题来源的网格名 + */ + private String topicReleaseGridName; + + @JsonIgnore + private String gridId; + + @JsonIgnore + private String topicId; + +} 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..6595c75f86 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyShiftIssueTopicsResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +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; + + /** + * 议题ID + */ + private String issueId; + + @JsonIgnore + 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 b9997f1705..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 @@ -1,9 +1,21 @@ package com.epmet.feign; -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; +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.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; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -12,5 +24,44 @@ import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack; * @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") public interface GovIssueOpenFeignClient { + + /** + * @Description 个人中心-我参与的议题列表 + * @Param myPartIssuesFormDTO + * @author zxc + * @date 2020/11/10 10:01 上午 + */ + @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); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 查询我发起的议题(可根据状态查询) + * @Date 2020/11/11 14:13 + **/ + @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 65b8a24fc6..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 @@ -1,8 +1,20 @@ 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.IssueDTO; +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 com.epmet.resi.mine.dto.from.MyShiftIssueTopicsFormDTO; +import com.epmet.resi.mine.dto.result.MyShiftIssueTopicsResultDTO; import org.springframework.stereotype.Component; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -11,4 +23,23 @@ import org.springframework.stereotype.Component; */ @Component public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient { + @Override + 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); + } + + @Override + 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/constant/IssueConstant.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java index 1f8ae5abb9..42090ef7ff 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java @@ -93,4 +93,6 @@ public interface IssueConstant { String BEIJING_TIME_ZONE = "+8"; String REVIEW_ISSUE = "议题评论失败,评论内容为:%s"; + + String GRID = "grid"; } 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..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 @@ -1,27 +1,19 @@ 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.ValidatorUtils; -import com.epmet.dto.form.*; -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.DefaultGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IssueDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.excel.IssueExcel; import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO; import com.epmet.service.IssueService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.MediaType; -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 javax.servlet.http.HttpServletResponse; import java.util.List; -import java.util.Map; /** * @Description 居民端党群议事 @@ -151,5 +143,41 @@ 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)); + } + + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 查询我发起的议题(可根据状态查询) + * @Date 2020/11/11 14:49 + **/ + @PostMapping("getmypubissues") + public Result> getMyPubIssues(@RequestBody MyPubIssuesAuditingFormDTO formDTO){ + 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/controller/IssueVoteStatisticalController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueVoteStatisticalController.java index 3c86c0c45a..7a7c4530f1 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueVoteStatisticalController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueVoteStatisticalController.java @@ -29,6 +29,8 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.IssueVoteStatisticalDTO; import com.epmet.dto.form.IssueIdFormDTO; +import com.epmet.dto.form.MyPartIssuesFormDTO; +import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.VoteResultDTO; import com.epmet.dto.result.VotingTrendResultDTO; import com.epmet.excel.IssueVoteStatisticalExcel; @@ -145,4 +147,16 @@ public class IssueVoteStatisticalController { return new Result(); } + /** + * @Description 个人中心-我参与的议题列表 + * @Param myPartIssuesFormDTO + * @author zxc + * @date 2020/11/10 10:01 上午 + */ + @PostMapping("mypartissues") + public Result> myPartIssues(@RequestBody MyPartIssuesFormDTO myPartIssuesFormDTO){ + ValidatorUtils.validateEntity(myPartIssuesFormDTO, MyPartIssuesFormDTO.MyPartIssues.class); + return new Result>().ok(issueVoteStatisticalService.myPartIssues(myPartIssuesFormDTO)); + } + } \ No newline at end of file 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..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 @@ -144,4 +144,36 @@ 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); + + /** + * @return java.util.List + * @param pageNo + * @param pageSize + * @param userId 当前用户 + * @param issueStatus :议题状态 表决中:voting 已转项目:shift_project 已关闭:closed + * @author yinzuomei + * @description 查询我发起的议题(可根据状态查询) + * @Date 2020/11/11 15:11 + **/ + List selectMyPubIssues(@Param("pageNo") Integer pageNo, + @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/dao/IssueVoteDetailDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java index 930e16e88e..e1d7cfbddf 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.VoteFormDTO; import com.epmet.dto.result.IssueAttitudeCountResultDTO; +import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.entity.IssueVoteDetailEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -73,4 +74,12 @@ public interface IssueVoteDetailDao extends BaseDao { List getVotingCountList(@Param("ids")Set ids, @Param("attitude")String attitude); List getVotingSummaryList(@Param("ids")Set ids); + + /** + * @Description 个人中心-我参与的议题列表 + * @Param myPartIssuesFormDTO + * @author zxc + * @date 2020/11/10 10:01 上午 + */ + List myPartIssues(@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..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 @@ -2,27 +2,13 @@ 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; -import com.epmet.dto.form.IssueDetailFormDTO; -import com.epmet.dto.form.IssueIdFormDTO; -import com.epmet.dto.result.DepartmentStaffListResultDTO; -import com.epmet.dto.result.GridIdResultDTO; -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 +218,31 @@ 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); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 查询我发起的议题(可根据状态查询) + * @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/IssueVoteStatisticalService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java index c6334dd86e..1a0f3a3cf8 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java @@ -23,7 +23,9 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IssueVoteStatisticalDTO; import com.epmet.dto.form.EvaluationListFormDTO; import com.epmet.dto.form.IssueIdFormDTO; +import com.epmet.dto.form.MyPartIssuesFormDTO; import com.epmet.dto.result.EvaluationListResultDTO; +import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.VoteResultDTO; import com.epmet.dto.result.VotingTrendResultDTO; import com.epmet.entity.IssueVoteStatisticalEntity; @@ -159,4 +161,12 @@ public interface IssueVoteStatisticalService extends BaseService myPartIssues(MyPartIssuesFormDTO myPartIssuesFormDTO); } \ No newline at end of file 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..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 @@ -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,28 @@ 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.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; 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 +86,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 +853,78 @@ 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.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.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("查询议题来源小组名称失败......"); + } + list.forEach(l -> groupNameList.getData().stream().filter(g -> l.getTopicId().equals(g.getTopicId())).forEach(g -> l.setTopicReleaseGroupName(g.getTopicGroupName()))); + } + return list; + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 查询我发起的议题(可根据状态查询) + * @Date 2020/11/11 14:57 + **/ + @Override + public List getMyPubIssues(MyPubIssuesAuditingFormDTO formDTO) { + formDTO.setPageNo(null == formDTO.getPageNo() ? NumConstant.ZERO : + (formDTO.getPageNo() - NumConstant.ONE)*formDTO.getPageSize() + ); + 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.debug("查询我创建的话题集合为空"); + 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/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 60b0aabbc3..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 @@ -40,6 +40,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.IssueEntity; import com.epmet.entity.IssueVoteStatisticalEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.ResiGroupFeignClient; import com.epmet.redis.IssueVoteDetailRedis; import com.epmet.redis.IssueVoteStatisticalRedis; @@ -51,6 +52,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.time.LocalDate; import java.time.LocalDateTime; @@ -86,6 +88,8 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl page(Map params) { @@ -532,4 +536,25 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl myPartIssues(MyPartIssuesFormDTO myPartIssuesFormDTO) { + List myPartIssuesResult = issueVoteDetailDao.myPartIssues(myPartIssuesFormDTO.getUserId()); + if (CollectionUtils.isEmpty(myPartIssuesResult)){ + return new ArrayList<>(); + } + List orgIds = myPartIssuesResult.stream().map(m -> m.getGridId()).collect(Collectors.toList()); + Result> listResult = govOrgOpenFeignClient.getGridListByGridIds(orgIds); + if (!listResult.success()){ + throw new RenException("查询议题来源网格名称失败......"); + } + myPartIssuesResult.forEach(m -> listResult.getData().stream().filter(l -> m.getGridId().equals(l.getGridId())).forEach(l -> m.setTopicReleaseGridName(l.getGridName()))); + return myPartIssuesResult; + } + } \ No newline at end of file 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-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..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 @@ -378,4 +378,67 @@ AND source_id = #{topicId} + + + + + + + + \ No newline at end of file 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 255d2d30b8..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 @@ -71,4 +71,20 @@ issue_id, attitude + + + \ No newline at end of file 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"; + +} 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..4d60f07fe5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgInfoFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/11/10 2:13 下午 + */ +@Data +@AllArgsConstructor +public class OrgInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 4480485864711053393L; + + /** + * org的类型 agency:机关,grid:网格,dept:部门 + */ + private String orgType; + + /** + * orgId集合 + */ + private List orgIds; + + public OrgInfoFormDTO() { + } +} 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-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..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 @@ -275,4 +275,23 @@ 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); + + /** + * @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 c3811eb323..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 @@ -161,4 +161,14 @@ 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); + } + + @Override + public Result> getGridListByGridIds(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridListByGridIds", gridIdList); + } } 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/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 80acd68b46..b88368a11d 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 @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.baomidou.mybatisplus.extension.api.R; import com.epmet.commons.tools.annotation.LoginUser; +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.ExcelUtils; @@ -32,12 +34,16 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.excel.CustomerAgencyExcel; import com.epmet.service.CustomerAgencyService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import javax.validation.constraints.NotBlank; import java.util.List; import java.util.Map; +import java.util.Set; /** @@ -243,6 +249,37 @@ public class CustomerAgencyController { return new Result().ok(customerAgencyService.staffInAgencyList(tokenDTO.getUserId())); } + /** + * @Description 对外接口,根据customerId返回Element UI中Tree结构的agency列表 + * @param map + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/11/6 13:51 + */ + @PostMapping("getagencyelementtreelist") + public Result> getAgencyElementTreeList(@RequestBody Map map){ + String customerId = map.get("customerId"); + if (StringUtils.isBlank(customerId)){ + throw new RenException("customerId不能为空"); + } + return new Result>().ok(customerAgencyService.getAgencyElementTree(customerId).getList()); + } + /** + * @Description 对外接口,根据customerId返回Element UI中Tree结构的agency keys + * @param map + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/11/6 13:51 + */ + @PostMapping("getagencyelementtreekeys") + public Result> getAgencyElementTreeKeys(@RequestBody Map map){ + String customerId = map.get("customerId"); + if (StringUtils.isBlank(customerId)){ + throw new RenException("customerId不能为空"); + } + return new Result>().ok(customerAgencyService.getAgencyElementTree(customerId).getDefaultKeys()); + } + /** * @Description 对外接口-根据组织Id获取组织信息 * @author sun 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/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index 1c6f42456c..9c1735a886 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -176,6 +176,16 @@ public interface CustomerAgencyDao extends BaseDao { **/ AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId); + /** + * @Description 返回elementTree结构的agency树 + * @param customerId + * @param pid + * @return java.util.List + * @Author liushaowen + * @Date 2020/11/6 14:57 + */ + List getAgencyElementTree(@Param("customerId") String customerId,@Param("pid") String pid); + /** * @Description 外挂-获取当前组织及部门、网格数据,递归查询所有下级数据 * @author sun 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/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 9297e8f5f1..8051ca63f5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -214,6 +214,15 @@ public interface CustomerAgencyService extends BaseService **/ StaffInAgencyListResultDTO staffInAgencyList(String staffId); + /** + * @Description 运营端-返回element ui - tree 结构agency列表 + * @param customerId + * @return com.epmet.dto.result.AgencyElementTreeResultDTO + * @Author liushaowen + * @Date 2020/11/6 14:02 + */ + AgencyElementTreeResultDTO getAgencyElementTree(String customerId); + /** * @Description 对外接口-根据组织Id获取组织信息 * @author sun 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/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index dd3360a781..bc91668e7c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -994,6 +994,33 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl agencyList = baseDao.getAgencyElementTree(customerId, "0"); + Set defaultKeys = new HashSet<>(); + traversalAgencyList(agencyList,0,defaultKeys); + AgencyElementTreeResultDTO dto = new AgencyElementTreeResultDTO(); + dto.setList(agencyList); + dto.setDefaultKeys(defaultKeys); + return dto; + } + private void traversalAgencyList(List agencyList,int times,Set set){ + if (agencyList.size() > 0 && times < 2){ + for (AgencyElementTreeResultDTO.Agency list : agencyList) { + set.add(list.getId()); + times++; + traversalAgencyList(list.getChildren(),times,set); + } + } + } + /** * @Description 对外接口-根据组织Id获取组织信息 * @author sun 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/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 300f559468..b85f892aa1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -373,4 +373,12 @@ + + + + + + \ No newline at end of file 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/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/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/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-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/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..b5e41d64a5 --- /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/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..8397d64b69 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java @@ -0,0 +1,48 @@ +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; + + private String issueId; +} 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..be6362471c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectOfCreateTopicUserResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.util.List; + +@Data +public class ProjectOfCreateTopicUserResultDTO { + + private String topicId; + private String projectId; + private String issueId; + 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 17bd06d5df..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 @@ -1,16 +1,18 @@ 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.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.ProcesslistResultDTO; -import org.springframework.cloud.openfeign.FeignClient; - -import com.epmet.commons.tools.constant.ServiceConstant; +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; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -22,6 +24,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 { /** @@ -46,4 +49,30 @@ 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); + + /** + * @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); + + /** + * @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 b0bb14a9eb..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,11 +5,14 @@ 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.ProcesslistResultDTO; +import com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO; import com.epmet.feign.GovProjectOpenFeignClient; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; import java.util.List; @@ -44,4 +47,26 @@ 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); + } + + /** + * @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); + } + + @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 345fb495a3..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 @@ -18,8 +18,6 @@ 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; @@ -27,18 +25,13 @@ 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; -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.form.*; +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 +176,32 @@ 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)); + } + + @PostMapping("queryprojectinfobyids") + 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 0584789909..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 @@ -24,7 +24,9 @@ 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.dto.result.ProjectOfCreateTopicUserResultDTO; import com.epmet.entity.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -130,4 +132,20 @@ 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); + + /** + * @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/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/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index 2050b5921e..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 @@ -19,11 +19,11 @@ 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.*; import com.epmet.entity.ProjectEntity; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import java.util.List; import java.util.Map; @@ -216,4 +216,21 @@ public interface ProjectService extends BaseService { * @date 2020.10.26 10:54 */ void projectProcessCostTimeDataCompensation(); + + /** + * @param formDTO + * @Author sun + * @Description 根据议题Id集合查询对应的项目信息 + **/ + 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 7808c44d57..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 @@ -42,7 +42,9 @@ 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 com.github.pagehelper.PageHelper; import org.apache.commons.collections4.CollectionUtils; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.ListUtils; @@ -687,6 +689,18 @@ public class ProjectServiceImpl extends BaseServiceImpl getClosedProjectList(LatestListFormDTO formDTO) { + + return baseDao.selectClosedProjectList(formDTO); + } + /** * @param formDTO * @return @@ -803,7 +817,7 @@ public class ProjectServiceImpl extends BaseServiceImpl projectStaffIds = entityList.stream().map(ProjectStaffEntity::getId).distinct().collect(Collectors.toList()); if(!CollectionUtils.isEmpty(projectStaffIds)){ List container = new LinkedList<>(); @@ -826,8 +840,12 @@ public class ProjectServiceImpl extends BaseServiceImpl getClosedProjectList(LatestListFormDTO formDTO) { - - return baseDao.selectClosedProjectList(formDTO); - } - @Override public void response(ProjectResponseFormDTO formDTO) { //公开回复内容审核 @@ -1362,4 +1368,58 @@ 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; + } + + @Override + public List 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; + } + + @Override + public List 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 new file mode 100644 index 0000000000..ceedfd85bb --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.4__alter_project_related_personnel.sql @@ -0,0 +1,14 @@ +ALTER TABLE `project_related_personnel` ADD COLUMN `SOURCE_TYPE` VARCHAR (32) CHARACTER +SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '来源类型(话题:topic 议题:issue)' AFTER `GRID_ID`, + 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 baf33ff218..a3747fe72e 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,44 @@ DEL_FLAG = '0' + + + + \ 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/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/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/dto/member/result/ApplyingMemberResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/ApplyingMemberResultDTO.java index 881333be54..6374a9314b 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/ApplyingMemberResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/ApplyingMemberResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.resi.group.dto.member.result; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * @Description @@ -45,4 +46,9 @@ public class ApplyingMemberResultDTO implements Serializable { * 入群被拒 - rejected 、 */ private String status; + + /** + * 用户徽章Url列表 + */ + private List badgeList; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/GroupMemberListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/GroupMemberListResultDTO.java index a5f69fc7c3..b6aaf3b8db 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/GroupMemberListResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/GroupMemberListResultDTO.java @@ -4,6 +4,7 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * @Description @@ -43,4 +44,9 @@ public class GroupMemberListResultDTO implements Serializable { * 审核通过 - approved、 已禁言 - silent */ private String status; + + /** + * 用户徽章列表 + */ + private List badgeList; } 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/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/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/dto/topic/result/GovHiddenTopicInfoResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovHiddenTopicInfoResultDTO.java index 6008f6c0eb..073a984545 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovHiddenTopicInfoResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovHiddenTopicInfoResultDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** * @Description @@ -51,4 +52,9 @@ public class GovHiddenTopicInfoResultDTO implements Serializable { * 话题的第一张图片地址 * */ private String topicFirstPhoto; + + /** + * 徽章Url集合 + */ + private List badgeList; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java index d60a24382d..84a1e2f5aa 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/GovTopicInfoResultDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -57,4 +58,9 @@ public class GovTopicInfoResultDTO implements Serializable { * 话题的状态 * */ private String topicState; + + /** + * 徽章Url集合 + */ + private List badgeList; } 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/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 new file mode 100644 index 0000000000..d5dc12d887 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyCreateTopicsResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +@Data +public class MyCreateTopicsResultDTO { + + private String topicId; + private String groupId; + private Long releaseTime; + private String topicContent; + private String releaseGroupName; + private String releaseGridId; + private String releaseGridName; + +} 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..2011d24943 --- /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,28 @@ +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 groupId; + + 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/dto/topic/result/ResiTopicDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java index 1a41c1afd0..cce7d050fb 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java @@ -56,4 +56,9 @@ public class ResiTopicDetailResultDTO implements Serializable { * */ private List topicImgs; + /** + * 徽章Url集合 + */ + private List badgeList; + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java index 988d319ad8..97c0a12faf 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java @@ -70,4 +70,11 @@ public class ResiTopicIncludeIssueDetailResultDTO implements Serializable { * 关闭详情 如果没有关闭 对象里的字符串属性为String * */ private ResiTopicClosingMsgResultDTO closeDetail; + + /** + * 徽章Url列表 + */ + private List badgeList; + + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueInfoResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueInfoResultDTO.java index 55fe66f286..e2822a9189 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueInfoResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueInfoResultDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** * @Description 话题信息返回DTO(包含议题Id和是否转为议题Flag) @@ -71,4 +72,9 @@ public class ResiTopicIncludeIssueInfoResultDTO implements Serializable { * 议题Id,当shiftIssueFlag为false时返回"" * */ private String issueId; + + /** + * 用户徽章 当releaseUserFlag为"me"时为空 + */ + private List badgeList; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicInfoResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicInfoResultDTO.java index 613b506acf..be2f5452e9 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicInfoResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicInfoResultDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** * @Description 查看历史话题返回对象 @@ -62,4 +63,9 @@ public class ResiTopicInfoResultDTO implements Serializable{ * 第一张图片 * */ private String firstPhoto; + + /** + * 用户勋章Url集合 + */ + private List badgeList; } 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..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 @@ -1,9 +1,22 @@ package com.epmet.resi.group.feign; -import org.springframework.cloud.openfeign.FeignClient; - 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.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; import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -12,5 +25,50 @@ import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; * @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 { + + /** + * @Description 查询用户参与的且不是自己发表的话题对应的议题Id集合 + * @author sun + */ + @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); + + /** + * @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); + + /** + * @Description 我创建的话题列表 + * @return + * @author wxz + * @date 2020.11.10 14:58 + */ + @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 df1c7bebf2..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 @@ -1,8 +1,21 @@ 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.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; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -11,4 +24,29 @@ 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); + } + + @Override + public Result> selectGroupInfo(GroupInfoFormDTO groupInfoFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectGroupInfo", groupInfoFormDTO); + } + + @Override + public Result> myPartTopics(CustomerPageFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "myPartTopics", param); + } + + @Override + 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/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/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/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java index 318989299c..6c3b9ff19c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java @@ -31,12 +31,10 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.ReadFlagConstant; -import com.epmet.dto.form.UserMessageFormDTO; -import com.epmet.dto.form.UserResiInfoFormDTO; -import com.epmet.dto.form.UserResiInfoListFormDTO; -import com.epmet.dto.form.WxSubscribeMessageFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.constant.GroupMemberConstant; import com.epmet.modules.constant.UserMessageConstant; import com.epmet.modules.feign.EpmetUserFeignClient; @@ -65,6 +63,7 @@ import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; import com.epmet.resi.group.dto.member.form.*; +import com.epmet.resi.group.dto.member.form.CommonGridIdListFormDTO; import com.epmet.resi.group.dto.member.result.ApplyingMemberResultDTO; import com.epmet.resi.group.dto.member.result.GridVotableCountResultDTO; import com.epmet.resi.group.dto.member.result.GroupMemberListResultDTO; @@ -75,10 +74,12 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; /** * 群组成员关系表 @@ -118,6 +119,8 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl page(Map params) { @@ -329,6 +332,24 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl>> badgeR + = userOpenFeignClient.userShowBadge(new UserGroupFormDTO(group.getCustomerId(), userIdList)); + if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){ + Map> map = badgeR.getData(); + list.forEach(member -> { + member.setBadgeList( + CollectionUtils.isEmpty(map.get(member.getUserId())) ? + Collections.EMPTY_LIST: + map.get(member.getUserId()).stream().map(UserBadgeUnitFormDTO :: getBadgeIcon).collect(Collectors.toList()) ); + }); + }else{ + list.forEach(member -> member.setBadgeList(Collections.EMPTY_LIST)); + } + } + return list; } @@ -368,6 +389,26 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl>> badgeR + = userOpenFeignClient.userShowBadge(new UserGroupFormDTO(group.getCustomerId(), userIdList)); + if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){ + Map> map = badgeR.getData(); + list.forEach(member -> { + member.setBadgeList( + CollectionUtils.isEmpty(map.get(member.getApplyUserId())) ? + Collections.EMPTY_LIST: + map.get(member.getApplyUserId()).stream().map(UserBadgeUnitFormDTO :: getBadgeIcon).collect(Collectors.toList()) ); + }); + }else{ + list.forEach(member -> member.setBadgeList(Collections.EMPTY_LIST)); + } + } + return list; } 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..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 @@ -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.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.*; 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,43 @@ 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-create-topics") + public Result> listMyCreateTopics(@RequestBody MyCreateTopicsFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + List myTopics = topicService.listMyCreateTopics(formDTO.getCustomerId(), formDTO.getUserId(), formDTO.getPageNo(), formDTO.getPageSize()); + 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)); + } + + /** + * @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/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 9c3b87d48f..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; @@ -153,4 +154,29 @@ public interface ResiTopicDao extends BaseDao { */ CheckTopicPublisherResultDTO checkTopicPublisher(CheckTopicPublisherFormDTO formDTO); + List listMyCreateTopics(@Param("userId") String userId, @Param("customerId") String customerId); + + /** + * @Description 根据话题Id集合查询对应的已转成议题的议题Id集合 + * @author sun + */ + 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); + + /** + * @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/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/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index 08b8e89fd9..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; @@ -264,4 +263,28 @@ public interface ResiTopicService extends BaseService { */ CheckTopicPublisherResultDTO checkTopicPublisher(CheckTopicPublisherFormDTO formDTO); + /** + * @Description 我发表的话题列表 + * @return + * @author wxz + * @date 2020.11.10 15:03 + */ + List listMyCreateTopics(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); + + /** + * @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/ResiTopicCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java index ae74578dcd..a4e0365d2a 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,9 @@ 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/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..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 @@ -37,11 +37,12 @@ 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.UserResiInfoResultDTO; +import com.epmet.dto.result.*; +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; @@ -79,6 +80,10 @@ 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; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -87,6 +92,7 @@ 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.text.SimpleDateFormat; import java.util.*; @@ -138,9 +144,15 @@ 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); } @@ -385,7 +426,38 @@ public class ResiTopicServiceImpl extends BaseServiceImpl>> badgeR + = userOpenFeignClient.userShowBadge( + new UserGroupFormDTO(group.getCustomerId(), + pastTopics.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(); + pastTopics.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 pastTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST)); + + } + + } + + return new Result>().ok(pastTopics); } @@ -578,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(customerId, userId)); + + if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){ + resultDTO.setBadgeList( + CollectionUtils.isEmpty(badgeR.getData().get(topicDetail.getCreatedBy())) ? + Collections.EMPTY_LIST: + badgeR.getData().get(topicDetail.getCreatedBy()).stream().map(UserBadgeUnitFormDTO :: getBadgeIcon).collect(Collectors.toList()) + ); + }else resultDTO.setBadgeList(Collections.EMPTY_LIST); return new Result().ok(resultDTO); } @@ -640,6 +735,36 @@ public class ResiTopicServiceImpl extends BaseServiceImpl 0) { setCacheUserInfo(topicPageFormDTO.getGroupId(), hiddenTopics); + + + //3.用户徽章 + //3.1首先需要拿到客户Id + ResiGroupEntity group = resiGroupDao.selectById(topicPageFormDTO.getGroupId()); + if(null != group && StringUtils.isNotBlank(group.getCustomerId())){ + Result>> badgeR + = userOpenFeignClient.userShowBadge( + new UserGroupFormDTO(group.getCustomerId(), + hiddenTopics.stream() + .filter(top -> StringUtils.equals("other",top.getReleaseUserFlag())) + .map(ResiTopicInfoResultDTO::getUserId) + .distinct().collect(Collectors.toList()))); + if(null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()){ + Map> badgeM = badgeR.getData(); + hiddenTopics.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 hiddenTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST)); + + } + + } return new Result>().ok(hiddenTopics); @@ -790,6 +915,30 @@ public class ResiTopicServiceImpl extends BaseServiceImpl>> badgeR + = userOpenFeignClient.userShowBadge( + new UserGroupFormDTO(group.getCustomerId(), + pastTopics.stream() + .map(ResiTopicInfoResultDTO::getUserId) + .distinct().collect(Collectors.toList()))); + if (null != badgeR && badgeR.success() && null != badgeR.getData() && !badgeR.getData().isEmpty()) { + Map> badgeM = badgeR.getData(); + pastTopics.forEach(top -> { + top.setBadgeList( + CollectionUtils.isEmpty(badgeM.get(top.getUserId())) ? + Collections.EMPTY_LIST : + badgeM.get(top.getUserId()).stream().map(UserBadgeUnitFormDTO::getBadgeIcon).collect(Collectors.toList()) + ); + }); + + } else pastTopics.forEach(top -> top.setBadgeList(Collections.EMPTY_LIST)); + + } } return new Result>().ok(pastTopics); @@ -863,11 +1012,13 @@ public class ResiTopicServiceImpl extends BaseServiceImpl 0) { for (UserResiInfoResultDTO user : result.getData()) { - ResiTopicInfoResultDTO topic = - topicMap.get(user.getUserId()).get(0); - topic.setReleaseUserHeadPhoto(user.getHeadPhoto()); - topic.setReleaseUserName(user.getShowName()); + if(!CollectionUtils.isEmpty(topicMap.get(user.getUserId()))){ + topicMap.get(user.getUserId()).forEach( topic -> { + topic.setReleaseUserHeadPhoto(user.getHeadPhoto()); + topic.setReleaseUserName(user.getShowName()); + }); + } //存入缓存 ResiGroupMemberInfoRedisDTO memberRedisDTO = new ResiGroupMemberInfoRedisDTO(); ResiGroupMemberDTO memberMySql = resiGroupMemberDao.selectGroupMemberInfo(groupId, user.getUserId()); @@ -935,10 +1086,12 @@ public class ResiTopicServiceImpl extends BaseServiceImpl 0) { for (UserResiInfoResultDTO user : result.getData()) { - ResiTopicIncludeIssueInfoResultDTO topic = - topicMap.get(user.getUserId()).get(0); - topic.setReleaseUserHeadPhoto(user.getHeadPhoto()); - topic.setReleaseUserName(user.getShowName()); + if(!CollectionUtils.isEmpty(topicMap.get(user.getUserId()))){ + topicMap.get(user.getUserId()).forEach( topic -> { + topic.setReleaseUserHeadPhoto(user.getHeadPhoto()); + topic.setReleaseUserName(user.getShowName()); + }); + } //存入缓存 ResiGroupMemberInfoRedisDTO memberRedisDTO = new ResiGroupMemberInfoRedisDTO(); @@ -1275,6 +1428,65 @@ public class ResiTopicServiceImpl extends BaseServiceImpl listMyCreateTopics(String customerId, String userId, Integer pageNo, Integer pageSize) { + PageHelper.startPage(pageNo, pageSize); + List myTopics = resiTopicDao.listMyCreateTopics(userId, customerId); + + HashMap gridIdAndNames = new HashMap<>(); + 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 (MyCreateTopicsResultDTO myTopic : myTopics) { + myTopic.setReleaseGridName(gridIdAndNames.get(myTopic.getReleaseGridId())); + } + + return myTopics; + } + + /** + * @Description 个人中心-我参与过的话题 + * @param param + * @return java.util.List + * @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.getOrgName()); + return topic; + })).collect(Collectors.toList()); + } return Collections.EMPTY_LIST; + } + + /** + * @Description 查询我创建的话题 + * @Param topicIdListFormDTO + * @author zxc + * @date 2020/11/13 4:32 下午 + */ + @Override + public List selectMyCreateTopic(TopicIdListFormDTO topicIdListFormDTO) { + return baseDao.selectMyCreateTopic(topicIdListFormDTO); + } } 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/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-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 c8420f242f..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 @@ -446,5 +446,67 @@ AND created_by = #{createdBy} AND id = #{topicId} + + + + + + + + + + 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 new file mode 100644 index 0000000000..c5ace2985f --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/BadgeListFormDTO.java @@ -0,0 +1,29 @@ +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 11:07 上午 + */ +@Data +public class BadgeListFormDTO implements Serializable { + + private static final long serialVersionUID = 9082922684993474574L; + + public interface BadgeList{} + + /** + * 用户ID + */ + private String userId; + + /** + * 客户ID + */ + @NotBlank(message = "客户ID不能为空",groups = {BadgeList.class}) + private String customerId; +} 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-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-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/from/MyShiftProjectTopicsFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftProjectTopicsFormDTO.java new file mode 100644 index 0000000000..1aa779b9af --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/MyShiftProjectTopicsFormDTO.java @@ -0,0 +1,14 @@ +package com.epmet.resi.mine.dto.from; + +import lombok.Data; + +@Data +public class MyShiftProjectTopicsFormDTO { + + private String customerId; + + 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/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 new file mode 100644 index 0000000000..d32230501e --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/BadgeListResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.resi.mine.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/3 11:08 上午 + */ +@Data +public class BadgeListResultDTO implements Serializable { + + private static final long serialVersionUID = -6542233940679158922L; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 徽章图片地址 + */ + private String badgeIcon; + + /** + * 徽章是否点亮 + */ + 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/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-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..0be06a0eed --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyCreateTopicsResultDTO.java @@ -0,0 +1,14 @@ +package com.epmet.resi.mine.dto.result; + +import lombok.Data; + +@Data +public class MyCreateTopicsResultDTO { + private String topicId; + private String groupId; + 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/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..b5dcb73645 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftIssueTopicsResultDTO.java @@ -0,0 +1,43 @@ +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; + + private String issueId; + +} 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..af2e1b80e7 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/MyShiftProjectTopicsResultDTO.java @@ -0,0 +1,16 @@ +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 String issueId; + private Long shiftProjectTime; + private List departmentNameList; + private String projectTitle; + private String releaseGridName; +} 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..d202918818 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/OperListResultDTO.java @@ -0,0 +1,51 @@ +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; + + /** + * 徽章类型:党员徽章;party,无:none + */ + private String badgeType; + +} 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/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..b9af883a21 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java @@ -0,0 +1,57 @@ +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; +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; +import java.util.Map; + +/** + * @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(@RequestBody 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(@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 new file mode 100644 index 0000000000..acf354f745 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/AdviceService.java @@ -0,0 +1,15 @@ +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; + +import java.util.List; +import java.util.Map; + +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..2c11338e90 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/service/impl/AdviceServiceImpl.java @@ -0,0 +1,44 @@ +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; +import io.swagger.models.auth.In; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * @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 epmetUserOpenFeignClient.submitAdvice(dto); + } + + /** + * @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 epmetUserOpenFeignClient.myAdviceList(dto); + } +} 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..e71b28101f --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java @@ -0,0 +1,85 @@ +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.dto.form.EditMobileFormDTO; +import com.epmet.dto.form.SendCodeFormDTO; +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(); + } + + /** + * 修改手机号-获取验证码 + * @author zhaoqifeng + * @date 2020/11/11 9:28 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("sendcode") + public Result sendCode(@LoginUser TokenDto tokenDto, @RequestBody SendCodeFormDTO formDTO) { + personalCenterService.sendCode(tokenDto, formDTO); + return new Result(); + } + + /** + * 修改手机号 + * @author zhaoqifeng + * @date 2020/11/11 8:59 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("editmobile") + public Result editMobile(@LoginUser TokenDto tokenDto, @RequestBody EditMobileFormDTO formDTO) { + personalCenterService.editMobile(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..7113c26539 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/PersonalCenterService.java @@ -0,0 +1,47 @@ +package com.epmet.modules.mine.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.EditInfoFormDTO; +import com.epmet.dto.form.EditMobileFormDTO; +import com.epmet.dto.form.SendCodeFormDTO; +import com.epmet.resi.mine.dto.result.InitInfoResultDTO; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/3 9:50 + */ +public interface PersonalCenterService { + + InitInfoResultDTO initInfo(TokenDto tokenDto); + + /** + * 修改信息 + * @author zhaoqifeng + * @date 2020/11/11 9:28 + * @param tokenDto + * @param formDTO + * @return void + */ + void editInfo(TokenDto tokenDto, EditInfoFormDTO formDTO); + + /** + * 获取验证码 + * @author zhaoqifeng + * @date 2020/11/10 10:50 + * @param tokenDto + * @param formDTO + * @return void + */ + void sendCode(TokenDto tokenDto, SendCodeFormDTO formDTO); + + /** + * 修改手机号 + * @author zhaoqifeng + * @date 2020/11/11 8:59 + * @param tokenDto + * @param formDTO + * @return void + */ + void editMobile(TokenDto tokenDto, EditMobileFormDTO 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..f758bf53b4 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java @@ -0,0 +1,89 @@ +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.form.EditMobileFormDTO; +import com.epmet.dto.form.SendCodeFormDTO; +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()); + } + } + + /** + * 获取验证码 + * + * @param tokenDto + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/11/10 10:50 + */ + @Override + public void sendCode(TokenDto tokenDto, SendCodeFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + Result result = epmetUserOpenFeignClient.sendCode(formDTO); + if (!result.success()) { + throw new RenException(result.getCode(), result.getMsg()); + } + } + + /** + * 修改手机号 + * + * @param tokenDto + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/11/11 8:59 + */ + @Override + public void editMobile(TokenDto tokenDto, EditMobileFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + Result result = epmetUserOpenFeignClient.editMobile(formDTO); + if (!result.success()) { + throw new RenException(result.getCode(), result.getMsg()); + } + } +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java new file mode 100644 index 0000000000..f9f133bc02 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/BadgeController.java @@ -0,0 +1,84 @@ +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.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; +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; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/11/3 10:42 上午 + */ +@RestController +@RequestMapping("badge") +public class BadgeController { + + @Autowired + private BadgeService badgeService; + + /** + * @Description 个人中心-获取个人徽章点亮列表 + * @Param badgeListFormDTO + * @author zxc + * @date 2020/11/3 4:11 下午 + */ + @PostMapping("list") + public Result> getBadgeList(@LoginUser TokenDto tokenDto,@RequestBody BadgeListFormDTO badgeListFormDTO){ + ValidatorUtils.validateEntity(badgeListFormDTO, BadgeListFormDTO.BadgeList.class); + 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)); + } + + /** + * @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); + return badgeService.certificationAdd(tokenDto,certificationAddFormDTO); + } + + /** + * @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/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..1119d95bc3 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/IssueController.java @@ -0,0 +1,97 @@ +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.form.MyPubIssuesAuditingFormDTO; +import com.epmet.dto.result.MyPartIssuesResultDTO; +import com.epmet.dto.result.MyPartProjectsResultDTO; +import com.epmet.dto.result.MyPubIssuesAuditingResultDTO; +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; +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 zxc + * @DateTime 2020/11/10 9:37 上午 + */ +@RestController +@RequestMapping("issue") +public class IssueController { + + @Autowired + private IssueService issueService; + @Autowired + private LoginUserUtil loginUserUtil; + + /** + * @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)); + } + + /** + * @Description 个人中心-我参与的项目列表 + * @author sun + */ + @PostMapping("my-part-projects") + public Result> myPartProjects(@LoginUser TokenDto tokenDTO, @RequestBody MyPartProjectsFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, MyPartProjectsFormDTO.MyProject.class); + formDTO.setUserId(tokenDTO.getUserId()); + 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)); + } + + /** + * @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/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..8ffdbeb5ea --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/controller/TopicController.java @@ -0,0 +1,94 @@ +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.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.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; +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; + + @Autowired + private TopicService topicService; + + /** + * @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); + } + + /** + * @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); + } + + /** + * @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/BadgeService.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java new file mode 100644 index 0000000000..2bd0869cbb --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/BadgeService.java @@ -0,0 +1,53 @@ +package com.epmet.modules.person.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; +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; + +/** + * @Author zxc + * @DateTime 2020/11/3 10:52 上午 + */ +public interface BadgeService { + + /** + * @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); + + /** + * @Description 个人中心-提交徽章认证 + * @Param tokenDto + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 11:16 上午 + */ + Result 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/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..b04c5082a3 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/IssueService.java @@ -0,0 +1,58 @@ +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.dto.result.MyPubIssuesClosedResultDTO; +import com.epmet.dto.result.MyPubIssuesShiftProjectResultDTO; +import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; + +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); + + /** + * @Description 个人中心-我参与的项目列表 + * @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); + + /** + * @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/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..1f920dc64b --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/TopicService.java @@ -0,0 +1,39 @@ +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; + +/** + * 话题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); + + /** + * @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/BadgeServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java new file mode 100644 index 0000000000..0bcfd1fb8b --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/BadgeServiceImpl.java @@ -0,0 +1,109 @@ +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.OpenedOrClosedFormDTO; +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.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; +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; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/11/3 10:53 上午 + */ +@Service +@Slf4j +public class BadgeServiceImpl implements BadgeService { + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @Description 个人中心-获取个人徽章点亮列表 + * @Param badgeListFormDTO + * @author zxc + * @date 2020/11/3 4:11 下午 + */ + @Override + 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("获取徽章点亮列表失败......"); + } + if (null == listResult.getData()){ + return new ArrayList<>(); + } + 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; + } + + /** + * @Description 个人中心-提交徽章认证 + * @Param tokenDto + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 11:16 上午 + */ + @Override + public Result certificationAdd(TokenDto tokenDto, CertificationAddFormDTO certificationAddFormDTO) { + certificationAddFormDTO.setUserId(tokenDto.getUserId()); + Result result = epmetUserOpenFeignClient.authBadgeRecord(certificationAddFormDTO); + return result; + } + + /** + * @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-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..c5f6e6757d --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/IssueServiceImpl.java @@ -0,0 +1,259 @@ +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.constant.IssueOpenConstant; +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.result.*; +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.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; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +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.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/11/10 10:00 上午 + */ +@Service +@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 个人中心-我参与的议题列表 + * @Param tokenDto + * @author zxc + * @date 2020/11/10 10:01 上午 + */ + @Override + public List myPartIssues(TokenDto tokenDto) { + MyPartIssuesFormDTO form = new MyPartIssuesFormDTO(); + form.setUserId(tokenDto.getUserId()); + Result> listResult = issueOpenFeignClient.myPartIssues(form); + if (!listResult.success()){ + throw new RenException("查询我参与的议题列表失败......"); + } + if (CollectionUtils.isEmpty(listResult.getData())){ + return new ArrayList<>(); + } + 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; + } + + /** + * @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("查询我发起的议题列表-表决中失败......"); + } + if (CollectionUtils.isEmpty(listResult.getData())){ + return new ArrayList<>(); + } + return listResult.getData(); + } + + /** + * @param formDTO + * @author yinzuomei + * @description 个人中心-我发起的议题列表-已转项目 按照转项目时间排序 + * @Date 2020/11/11 13:35 + **/ + @Override + public List getMyPubIssuesShiftProject(MyPubIssuesAuditingFormDTO formDTO) { + //查询我发起的议题,并且 已转项目 + 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<>(); + Set gridIds=new HashSet<>(); + 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.getGridListByGridIds(new ArrayList<>(gridIds)); + 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.setIssueId(issueDTO.getId()); + resultDTO.setProjectId(issueDTO.getProjectId()); + 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()); + + + 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; + } + + /** + * @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<>(); + } + //议题来源话题id集合 + List topicIds=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()); + gridIds.add(issueDTO.getGridId()); + } + } ); + //查询网格名称 + Result> gridNameList = govOrgOpenFeignClient.getGridListByGridIds(new ArrayList<>(gridIds)); + if (!gridNameList.success()){ + logger.error("查询议题来源网格名称失败......"); + } + //查询话题来源小组名称 + Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(topicIds)); + if (!groupNameList.success()){ + logger.error("查询议题来源小组名称失败......"); + } + List resultDTOList=new ArrayList<>(); + for(IssueDTO issueDTO:issueResult.getData()){ + MyPubIssuesClosedResultDTO resultDTO=new MyPubIssuesClosedResultDTO(); + resultDTO.setIssueId(issueDTO.getId()); + resultDTO.setIssueTitle(issueDTO.getIssueTitle()); + resultDTO.setSuggestion(issueDTO.getSuggestion()); + resultDTO.setClosedTime(issueDTO.getClosedTimeStamp()); + 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); + } + return resultDTOList; + } +} 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..fe816108c1 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/person/service/impl/TopicServiceImpl.java @@ -0,0 +1,112 @@ +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; + +@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; + + @Autowired + private GovIssueOpenFeignClient govIssueOpenFeignClient; + + @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(), RenException.MessageMode.CODE_INTERNAL_EXTERNAL); + } + + 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(), RenException.MessageMode.CODE_INTERNAL_EXTERNAL); + } + 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(); + } +} 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 new file mode 100644 index 0000000000..131e4a9203 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/constant/BadgeConstant.java @@ -0,0 +1,45 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2020/11/3 2:45 下午 + */ +public interface BadgeConstant { + + String BADGE_KEY = "epmet:badge:customer:"; + + String BADGE = "badge"; + + String DEFAULT_CUSTOMER = "default"; + + String YES = "yes"; + + String NO = "no"; + + String REJECTED = "rejected"; + + String APPROVED = "approved"; + + String NONE ="none"; + + String SMS_CODE_KEY = "epmet:smsCode:badge:"; + + String PARTY ="party"; + + String ONLINE ="online"; + + String OFFLINE ="offline"; + + String RESI = "resi"; + + String AUTH_TITLE = "您有一条认证消息"; + + String GET_BADGE_NAME_FAILURE = "获取徽章名称失败......"; + + String MESSAGE_CONTENT = "您好,您的%s因认证失败未成功点亮,请查看"; + + String READ_FLAG = "unread"; + + String DEFAULT = "default"; + +} 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/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-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..6a26e01d39 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceDTO.java @@ -0,0 +1,171 @@ +/** + * 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; + + +/** + * user_advice + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +@Data +public class UserAdviceDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户名 + */ + private String customerName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织pids + */ + private String agencyPids; + + /** + * 组织parent name + */ + private String agencyAllParentName; + + /** + * 组织名 + */ + 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; + + /** + * 问题分类(gov政府software软件,逗号分隔) + */ + private String adviceType; + + /** + * 问题时间 + */ + private Date adviceTime; + + /** + * 回复内容 + */ + private String replyContent; + + /** + * 回复人id + */ + private String replyUserId; + + /** + * 回复人姓名 + */ + private String replyUserName; + + /** + * 回复时间 + */ + private Date replyTime; + + /** + * 政府存证文字 + */ + private String govContent; + + /** + * 删除标志 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} 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..cb39a925d5 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserAdviceImgDTO.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 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; + + /** + * 类型,resi为用户上传,oper为运营上传 + */ + private String type; + + /** + * 图片url + */ + private String imgUrl; + + /** + * 删除标志 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} 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..820f0fa45c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBadgeCertificateRecordDTO.java @@ -0,0 +1,45 @@ +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 id; + private String customerId; + private String gridId; + private String userId; + private String badgeId; + private String surname; + private String name; + private String mobile; + 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/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/AdviceListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AdviceListFormDTO.java new file mode 100644 index 0000000000..1e001b988a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AdviceListFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.util.Date; + +/** + * @description: + * @author: liushaowen + * @date: 2020/11/9 10:37 + */ +@Data +public class AdviceListFormDTO { + /** + * 客户id 不填查询所有 + */ + private String customerId; + + /** + * 组织id 不填查询所有 + */ + private String agencyId; + + /** + * 是否被回复,0未回复,1回复, 传空查询所有 + */ + private String isReply; + + /** + * 问题类型 gov政府,software软件 ,传空查询全部,单选 + */ + private String adviceType; + + /** + * 开始时间 可不填 + */ + private Date startTime; + + /** + * 结束时间 可不填 + */ + private Date endTime; + + /** + * 页码 + */ + @Min(1) + private int pageNo; + + /** + * 页大小 + */ + @Min(1) + private int pageSize; +} 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/form/BadgeAuditFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java new file mode 100644 index 0000000000..c3748fe49f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeAuditFormDTO.java @@ -0,0 +1,23 @@ +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/5 11:06 + */ +@NoArgsConstructor +@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 new file mode 100644 index 0000000000..66384607cf --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/BadgeFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +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; + public interface ManageGroup {} + public interface AuditGroup {} + @NotBlank(message = "徽章id不能为空", groups = {ManageGroup.class}) + private String badgeId; + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + /** + * 网格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/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..feef1ee323 --- /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 surname; + + /** + * 名 + */ + private String name; + + /** + * 身份证号 + */ + private String idcard; + + /** + * 认证证件图片url + */ + private String certificationImg; + + /** + * 认证说明 + */ + private String remark; + + /** + * 验证码 + */ + private String code; + +} 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..9618efac5d --- /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 recordId; +} 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..7b8cc1fb4a --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditBadgeFormDTO.java @@ -0,0 +1,41 @@ +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; + @NotBlank(message = "徽章ID不能为空") + 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/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/dto/form/EditMobileFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditMobileFormDTO.java new file mode 100644 index 0000000000..681a70b391 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditMobileFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/11 8:56 + */ +@Data +public class EditMobileFormDTO implements Serializable { + private static final long serialVersionUID = -6414713675159933915L; + @NotBlank(message = "手机号不能为空") + private String mobile; + @NotBlank(message = "验证码不能为空") + private String code; + private String userId; +} 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/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/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/form/SendCodeFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendCodeFormDTO.java new file mode 100644 index 0000000000..e456507a0b --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SendCodeFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/10 10:44 + */ +@Data +public class SendCodeFormDTO implements Serializable { + private static final long serialVersionUID = -2098912419326588536L; + @NotBlank(message = "客户ID不能为空") + private String customerId; + @NotBlank(message = "手机号不能为空") + private String mobile; + private String userId; + +} 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-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 new file mode 100644 index 0000000000..2cb7f728dc --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeListFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/3 11:07 上午 + */ +@Data +public class UserBadgeListFormDTO implements Serializable { + + private static final long serialVersionUID = 9002922684993474574L; + + /** + * 用户ID + */ + private String userId; + + /** + * 客户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/UserBadgeUnitFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java new file mode 100644 index 0000000000..124b94b3bd --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserBadgeUnitFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Objects; + +/** + * @Description 用户-徽章缓存单元(专为redis操作提供) 尽量不要使用这个DTO,因为重写了hashcode和equals + * 在为单个用户查询时可以使用这个DTO,FIXME 批量查询时不要用该类接收!!!!!! + * @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-client/src/main/java/com/epmet/dto/form/UserGroupFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserGroupFormDTO.java new file mode 100644 index 0000000000..341a868589 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserGroupFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.form; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 传入一组用户Id + * @ClassName UserGroupFormDTO + * @Auth wangc + * @Date 2020-11-10 14:47 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class UserGroupFormDTO implements Serializable { + private static final long serialVersionUID = -8406380736895707328L; + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空") + private String customerId; + + /** + * 用户Id集合 + */ + @NotEmpty(message = "用户Id不能为空") + private List userIds; +} 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/AdviceDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java new file mode 100644 index 0000000000..2f8bbbc262 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/AdviceDetailResultDTO.java @@ -0,0 +1,99 @@ +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/5 17:37 + */ +@Data +public class AdviceDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 建议id + */ + private String adviceId; + + /** + * 客户名 + */ + private String customerName; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 网格名 + */ + private String gridName; + + /** + * 注册电话 + */ + private String regPhone; + + /** + * 意见类型 + */ + private String adviceType; + + /** + * 提建议人姓名 + */ + private String userName; + + /** + * 建议内容 + */ + private String adviceContent; + + /** + * 填写的电话 + */ + private String phone; + + /** + * 建议时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date adviceTime; + + /** + * 回复内容 + */ + private String replyContent; + + /** + * 回复时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date replyTime; + + /** + * 回复人姓名 + */ + private String replyUserName; + + /** + * 建议图片列表 + */ + private List imgList; + + /** + * 政府回应图片 + */ + private List govImgList; + + /** + * 政府回应文字 + */ + private String govContent; +} 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-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-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..7ae47fdbca --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditRecordResultDTO.java @@ -0,0 +1,53 @@ +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; + + /** + * 用户头像 + */ + 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 new file mode 100644 index 0000000000..58d322f8df --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/BadgeAuditingResultDTO.java @@ -0,0 +1,53 @@ +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; + + /** + * 用户头像 + */ + private String userAvatar; + + /** + * 徽章审核记录ID + */ + private String recordId; + +} 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-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..95670ba7e8 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java @@ -0,0 +1,65 @@ +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 idcard; + + /** + * 是否认证 yes 认证 no 已认证 + */ + private String isCertificated; + + /** + * 手机号 + */ + private String mobile; + + /** + * 认证图片地址 + */ + private String certificationImg; + + /** + * 备注 + */ + private String remark; + + /** + * 审核结果 + */ + private String authResult; + + /** + * 驳回原因 + */ + private String authReason; + + /** + * 审核记录ID + */ + private String recordId; +} 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/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..b6d12a12d4 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MyAdviceListResultDTO.java @@ -0,0 +1,32 @@ +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 String adviceType; + + 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-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-client/src/main/java/com/epmet/dto/result/UserBadgeInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeInfoResultDTO.java new file mode 100644 index 0000000000..d600c35254 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeInfoResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 用户勋章单位DTO + ClassName UserBadgeInfoResultDTO + * @Auth wangc + * @Date 2020-11-10 15:29 + */ +@Data +public class UserBadgeInfoResultDTO implements Serializable { + private static final long serialVersionUID = -793619932269122320L; + + /** + * 用户Id + */ + private String userId; + + /** + * 徽章Id + */ + private String badgeId; + + /** + * 徽章图标 url + */ + private String badgeIcon; + + /** + * 徽章名称 + */ + private String badgeName; +} 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 new file mode 100644 index 0000000000..19fce3bb3c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBadgeListResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/11/3 11:08 上午 + */ +@Data +public class UserBadgeListResultDTO implements Serializable { + + private static final long serialVersionUID = -6542233940679158922L; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 徽章图片地址 + */ + private String badgeIcon; + + /** + * 徽章是否点亮 + */ + private String isOpened; + + private String badgeType; + + @JsonIgnore + private String customerId; + @JsonIgnore + private String badgeName; + @JsonIgnore + private String fixationBadgeType; + @JsonIgnore + private Boolean status; + + public UserBadgeListResultDTO() { + this.badgeId = ""; + this.badgeIcon = ""; + this.isOpened = "0"; + this.status = false; + } +} 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..89f3f98aba --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserOperListResultDTO.java @@ -0,0 +1,67 @@ +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; + + /** + * 徽章类型:党员徽章;party,无:none + */ + private String badgeType; + + @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 e7fda8ad3e..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 @@ -13,6 +13,7 @@ import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.Map; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -50,7 +51,7 @@ public interface EpmetUserOpenFeignClient { * @date 2020/6/2 16:11 */ @PostMapping("/epmetuser/staffrole/staffroles/{staffId}") - Result> getStaffRoles(@PathVariable String staffId); + Result> getStaffRoles(@PathVariable("staffId") String staffId); /** * @param staffId @@ -328,10 +329,115 @@ 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); + + /** + * 修改手机号-获取验证码 + * @author zhaoqifeng + * @date 2020/11/10 10:51 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/epmetuser/userresiinfo/sendcode") + Result sendCode(@RequestBody SendCodeFormDTO formDTO); + + /** + * 修改手机号 + * @author zhaoqifeng + * @date 2020/11/11 8:59 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/epmetuser/userresiinfo/editmobile") + Result editMobile(@RequestBody EditMobileFormDTO formDTO); + + /** + * @Description 查询已经点亮的徽章 + * @Param userBadgeListFormDTO + * @author zxc + * @date 2020/11/3 1:33 下午 + */ + @PostMapping("/epmetuser/more/badge/badgelist") + Result> selectBadgeList(@RequestBody UserBadgeListFormDTO userBadgeListFormDTO); + + /** + * @Description 个人中心-获取徽章可操作列表(点亮,取消,认证) + * @Param operListFormDTO + * @author zxc + * @date 2020/11/3 4:28 下午 + */ + @PostMapping("/epmetuser/more/badge/badgeoperlist") + Result> selectOperList(@RequestBody UserOperListFormDTO userOperListFormDTO); + + /** + * @Description 徽章认证提交 + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 4:30 下午 + */ + @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); + /** * 根据staffId查询用户基本信息 * @author sun */ @PostMapping("/epmetuser/customerstaff/getstaffbasicinfo") Result getStaffBasicInfo(@RequestBody StaffBasicInfoFromDTO fromDTO); + + /** + * @Description 个人中心-我的建议列表 + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/11/11 10:35 + */ + @PostMapping("/epmetuser/useradvice/myadvicelist") + Result> myAdviceList(@RequestBody MyAdviceListFormDTO dto); + + /** + * @Description 个人中心-提交建议 + * @param dto + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/11/11 10:36 + */ + @PostMapping("/epmetuser/useradvice/submitadvice") + Result submitAdvice(@RequestBody SubmitAdviceFormDTO dto); + + /** + * @Description 供其他服务调用 查询指定用户需要显示的徽章信息(缓存补偿) + * @param param + * @return com.epmet.commons.tools.utils.Result>> + * @author wangc + * @date 2020.11.10 15:59 + */ + @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 9e0c973463..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 @@ -11,6 +11,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient; import org.springframework.stereotype.Component; import java.util.List; +import java.util.Map; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -221,8 +222,93 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffBasicInfo", formDTO); } + @Override + public Result editUserInfo(EditInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editUserInfo", formDTO); + } + + /** + * 修改手机号-获取验证码 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/11/10 10:51 + */ + @Override + public Result sendCode(SendCodeFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "sendCode", formDTO); + } + + /** + * 修改手机号 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/11/11 8:59 + */ + @Override + public Result editMobile(EditMobileFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editMobile", formDTO); + } + + @Override + 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); + } + + @Override + 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); + } + @Override public Result getStaffBasicInfo(StaffBasicInfoFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffBasicInfo", fromDTO); } + + @Override + public Result> myAdviceList(MyAdviceListFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "myAdviceList", dto); + + } + + @Override + public Result submitAdvice(SubmitAdviceFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "submitAdvice", dto); + } + + /** + * @Description 供其他服务调用 查询指定用户需要显示的徽章信息(缓存补偿) + * @param param + * @return com.epmet.commons.tools.utils.Result>> + * @author wangc + * @date 2020.11.10 15:59 + */ + @Override + 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/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/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/constant/UserAdviceConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserAdviceConstant.java new file mode 100644 index 0000000000..fb82d09fd7 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/constant/UserAdviceConstant.java @@ -0,0 +1,7 @@ +package com.epmet.constant; + +public interface UserAdviceConstant { + String GOV_TYPE_TEXT = "政府业务建议"; + + String SOFTWARE_TYPE_TEXT = "软件功能及体验问题"; +} 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..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 @@ -23,4 +25,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(":").concat( StringUtils.isBlank(userId) ? "*" : userId );} } 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..7a880540bd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java @@ -0,0 +1,181 @@ +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.*; +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.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; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/11/3 16:09 + */ +@RestController +@RequestMapping("badge") +public class BadgeController { + @Autowired + private BadgeService badgeService; + @Autowired + private UserBadgeRedis badgeRedis; + + /** + * 徽章列表 + * @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) { + ValidatorUtils.validateEntity(formDTO, BadgeFormDTO.ManageGroup.class); + 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) { + ValidatorUtils.validateEntity(formDTO, BadgeFormDTO.ManageGroup.class); + badgeService.deleteBadge(tokenDto, formDTO); + return new Result(); + } + + @PostMapping("test-cache") + public Result testCache(){ + 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) { + ValidatorUtils.validateEntity(formDTO, BadgeFormDTO.AuditGroup.class); + 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) { + ValidatorUtils.validateEntity(formDTO, BadgeFormDTO.AuditGroup.class); + 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) { + ValidatorUtils.validateEntity(formDTO); + badgeService.audit(tokenDto, formDTO); + return new Result(); + } + + /** + * @Description 供其他服务调用 查询指定用户需要显示的徽章信息(缓存补偿) + * @param param + * @return com.epmet.commons.tools.utils.Result>> + * @author wangc + * @date 2020.11.10 15:59 + */ + @PostMapping("usershowbadge") + public Result>> userShowBadge(@RequestBody UserGroupFormDTO param){ + 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/controller/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java new file mode 100644 index 0000000000..ed52f4da9d --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -0,0 +1,182 @@ +/** + * 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.exception.RenException; +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; +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.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; +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; +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; +import java.util.regex.Pattern; + + +/** + * user_advice + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +@RestController +@RequestMapping("useradvice") +public class UserAdviceController { + + @Autowired + private UserAdviceService userAdviceService; + + @Autowired + private LoginUserUtil loginUserUtil; + + @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); + } + + /** + * @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); + userAdviceService.replyAdvice(dto, loginUserUtil.getLoginUserId()); + 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(@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); + 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); + } + + /** + * @Description 居民端-我的建议列表 + * @param dto + * @return com.epmet.commons.tools.utils.Result> + * @Author liushaowen + * @Date 2020/11/9 17:35 + */ + @PostMapping("myadvicelist") + public Result> myAdviceList(@RequestBody MyAdviceListFormDTO dto) { + return new Result>().ok(userAdviceService.myAdviceList(dto.getPageSize(),dto.getPageNo(),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/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/controller/UserBadgeController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java new file mode 100644 index 0000000000..a901d9202f --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBadgeController.java @@ -0,0 +1,115 @@ +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.*; +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 com.epmet.service.UserBadgeService; +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 zxc + * @DateTime 2020/11/3 11:16 上午 + */ +@RestController +@RequestMapping("more/badge") +public class UserBadgeController { + + @Autowired + private UserBadgeService userBadgeService; + + /** + * @Description 查询已经点亮的徽章 + * @Param userBadgeListFormDTO + * @author zxc + * @date 2020/11/3 1:33 下午 + */ + @PostMapping("badgelist") + public Result> selectBadgeList(@RequestBody UserBadgeListFormDTO userBadgeListFormDTO){ + 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)); + } + + /** + * @Description 个人中心-提交徽章认证 + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 1:36 下午 + */ + @PostMapping("authbadgerecord") + public Result authBadgeRecord(@RequestBody CertificationAddFormDTO certificationAddFormDTO){ + return userBadgeService.authBadgeRecord(certificationAddFormDTO); + } + + /** + * @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(); + } + + /** + * @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)); + } + + /** + * @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)); + } + + /** + * @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/controller/UserResiInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java index 56a75d64cc..604c8ac22b 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,42 @@ 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(); + } + + /** + * 修改手机号-获取验证码 + * @author zhaoqifeng + * @date 2020/11/10 10:51 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("sendcode") + public Result sendCode(@RequestBody SendCodeFormDTO formDTO) { + userResiInfoService.sendCode(formDTO); + return new Result(); + } + + /** + * 修改手机号 + * @author zhaoqifeng + * @date 2020/11/11 8:59 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("editmobile") + public Result editMobile(@RequestBody EditMobileFormDTO formDTO) { + userResiInfoService.editMobile(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..64356f9b56 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java @@ -0,0 +1,170 @@ +/** + * 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.BadgeDTO; +import com.epmet.dto.result.*; +import com.epmet.entity.BadgeEntity; +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 BadgeDao extends BaseDao { + + /** + * 获取徽章列表 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/3 17:30 + */ + List selectList(@Param("customerId") String customerId); + + /** + * 重名校验 + * + * @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); + + /** + * 编辑重名校验 + * + * @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 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); + + /** + * 获取徽章信息 + * + * @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); + + /** + * 更新徽章信息 + * + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/11/4 15:38 + */ + void updateBadge(BadgeEntity entity); + + /** + * 删除徽章信息 + * + * @param customerId + * @param badgeId + * @return void + * @author zhaoqifeng + * @date 2020/11/4 15:39 + */ + void deleteBadge(@Param("customerId") String customerId, @Param("badgeId") String badgeId); + + + /** + * 待审核列表 + * + * @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("gridId") String gridId); + + /** + * 审核历史列表 + * + * @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("gridId") String gridId); + + /** + * @param customerId + * @return java.util.List + * @Description 查询客户的徽章 + * @author wangc + * @date 2020.11.05 15:50 + */ + List selectCustomerBadgePool(@Param("customerId") String customerId); + + /** + * 插入数据 + * + * @param entity + * @return void + * @author zhaoqifeng + * @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/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/dao/UserAdviceDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.java new file mode 100644 index 0000000000..3fd6a4f205 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserAdviceDao.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.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; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * user_advice + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +@Mapper +public interface UserAdviceDao extends BaseDao { + void replyAdvice(@Param("adviceId") String adviceId, + @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); + + int saveUserAdvice(UserAdviceDTO dto); +} 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/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/dao/UserBadgeDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java new file mode 100644 index 0000000000..e861249258 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBadgeDao.java @@ -0,0 +1,122 @@ +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.form.UserBadgeUnitFormDTO; +import com.epmet.dto.result.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/11/3 1:22 下午 + */ +@Mapper +public interface UserBadgeDao { + + /** + * @Description 查询已经点亮的徽章 + * @Param userBadgeListFormDTO + * @author zxc + * @date 2020/11/3 1:33 下午 + */ + List selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO); + + /** + * @Description 查询默认徽章和改名后的徽章 + * @Param userBadgeListFormDTO + * @author zxc + * @date 2020/11/3 3:11 下午 + */ + List selectAllBadge(@Param("customerId") String customerId); + + /** + * @Description 查询单个徽章信息 + * @Param customerId + * @Param badgeId + * @author zxc + * @date 2020/11/9 11:17 上午 + */ + UserBadgeListResultDTO selectBadgeByBadgeId(@Param("customerId") String customerId,@Param("badgeId") String badgeId); + + /** + * @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); + + /** + * @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); + + /** + * @Description 查询单个徽章的认证记录 + * @Param userId + * @Param badgeId + * @author zxc + * @date 2020/11/4 4:09 下午 + */ + CertificationDetailResultDTO selectBadgeAuthRecord(@Param("userId")String userId, @Param("badgeId")String badgeId,@Param("recordId")String recordId); + + /** + * @Description 个人中心-查询徽章要显示的认证信息字段 + * @Param authFieldFormDTO + * @author zxc + * @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); + + /** + * @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); + + /** + * @Description 批量查找用户全部的显示徽章(排序) + * @param customerId + * @param userIds + * @return java.util.List + * @author wangc + * @date 2020.11.09 14:14 + */ + List selectBatchUserSortedBadge(@Param("customerId")String customerId, @Param("userIds")List userIds); +} 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/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/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/entity/UserAdviceEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java new file mode 100644 index 0000000000..9340acd044 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceEntity.java @@ -0,0 +1,141 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.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; + +/** + * user_advice + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_advice") +public class UserAdviceEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户名 + */ + private String customerName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织pids + */ + private String agencyPids; + + /** + * 组织parent name + */ + private String agencyAllParentName; + + /** + * 组织名 + */ + 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; + + /** + * 问题分类(gov政府software软件,逗号分隔) + */ + private String adviceType; + + /** + * 回复内容 + */ + private String replyContent; + + /** + * 回复人id + */ + private String replyUserId; + + /** + * 回复人姓名 + */ + private String replyUserName; + + /** + * 回复时间 + */ + private Date replyTime; + + /** + * 政府存证文字 + */ + private String govContent; + + /** + * 建议时间 + */ + private Date adviceTime; + +} 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..849b0ba467 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserAdviceImgEntity.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 qu qu@elink-cn.com + * @since v1.0.0 2020-11-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_advice_img") +public class UserAdviceImgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 建议id + */ + private String adviceId; + + /** + * 类型,resi为用户上传,oper为运营上传 + */ + private String type; + + /** + * 图片url + */ + private String imgUrl; + +} 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/excel/UserAdviceExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.java new file mode 100644 index 0000000000..4f5f0896b5 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceExcel.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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * user_advice + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +@Data +public class UserAdviceExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "客户名") + private String customerName; + + @Excel(name = "组织ID") + private String agencyId; + + @Excel(name = "组织PIDs") + private String agencyPids; + + @Excel(name = "组织ParentName") + private String agencyAllParentName; + + @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 Date adviceTime; + + @Excel(name = "建议描述") + private String adviceContent; + + @Excel(name = "填写手机号") + private String phone; + + @Excel(name = "问题分类(gov政府software软件,逗号分隔)") + private String adviceType; + + @Excel(name = "回复内容") + private String replyContent; + + @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; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} diff --git a/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..f32014927c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserAdviceImgExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.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 = "类型") + private String type; + + @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; + + +} 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/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..d35e8427b9 --- /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; + +/** + * user_advice + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +@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/redis/UserBadgeRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java new file mode 100644 index 0000000000..16644fa332 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBadgeRedis.java @@ -0,0 +1,247 @@ +package com.epmet.redis; + + + +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.UserBadgeInfoResultDTO; +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.dao.DataAccessException; +import org.springframework.data.redis.connection.RedisConnection; +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.*; +import java.util.stream.Collectors; + +import static com.epmet.commons.tools.redis.RedisUtils.MINUTE_THIRTY_EXPIRE; + +/** + * @Author zxc + * @DateTime 2020/11/3 2:21 下午 + */ +@Component +@Slf4j +public class UserBadgeRedis { + + @Autowired + private RedisUtils redisUtils; + @Autowired + private BadgeDao badgeDao; + @Autowired + private UserBadgeService badgeService; + @Autowired + private RedisTemplate redisTemplate; + + /** + * @Description 获取客户徽章信息 + * @Param customerId + * @author zxc + * @date 2020/11/3 2:50 下午 + */ + public Object getCustomerBadge(String customerId) { + Object userBadge = redisUtils.hGet(BadgeConstant.BADGE_KEY + customerId, BadgeConstant.BADGE); + return userBadge; + } + + /** + * @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); + } + + /** + * @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 + * @author zxc + * @date 2020/11/5 10:30 上午 + */ + public void saveBadgeSmsCode(String mobile, String smsCode) { + String smsCodeKey = BadgeConstant.SMS_CODE_KEY + mobile; + redisUtils.set(smsCodeKey, smsCode, MINUTE_THIRTY_EXPIRE); + } + + /** + * @Description 获取徽章审核 手机验证码 + * @Param mobile + * @author zxc + * @date 2020/11/5 10:30 上午 + */ + public String getBadgeSmsCode(String mobile) { + String smsCodeKey = BadgeConstant.SMS_CODE_KEY + mobile; + String smsCode = (String) redisUtils.get(smsCodeKey); + return smsCode; + } + + /** + * @param userId + * @return java.util.List + * @Description 获取用户的全部勋章信息(点亮的 、 排序从前到后) + * @author wangc + * @date 2020.11.05 13:26 + */ + public List obtainUserBadge2List(String userId,String customerId) { + 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; + } + + /** + * @Description 批量获取用户显示徽章 + * @param customerId + * @param userIds + * @return java.util.Map> + * @author wangc + * @date 2020.11.10 15:00 + */ + public Map> batchObtainUserBadge(String customerId,List userIds){ + if(CollectionUtils.isEmpty(userIds)) return Collections.EMPTY_MAP; + Map> result = new HashMap<>(); + //存放缓存为空的 + List cacheBlank = new LinkedList<>(); + userIds.forEach(userId -> { + List badges = + redisUtils.lrange(UserRedisKeys.getResiUserBadgeKey(customerId,userId), NumConstant.ZERO, NumConstant.ONE_NEG, UserBadgeUnitFormDTO.class); + if(CollectionUtils.isEmpty(badges)){cacheBlank.add(userId);}else{result.put(userId,badges);} + }); + if(!CollectionUtils.isEmpty(cacheBlank)){ + Map> + map = badgeService.getBatchUserSortedBadge(customerId,cacheBlank); + if(null != map && !map.isEmpty()){ + map.forEach((k,v) -> { + List covert = + v.stream().map( o -> { + return ConvertUtils.sourceToTarget(o,UserBadgeUnitFormDTO.class); + }).collect(Collectors.toList()); + result.put(k,covert); + + redisTemplate.executePipelined((RedisCallback>) connection ->{ + covert.forEach(badge -> { + connection.listCommands().rPush(UserRedisKeys.getResiUserBadgeKey(customerId, k).getBytes(), + redisTemplate.getValueSerializer().serialize(badge)); + }); + return null; + }); + }); + } + } + return result; + } + + /** + * 用户点亮或取消徽章 + * @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,customerId); + 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); + } + } + + //徽章池 + Object badgeObj = getCustomerBadge(customerId); + + List badgePool = + null == badgeObj ? badgeDao.selectCustomerBadgePool(customerId) : JSON.parseArray(badgeObj.toString(), UserBadgeListResultDTO.class); + + 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; + } + + + /** + * @Description 批量清除用户徽章信息,用处:在客户取消点亮某个徽章后,批量清除该客户下所有用户的徽章缓存,当需要查取时再次初始化进缓存中 + * @param customerId + * @return void + * @author wangc + * @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 ->{ + keys.forEach( ser -> {connection.del(redisTemplate.getKeySerializer().serialize(ser));}); + return null; + }); + + } + + 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; + } + + } + 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..b409d5709b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java @@ -0,0 +1,190 @@ +/** + * 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.BadgeAuditFormDTO; +import com.epmet.dto.form.BadgeFormDTO; +import com.epmet.dto.form.EditBadgeFormDTO; +import com.epmet.dto.result.*; +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); + + /** + * 待审核列表 + * @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(); + + /** + * @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/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/UserAdviceImgService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceImgService.java new file mode 100644 index 0000000000..86ed81cb83 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceImgService.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; + +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); + + /** + * @Description 根据adviceId获取关联的图片 + * @param adviceId + * @return void + * @Author liushaowen + * @Date 2020/11/9 9:59 + */ + List getImgsByAdviceId(String adviceId); +} 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..4bfc5d5307 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserAdviceService.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.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; +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-06 + */ +public interface UserAdviceService 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 UserAdviceDTO + * @author generator + * @date 2020-11-06 + */ + UserAdviceDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-06 + */ + void save(UserAdviceDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-06 + */ + void update(UserAdviceDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-11-06 + */ + void delete(String[] ids); + + /** + * @Description 回复建议 + * @param dto + * @param loginUserId + * @return void + * @Author liushaowen + * @Date 2020/11/6 16:44 + */ + void replyAdvice(ReplyAdviceFormDTO dto, String loginUserId); + + /** + * @Description 建议详情 + * @param adviceId + * @return com.epmet.dto.result.AdviceDetailResultDTO + * @Author liushaowen + * @Date 2020/11/6 17:19 + */ + AdviceDetailResultDTO adviceDetail(String adviceId); + + /** + * @Description 查询建议列表 + * @param dto + * @return com.epmet.commons.tools.page.PageData + * @Author liushaowen + * @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); + + /** + * @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/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/UserBadgeService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java new file mode 100644 index 0000000000..a905bb2f9b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBadgeService.java @@ -0,0 +1,101 @@ +package com.epmet.service; + +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.*; + +import java.util.List; +import java.util.Map; + +/** + * @Author zxc + * @DateTime 2020/11/3 11:18 上午 + */ +public interface UserBadgeService { + + /** + * @Description 查询已经点亮的徽章 + * @Param userBadgeListFormDTO + * @author zxc + * @date 2020/11/3 1:33 下午 + */ + List selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO); + + /** + * @Description 个人中心-获取徽章可操作列表(点亮,取消,认证) + * @Param userOperListFormDTO + * @author zxc + * @date 2020/11/3 4:42 下午 + */ + 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); + + /** + * @Description 个人中心-获取徽章认证页面详情 + * @Param tokenDto + * @Param certificationDetailFormDTO + * @author zxc + * @date 2020/11/4 4:03 下午 + */ + CertificationDetailResultDTO certificationDetail(TokenDto tokenDto, CertificationDetailFormDTO certificationDetailFormDTO); + + /** + * @Description 个人中心-查询徽章要显示的认证信息字段 + * @Param authFieldFormDTO + * @author zxc + * @date 2020/11/4 5:05 下午 + */ + List authField(AuthFieldFormDTO authFieldFormDTO); + + /** + * @Description 个人中心-取消/点亮徽章 + * @Param openedOrClosedFormDTO + * @author zxc + * @date 2020/11/4 5:47 下午 + */ + void openedOrClosed(OpenedOrClosedFormDTO openedOrClosedFormDTO); + + /** + * @Description 客户徽章缓存初始化 + * @Param customerId + * @author zxc + * @date 2020/11/5 3:12 下午 + */ + 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); + + /** + * @Description 批量获取用户显示徽章 + * @param customerId + * @param userIds + * @return java.util.Map> + * @author wangc + * @date 2020.11.10 15:12 + */ + Map> getBatchUserSortedBadge(String customerId, List userIds); +} 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..f0281dae5c 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,31 @@ 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); + + /** + * 获取验证码 + * @author zhaoqifeng + * @date 2020/11/10 10:50 + * @param formDTO + * @return void + */ + void sendCode(SendCodeFormDTO formDTO); + + /** + * 修改手机号 + * @author zhaoqifeng + * @date 2020/11/11 8:59 + * @param formDTO + * @return void + */ + void editMobile(EditMobileFormDTO formDTO); } 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..0c52da11ba --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java @@ -0,0 +1,429 @@ +/** + * 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.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; +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.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; +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.*; +import com.epmet.dto.result.*; +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; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; + +/** + * 徽章 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-03 + */ +@Service +@Slf4j +public class BadgeServiceImpl extends BaseServiceImpl implements BadgeService { + + @Autowired + private BadgeCertificationConfigService badgeCertificationConfigService; + @Autowired + private UserBadgeCertificateRecordService userBadgeCertificateRecordService; + @Autowired + private UserBadgeRedis badgeRedis; + @Autowired + private UserBadgeService userBadgeService; + @Autowired + private ResiUserBadgeService resiUserBadgeService; + @Autowired + private MessageFeignClient messageFeignClient; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + + + + @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 客户ID + * @return java.util.List + * @author zhaoqifeng + * @date 2020/11/3 17:04 + */ + @Override + public List getList(String customerId) { + return baseDao.selectList(customerId); + } + + /** + * 添加徽章 + * + * @param tokenDto token + * @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); + //更新Redis + if (BadgeConstant.ONLINE.equals(formDTO.getBadgeStatus())) { + userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId()); + } + } + + /** + * 徽章详情 + * + * @param tokenDto token + * @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 token + * @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); + //更新Redis + userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId()); + } + + /** + * 删除徽章 + * + * @param tokenDto token + * @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()); + if (BadgeConstant.PARTY.equals(badgeEntity.getFixationBadgeType())) { + throw new RenException(EpmetErrorCode.DUPLICATE_PARTY_BADGE_NAME.getCode()); + } + 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()); + } + baseDao.deleteBadge(tokenDto.getCustomerId(), formDTO.getBadgeId()); + } + badgeCertificationConfigService.deleteConfig(tokenDto.getCustomerId(), formDTO.getBadgeId()); + //更新Redis + userBadgeService.reloadCustomerBadge(tokenDto.getCustomerId()); + } + + /** + * 待审核列表 + * + * @param tokenDto token + * @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(), formDTO.getGridId()); + return list; + } + + /** + * 审核历史列表 + * + * @param tokenDto token + * @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(), formDTO.getGridId()); + return list; + } + + /** + * 审核 + * + * @param tokenDto token + * @param formDTO 入参 + * @return void + * @author zhaoqifeng + * @date 2020/11/5 11:08 + */ + @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()); + dto.setAuditRemark(formDTO.getAuditRemark()); + dto.setStaffId(tokenDto.getUserId()); + dto.setIsLast(BadgeConstant.YES); + dto.setAuditTime(new Date()); + userBadgeCertificateRecordService.update(dto); + + 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 + 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(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(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 + public void testCache() { + badgeRedis.pushOrRemoveUserBadge4List("test-wc","1","45687aa479955f9d06204d415238f7cc"); + List cache = badgeRedis.obtainUserBadge2List("test-wc","45687aa479955f9d06204d415238f7cc"); + 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/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/UserAdviceImgServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.java new file mode 100644 index 0000000000..cc8a164969 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceImgServiceImpl.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.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)); + } + + /** + * @param adviceId + * @return UserAdviceImgEntity + * @Description 根据adviceId获取关联的图片 + * @Author liushaowen + * @Date 2020/11/9 9:59 + */ + @Override + public List getImgsByAdviceId(String adviceId) { + return baseDao.selectList(new QueryWrapper().eq("ADVICE_ID",adviceId)); + } + +} 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..be97e8ae21 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -0,0 +1,447 @@ +/** + * 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.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.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.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; +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.*; + +/** + * user_advice + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-11-06 + */ +@Service +public class UserAdviceServiceImpl extends BaseServiceImpl implements UserAdviceService { + + private Logger logger = LogManager.getLogger(UserAdviceServiceImpl.class); + @Autowired + private UserAdviceRedis userAdviceRedis; + + @Autowired + private UserAdviceImgService userAdviceImgService; + + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private UserResiInfoService userResiInfoService; + + @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( + 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)); + } + + /** + * @param dto + * @param loginUserId + * @return void + * @Description 回复建议 + * @Author liushaowen + * @Date 2020/11/6 16:44 + */ + @Override + public void replyAdvice(ReplyAdviceFormDTO dto, String loginUserId) { + //检验是否已经回复过 + UserAdviceEntity userAdviceEntity = baseDao.selectById(dto.getAdviceId()); + if (StringUtils.isNotBlank(userAdviceEntity.getReplyContent()) || StringUtils.isNotBlank(userAdviceEntity.getReplyUserId())) { + throw new RenException("该建议已被回复,不能再次回复"); + } + //审核图片 + auditPic(dto.getGovImgList()); + //审核文字 + auditText(dto.getReplyContent()); + //更新advice表 + baseDao.replyAdvice(dto.getAdviceId(), dto.getReplyContent(), dto.getGovContent(), loginUserId); + //如果govImg不为空,插入advice_img表 + List govImgList = dto.getGovImgList(); + 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(dto.getAdviceId()); + entity.setType("oper"); + userAdviceImgEntities.add(entity); + } + userAdviceImgService.insertBatch(userAdviceImgEntities); + } + } + + /** + * @param adviceId + * @return com.epmet.dto.result.AdviceDetailResultDTO + * @Description 建议详情 + * @Author liushaowen + * @Date 2020/11/6 17:19 + */ + @Override + public AdviceDetailResultDTO adviceDetail(String adviceId) { + UserAdviceEntity userAdviceEntity = baseDao.selectById(adviceId); + AdviceDetailResultDTO adviceDetailResultDTO = new AdviceDetailResultDTO(); + BeanUtils.copyProperties(userAdviceEntity, adviceDetailResultDTO); + adviceDetailResultDTO.setAdviceId(userAdviceEntity.getId()); + //如果parentName不为空,拼接agencyName + if (StringUtils.isNotBlank(userAdviceEntity.getAgencyAllParentName())){ + adviceDetailResultDTO.setAgencyName(userAdviceEntity.getAgencyAllParentName()+"-"+userAdviceEntity.getAgencyName()); + } + //拼接建议类型 + if (!"*".equals(userAdviceEntity.getAdviceType())) { + StringBuilder type = new StringBuilder(); + if (userAdviceEntity.getAdviceType().contains("gov")) { + type.append(UserAdviceConstant.GOV_TYPE_TEXT); + } + if (userAdviceEntity.getAdviceType().contains("software")) { + if (type.length() != 0) { + type.append(","); + } + type.append(UserAdviceConstant.SOFTWARE_TYPE_TEXT); + } + adviceDetailResultDTO.setAdviceType(type.toString()); + } + //获取建议图片 + List imgsByAdviceId = userAdviceImgService.getImgsByAdviceId(adviceId); + List govImgList = new ArrayList<>(); + List resiImgList = new ArrayList<>(); + for (UserAdviceImgEntity entity : imgsByAdviceId) { + if ("resi".equals(entity.getType())) { + resiImgList.add(entity.getImgUrl()); + } else if ("oper".equals(entity.getType())) { + govImgList.add(entity.getImgUrl()); + } + } + adviceDetailResultDTO.setImgList(resiImgList); + adviceDetailResultDTO.setGovImgList(govImgList); + return adviceDetailResultDTO; + } + + /** + * @param dto + * @return com.epmet.commons.tools.page.PageData + * @Description 查询建议列表 + * @Author liushaowen + * @Date 2020/11/9 10:41 + */ + @Override + public PageData adviceList(AdviceListFormDTO dto) { + //page分页 + Page page = new Page<>(dto.getPageNo(), dto.getPageSize()); + //时间降序 + page.addOrder(OrderItem.desc(FieldConstant.CREATED_TIME)); + + //wrapper + QueryWrapper wrapper = new QueryWrapper<>(); + //del_flag + wrapper.eq("DEL_FLAG","0"); + //客户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", ""); + } + //建议类型 + 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()); + // 组织id + if (StringUtils.isNotBlank(dto.getAgencyId())){ + wrapper.and(wrapper1 ->wrapper1.eq("AGENCY_ID", dto.getAgencyId()) + .or() + .like("AGENCY_PIDS", dto.getAgencyId())); + } + + + 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); + + return getPageData(result, AdviceListResultDTO.class); + } + + /** + * @param pageSize + * @param pageNo + * @param loginUserId + * @return java.util.List + * @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); + } + + /** + * @param dto + * @param loginUserId + * @return void + * @Description 居民端-回复建议 + * @Author liushaowen + * @Date 2020/11/10 10:57 + */ + @Override + public void submitAdvice(SubmitAdviceFormDTO dto, String loginUserId) { + //审核图片文字 + auditText(dto.getAdviceContent()); + auditPic(dto.getImgList()); + UserAdviceDTO userAdviceDTO = new UserAdviceDTO(); + BeanUtils.copyProperties(dto,userAdviceDTO); + + //获取customerName + CustomerDTO customerDTO = new CustomerDTO(); + customerDTO.setId(dto.getCustomerId()); + Result 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()); + userAdviceDTO.setAgencyAllParentName(agencyById.getData().getAllParentName()); + userAdviceDTO.setAgencyPids(agencyById.getData().getPids()); + }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(); + taskDTO.setContent(text); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result 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("图片审核成功"); + } + } +} 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/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java new file mode 100644 index 0000000000..f7939fabb8 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java @@ -0,0 +1,308 @@ +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.security.dto.TokenDto; +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.ResiUserBadgeDao; +import com.epmet.dao.UserBadgeDao; +import com.epmet.dto.UserBadgeCertificateRecordDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.redis.UserBadgeRedis; +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.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/11/3 11:18 上午 + */ +@Service +@Slf4j +public class UserBadgeServiceImpl implements UserBadgeService { + + @Autowired + private UserBadgeDao userBadgeDao; + @Autowired + private UserBadgeRedis userBadgeRedis; + @Autowired + private UserBaseInfoService userBaseInfoService; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private EpmetMessageOpenFeignClient messageFeignClient; + + /** + * @Description 查询已经点亮的徽章 + * @Param userBadgeListFormDTO + * @author zxc + * @date 2020/11/3 1:33 下午 + */ + @Override + public List selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO) { + Object userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId()); + if (null == userBadge){ + this.reloadCustomerBadge(userBadgeListFormDTO.getCustomerId()); + userBadge = userBadgeRedis.getCustomerBadge(userBadgeListFormDTO.getCustomerId()); + } + List redisUserBadgeList = JSON.parseArray(userBadge.toString(), UserBadgeListResultDTO.class); + List userBadgeListResultDTOS = userBadgeDao.selectBadgeList(userBadgeListFormDTO); + if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){ + return redisUserBadgeList; + } + redisUserBadgeList.forEach(u -> { + userBadgeListResultDTOS.forEach(badge -> { + if (u.getBadgeId().equals(badge.getBadgeId())){ + badge.setBadgeIcon(u.getBadgeIcon()); + u.setStatus(true); + } + }); + }); + 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.getCustomerBadge(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; + } + + /** + * @Description 个人中心-提交徽章认证 + * @Param certificationAddFormDTO + * @author zxc + * @date 2020/11/4 1:36 下午 + */ + @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)){ + 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.getCertificationImg()); + form.setSurname(certificationAddFormDTO.getSurname()); + log.info(JSON.toJSONString(form)); + userBadgeDao.insertUserBadgeCertificateRecord(form); + + //TODO 站内信发送 您好,您的xxx徽章因认证失败未成功点亮,请查看 + this.sendMessageByUser(form); + + 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(); + formDTO.setApp(BadgeConstant.RESI); + formDTO.setCustomerId(form.getCustomerId()); + formDTO.setGridId(form.getGridId()); + UserBadgeListResultDTO userBadgeListResultDTO = userBadgeDao.selectBadgeByBadgeId(form.getCustomerId(), form.getBadgeId()); + if (null == userBadgeListResultDTO){ + log.error(BadgeConstant.GET_BADGE_NAME_FAILURE); + return; + } + formDTO.setMessageContent(String.format(BadgeConstant.MESSAGE_CONTENT,userBadgeListResultDTO.getBadgeName())); + formDTO.setTitle(BadgeConstant.AUTH_TITLE); + formDTO.setReadFlag(BadgeConstant.READ_FLAG); + formDTO.setUserId(form.getUserId()); + msgList.add(formDTO); + Result result = messageFeignClient.saveUserMessageList(msgList); + } + + /** + * @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())); + } + + /** + * @Description 个人中心-获取徽章认证页面详情 + * 先判断 recordId存在不,不存在是居民端,反之,工作端【工作端和居民端合用一个接口】 + * @Param tokenDto + * @Param certificationDetailFormDTO + * @author zxc + * @date 2020/11/4 4:03 下午 + */ + @Override + public CertificationDetailResultDTO certificationDetail(TokenDto tokenDto, CertificationDetailFormDTO certificationDetailFormDTO) { + if (StringUtils.isNotBlank(certificationDetailFormDTO.getRecordId())){ + return userBadgeDao.selectBadgeAuthRecord(null, certificationDetailFormDTO.getBadgeId(),certificationDetailFormDTO.getRecordId()); + } + return userBadgeDao.selectBadgeAuthRecord(tokenDto.getUserId(), certificationDetailFormDTO.getBadgeId(),certificationDetailFormDTO.getRecordId()); + } + + + /** + * @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; + } + + /** + * @Description 个人中心-取消/点亮徽章 + * @Param openedOrClosedFormDTO + * @author zxc + * @date 2020/11/4 5:47 下午 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void openedOrClosed(OpenedOrClosedFormDTO form) { + userBadgeDao.updateIsOpen(form); + userBadgeRedis.pushOrRemoveUserBadge4List(form.getUserId(),form.getBadgeId(),form.getCustomerId()); + } + + /** + * @Description 客户徽章缓存初始化 + * @Param customerId + * @author zxc + * @date 2020/11/5 3:12 下午 + */ + @Override + public void reloadCustomerBadge(String customerId){ + userBadgeRedis.delCustomerBadge(customerId); + List userBadgeListResultDTOS = userBadgeDao.selectAllBadge(customerId); + if (CollectionUtils.isEmpty(userBadgeListResultDTOS)){ + throw new RenException("客户徽章缓存初始化未查到数据"); + } + userBadgeRedis.batchClearUserBadgeCache(customerId); + 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); + } + + /** + * @Description 批量获取用户显示徽章 + * @param customerId + * @param userIds + * @return java.util.Map> + * @author wangc + * @date 2020.11.10 15:12 + */ + @Override + public Map> getBatchUserSortedBadge(String customerId, List userIds) { + List badges = userBadgeDao.selectBatchUserSortedBadge(customerId,userIds); + if(CollectionUtils.isEmpty(badges)) return Collections.EMPTY_MAP; + return badges.stream().collect(Collectors.groupingBy(UserBadgeInfoResultDTO :: getUserId)); + } + +} 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..e8efe9816d 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 @@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -325,4 +326,74 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl result = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); + if (!result.success() || null == result.getData() || StringUtils.isBlank(result.getData().getCode())) { + throw new RenException(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode()); + } + //3:删除缓存中可能存在的旧验证码 + userResiInfoRedis.deleteOldUserMobileCode(formDTO.getUserId(), formDTO.getMobile()); + //4:将验证码存入redis + userResiInfoRedis.setUserResiMobileCode(formDTO.getUserId(),formDTO.getMobile(),result.getData().getCode()); + } + + /** + * 修改手机号 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/11/11 8:59 + */ + @Override + public void editMobile(EditMobileFormDTO formDTO) { + //手机验证码数据校验 + String verificationCode = userResiInfoRedis.getUserResiMobileCode(formDTO.getUserId(), formDTO.getMobile(), formDTO.getCode()); + if (null == verificationCode || StringUtils.isBlank(verificationCode)) { + throw new RenException(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode()); + } + //更新手机号 + UserResiInfoDTO dto = baseDao.selectByUserId(formDTO.getUserId()); + dto.setRegMobile(formDTO.getMobile()); + update(dto); + //更新baseInfo + UserBaseInfoEntity baseInfo = ConvertUtils.sourceToTarget(formDTO, UserBaseInfoEntity.class); + userBaseInfoService.insertOrUpdate(baseInfo); + } + } 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 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; 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 new file mode 100644 index 0000000000..5fe0e2651e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.7__add_useradvice.sql @@ -0,0 +1,44 @@ +CREATE TABLE `user_advice` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `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 '网格名', + `USER_ID` varchar(64) NOT NULL COMMENT 'userid', + `USER_NAME` varchar(32) NOT NULL COMMENT '用户姓名', + `REG_PHONE` varchar(32) NOT NULL COMMENT '用户注册手机号', + `ADVICE_CONTENT` varchar(500) NOT NULL COMMENT '建议描述', + `PHONE` varchar(32) DEFAULT NULL COMMENT '填写手机号', + `ADVICE_TIME` datetime NOT NULL COMMENT '建议时间', + `ADVICE_TYPE` varchar(32) DEFAULT NULL COMMENT '问题分类(gov政府software软件,逗号分隔)', + `REPLY_CONTENT` varchar(500) DEFAULT NULL COMMENT '回复内容', + `REPLY_USER_ID` varchar(64) DEFAULT NULL COMMENT '回复人id', + `REPLY_USER_NAME` varchar(32) DEFAULT NULL COMMENT '回复人姓名', + `REPLY_TIME` datetime DEFAULT NULL COMMENT '回复时间', + `GOV_CONTENT` varchar(500) DEFAULT NULL COMMENT '政府存证文字', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标志', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户建议表'; + +CREATE TABLE `user_advice_img` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `ADVICE_ID` varchar(64) NOT NULL COMMENT '建议id', + `TYPE` varchar(10) NOT NULL COMMENT '图片类型,resi是用户上传的建议图片,oper是运营上传的代替政府回复的存证', + `IMG_URL` varchar(255) NOT NULL COMMENT '图片url', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标志', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户建议图片'; 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..b5a72206b6 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + 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}, + 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 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 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..1499c9581b --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceDao.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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} and del_flag = 0 + + + + + + + + + + + + + + + + + + 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} + ) + + 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..8bb5ff3792 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserAdviceImgDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeCertificateRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeCertificateRecordDao.xml new file mode 100644 index 0000000000..a2f59e8b8e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeCertificateRecordDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000000..8377839e72 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBadgeDao.xml @@ -0,0 +1,303 @@ + + + + + + + + UPDATE user_badge_certificate_record + SET is_last = 'no' + WHERE DEL_FLAG = '0' + AND BADGE_ID = #{badgeId} + 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} + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO user_badge_certificate_record ( + ID, + CUSTOMER_ID, + GRID_ID, + USER_ID, + BADGE_ID, + SURNAME, + NAME, + MOBILE, + 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}, + #{mobile}, + #{idNum}, + #{certificationImg}, + #{remark}, + #{auditStatus}, + #{auditRemark}, + #{staffId}, + #{auditTime}, + #{isLast}, + #{delFlag}, + #{revision}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + + + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml index fc345f9fd2..0dddb3b46c 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml @@ -37,6 +37,16 @@ uri.updated_by AS "updatedby", uri.updated_time AS "updatedtime" + + update user_resi_info set + SURNAME = #{surname}, + NAME = #{name}, + STREET = #{street}, + DISTRICT = #{district}, + BUILDING_ADDRESS = #{buildingAddress} + where USER_ID = #{userId} + and DEL_FLAG = '0' +