From debc462e8c8a96eedbff18e6a44ef5bf72cf9f24 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 14 May 2020 00:08:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BF=E5=BA=9C=E7=AB=AF=E5=BE=85=E5=8A=9E?= =?UTF-8?q?=E4=BA=8B=E9=A1=B9=EF=BC=88reddot=EF=BC=89=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E3=80=81=E6=9F=A5=E8=AF=A2=E7=BD=91=E6=A0=BC=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91=E5=8F=8A=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E6=B6=89=E5=8F=8A=E5=90=84=E4=B8=9A=E5=8A=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 22 - .../epmet/commons/tools/redis/RedisUtils.java | 31 ++ .../com/epmet/dto/form/RedDotFormDTO.java | 29 ++ .../result/GridProcessingCountResultDTO.java | 24 + .../com/epmet/dto/result/RedDotResultDTO.java | 28 + .../WorkGrassRootsFunctionConstant.java | 30 ++ .../epmet/controller/RemindController.java | 48 ++ .../com/epmet/controller/TestFormDTO1.java | 15 + .../com/epmet/controller/TestResultDTO1.java | 15 + .../com/epmet/feign/GovIssueFeignClient.java | 29 ++ .../com/epmet/feign/GovOrgFeignClient.java | 29 ++ .../com/epmet/feign/ResiGroupFeignClient.java | 24 +- .../feign/ResiPartymemberFeignClient.java | 21 + .../fallback/GovIssueFeignClientFallBack.java | 23 + .../fallback/GovOrgFeignClientFallBack.java | 27 + .../ResiGroupFeignClientFallBack.java | 13 + .../ResiPartymemberFeignClientFallBack.java | 11 + .../java/com/epmet/service/RemindService.java | 24 + .../epmet/service/impl/RemindServiceImpl.java | 174 +++++++ .../result/GridVotingIssueCountResultDTO.java | 24 + .../com/epmet/constant/GovIssueRedisKeys.java | 22 + .../com/epmet/controller/IssueController.java | 15 + .../java/com/epmet/redis/GovIssueRedis.java | 33 ++ .../java/com/epmet/service/IssueService.java | 11 + .../epmet/service/impl/IssueServiceImpl.java | 18 + .../result/GridProcessingCountResultDTO.java | 24 + .../epmet/dto/result/StaffGridResultDTO.java | 37 ++ .../controller/StaffAgencyController.java | 6 +- .../com/epmet/feign/GovIssueFeignClient.java | 29 ++ .../com/epmet/feign/ResiGroupFeignClient.java | 30 ++ .../feign/ResiPartymemberFeignClient.java | 41 ++ .../fallback/GovIssueFeignClientFallBack.java | 23 + .../ResiGroupFeignClientFallBack.java | 25 + .../ResiPartymemberFeignClientFallBack.java | 29 ++ .../com/epmet/service/StaffAgencyService.java | 7 +- .../service/impl/StaffAgencyServiceImpl.java | 151 +++++- .../group/GroupProcessingCountResultDTO.java | 25 + .../resi-group/resi-group-server/pom.xml | 4 +- .../modules/constant/ResiGroupRedisKeys.java | 53 ++ .../group/controller/ResiGroupController.java | 478 +++++++++--------- .../group/controller/TestFormDTO2.java | 15 + .../group/controller/TestResultDTO2.java | 15 + .../modules/group/redis/ResiGroupRedis.java | 69 ++- .../group/service/ResiGroupService.java | 30 +- .../service/impl/ResiGroupServiceImpl.java | 104 ++-- .../member/redis/ResiGroupMemberRedis.java | 7 +- .../service/impl/ResiTopicServiceImpl.java | 5 +- .../resi-hall-server/resi-hall-server.iml | 5 + .../PartyAuthProcessingCountResultDTO.java | 25 + .../result/ResiProcessingCountResultDTO.java | 25 + .../constant/ResiPartyMemberRedisKeys.java | 35 ++ .../controller/PartymemberInfoController.java | 14 + .../service/PartymemberInfoService.java | 9 + .../impl/PartyMemberConfirmServiceImpl.java | 11 +- .../impl/PartymemberInfoServiceImpl.java | 18 +- .../ResiWarmheartedApplyController.java | 13 + .../service/ResiWarmheartedApplyService.java | 10 + .../impl/ResiWarmheartedApplyServiceImpl.java | 36 +- .../com/epmet/redis/ResiPartyMemberRedis.java | 168 ++++++ 59 files changed, 1963 insertions(+), 353 deletions(-) create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/GridProcessingCountResultDTO.java create mode 100644 epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/RedDotResultDTO.java create mode 100644 epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/constant/WorkGrassRootsFunctionConstant.java create mode 100644 epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/RemindController.java create mode 100644 epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/TestFormDTO1.java create mode 100644 epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/TestResultDTO1.java create mode 100644 epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java create mode 100644 epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java create mode 100644 epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/GovIssueFeignClientFallBack.java create mode 100644 epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java create mode 100644 epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/RemindService.java create mode 100644 epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GridVotingIssueCountResultDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/GovIssueRedisKeys.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/GovIssueRedis.java create mode 100644 epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/result/GridProcessingCountResultDTO.java create mode 100644 epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/result/StaffGridResultDTO.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovIssueFeignClientFallBack.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java create mode 100644 epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/GroupProcessingCountResultDTO.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/ResiGroupRedisKeys.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/TestFormDTO2.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/TestResultDTO2.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyAuthProcessingCountResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiProcessingCountResultDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/ResiPartyMemberRedisKeys.java create mode 100644 epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/redis/ResiPartyMemberRedis.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index d90feff39e..3670e1f9a6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -174,28 +174,6 @@ public class RedisKeys { return rootPrefix.concat("resiregister:confirm:").concat(userId).concat("-").concat(mobile).concat("-*"); } - /** - * @Description 小组缓存信息key - * @Param 组Id - * @return epmet:resi:group:groupId - * @Author wangc - * @Date 2020.04.13 11:27 - **/ - public static String getResiGroupInfoKey(String groupId){ - return rootPrefix.concat("resi:group:").concat(groupId); - } - - /** - * @Description 组成员信息缓存key - * @Param 组Id 用户Id - * @return epmet:resi:group:member:groupId:userId - * @Author wangc - * @Date 2020.04.13 13:40 - **/ - public static String getResiGroupMemberInfoKey(String groupId, String userId){ - return rootPrefix.concat("resi:group:member:").concat(groupId).concat(":").concat(userId); - } - /** * @param phone 手机号 * @param smsCode 短信验证码 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 b68418626a..921a7e5576 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 @@ -13,6 +13,7 @@ import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactor import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.support.atomic.RedisAtomicLong; import org.springframework.stereotype.Component; import java.util.Collection; @@ -210,4 +211,34 @@ public class RedisUtils { setString(key, value, DEFAULT_EXPIRE); } + /** + * @param key + * @return java.lang.Long + * @Author yinzuomei + * @Description 将 key 中储存的数字值+1 ,返回结果 + * @Date 2020/5/12 18:55 + **/ + public Long incrementAndGet(String key) { + RedisAtomicLong entityIdCounter = new RedisAtomicLong(key, redisTemplate.getConnectionFactory()); + //前者,先+1,再返回 + Long count = entityIdCounter.incrementAndGet(); + if (count == 0) { + System.out.println("返回值=0"); + count = entityIdCounter.incrementAndGet(); + } + return count; + } + + /** + * @param key + * @return java.lang.Long + * @Author yinzuomei + * @Description 将key中储存的数字值-1 ,返回结果 + * @Date 2020/5/13 9:39 + **/ + public Long decrementAndGet(String key) { + RedisAtomicLong entityIdCounter = new RedisAtomicLong(key, redisTemplate.getConnectionFactory()); + Long count = entityIdCounter.decrementAndGet(); + return count; + } } diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java new file mode 100644 index 0000000000..52b9d21b44 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 待办提醒(红点)入参 + * @Author yinzuomei + * @Date 2020/5/13 14:22 + */ +@Data +public class RedDotFormDTO implements Serializable { + private static final long serialVersionUID = -3108932695005624852L; + + /** + * token中获取,不能为空 + */ + @NotBlank(message = "staffId不能为空(异常:TokenDto中userId为空)") + private String staffId; + + /** + * 网格ID + */ + @NotBlank(message = "网格id不能为空") + private String gridId; +} + diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/GridProcessingCountResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/GridProcessingCountResultDTO.java new file mode 100644 index 0000000000..3d5a599425 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/GridProcessingCountResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 政府端基层治理群组管理、议题管理、居民管理、党员认证查询待办数量feign统一返参 + * @Author yinzuomei + * @Date 2020/5/13 21:43 + */ +@Data +public class GridProcessingCountResultDTO implements Serializable { + /** + * 网格id + */ + private String gridId; + + /** + * 待审核的小组总数 + */ + private Long count; +} + diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/RedDotResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/RedDotResultDTO.java new file mode 100644 index 0000000000..9255f78771 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/RedDotResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 待办提醒(红点)返参 + * @Author yinzuomei + * @Date 2020/5/13 14:23 + */ +@Data +public class RedDotResultDTO implements Serializable { + + private static final long serialVersionUID = -7872984015211318329L; + + /** + * 其它网格是否有待办事项true,false + */ + private Boolean otherGridRedDot; + + /** + * 需要显示的功能key(群组管理:work_grassroots_group,居民管理:work_grassroots_resi,党员认证:work_grassroots_partyauth,议题管理:work_grassroots_issue) + */ + private List functionList; +} + 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 new file mode 100644 index 0000000000..1e52667fff --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/constant/WorkGrassRootsFunctionConstant.java @@ -0,0 +1,30 @@ +package com.epmet.constant; + +/** + * @Description 基层治理菜单key,用于是否显示红点提示 待办提醒(红点)接口反参用 + * @Author yinzuomei + * @Date 2020/5/13 14:47 + */ +public class WorkGrassRootsFunctionConstant { + + /** + * 群组管理 + */ + public static final String WORK_GRASSROOTS_GROUP="work_grassroots_group"; + + /** + * 居民管理 + */ + public static final String WORK_GRASSROOTS_RESI="work_grassroots_resi"; + + /** + * 党员认证 + */ + public static final String WORK_GRASSROOTS_PARTYAUTH="work_grassroots_partyauth"; + + /** + * 议题管理 + */ + public static final String WORK_GRASSROOTS_ISSUE="work_grassroots_issue"; +} + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/RemindController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/RemindController.java new file mode 100644 index 0000000000..894fa60ab7 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/RemindController.java @@ -0,0 +1,48 @@ +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.RedDotFormDTO; +import com.epmet.dto.result.RedDotResultDTO; +import com.epmet.service.RemindService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @Description 基层治理待办事项提醒 + * @Author yinzuomei + * @Date 2020/5/13 14:17 + */ +@RestController +@RequestMapping("remind") +public class RemindController { + @Autowired + private RemindService remindService; + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @Author yinzuomei + * @Description 根据网格id,查询基层治理下网格各功能菜单是否显示红点,以及除当前网格外,其他网格是否有待办事项 + * @Date 2020/5/13 14:28 + **/ + @PostMapping("reddot") + public Result queryGridRedDot(@LoginUser TokenDto tokenDto, @RequestBody RedDotFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO); + RedDotResultDTO redDotResultDTO=remindService.queryGridRedDot(formDTO); + return new Result().ok(redDotResultDTO); + } + + @GetMapping("test") + public Result test( ){ + TestFormDTO1 testFormDTO1=new TestFormDTO1(); + testFormDTO1.setId("111"); + testFormDTO1.setName("啊啊啊"); + TestResultDTO1 testResultDTO1=remindService.test(testFormDTO1); + return new Result().ok(testResultDTO1); + } +} + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/TestFormDTO1.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/TestFormDTO1.java new file mode 100644 index 0000000000..564ca8426a --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/TestFormDTO1.java @@ -0,0 +1,15 @@ +package com.epmet.controller; + +import lombok.Data; + +/** + * @Description 测试feign + * @Author yinzuomei + * @Date 2020/5/13 18:23 + */ +@Data +public class TestFormDTO1 { + private String id; + private String name; +} + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/TestResultDTO1.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/TestResultDTO1.java new file mode 100644 index 0000000000..04348391bc --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/TestResultDTO1.java @@ -0,0 +1,15 @@ +package com.epmet.controller; + +import lombok.Data; + +/** + * @Description 测试feign + * @Author yinzuomei + * @Date 2020/5/13 18:23 + */ +@Data +public class TestResultDTO1 { + private String resultId; + private String resultName; +} + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java new file mode 100644 index 0000000000..1b7642c82a --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java @@ -0,0 +1,29 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.fallback.GovIssueFeignClientFallBack; +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; + +/** + * @Description 议题管理服务 + * @Author yinzuomei + * @Date 2020/5/13 15:45 + */ +@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueFeignClientFallBack.class) +public interface GovIssueFeignClient { + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询网格下表决中的议题 + * @Date 2020/5/13 15:47 + **/ + @PostMapping(value = "/gov/issue/issue/queryvotingissuecount",consumes = MediaType.APPLICATION_JSON_VALUE) + Result queryVotingIssueCount(@RequestBody List gridIdList); +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java new file mode 100644 index 0000000000..97c3ce6b7f --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/GovOrgFeignClient.java @@ -0,0 +1,29 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.feign.fallback.GovOrgFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +import java.util.List; + +/** + * @Description + * @Author sun + */ +@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class) +public interface GovOrgFeignClient { + + /** + * @param userId + * @return + * @Description 根据userId查询该用户涉及的所有网格列表 + * @Author sun + */ + @GetMapping(value = "/gov/org/customergrid/getmygrids/{userId}") + Result> getMyGrids(@PathVariable("userId") String userId); + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java index 4449e64962..18815b635a 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java @@ -2,20 +2,22 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.controller.TestFormDTO1; +import com.epmet.controller.TestResultDTO1; +import com.epmet.dto.result.GridProcessingCountResultDTO; import com.epmet.feign.fallback.ResiGroupFeignClientFallBack; import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; -import com.epmet.resi.group.dto.group.form.GovGroupSummarizeFromDTO; -import com.epmet.resi.group.dto.group.form.GroupAuditedFromDTO; -import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.group.form.*; +import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.topic.form.ResiTopicDetailFormDTO; import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO; import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO; import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; 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; @@ -137,4 +139,16 @@ public interface ResiGroupFeignClient { @PostMapping("/resi/group/comment/getcommentlistoftopicgov") Result> getCommentListOfTopicGov(ResiQueryCommentFormDTO queryCommentFormDTO); - } + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询网格下待审核的小组总数 + * @Date 2020/5/13 15:49 + **/ + @PostMapping(value = "/resi/group/group/groupprocessingcount",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> queryGroupProcessingCount(@RequestBody List gridIdList); + + @PostMapping(value = "/resi/group/group/test",consumes = MediaType.APPLICATION_JSON_VALUE) + Result test(@RequestBody TestFormDTO1 testFormDTO1); +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java index c5be8fc73a..9d4cd796fa 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java @@ -6,6 +6,7 @@ import com.epmet.dto.form.CertifiedDetailFormDTO; import com.epmet.dto.form.CertifiedFormDTO; import com.epmet.dto.result.CertifiedDetailResultDTO; import com.epmet.dto.result.CertifiedResultDTO; +import com.epmet.dto.result.GridProcessingCountResultDTO; import com.epmet.feign.fallback.ResiPartymemberFeignClientFallBack; import com.epmet.resi.partymember.dto.partymember.form.*; import com.epmet.resi.partymember.dto.partymember.result.*; @@ -148,4 +149,24 @@ public interface ResiPartymemberFeignClient { @PostMapping("/resi/partymember/confirm/rejecteddetail") Result rejectedDetail(@RequestBody RejectedDetailFromDTO fromDTO); + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询网格下待审核的热心居民数 + * @Date 2020/5/13 15:41 + **/ + @PostMapping(value = "/resi/partymember/resiwarmheartedapply/queryresiprocessingcount",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> queryResiProcessingCount(@RequestBody List gridIdList); + + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询网格下待审核的党员数 + * @Date 2020/5/13 15:41 + **/ + @PostMapping(value = "/resi/partymember/partymemberbaseinfo/getworkgrassrootspartyauth",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> queryPartyMemberProcessingCount(@RequestBody List gridIdList); + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/GovIssueFeignClientFallBack.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/GovIssueFeignClientFallBack.java new file mode 100644 index 0000000000..3a1ccf8714 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/GovIssueFeignClientFallBack.java @@ -0,0 +1,23 @@ +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.feign.GovIssueFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Description 议题管理服务 + * @Author yinzuomei + * @Date 2020/5/13 15:45 + */ +@Component +public class GovIssueFeignClientFallBack implements GovIssueFeignClient { + @Override + public Result queryVotingIssueCount(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryVotingIssueCount", gridIdList); + } +} + diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java new file mode 100644 index 0000000000..bfb238d29a --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/GovOrgFeignClientFallBack.java @@ -0,0 +1,27 @@ +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.CustomerAgencyDTO; +import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.feign.GovOrgFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Description + * @Author sun + */ +@Component +public class GovOrgFeignClientFallBack implements GovOrgFeignClient { + + @Override + public Result> getMyGrids(String userId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getMyGrids", userId); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java index b4fe70ea34..588142a4f0 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java @@ -3,6 +3,9 @@ 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.controller.TestFormDTO1; +import com.epmet.controller.TestResultDTO1; +import com.epmet.dto.result.GridProcessingCountResultDTO; import com.epmet.feign.ResiGroupFeignClient; import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; @@ -107,4 +110,14 @@ public class ResiGroupFeignClientFallBack implements ResiGroupFeignClient { public Result> getCommentListOfTopicGov(ResiQueryCommentFormDTO queryCommentFormDTO) { return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getCommentListOfTopicGov", queryCommentFormDTO); } + + @Override + public Result> queryGroupProcessingCount(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "queryGroupProcessingCount", gridIdList); + } + + @Override + public Result test(TestFormDTO1 testFormDTO1) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "test", testFormDTO1); + } } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java index acab85141f..17d8e6f0d6 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java @@ -7,6 +7,7 @@ import com.epmet.dto.form.CertifiedDetailFormDTO; import com.epmet.dto.form.CertifiedFormDTO; import com.epmet.dto.result.CertifiedDetailResultDTO; import com.epmet.dto.result.CertifiedResultDTO; +import com.epmet.dto.result.GridProcessingCountResultDTO; import com.epmet.feign.ResiPartymemberFeignClient; import com.epmet.resi.partymember.dto.partymember.form.*; import com.epmet.resi.partymember.dto.partymember.result.*; @@ -89,4 +90,14 @@ public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignC return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "rejectedDetail", fromDTO); } + @Override + public Result> queryResiProcessingCount(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "queryResiProcessingCount", gridIdList); + } + + @Override + public Result> queryPartyMemberProcessingCount(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "queryPartyMemberProcessingCount", gridIdList); + } + } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/RemindService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/RemindService.java new file mode 100644 index 0000000000..95c577b5ca --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/RemindService.java @@ -0,0 +1,24 @@ +package com.epmet.service; + +import com.epmet.controller.TestFormDTO1; +import com.epmet.controller.TestResultDTO1; +import com.epmet.dto.form.RedDotFormDTO; +import com.epmet.dto.result.RedDotResultDTO; + +/** + * @Description 基层治理待办事项提醒 + * @Author yinzuomei + * @Date 2020/5/13 14:26 + */ +public interface RemindService { + /** + * @return com.epmet.dto.result.RedDotResultDTO + * @param formDTO + * @Author yinzuomei + * @Description 根据网格id,查询基层治理下网格各功能菜单是否显示红点,以及除当前网格外,其他网格是否有待办事项 + * @Date 2020/5/13 14:34 + **/ + RedDotResultDTO queryGridRedDot(RedDotFormDTO formDTO); + + TestResultDTO1 test(TestFormDTO1 testFormDTO1); +} 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 new file mode 100644 index 0000000000..f9dea745a0 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java @@ -0,0 +1,174 @@ +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.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.service.RemindService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 基层治理待办事项提醒 + * @Author yinzuomei + * @Date 2020/5/13 14:27 + */ +@Service +public class RemindServiceImpl implements RemindService { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private ResiGroupFeignClient resiGroupFeignClient; + + @Autowired + private ResiPartymemberFeignClient resiPartymemberFeignClient; + + @Autowired + private GovOrgFeignClient govOrgFeignClient; + + @Autowired + private GovIssueFeignClient govIssueFeignClient; + + @Override + public RedDotResultDTO queryGridRedDot(RedDotFormDTO formDTO) { + RedDotResultDTO redDotResultDTO = new RedDotResultDTO(); + redDotResultDTO.setOtherGridRedDot(false); + redDotResultDTO.setFunctionList(getRedDotFunctionList(formDTO.getGridId())); + Result> govOrgResult = govOrgFeignClient.getMyGrids(formDTO.getStaffId()); + if (!govOrgResult.success()) { + logger.error(String.format("调用gov-org-server服务查询工作人员网格列表失败返回结果", govOrgResult.toString())); + } + List gridList = govOrgResult.getData(); + for (CustomerGridByUserIdResultDTO gridInfo : gridList) { + if(formDTO.getGridId().equals(gridInfo)){ + //查询非当前网格的 + break; + } + //其他网格,只要存在有待办事项的网格,就需要在工作首页网格名称后面显示红点 + List functionList = this.getRedDotFunctionList(gridInfo.getGridId()); + if (null != functionList && functionList.size() > 0) { + redDotResultDTO.setOtherGridRedDot(true); + break; + } + } + return redDotResultDTO; + + } + + public List getRedDotFunctionList(String gridId) { + List functionList = new ArrayList<>(); + List gridIdList = new ArrayList<>(); + gridIdList.add(gridId); + if (this.getWorkGrassRootsGroup(gridIdList)) { + functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_GROUP); + } + if (this.getWorkGrassRootsResi(gridIdList)) { + functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_RESI); + } + if (getWorkGrassRootsPartyAuth(gridIdList)) { + functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_PARTYAUTH); + } + if (getWorkGrassRootsIssue(gridIdList)) { + functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE); + } + return functionList; + } + + + //群组管理: work_grassroots_group + public Boolean getWorkGrassRootsGroup(List gridIdList) { + Result> groupProcessingCountResult = resiGroupFeignClient.queryGroupProcessingCount(gridIdList); + if (groupProcessingCountResult.success()) { + for (String gridId : gridIdList) { + for (GridProcessingCountResultDTO GridProcessingCountResultDTO : groupProcessingCountResult.getData()) { + if (gridId.equals(GridProcessingCountResultDTO.getGridId()) && GridProcessingCountResultDTO.getCount() > 0) { + return true; + } + } + } + } + logger.error(String.format("调用%s服务,查询网格%s待审核小组数失败code%s,msg:", ServiceConstant.RESI_GROUP_SERVER, gridIdList.get(0), groupProcessingCountResult.getCode(), + groupProcessingCountResult.getMsg())); + return false; + } + + //居民管理:work_grassroots_resi, + //查询网格下 + public Boolean getWorkGrassRootsResi(List gridIdList) { + Result> resiGroupProcessingCountResult = resiPartymemberFeignClient.queryResiProcessingCount(gridIdList); + if (resiGroupProcessingCountResult.success()) { + for (String gridId : gridIdList) { + for (GridProcessingCountResultDTO GridProcessingCountResultDTO : resiGroupProcessingCountResult.getData()) { + if (gridId.equals(GridProcessingCountResultDTO.getGridId()) && GridProcessingCountResultDTO.getCount() > 0) { + return true; + } + } + } + } + logger.error(String.format("调用%s服务,查询网格%s待审核热心居民数失败code%s,msg:", ServiceConstant.RESI_PARTYMEMBER_SERVER, gridIdList.get(0), resiGroupProcessingCountResult.getCode(), + resiGroupProcessingCountResult.getMsg())); + return false; + } + + //党员认证:work_grassroots_partyauth, + //查询网格下是否存在待审核的党员 + public Boolean getWorkGrassRootsPartyAuth(List gridIdList) { + Result> partyMemberProcessingCountResult = resiPartymemberFeignClient.queryPartyMemberProcessingCount(gridIdList); + if (partyMemberProcessingCountResult.success()) { + for (String gridId : gridIdList) { + for (GridProcessingCountResultDTO GridProcessingCountResultDTO : partyMemberProcessingCountResult.getData()) { + if (gridId.equals(GridProcessingCountResultDTO.getGridId()) && GridProcessingCountResultDTO.getCount() > 0) { + return true; + } + } + } + } + logger.error(String.format("调用%s服务,查询网格%s待审核党员数失败code%s,msg:", ServiceConstant.RESI_PARTYMEMBER_SERVER, gridIdList.get(0), partyMemberProcessingCountResult.getCode(), + partyMemberProcessingCountResult.getMsg())); + return false; + } + + //议题管理: work_grassroots_issue + //查询网格下是否存在表决中的议题 + public Boolean getWorkGrassRootsIssue(List gridIdList) { + Result> issueResult = govIssueFeignClient.queryVotingIssueCount(gridIdList); + if (issueResult.success()) { + for (String gridId : gridIdList) { + for (GridProcessingCountResultDTO GridProcessingCountResultDTO : issueResult.getData()) { + if (gridId.equals(GridProcessingCountResultDTO.getGridId()) && GridProcessingCountResultDTO.getCount() > 0) { + return true; + } + } + } + } + logger.error(String.format("调用%s服务,查询网格%s表决中议题总数失败code%s,msg:", ServiceConstant.GOV_ISSUE_SERVER, gridIdList.get(0), issueResult.getCode(), + issueResult.getMsg())); + return false; + } + + @Override + public TestResultDTO1 test(TestFormDTO1 testFormDTO1) { + Result resultDTO1Result = resiGroupFeignClient.test(testFormDTO1); + if (resultDTO1Result.success()) { + logger.info("gov-grid服务,接收返参:" + JSON.toJSONString(resultDTO1Result.getData())); + return resultDTO1Result.getData(); + } + return new TestResultDTO1(); + } +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GridVotingIssueCountResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GridVotingIssueCountResultDTO.java new file mode 100644 index 0000000000..61a4aecfbc --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GridVotingIssueCountResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 网格下表决中的议题总数列表 + * @Author yinzuomei + * @Date 2020/5/13 22:49 + */ +@Data +public class GridVotingIssueCountResultDTO implements Serializable { + /** + * 网格id + */ + private String gridId; + + /** + * 表决中的议题总数 + */ + private Long count; +} + diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/GovIssueRedisKeys.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/GovIssueRedisKeys.java new file mode 100644 index 0000000000..1da3dc7911 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/GovIssueRedisKeys.java @@ -0,0 +1,22 @@ +package com.epmet.constant; + +/** + * @Description gov-issue-server模块redis key + * @Author yinzuomei + * @Date 2020/5/13 23:00 + */ +public class GovIssueRedisKeys { + /** + * 党群e事通redis前缀 + */ + private static String rootPrefix = "epmet:"; + + + /** + * 政府工作段小程序:基层治理-议题管理(表决中议题总数)红点key + */ + public static String getWorkGrassrootsIssueRedDotKey(String gridId) { + return rootPrefix.concat(String.format("gov:wxmp:work:grassroots:issue:%s",gridId)); + } +} + 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 05cdb50892..9e6169f22b 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 @@ -4,6 +4,7 @@ import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.IssueDetailFormDTO; +import com.epmet.dto.result.GridVotingIssueCountResultDTO; import com.epmet.dto.result.IssueResultDTO; import com.epmet.service.IssueService; import org.springframework.beans.factory.annotation.Autowired; @@ -12,6 +13,8 @@ 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 居民端党群议事 * @Author yinzuomei @@ -36,5 +39,17 @@ public class IssueController { return new Result().ok(issueService.detail(issueDetail)); } + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 传入网格id列表,查询出每个网格下表决中的议题总数 + * @Date 2020/5/13 22:52 + **/ + @PostMapping("queryvotingissuecount") + public Result> queryVotingIssueCount(@RequestBody List gridIdList) { + List list = issueService.queryVotingIssueCount(gridIdList); + return new Result>().ok(list); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/GovIssueRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/GovIssueRedis.java new file mode 100644 index 0000000000..074c8e9597 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/GovIssueRedis.java @@ -0,0 +1,33 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.constant.GovIssueRedisKeys; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Description gov-issue-server模块redis + * @Author yinzuomei + * @Date 2020/5/13 22:57 + */ +@Component +public class GovIssueRedis { + private Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private RedisUtils redisUtils; + + public Long queryVotingIssueCount(String gridId) { + Long auditingGroupCount = 0L; + try { + String workGrassrootsGroupRedDotKey = GovIssueRedisKeys.getWorkGrassrootsIssueRedDotKey(gridId); + auditingGroupCount = (Long) redisUtils.get(workGrassrootsGroupRedDotKey); + } catch (Exception e) { + logger.error(String.format("网格id%s,查询网格下表决中议题总数异常%s", gridId, e.getMessage())); + e.printStackTrace(); + } + return auditingGroupCount; + } +} + 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 ab38c329c5..51a86afe48 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 @@ -3,9 +3,12 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.form.CloseIssueFormDTO; import com.epmet.dto.form.IssueDetailFormDTO; +import com.epmet.dto.result.GridVotingIssueCountResultDTO; import com.epmet.dto.result.IssueResultDTO; import com.epmet.entity.IssueEntity; +import java.util.List; + /** * @Author zxc * @CreateTime 2020/5/11 9:44 @@ -28,4 +31,12 @@ public interface IssueService extends BaseService { **/ void closeIssue(CloseIssueFormDTO formDTO); + /** + * @param gridIdList + * @return java.util.List + * @Author yinzuomei + * @Description 传入网格id列表,查询出每个网格下表决中的议题总数 + * @Date 2020/5/13 22:53 + **/ + List queryVotingIssueCount(List gridIdList); } 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 536a12307e..6483bfa018 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 @@ -14,12 +14,14 @@ import com.epmet.dto.form.CloseIssueFormDTO; import com.epmet.dto.form.IssueDetailFormDTO; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.result.AgencyGridResultDTO; +import com.epmet.dto.result.GridVotingIssueCountResultDTO; import com.epmet.dto.result.IssueResultDTO; import com.epmet.entity.IssueEntity; import com.epmet.entity.IssueProcessEntity; import com.epmet.feign.GovOrgFeignClient; import com.epmet.feign.MessageFeignClient; import com.epmet.feign.ResiGroupFeignClient; +import com.epmet.redis.GovIssueRedis; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.service.IssueService; import org.springframework.beans.factory.annotation.Autowired; @@ -47,6 +49,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp private ResiGroupFeignClient resiGroupFeignClient; @Autowired private MessageFeignClient messageFeignClient; + @Autowired + private GovIssueRedis govIssueRedis; /** * @Description 议题详情 @@ -104,6 +108,20 @@ public class IssueServiceImpl extends BaseServiceImpl imp throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION); } } + + @Override + public List queryVotingIssueCount(List gridIdList) { + List list=new ArrayList<>(); + for(String gridId:gridIdList){ + GridVotingIssueCountResultDTO gridVotingIssueCountResultDTO=new GridVotingIssueCountResultDTO(); + gridVotingIssueCountResultDTO.setGridId(gridId); + Long auditingCount=govIssueRedis.queryVotingIssueCount(gridId); + gridVotingIssueCountResultDTO.setCount(auditingCount); + list.add(gridVotingIssueCountResultDTO); + } + return list; + } + /** * @Description 关闭议题给话题创建人和议题发起人发送消息 * @author sun diff --git a/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/result/GridProcessingCountResultDTO.java b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/result/GridProcessingCountResultDTO.java new file mode 100644 index 0000000000..3d5a599425 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/result/GridProcessingCountResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 政府端基层治理群组管理、议题管理、居民管理、党员认证查询待办数量feign统一返参 + * @Author yinzuomei + * @Date 2020/5/13 21:43 + */ +@Data +public class GridProcessingCountResultDTO implements Serializable { + /** + * 网格id + */ + private String gridId; + + /** + * 待审核的小组总数 + */ + private Long count; +} + diff --git a/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/result/StaffGridResultDTO.java b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/result/StaffGridResultDTO.java new file mode 100644 index 0000000000..06c76761c8 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/result/StaffGridResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 政府端工作人员的所有网格返参 + * @Author yinzuomei + * @Date 2020/5/13 13:45 + */ +@Data +public class StaffGridResultDTO implements Serializable { + + private static final long serialVersionUID = 5576720099807706663L; + /** + * 网格直属组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 待办事项标记:true显示,false不显示 + */ + private Boolean redDot; + +} + diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java index 3c77f93e23..692ac17669 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/StaffAgencyController.java @@ -25,6 +25,7 @@ import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.dto.result.StaffGridResultDTO; import com.epmet.service.StaffAgencyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -54,8 +55,9 @@ public class StaffAgencyController { * @Author sun */ @PostMapping("getmygrids") - public Result> getMyGrids(@LoginUser TokenDto tokenDTO) { - return staffAgencyService.getMyGrids(tokenDTO); + public Result> getMyGrids(@LoginUser TokenDto tokenDTO) { + List list=staffAgencyService.getMyGrids(tokenDTO.getUserId()); + return new Result>().ok(list); } /** diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java new file mode 100644 index 0000000000..1b7642c82a --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/GovIssueFeignClient.java @@ -0,0 +1,29 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.fallback.GovIssueFeignClientFallBack; +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; + +/** + * @Description 议题管理服务 + * @Author yinzuomei + * @Date 2020/5/13 15:45 + */ +@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallback = GovIssueFeignClientFallBack.class) +public interface GovIssueFeignClient { + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询网格下表决中的议题 + * @Date 2020/5/13 15:47 + **/ + @PostMapping(value = "/gov/issue/issue/queryvotingissuecount",consumes = MediaType.APPLICATION_JSON_VALUE) + Result queryVotingIssueCount(@RequestBody List gridIdList); +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java new file mode 100644 index 0000000000..43a1ac2ad9 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/ResiGroupFeignClient.java @@ -0,0 +1,30 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.GridProcessingCountResultDTO; +import com.epmet.feign.fallback.ResiGroupFeignClientFallBack; +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; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/17 15:24 + */ +@FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupFeignClientFallBack.class) +public interface ResiGroupFeignClient { + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询网格下待审核的小组总数 + * @Date 2020/5/13 15:49 + **/ + @PostMapping(value = "/resi/group/group/groupprocessingcount",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> queryGroupProcessingCount(@RequestBody List gridIdList); +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java new file mode 100644 index 0000000000..cb7c2eceed --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/ResiPartymemberFeignClient.java @@ -0,0 +1,41 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.GridProcessingCountResultDTO; +import com.epmet.feign.fallback.ResiPartymemberFeignClientFallBack; +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; + +/** + * 调用epmet-user服务 + * + * @author 赵奇风 + */ +@FeignClient(name = ServiceConstant.RESI_PARTYMEMBER_SERVER, fallback = ResiPartymemberFeignClientFallBack.class) +public interface ResiPartymemberFeignClient { + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询网格下待审核的热心居民数 + * @Date 2020/5/13 15:41 + **/ + @PostMapping(value = "/resi/partymember/resiwarmheartedapply/queryresiprocessingcount",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> queryResiProcessingCount(@RequestBody List gridIdList); + + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查询网格下待审核的党员数 + * @Date 2020/5/13 15:41 + **/ + @PostMapping(value = "/resi/partymember/partymemberbaseinfo/getworkgrassrootspartyauth",consumes = MediaType.APPLICATION_JSON_VALUE) + Result> queryPartyMemberProcessingCount(@RequestBody List gridIdList); + +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovIssueFeignClientFallBack.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovIssueFeignClientFallBack.java new file mode 100644 index 0000000000..3a1ccf8714 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/GovIssueFeignClientFallBack.java @@ -0,0 +1,23 @@ +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.feign.GovIssueFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @Description 议题管理服务 + * @Author yinzuomei + * @Date 2020/5/13 15:45 + */ +@Component +public class GovIssueFeignClientFallBack implements GovIssueFeignClient { + @Override + public Result queryVotingIssueCount(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryVotingIssueCount", gridIdList); + } +} + diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java new file mode 100644 index 0000000000..8afd447147 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/ResiGroupFeignClientFallBack.java @@ -0,0 +1,25 @@ +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.result.GridProcessingCountResultDTO; +import com.epmet.feign.ResiGroupFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/17 15:27 + */ +@Component +public class ResiGroupFeignClientFallBack implements ResiGroupFeignClient { + + @Override + public Result> queryGroupProcessingCount(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "queryGroupProcessingCount", gridIdList); + } + +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java new file mode 100644 index 0000000000..747c715e96 --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/ResiPartymemberFeignClientFallBack.java @@ -0,0 +1,29 @@ +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.result.GridProcessingCountResultDTO; +import com.epmet.feign.ResiPartymemberFeignClient; +import org.springframework.stereotype.Component; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/4/16 17:01 + */ +@Component +public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignClient { + @Override + public Result> queryResiProcessingCount(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "queryResiProcessingCount", gridIdList); + } + + @Override + public Result> queryPartyMemberProcessingCount(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "queryPartyMemberProcessingCount", gridIdList); + } + +} diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java index 2530c956a4..da353a9f37 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/StaffAgencyService.java @@ -23,6 +23,7 @@ import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; +import com.epmet.dto.result.StaffGridResultDTO; import java.util.List; @@ -34,12 +35,12 @@ import java.util.List; public interface StaffAgencyService { /** - * @param tokenDTO + * @param staffId * @return - * @Description 根据userId查询该用户涉及的所有网格列表 + * @Description 根据staffId查询该工作人员的所有网格列表 * @Author sun */ - Result> getMyGrids(TokenDto tokenDTO); + List getMyGrids(String staffId); /** * 获取最近一次登录的客户信息 diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index adc8807690..2cbda237bb 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -25,10 +25,10 @@ import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.dto.form.SwitchGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.GridProcessingCountResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; -import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.GovOrgFeignClient; -import com.epmet.service.AccessService; +import com.epmet.dto.result.StaffGridResultDTO; +import com.epmet.feign.*; import com.epmet.service.StaffAgencyService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -36,6 +36,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -51,27 +52,153 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { @Autowired private EpmetUserFeignClient epmetUserFeignClient; @Autowired - private AccessService accessService; + private ResiGroupFeignClient resiGroupFeignClient; + @Autowired + private ResiPartymemberFeignClient resiPartymemberFeignClient; + @Autowired + private GovIssueFeignClient govIssueFeignClient; + /** - * @param tokenDTO + * @param staffId * @return * @Description 根据userId查询该用户涉及的所有网格列表 * @Author sun */ @Override - public Result> getMyGrids(TokenDto tokenDTO) { - return govOrgFeignClient.getMyGrids(tokenDTO.getUserId()); + public List getMyGrids(String staffId) { + //1、获取拥有的所有网格 + Result> govOrgResult = govOrgFeignClient.getMyGrids(staffId); + if (!govOrgResult.success() || (null == govOrgResult.getData() || govOrgResult.getData().size() < 1)) { + logger.error(String.format("调用gov-org-server服务查询工作人员网格列表失败返回结果", govOrgResult.toString())); + return new ArrayList<>(); + } + List gridList = ConvertUtils.sourceToTarget(govOrgResult.getData(), StaffGridResultDTO.class); + if (null == gridList || gridList.isEmpty()) { + return gridList; + } + //2、获取网格id列表 + List gridIds = new ArrayList<>(); + for (StaffGridResultDTO staffGridResultDTO : gridList) { + //默认不显示红点 + staffGridResultDTO.setRedDot(false); + gridIds.add(staffGridResultDTO.getGridId()); + } + //获取各个网格每个菜单的待办数量 + List groupProcessingList = this.getGroupCountList(gridIds); + List resiProcessingList = this.getResiCountList(gridIds); + List partyMemberProcessingList = this.getPartyMemberCountList(gridIds); + List issueProcessingList = this.getIssueCountList(gridIds); + for (StaffGridResultDTO staffGridInfo : gridList) { + if (this.checkGroupProcessing(staffGridInfo.getGridId(), groupProcessingList)) { + staffGridInfo.setRedDot(true); + break; + } + if (this.checkResiProcessing(staffGridInfo.getGridId(), resiProcessingList)) { + staffGridInfo.setRedDot(true); + break; + } + if (this.checkPartyMemberProcessing(staffGridInfo.getGridId(), partyMemberProcessingList)) { + staffGridInfo.setRedDot(true); + break; + } + if (this.checkIssueProcessing(staffGridInfo.getGridId(), issueProcessingList)) { + staffGridInfo.setRedDot(true); + break; + } + } + return gridList; + } + + private boolean checkIssueProcessing(String gridId, List issueProcessingList) { + boolean flag = false; + for (GridProcessingCountResultDTO gridProcessingCountResultDTO : issueProcessingList) { + if (gridId.equals(gridProcessingCountResultDTO.getGridId()) && gridProcessingCountResultDTO.getCount() > 0) { + flag = true; + break; + } + } + return flag; + } + + private boolean checkPartyMemberProcessing(String gridId, List partyMemberProcessingList) { + boolean flag = false; + for (GridProcessingCountResultDTO gridProcessingCountResultDTO : partyMemberProcessingList) { + if (gridId.equals(gridProcessingCountResultDTO.getGridId()) && gridProcessingCountResultDTO.getCount() > 0) { + flag = true; + break; + } + } + return flag; + } + + private boolean checkResiProcessing(String gridId, List resiProcessingList) { + boolean flag = false; + for (GridProcessingCountResultDTO gridProcessingCountResultDTO : resiProcessingList) { + if (gridId.equals(gridProcessingCountResultDTO.getGridId()) && gridProcessingCountResultDTO.getCount() > 0) { + flag = true; + break; + } + } + return flag; + } + + private boolean checkGroupProcessing(String gridId, List groupProcessingList) { + boolean flag = false; + for (GridProcessingCountResultDTO gridProcessingCountResultDTO : groupProcessingList) { + if (gridId.equals(gridProcessingCountResultDTO.getGridId()) && gridProcessingCountResultDTO.getCount() > 0) { + flag = true; + break; + } + } + return flag; } + private List getIssueCountList(List gridIdList) { + List list = new ArrayList<>(); + Result> issueResult = govIssueFeignClient.queryVotingIssueCount(gridIdList); + if (issueResult.success() && null != issueResult.getData() && issueResult.getData().size() > 0) { + list.addAll(issueResult.getData()); + } + return list; + } + + private List getPartyMemberCountList(List gridIdList) { + List list = new ArrayList<>(); + Result> partyAuthResult = resiPartymemberFeignClient.queryPartyMemberProcessingCount(gridIdList); + if (partyAuthResult.success() && null != partyAuthResult.getData() && partyAuthResult.getData().size() > 0) { + list.addAll(partyAuthResult.getData()); + } + return list; + } + + private List getResiCountList(List gridIdList) { + List list = new ArrayList<>(); + Result> resiCount = resiPartymemberFeignClient.queryResiProcessingCount(gridIdList); + if (resiCount.success() && null != resiCount.getData() && resiCount.getData().size() > 0) { + list.addAll(resiCount.getData()); + } + return list; + } + + private List getGroupCountList(List gridIdList) { + List list = new ArrayList<>(); + Result> groupProcessingCountResult = resiGroupFeignClient.queryGroupProcessingCount(gridIdList); + if (groupProcessingCountResult.success() && null != groupProcessingCountResult.getData() && groupProcessingCountResult.getData().size() > 0) { + list.addAll(groupProcessingCountResult.getData()); + } + return list; + } + + @Override public Result getLatestCustomer(TokenDto tokenDTO) { return govOrgFeignClient.getLatestCustomer(tokenDTO.getUserId()); } /** + * @return Result * @Description 得到工作人员最后一次登录的网格 * @Param LatestGridFormDTO -> staffId ; customerId - * @return Result * @Author wangc * @Date 2020.04.23 11:14 **/ @@ -79,12 +206,12 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { public Result getLatestGrid(LatestGridFormDTO latestGridFormDTO) { Result latestGridResult = epmetUserFeignClient.getStaffLatestGrid(latestGridFormDTO); - if(latestGridResult.success() && null != latestGridResult.getData() && StringUtils.isNotBlank(latestGridResult.getData().getGridId())){ + if (latestGridResult.success() && null != latestGridResult.getData() && StringUtils.isNotBlank(latestGridResult.getData().getGridId())) { return latestGridResult; - }else{ + } else { Result staffGridResult = - govOrgFeignClient.getStaffGrid(latestGridFormDTO); - if(staffGridResult.success() && null != staffGridResult.getData() && StringUtils.isNotBlank(staffGridResult.getData().getGridId())){ + govOrgFeignClient.getStaffGrid(latestGridFormDTO); + if (staffGridResult.success() && null != staffGridResult.getData() && StringUtils.isNotBlank(staffGridResult.getData().getGridId())) { return staffGridResult; } } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/GroupProcessingCountResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/GroupProcessingCountResultDTO.java new file mode 100644 index 0000000000..4ef970e52b --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/GroupProcessingCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.group.dto.group; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 网格待审核小组数 + * @Author yinzuomei + * @Date 2020/5/13 21:29 + */ +@Data +public class GroupProcessingCountResultDTO implements Serializable { + + /** + * 网格id + */ + private String gridId; + + /** + * 待审核的小组总数 + */ + private Long count; +} + diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 952ccc1abd..45075ae886 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -118,7 +118,7 @@ epmet_resi_group_user EpmEt-db-UsEr - 0 + 1 192.168.1.130 6379 123456 @@ -148,7 +148,7 @@ epmet elink@833066 - 0 + 1 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com 6379 EpmEtrEdIs!q@w diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/ResiGroupRedisKeys.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/ResiGroupRedisKeys.java new file mode 100644 index 0000000000..303d52c75f --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/ResiGroupRedisKeys.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.modules.constant; + +/** + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class ResiGroupRedisKeys { + + /** + * 党群e事通redis前缀 + */ + private static String rootPrefix = "epmet:"; + + + /** + * @Description 小组缓存信息key + * @Param 组Id + * @return epmet:resi:group:groupId + * @Author wangc + * @Date 2020.04.13 11:27 + **/ + public static String getResiGroupInfoKey(String groupId){ + return rootPrefix.concat("resi:group:").concat(groupId); + } + + /** + * @Description 组成员信息缓存key + * @Param 组Id 用户Id + * @return epmet:resi:group:member:groupId:userId + * @Author wangc + * @Date 2020.04.13 13:40 + **/ + public static String getResiGroupMemberInfoKey(String groupId, String userId){ + return rootPrefix.concat("resi:group:member:").concat(groupId).concat(":").concat(userId); + } + + /** + * 政府工作段小程序:基层治理-群组管理(待审核待测小组)红点key eg:epmet:gov:wxmp:work:grassroots:group:XX网格id + */ + public static String getWorkGrassrootsGroupRedDotKey(String gridId) { + return rootPrefix.concat(String.format("gov:wxmp:work:grassroots:group:%s",gridId)); + } + + +} 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 fdd74e28a6..98eb905c13 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 @@ -17,17 +17,16 @@ package com.epmet.modules.group.controller; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; -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.commons.tools.validator.ValidatorUtils; +import com.epmet.modules.group.redis.ResiGroupRedis; import com.epmet.modules.group.service.ResiGroupService; -import com.epmet.modules.utils.ModuleConstant; +import com.epmet.resi.group.dto.group.GroupProcessingCountResultDTO; import com.epmet.resi.group.dto.group.form.*; import com.epmet.resi.group.dto.group.result.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -43,252 +42,273 @@ import java.util.List; @RestController @RequestMapping("group") public class ResiGroupController { - private Logger logger = LoggerFactory.getLogger(getClass()); - @Autowired - private ResiGroupService resiGroupService; + @Autowired + private ResiGroupService resiGroupService; - /** - * @param tokenDto - * @param myGroupFormDTO - * @return com.epmet.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 我的小组查询(包含我创建的小组+我加入的小组),以各组的最新话题时间有近到远排序) - * @Date 2020/3/28 20:36 - **/ - @PostMapping("getmygroup") - public Result> getMyGroup(@LoginUser TokenDto tokenDto, @RequestBody MyGroupFormDTO myGroupFormDTO) { - myGroupFormDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(myGroupFormDTO); - return resiGroupService.getMyGroup(myGroupFormDTO); - } + /** + * @param tokenDto + * @param myGroupFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 我的小组查询(包含我创建的小组+我加入的小组),以各组的最新话题时间有近到远排序) + * @Date 2020/3/28 20:36 + **/ + @PostMapping("getmygroup") + public Result> getMyGroup(@LoginUser TokenDto tokenDto, @RequestBody MyGroupFormDTO myGroupFormDTO) { + myGroupFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(myGroupFormDTO); + List myGroupList = resiGroupService.getMyGroup(myGroupFormDTO); + return new Result>().ok(myGroupList); + } - /** - * @param tokenDto - * @param recommendGroupFormDTO - * @return com.epmet.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 推荐组列表查询 - * @Date 2020/3/28 19:52 - **/ - @PostMapping("getrecommendgroup") - public Result> getRecommendGroup(@LoginUser TokenDto tokenDto, + /** + * @param tokenDto + * @param recommendGroupFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 推荐组列表查询 + * @Date 2020/3/28 19:52 + **/ + @PostMapping("getrecommendgroup") + public Result> getRecommendGroup(@LoginUser TokenDto tokenDto, @RequestBody RecommendGroupFormDTO recommendGroupFormDTO) { - recommendGroupFormDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(recommendGroupFormDTO); - return resiGroupService.getRecommendGroup(recommendGroupFormDTO); - } + recommendGroupFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(recommendGroupFormDTO); + List recommendGroupList = resiGroupService.getRecommendGroup(recommendGroupFormDTO); + return new Result>().ok(recommendGroupList); + } - /** - * @param tokenDto - * @param createdFormDTO - * @return com.epmet.commons.tools.utils.Result> - * @Author yinzuomei - * @Description 我创建的小组 - * @Date 2020/3/28 21:59 - **/ - @PostMapping("getcreated") - public Result> getCreated(@LoginUser TokenDto tokenDto, + /** + * @param tokenDto + * @param createdFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 我创建的小组 + * @Date 2020/3/28 21:59 + **/ + @PostMapping("getcreated") + public Result> getCreated(@LoginUser TokenDto tokenDto, @RequestBody CreatedFormDTO createdFormDTO) { - createdFormDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(createdFormDTO); - return resiGroupService.getCreated(createdFormDTO); - } + createdFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(createdFormDTO); + List createdGroupList = resiGroupService.getCreated(createdFormDTO); + return new Result>().ok(createdGroupList); + } - /** - * @param tokenDto - * @param modifyGroupFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 修改组信息 - * @Date 2020/3/28 22:20 - **/ - @PostMapping("modifygroup") - public Result modifyGroup(@LoginUser TokenDto tokenDto, @RequestBody ModifyGroupFormDTO modifyGroupFormDTO) { - modifyGroupFormDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(modifyGroupFormDTO); - return resiGroupService.modifyGroup(modifyGroupFormDTO); - } + /** + * @param tokenDto + * @param modifyGroupFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 修改组信息 + * @Date 2020/3/28 22:20 + **/ + @PostMapping("modifygroup") + public Result modifyGroup(@LoginUser TokenDto tokenDto, @RequestBody ModifyGroupFormDTO modifyGroupFormDTO) { + modifyGroupFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(modifyGroupFormDTO); + resiGroupService.modifyGroup(modifyGroupFormDTO); + return new Result(); + } - /** - * @param tokenDto - * @param groupSummarizeFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 查看小组管理界面信息 - * @Date 2020/3/29 17:32 - **/ - @PostMapping("getgroupsummarize") - public Result getGroupSummarize(@LoginUser TokenDto tokenDto, + /** + * @param tokenDto + * @param groupSummarizeFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 查看小组管理界面信息 + * @Date 2020/3/29 17:32 + **/ + @PostMapping("getgroupsummarize") + public Result getGroupSummarize(@LoginUser TokenDto tokenDto, @RequestBody GroupSummarizeFormDTO groupSummarizeFormDTO) { - groupSummarizeFormDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(groupSummarizeFormDTO); - return resiGroupService.getGroupSummarize(groupSummarizeFormDTO); - } + groupSummarizeFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(groupSummarizeFormDTO); + GroupSummarizeResultDTO groupSummarizeResultDTO = resiGroupService.getGroupSummarize(groupSummarizeFormDTO); + return new Result().ok(groupSummarizeResultDTO); + } - /** - * @param tokenDto - * @param applyCreateGroupFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 创建小组 - * @Date 2020/3/29 19:26 - **/ - @PostMapping("applycreategroup") - public Result applyCreateGroup(@LoginUser TokenDto tokenDto, + /** + * @param tokenDto + * @param applyCreateGroupFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 创建小组 + * @Date 2020/3/29 19:26 + **/ + @PostMapping("applycreategroup") + public Result applyCreateGroup(@LoginUser TokenDto tokenDto, @RequestBody ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { - applyCreateGroupFormDTO.setUserId(tokenDto.getUserId()); - applyCreateGroupFormDTO.setApp(tokenDto.getApp()); - ValidatorUtils.validateEntity(applyCreateGroupFormDTO); - return resiGroupService.applyCreateGroup(applyCreateGroupFormDTO); - } + applyCreateGroupFormDTO.setUserId(tokenDto.getUserId()); + applyCreateGroupFormDTO.setApp(tokenDto.getApp()); + ValidatorUtils.validateEntity(applyCreateGroupFormDTO); + resiGroupService.applyCreateGroup(applyCreateGroupFormDTO); + return new Result(); + } - /** - * @param tokenDto - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 加入小组界面初始化 - * 只有已经注册过的居民才可以加入小组 - * @Date 2020/3/30 10:11 - **/ - @PostMapping("initapplygroup") - public Result initApplyGroup(@LoginUser TokenDto tokenDto, + /** + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 加入小组界面初始化 + * 只有已经注册过的居民才可以加入小组 + * @Date 2020/3/30 10:11 + **/ + @PostMapping("initapplygroup") + public Result initApplyGroup(@LoginUser TokenDto tokenDto, @RequestBody InitApplyGroupFormDTO initApplyGroupFormDTO) { - if (null == tokenDto) { - logger.error(ModuleConstant.USER_NOT_NULL); - throw new RenException(ModuleConstant.USER_NOT_NULL); - } - initApplyGroupFormDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(initApplyGroupFormDTO); - return resiGroupService.initApplyGroup(initApplyGroupFormDTO); - } + initApplyGroupFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(initApplyGroupFormDTO); + resiGroupService.initApplyGroup(initApplyGroupFormDTO); + return new Result(); + } - /** - * @param tokenDto - * @param initApplyCreatedGroupFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 创建小组界面初始化 只有党员和热心居民才能创建小组 - * @Date 2020/3/30 15:44 - **/ - @PostMapping("initapplycreategroup") - public Result initApplyCreatedGroup(@LoginUser TokenDto tokenDto, + /** + * @param tokenDto + * @param initApplyCreatedGroupFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 创建小组界面初始化 只有党员和热心居民才能创建小组 + * @Date 2020/3/30 15:44 + **/ + @PostMapping("initapplycreategroup") + public Result initApplyCreatedGroup(@LoginUser TokenDto tokenDto, @RequestBody InitApplyCreatedGroupFormDTO initApplyCreatedGroupFormDTO) { - if (null == tokenDto) { - logger.error(ModuleConstant.USER_NOT_NULL); - throw new RenException(ModuleConstant.USER_NOT_NULL); - } - initApplyCreatedGroupFormDTO.setUserId(tokenDto.getUserId()); - initApplyCreatedGroupFormDTO.setApp(tokenDto.getApp()); - ValidatorUtils.validateEntity(initApplyCreatedGroupFormDTO); - return resiGroupService.initApplyCreatedGroup(initApplyCreatedGroupFormDTO); - } + initApplyCreatedGroupFormDTO.setUserId(tokenDto.getUserId()); + initApplyCreatedGroupFormDTO.setApp(tokenDto.getApp()); + ValidatorUtils.validateEntity(initApplyCreatedGroupFormDTO); + resiGroupService.initApplyCreatedGroup(initApplyCreatedGroupFormDTO); + return new Result(); + } - /** - * @param tokenDto - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 审核(同意)群申请-测试用后面会放到政府端 - * @Date 2020/3/31 12:31 - **/ - @PostMapping("agreeapplygroup") - public Result agreeApplyGroup(@LoginUser TokenDto tokenDto, @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { - agreeApplyGroupFormDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(agreeApplyGroupFormDTO); - return resiGroupService.agreeApplyGroup(agreeApplyGroupFormDTO); - } + /** + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 审核(同意)群申请-测试用后面会放到政府端 已废弃 + * @Date 2020/3/31 12:31 + **/ + @PostMapping("agreeapplygroup") + public Result agreeApplyGroup(@LoginUser TokenDto tokenDto, @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { + agreeApplyGroupFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(agreeApplyGroupFormDTO); + return resiGroupService.agreeApplyGroup(agreeApplyGroupFormDTO); + } - /** - * @param tokenDto - * @param disAgreeApplyGroupFormDTO - * @return com.epmet.commons.tools.utils.Result - * @Author yinzuomei - * @Description 审核(拒绝)群申请-测试用后面会放到政府端 - * @Date 2020/3/31 13:23 - **/ - @PostMapping("disagreeapplygroup") - public Result disagreeApplyGroup(@LoginUser TokenDto tokenDto, @RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { - disAgreeApplyGroupFormDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO); - return resiGroupService.disagreeApplyGroup(disAgreeApplyGroupFormDTO); - } + /** + * @param tokenDto + * @param disAgreeApplyGroupFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 审核(拒绝)群申请-测试用后面会放到政府端 已废弃 + * @Date 2020/3/31 13:23 + **/ + @PostMapping("disagreeapplygroup") + public Result disagreeApplyGroup(@LoginUser TokenDto tokenDto, @RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { + disAgreeApplyGroupFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO); + return resiGroupService.disagreeApplyGroup(disAgreeApplyGroupFormDTO); + } - /** - * 小组审核历史列表 - * - * @param formDTO 参数 - * @return Result> - */ - @PostMapping("audited") - public Result> audited(@RequestBody GroupAuditedFromDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); - return resiGroupService.audited(formDTO); - } + /** + * 小组审核历史列表 + * + * @param formDTO 参数 + * @return Result> + */ + @PostMapping("audited") + public Result> audited(@RequestBody GroupAuditedFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiGroupService.audited(formDTO); + } - /** - * 本网格小组列表 - * - * @param formDTO 参数 - * @return Result> - */ - @PostMapping("groupsingrid") - public Result> getGroupsInGrid(@RequestBody GroupAuditedFromDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); - return resiGroupService.getGroupsInGrid(formDTO); - } + /** + * 本网格小组列表 + * + * @param formDTO 参数 + * @return Result> + */ + @PostMapping("groupsingrid") + public Result> getGroupsInGrid(@RequestBody GroupAuditedFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return resiGroupService.getGroupsInGrid(formDTO); + } - /** - * 小组管理界面信息 - * - * @param formDTO 参数 - * @return Result - */ - @PostMapping("getgovgroupsummarize") - public Result getGovGroupSummarize(@RequestBody GovGroupSummarizeFromDTO formDTO) { - return resiGroupService.getGovGroupSummarize(formDTO); - } + /** + * 小组管理界面信息 + * + * @param formDTO 参数 + * @return Result + */ + @PostMapping("getgovgroupsummarize") + public Result getGovGroupSummarize(@RequestBody GovGroupSummarizeFromDTO formDTO) { + return resiGroupService.getGovGroupSummarize(formDTO); + } - /** - * @Description 得到小组待审核列表,用户信息不注入TokenDTO,通过外部服务调用直接传入参数 - * @Param ApplyingGroupsFormDTO.class - * @return Result> - * @Author wangc - * @Date 2020.04.20 13:59 - **/ - @PostMapping("getapplyinggroups") - public Result> getApplyingGroups(@RequestBody ApplyingGroupsFormDTO applyingGroupsFormDTO){ - ValidatorUtils.validateEntity(applyingGroupsFormDTO); - return resiGroupService.getApplyingGroups(applyingGroupsFormDTO); - } + /** + * @return Result> + * @Description 得到小组待审核列表,用户信息不注入TokenDTO,通过外部服务调用直接传入参数 + * @Param ApplyingGroupsFormDTO.class + * @Author wangc + * @Date 2020.04.20 13:59 + **/ + @PostMapping("getapplyinggroups") + public Result> getApplyingGroups(@RequestBody ApplyingGroupsFormDTO applyingGroupsFormDTO) { + ValidatorUtils.validateEntity(applyingGroupsFormDTO); + return resiGroupService.getApplyingGroups(applyingGroupsFormDTO); + } - /** - * @Description 得到待审核/未审核小组信息的详情 - * @Param CommonGroupIdFromDTO -> String groupId; String userId - * @return Result - * @Author wangc - * @Date 2020.04.20 14:08 - **/ - @PostMapping("getapplyinggroupdetail") - public Result getApplyingGroupDetail(@RequestBody CommonGroupIdFromDTO groupIdFromDTO){ - ValidatorUtils.validateEntity(groupIdFromDTO); - return resiGroupService.getApplyingGroupDetail(groupIdFromDTO); - } + /** + * @return Result + * @Description 得到待审核/未审核小组信息的详情 + * @Param CommonGroupIdFromDTO -> String groupId; String userId + * @Author wangc + * @Date 2020.04.20 14:08 + **/ + @PostMapping("getapplyinggroupdetail") + public Result getApplyingGroupDetail(@RequestBody CommonGroupIdFromDTO groupIdFromDTO) { + ValidatorUtils.validateEntity(groupIdFromDTO); + return resiGroupService.getApplyingGroupDetail(groupIdFromDTO); + } - @PostMapping("agreeapplying") - public Result agreeApplying( @RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { - ValidatorUtils.validateEntity(agreeApplyGroupFormDTO); - return resiGroupService.agreeApplyGroup(agreeApplyGroupFormDTO); - } + @PostMapping("agreeapplying") + public Result agreeApplying(@RequestBody AgreeApplyGroupFormDTO agreeApplyGroupFormDTO) { + ValidatorUtils.validateEntity(agreeApplyGroupFormDTO); + return resiGroupService.agreeApplyGroup(agreeApplyGroupFormDTO); + } - /** - * @Description 建组申请-审核驳回-供外部服务调用,当前用户Id需要调用时一并传入 - * @Param DisAgreeApplyGroupFormDTO - * @return Result - * @Author wangc - * @Date 2020.04.20 14:26 - **/ - @PostMapping("disagreeapplying") - public Result disagreeApplying(@RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { - ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO); - return resiGroupService.disagreeApplyGroup(disAgreeApplyGroupFormDTO); - } + /** + * @return Result + * @Description 建组申请-审核驳回-供外部服务调用,当前用户Id需要调用时一并传入 + * @Param DisAgreeApplyGroupFormDTO + * @Author wangc + * @Date 2020.04.20 14:26 + **/ + @PostMapping("disagreeapplying") + public Result disagreeApplying(@RequestBody DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO) { + ValidatorUtils.validateEntity(disAgreeApplyGroupFormDTO); + return resiGroupService.disagreeApplyGroup(disAgreeApplyGroupFormDTO); + } + + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 传入网格id列表,返回每个网格的待审核小组总数 + * @Date 2020/5/13 21:33 + **/ + @PostMapping("groupprocessingcount") + public Result> queryGroupProcessingCount(@RequestBody List gridIdList) { + List list = resiGroupService.queryGroupProcessingCount(gridIdList); + return new Result>().ok(list); + } + + @PostMapping("test") + public Result test(@RequestBody TestFormDTO2 formDTO2) { + System.out.println("group接收到入参:" + JSON.toJSONString(formDTO2)); + TestResultDTO2 resultDTO2 = new TestResultDTO2(); + resultDTO2.setResultId("group"); + resultDTO2.setResultName("group返参"); + return new Result().ok(resultDTO2); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/TestFormDTO2.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/TestFormDTO2.java new file mode 100644 index 0000000000..8114d03488 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/TestFormDTO2.java @@ -0,0 +1,15 @@ +package com.epmet.modules.group.controller; + +import lombok.Data; + +/** + * @Description 测试feign + * @Author yinzuomei + * @Date 2020/5/13 18:30 + */ +@Data +public class TestFormDTO2 { + private String id; + private String name; +} + diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/TestResultDTO2.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/TestResultDTO2.java new file mode 100644 index 0000000000..5da3d98d31 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/TestResultDTO2.java @@ -0,0 +1,15 @@ +package com.epmet.modules.group.controller; + +import lombok.Data; + +/** + * @Description 测试feign + * @Author yinzuomei + * @Date 2020/5/13 18:30 + */ +@Data +public class TestResultDTO2 { + private String resultId; + private String resultName; +} + diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java index 8971aae9dc..15197a9fd3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/redis/ResiGroupRedis.java @@ -19,9 +19,9 @@ package com.epmet.modules.group.redis; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.constant.ResiGroupRedisKeys; import com.epmet.modules.group.service.ResiGroupService; import com.epmet.modules.group.service.ResiGroupStatisticalService; import com.epmet.resi.group.constant.TopicConstant; @@ -30,6 +30,8 @@ import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO; import com.epmet.resi.group.dto.group.ResiGroupStatisticalDTO; import com.epmet.resi.group.dto.group.ResiGroupStatisticalInfoRedisDTO; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -43,6 +45,7 @@ import java.util.*; */ @Component public class ResiGroupRedis { + private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private RedisUtils redisUtils; @@ -65,7 +68,7 @@ public class ResiGroupRedis { **/ public void set(ResiGroupInfoRedisDTO groupInfoRedis){ if(null != groupInfoRedis && StringUtils.isNotBlank(groupInfoRedis.getGroupId())){ - redisUtils.set(RedisKeys.getResiGroupInfoKey(groupInfoRedis.getGroupId()), groupInfoRedis); + redisUtils.set(ResiGroupRedisKeys.getResiGroupInfoKey(groupInfoRedis.getGroupId()), groupInfoRedis); } } @@ -80,7 +83,7 @@ public class ResiGroupRedis { if(StringUtils.isNotBlank(groupId)){ ResiGroupInfoRedisDTO groupCache = (ResiGroupInfoRedisDTO) - redisUtils.get(RedisKeys.getResiGroupInfoKey(groupId)); + redisUtils.get(ResiGroupRedisKeys.getResiGroupInfoKey(groupId)); if(null == groupCache || StringUtils.isBlank(groupCache.getGroupId())){ //如果缓存中没有该组信息,从数据库中查询并放入缓存 ResiGroupDTO groupMySql = groupService.get(groupId); @@ -143,4 +146,64 @@ public class ResiGroupRedis { return null; } + + /** + * @param gridId + * @return java.lang.Long + * @Author yinzuomei + * @Description 当前网格带审核小组数量key eg:epmet:gov:wxmp:work:grassroots:group:xx网格id + * 居民端创建小组,提交成功后,该redis值+1,目的:政府端基层治理-群组管理显示红点,提醒工作人员有待办事项 + * @Date 2020/5/13 9:50 + **/ + public Long addWorkGrassrootsGroupRedDotValue(String gridId) { + Long auditingGroupCount = 0L; + try { + String workGrassrootsGroupRedDotKey = ResiGroupRedisKeys.getWorkGrassrootsGroupRedDotKey(gridId); + auditingGroupCount = redisUtils.incrementAndGet(workGrassrootsGroupRedDotKey); + logger.info(String.format("居民端创建小组提交,更新redis-reddot值成功,key[%s],Value[%s]", workGrassrootsGroupRedDotKey, auditingGroupCount)); + } catch (Exception e) { + logger.error(String.format("居民端创建小组提交,更新redis-reddot值异常%s",e.getMessage())); + e.printStackTrace(); + } + return auditingGroupCount; + } + + /** + * @param gridId + * @return java.lang.Long + * @Author yinzuomei 当前网格带审核小组数量key eg:epmet:gov:wxmp:work:grassroots:group:xx网格id + * @Description 政府端工作人员审核建组申请之后(同意或驳回),该redis值-1 + * @Date 2020/5/13 12:58 + **/ + public Long subtractWorkGrassrootsPartyAuthRedDotValue(String gridId) { + Long auditingGroupCount = 0L; + try { + String workGrassrootsGroupRedDotKey = ResiGroupRedisKeys.getWorkGrassrootsGroupRedDotKey(gridId); + auditingGroupCount = redisUtils.decrementAndGet(workGrassrootsGroupRedDotKey); + logger.info(String.format("政府端(wxmp)同意建组,更新redis-reddot值成功,key[%s],Value[%s]", workGrassrootsGroupRedDotKey, auditingGroupCount)); + } catch (Exception e) { + logger.error(String.format("政府端(wxmp)同意建组,更新redis-reddot值异常%s", e.getMessage())); + e.printStackTrace(); + } + return auditingGroupCount; + } + + /** + * @return java.lang.Long + * @param gridId + * @Author yinzuomei + * @Description 获取某网格下待审核小组总数 + * @Date 2020/5/13 21:40 + **/ + public Long getWorkGrassrootsGroupRedDotValue(String gridId) { + Long auditingGroupCount = 0L; + try { + String workGrassrootsGroupRedDotKey = ResiGroupRedisKeys.getWorkGrassrootsGroupRedDotKey(gridId); + auditingGroupCount = (Long) redisUtils.get(workGrassrootsGroupRedDotKey); + } catch (Exception e) { + logger.error(String.format("网格id%s,查询网格下待审核小组总数异常%s", gridId, e.getMessage())); + e.printStackTrace(); + } + return auditingGroupCount; + } } \ No newline at end of file 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 71a902430a..440b4ebf9d 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 @@ -23,6 +23,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.group.entity.ResiGroupEntity; import com.epmet.resi.group.dto.UserRoleDTO; +import com.epmet.resi.group.dto.group.GroupProcessingCountResultDTO; import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.group.form.*; import com.epmet.resi.group.dto.group.result.*; @@ -105,7 +106,7 @@ public interface ResiGroupService extends BaseService { * @Description 我的小组查询(包含我创建的小组+我加入的小组),以各组的最新话题时间有近到远排序) * @Date 2020/3/28 20:37 **/ - Result> getMyGroup(MyGroupFormDTO myGroupFormDTO); + List getMyGroup(MyGroupFormDTO myGroupFormDTO); /** * @param recommendGroupFormDTO @@ -114,7 +115,7 @@ public interface ResiGroupService extends BaseService { * @Description 推荐组列表查询 * @Date 2020/3/28 19:53 **/ - Result> getRecommendGroup(RecommendGroupFormDTO recommendGroupFormDTO); + List getRecommendGroup(RecommendGroupFormDTO recommendGroupFormDTO); /** * @param createdFormDTO @@ -123,7 +124,7 @@ public interface ResiGroupService extends BaseService { * @Description 我创建的小组 * @Date 2020/3/28 22:01 **/ - Result> getCreated(CreatedFormDTO createdFormDTO); + List getCreated(CreatedFormDTO createdFormDTO); /** * @param modifyGroupFormDTO @@ -132,7 +133,7 @@ public interface ResiGroupService extends BaseService { * @Description 修改组信息 * @Date 2020/3/28 22:27 **/ - Result modifyGroup(ModifyGroupFormDTO modifyGroupFormDTO); + void modifyGroup(ModifyGroupFormDTO modifyGroupFormDTO); /** * @param groupSummarizeFormDTO @@ -141,7 +142,7 @@ public interface ResiGroupService extends BaseService { * @Description 查看小组管理界面信息 * @Date 2020/3/29 17:52 **/ - Result getGroupSummarize(GroupSummarizeFormDTO groupSummarizeFormDTO); + GroupSummarizeResultDTO getGroupSummarize(GroupSummarizeFormDTO groupSummarizeFormDTO); /** * @param applyCreateGroupFormDTO @@ -150,7 +151,7 @@ public interface ResiGroupService extends BaseService { * @Description 创建小组 * @Date 2020/3/29 19:26 **/ - Result applyCreateGroup(ApplyCreateGroupFormDTO applyCreateGroupFormDTO); + void applyCreateGroup(ApplyCreateGroupFormDTO applyCreateGroupFormDTO); /** * @param initApplyGroupFormDTO @@ -159,7 +160,7 @@ public interface ResiGroupService extends BaseService { * @Description 加入小组界面初始化 * @Date 2020/3/30 10:17 **/ - Result initApplyGroup(InitApplyGroupFormDTO initApplyGroupFormDTO); + void initApplyGroup(InitApplyGroupFormDTO initApplyGroupFormDTO); /** * @param initApplyCreatedGroupFormDTO @@ -168,13 +169,13 @@ public interface ResiGroupService extends BaseService { * @Description 校验用户是否是热心居民或者党员 * @Date 2020/3/30 15:50 **/ - Result initApplyCreatedGroup(InitApplyCreatedGroupFormDTO initApplyCreatedGroupFormDTO); + void initApplyCreatedGroup(InitApplyCreatedGroupFormDTO initApplyCreatedGroupFormDTO); /** * @param agreeApplyGroupFormDTO * @return com.epmet.commons.tools.utils.Result * @Author yinzuomei - * @Description 审核(同意)群申请-测试用后面会放到政府端 + * @Description 审核(同意)群申请 * @Date 2020/3/31 12:44 **/ Result agreeApplyGroup(AgreeApplyGroupFormDTO agreeApplyGroupFormDTO); @@ -183,7 +184,7 @@ public interface ResiGroupService extends BaseService { * @param disAgreeApplyGroupFormDTO * @return com.epmet.commons.tools.utils.Result * @Author yinzuomei - * @Description 审核(拒绝)群申请-测试用后面会放到政府端 + * @Description 审核(拒绝)群申请 * @Date 2020/3/31 13:22 **/ Result disagreeApplyGroup(DisAgreeApplyGroupFormDTO disAgreeApplyGroupFormDTO); @@ -241,4 +242,13 @@ public interface ResiGroupService extends BaseService { * @Date 2020.04.19 23:32 **/ Result getApplyingGroupDetail(CommonGroupIdFromDTO groupId); + + /** + * @param gridIdList + * @return java.util.List + * @Author yinzuomei + * @Description 传入网格id列表,返回每个网格的待审核小组总数 + * @Date 2020/5/13 21:37 + **/ + List queryGroupProcessingCount(List gridIdList); } 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 9282ee3895..2bc77432e2 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 @@ -118,7 +118,6 @@ public class ResiGroupServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -179,11 +178,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl> getMyGroup(MyGroupFormDTO myGroupFormDTO) { + public List getMyGroup(MyGroupFormDTO myGroupFormDTO) { int pageIndex = (myGroupFormDTO.getPageNo() - NumConstant.ONE) * myGroupFormDTO.getPageSize(); myGroupFormDTO.setPageNo(pageIndex); List myGroupList = baseDao.selectListMyGroup(myGroupFormDTO); - return new Result>().ok(myGroupList); + return myGroupList; } /** @@ -194,7 +193,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl> getRecommendGroup(RecommendGroupFormDTO recommendGroupFormDTO) { + public List getRecommendGroup(RecommendGroupFormDTO recommendGroupFormDTO) { int pageIndex = (recommendGroupFormDTO.getPageNo() - NumConstant.ONE) * recommendGroupFormDTO.getPageSize(); recommendGroupFormDTO.setPageNo(pageIndex); //显示当前网格内所有当前用户还未加入的组,以组的人数由高到低排序;如果人数相同,以最新话题的时间有近到远排序 @@ -206,7 +205,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl>().ok(recommendGroupList); + return recommendGroupList; } /** @@ -217,11 +216,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl> getCreated(CreatedFormDTO createdFormDTO) { + public List getCreated(CreatedFormDTO createdFormDTO) { int pageIndex = (createdFormDTO.getPageNo() - NumConstant.ONE) * createdFormDTO.getPageSize(); createdFormDTO.setPageNo(pageIndex); List createdResultDTOList = baseDao.selectListMyCreated(createdFormDTO); - return new Result>().ok(createdResultDTOList); + return createdResultDTOList; } /** @@ -233,24 +232,24 @@ public class ResiGroupServiceImpl extends BaseServiceImpl getGroupSummarize(GroupSummarizeFormDTO groupSummarizeFormDTO) { + public GroupSummarizeResultDTO getGroupSummarize(GroupSummarizeFormDTO groupSummarizeFormDTO) { GroupSummarizeResultDTO groupSummarizeResultDTO = baseDao.selectGroupSummarize(groupSummarizeFormDTO); if (null == groupSummarizeResultDTO) { - logger.error(ModuleConstant.GETGROUPSUMMARIZE_FAILED); - return new Result().error(); + logger.error(String.format("查看小组管理界面信息异常%s",ModuleConstant.GETGROUPSUMMARIZE_FAILED)); + return new GroupSummarizeResultDTO(); } //获取组长信息 Result groupLeaderUserInfo = this.getGroupLeaderUserInfo(groupSummarizeFormDTO.getGroupId()); if (groupLeaderUserInfo.success() && null != groupLeaderUserInfo.getData()) { groupSummarizeResultDTO.setLeaderName(groupLeaderUserInfo.getData().getShowName()); } else { - logger.info("组长注册信息查询失败" + groupLeaderUserInfo.getMsg()); + logger.warn("组长注册信息查询失败" + groupLeaderUserInfo.getMsg()); } - return new Result().ok(groupSummarizeResultDTO); + return groupSummarizeResultDTO; } /** @@ -309,11 +308,12 @@ public class ResiGroupServiceImpl extends BaseServiceImpl resiGroupEntityList = this.getResiGroupEntityList(applyCreateGroupFormDTO); if (null != resiGroupEntityList && resiGroupEntityList.size() > 0) { - return new Result().error(EpmetErrorCode.GROUP_ALREADY_EXISTED.getCode()); + logger.error(String.format("创建小组异常:%s",EpmetErrorCode.GROUP_ALREADY_EXISTED.getMsg())); + throw new RenException(EpmetErrorCode.GROUP_ALREADY_EXISTED.getCode()); } //2、插入一条待审核的组信息 ResiGroupEntity resiGroupEntity = this.structureResiGroupEntity(applyCreateGroupFormDTO); @@ -324,7 +324,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl result = epmetUserFeignClient.getUserResiInfoDTO(resiUserInfoFormDTO); if (!result.success() || null == result.getData() || StringUtils.isBlank(result.getData().getRegMobile())) { - logger.info("居民注册信息查询失败"); - return new Result().error(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); + logger.error("加入小组界面初始化,居民注册信息查询失败"); + throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); } - return new Result(); } private ResiGroupEntity structureResiGroupEntity(ApplyCreateGroupFormDTO applyCreateGroupFormDTO) { @@ -455,23 +457,15 @@ public class ResiGroupServiceImpl extends BaseServiceImpl().ok(ConvertUtils.sourceToTarget(detail, ApplyingGroupDetailResult2DTO.class)); } + + @Override + public List queryGroupProcessingCount(List gridIdList) { + List list=new ArrayList<>(); + for(String gridId:gridIdList){ + GroupProcessingCountResultDTO resultDTO=new GroupProcessingCountResultDTO(); + resultDTO.setGridId(gridId); + Long auditingCount=resiGroupRedis.getWorkGrassrootsGroupRedDotValue(gridId); + resultDTO.setCount(auditingCount); + list.add(resultDTO); + } + return list; + } + /** * @Description 给加入此网格的网格长发送消息 * @param msg diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java index 2fc537cdb2..7f73fc2a23 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.UserResiInfoFormDTO; import com.epmet.dto.result.UserResiInfoResultDTO; +import com.epmet.modules.constant.ResiGroupRedisKeys; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.group.service.ResiGroupService; import com.epmet.modules.member.service.ResiGroupMemberService; @@ -79,7 +80,7 @@ public class ResiGroupMemberRedis { if(null != memberInfoRedis && StringUtils.isNotBlank(memberInfoRedis.getUserId()) && StringUtils.isNotBlank(memberInfoRedis.getGroupId())){ - redisUtils.set(RedisKeys.getResiGroupMemberInfoKey(memberInfoRedis.getGroupId(),memberInfoRedis.getUserId()),memberInfoRedis); + redisUtils.set(ResiGroupRedisKeys.getResiGroupMemberInfoKey(memberInfoRedis.getGroupId(),memberInfoRedis.getUserId()),memberInfoRedis); } } @@ -94,7 +95,7 @@ public class ResiGroupMemberRedis { public ResiGroupMemberInfoRedisDTO get(String groupId ,String userId){ ResiGroupMemberInfoRedisDTO memberCache = - (ResiGroupMemberInfoRedisDTO) redisUtils.get(RedisKeys.getResiGroupMemberInfoKey(groupId,userId)); + (ResiGroupMemberInfoRedisDTO) redisUtils.get(ResiGroupRedisKeys.getResiGroupMemberInfoKey(groupId,userId)); //如果缓存中没有该成员数据 if(null == memberCache || StringUtils.isNotBlank(memberCache.getUserId())){ Map param = new HashMap<>(); @@ -152,7 +153,7 @@ public class ResiGroupMemberRedis { **/ public ResiGroupMemberInfoRedisResultDTO getKeys(String groupId){ Set groupMemberKeys = - redisUtils.keys(RedisKeys.getResiGroupMemberInfoKey(groupId,"*")); + redisUtils.keys(ResiGroupRedisKeys.getResiGroupMemberInfoKey(groupId,"*")); Map memberMap = new HashMap<>(NumConstant.ONE_HUNDRED); for(String key : groupMemberKeys){ ResiGroupMemberInfoRedisDTO member = (ResiGroupMemberInfoRedisDTO)redisUtils.get(key); 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 f775c004d6..6e1927f82c 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 @@ -34,6 +34,7 @@ import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.result.IssueInitiatorResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.constant.GroupMemberConstant; +import com.epmet.modules.constant.ResiGroupRedisKeys; import com.epmet.modules.feign.EpmetUserFeignClient; import com.epmet.modules.group.dao.ResiGroupDao; import com.epmet.modules.group.dao.ResiGroupStatisticalDao; @@ -741,7 +742,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl + + + + @@ -16,6 +20,7 @@ + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyAuthProcessingCountResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyAuthProcessingCountResultDTO.java new file mode 100644 index 0000000000..9ea7fa5f60 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/PartyAuthProcessingCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.partymember.dto.partymember.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 网格待审核党员数 + * @Author yinzuomei + * @Date 2020/5/13 22:15 + */ +@Data +public class PartyAuthProcessingCountResultDTO implements Serializable { + private static final long serialVersionUID = 1595766019917829995L; + /** + * 网格id + */ + private String gridId; + + /** + * 待审核党员申请总数 + */ + private Long count; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiProcessingCountResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiProcessingCountResultDTO.java new file mode 100644 index 0000000000..8d8135a9b9 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiProcessingCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.partymember.dto.warmhearted.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 网格待审核热心居民数 + * @Author yinzuomei + * @Date 2020/5/13 22:16 + */ +@Data +public class ResiProcessingCountResultDTO implements Serializable { + private static final long serialVersionUID = 4002474433059912113L; + /** + * 网格id + */ + private String gridId; + + /** + * 待审核党员申请总数 + */ + private Long count; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/ResiPartyMemberRedisKeys.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/ResiPartyMemberRedisKeys.java new file mode 100644 index 0000000000..d3ea121a6e --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/ResiPartyMemberRedisKeys.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.constant; + +/** + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public class ResiPartyMemberRedisKeys { + + /** + * 党群e事通redis前缀 + */ + private static String rootPrefix = "epmet:"; + + /** + * 政府工作段小程序:基层治理-居民管理(待审核的热心居民)红点key eg:epmet:gov:wxmp:work:grassroots:resi:XX网格id + */ + public static String getWorkGrassrootsResiRedDotKey(String gridId) { + return rootPrefix.concat(String.format("gov:wxmp:work:grassroots:resi:%s",gridId)); + } + + /** + * 政府工作段小程序:基层治理-党员认证(待审核的党员)红点key eg:epmet:gov:wxmp:work:grassroots:resi:XX网格id + */ + public static String getWorkGrassrootsPartyAuthRedDotKey(String gridId) { + return rootPrefix.concat(String.format("gov:wxmp:work:grassroots:partyauth:%s",gridId)); + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java index c98ec3ce99..ab98cf565a 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java @@ -32,6 +32,7 @@ import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.CertifiedDetailFormDTO; import com.epmet.resi.partymember.dto.partymember.form.CertifiedFormDTO; import com.epmet.resi.partymember.dto.partymember.result.CertifiedDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyAuthProcessingCountResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -118,4 +119,17 @@ public class PartymemberInfoController { return new Result().ok(partymemberInfoService.certifiedDetail(formDTO)); } + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 传入网格id列表,返回各个网格对应的待审核党员总数 + * @Date 2020/5/13 22:37 + **/ + @PostMapping("getworkgrassrootspartyauth") + public Result> queryPartyMemberProcessingCount(@RequestBody List gridIdList) { + List list = partymemberInfoService.queryPartyMemberProcessingCount(gridIdList); + return new Result>().ok(list); + } + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java index d2e6779edc..0fe2142c08 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java @@ -26,6 +26,7 @@ import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.CertifiedDetailFormDTO; import com.epmet.resi.partymember.dto.partymember.form.CertifiedFormDTO; import com.epmet.resi.partymember.dto.partymember.result.CertifiedDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyAuthProcessingCountResultDTO; import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -137,4 +138,12 @@ public interface PartymemberInfoService extends BaseService + * @Author yinzuomei + * @Description 传入网格id列表,返回各个网格对应的待审核党员总数 + * @Date 2020/5/13 22:37 + **/ + List queryPartyMemberProcessingCount(List gridIdList); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index dc9f3200d9..13dc1d53dd 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -22,8 +22,7 @@ import com.epmet.modules.feign.GovOrgFeignClient; import com.epmet.modules.partymember.entity.*; import com.epmet.modules.partymember.redis.PartymemberInfoRedis; import com.epmet.modules.partymember.service.*; -import com.epmet.modules.warmhearted.constant.ResiWarmUserMessageConstant; -import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity; +import com.epmet.redis.ResiPartyMemberRedis; import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; @@ -78,7 +77,8 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService private EpmetMessageFeignClient messageFeignClient; @Autowired private GovOrgFeignClient govOrgFeignClient; - + @Autowired + private ResiPartyMemberRedis resiPartyMemberRedis; @Override @Transactional(rollbackFor = Exception.class) public Result init(PartyMemberInitFromDTO fromDto) { @@ -269,6 +269,8 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService } auditMessage(ConvertUtils.sourceToTarget(partyMemberInfo, PartymemberInfoEntity.class), PartyMemberMessageConstant.MEMBER_APPLY_MSG); + //更新政府端:工作-基层治理-党员认证reddot + resiPartyMemberRedis.addWorkGrassrootsPartyAuthRedDotValue(infoDTO.getGridId()); return new Result(); } @@ -302,7 +304,8 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService } else { auditMessage(partyMemberInfoEntity, PartyMemberMessageConstant.AUDIT_REJECT_MSG); } - + //更新政府端:工作-基层治理-党员认证reddot + resiPartyMemberRedis.subtractWorkGrassrootsPartyAuthRedDotValue(manualEntity.getGridId()); return new Result(); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java index 680a3ba35a..732bcf1d83 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java @@ -36,10 +36,12 @@ import com.epmet.modules.partymember.dao.PartymemberInfoDao; import com.epmet.modules.partymember.entity.PartymemberInfoEntity; import com.epmet.modules.partymember.redis.PartymemberInfoRedis; import com.epmet.modules.partymember.service.PartymemberInfoService; +import com.epmet.redis.ResiPartyMemberRedis; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.CertifiedDetailFormDTO; import com.epmet.resi.partymember.dto.partymember.form.CertifiedFormDTO; import com.epmet.resi.partymember.dto.partymember.result.CertifiedDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyAuthProcessingCountResultDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -69,7 +71,8 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -199,5 +202,18 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl queryPartyMemberProcessingCount(List gridIdList) { + List list = new ArrayList<>(); + for (String gridId : gridIdList) { + PartyAuthProcessingCountResultDTO partyAuthProcessingCountResultDTO = new PartyAuthProcessingCountResultDTO(); + partyAuthProcessingCountResultDTO.setGridId(gridId); + Long auditingPartyMember = resiPartyMemberRedis.queryPartyAuthProcessingCount(gridId); + partyAuthProcessingCountResultDTO.setCount(auditingPartyMember); + list.add(partyAuthProcessingCountResultDTO); + } + return list; + } + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java index 5444e4ccca..e2da03019c 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java @@ -31,6 +31,7 @@ import com.epmet.modules.warmhearted.excel.ResiWarmheartedApplyExcel; import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService; import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO; import com.epmet.resi.partymember.dto.warmhearted.form.*; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiProcessingCountResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; @@ -162,4 +163,16 @@ public class ResiWarmheartedApplyController { return resiWarmheartedApplyService.getDetail(formDTO); } + /** + * @param gridIdList + * @return com.epmet.commons.tools.utils.Result> + * @Author yinzuomei + * @Description 传入网格id列表,返回每个列表下对应的待审核居民总数 + * @Date 2020/5/13 22:25 + **/ + @PostMapping("queryresiprocessingcount") + public Result> queryResiProcessingCount(@RequestBody List gridIdList) { + List list = resiWarmheartedApplyService.queryResiProcessingCount(gridIdList); + return new Result>().ok(list); + } } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java index 0fba6e16ff..7bd90437b1 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity; import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO; import com.epmet.resi.partymember.dto.warmhearted.form.*; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiProcessingCountResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; @@ -158,4 +159,13 @@ public interface ResiWarmheartedApplyService extends BaseService getDetail(ResiWarmGetDetailFormDTO formDTO); + + /** + * @param gridIdList + * @return java.util.List + * @Author yinzuomei + * @Description 传入网格id列表,返回每个列表下对应的待审核居民总数 + * @Date 2020/5/13 22:25 + **/ + List queryResiProcessingCount(List gridIdList); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java index 6da9ab7c94..8ddb224bf0 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java @@ -46,11 +46,12 @@ import com.epmet.modules.warmhearted.constant.ResiWarmheartedConstant; import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant; import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao; import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity; -import com.epmet.modules.warmhearted.redis.ResiWarmheartedApplyRedis; import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService; import com.epmet.modules.warmhearted.service.ResiWarmheartedVisitService; +import com.epmet.redis.ResiPartyMemberRedis; import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO; import com.epmet.resi.partymember.dto.warmhearted.form.*; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiProcessingCountResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; @@ -78,8 +79,6 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl page(Map params) { @@ -210,6 +211,8 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl queryResiProcessingCount(List gridIdList) { + List list = new ArrayList<>(); + for (String gridId : gridIdList) { + ResiProcessingCountResultDTO resiProcessingCountResultDTO = new ResiProcessingCountResultDTO(); + resiProcessingCountResultDTO.setGridId(gridId); + Long auditingResi = resiPartyMemberRedis.queryResiProcessingCount(gridId); + resiProcessingCountResultDTO.setCount(auditingResi); + list.add(resiProcessingCountResultDTO); + } + return list; + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/redis/ResiPartyMemberRedis.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/redis/ResiPartyMemberRedis.java new file mode 100644 index 0000000000..10dce072dd --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/redis/ResiPartyMemberRedis.java @@ -0,0 +1,168 @@ +/** + * 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 com.epmet.constant.ResiPartyMemberRedisKeys; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 本模块redis所有操作放这 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-30 + */ +@Component +public class ResiPartyMemberRedis { + private Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set() { + + } + + public String get(String id) { + return null; + } + + /** + * @param gridId + * @return java.lang.Long + * @Author yinzuomei + * @Description 居民端热心居民申请成功,该redis值+1,目的:政府端基层治理-居民管理显示红点提醒工作人员有待办事项 + * @Date 2020/5/13 10:55 + **/ + public Long addWorkGrassrootsResiRedDotValue(String gridId) { + Long auditingResiWarmHeartedCount = 0L; + try { + String workGrassrootsResiRedDotKey = ResiPartyMemberRedisKeys.getWorkGrassrootsResiRedDotKey(gridId); + auditingResiWarmHeartedCount = redisUtils.incrementAndGet(workGrassrootsResiRedDotKey); + logger.info(String.format("居民端热心居民申请提交,更新redis-reddot值成功,key[%s],Value[%s]", workGrassrootsResiRedDotKey, auditingResiWarmHeartedCount)); + } catch (Exception e) { + logger.error(String.format("居民端热心居民申请提交,更新redis-reddot值异常%s", e.getMessage())); + e.printStackTrace(); + } + return auditingResiWarmHeartedCount; + } + + /** + * @param gridId + * @return java.lang.Long + * @Author yinzuomei keyeg: epmet:gov:wxmp:work:grassroots:partyauth:XX网格id + * @Description 政府端小程序审核热心居民申请(同意或拒绝),更新该redis值-1 + * @Date 2020/5/13 13:11 + **/ + public Long subtractWorkGrassrootsResiRedDotValue(String gridId) { + Long auditingPartyMemberCount = 0L; + try { + String workGrassrootsPartyAuthRedDotKey = ResiPartyMemberRedisKeys.getWorkGrassrootsResiRedDotKey(gridId); + auditingPartyMemberCount = redisUtils.incrementAndGet(workGrassrootsPartyAuthRedDotKey); + logger.info(String.format("政府端(wxmp)审核热心居民申请,更新redis-reddot值成功,key[%s],Value[%s]", workGrassrootsPartyAuthRedDotKey, auditingPartyMemberCount)); + } catch (Exception e) { + logger.error(String.format("政府端(wxmp)审核热心居民申请,更新redis-reddot值异常%s", e.getMessage())); + e.printStackTrace(); + } + return auditingPartyMemberCount; + } + + /** + * @param gridId + * @return java.lang.Long + * @Author yinzuomei keyeg: epmet:gov:wxmp:work:grassroots:partyauth:XX网格id + * @Description 居民端党员自动认证失败,且填写了补充信息,提交成功后,该redis值+1,目的:政府端基层治理-党员认证显示红点,提醒工作人员有待办事项 + * @Date 2020/5/13 10:56 + **/ + public Long addWorkGrassrootsPartyAuthRedDotValue(String gridId) { + Long auditingPartyMemberCount = 0L; + try { + String workGrassrootsPartyAuthRedDotKey = ResiPartyMemberRedisKeys.getWorkGrassrootsPartyAuthRedDotKey(gridId); + auditingPartyMemberCount = redisUtils.incrementAndGet(workGrassrootsPartyAuthRedDotKey); + logger.info(String.format("居民端党员认证补充信息提交,更新redis-reddot值成功,key[%s],Value[%s]", workGrassrootsPartyAuthRedDotKey, auditingPartyMemberCount)); + } catch (Exception e) { + logger.error(String.format("居民端党员认证补充信息提交,更新redis-reddot值异常%s", e.getMessage())); + e.printStackTrace(); + } + return auditingPartyMemberCount; + } + + /** + * @param gridId + * @return java.lang.Long + * @Author yinzuomei keyeg: epmet:gov:wxmp:work:grassroots:partyauth:XX网格id + * @Description 政府端审批党员认证申请成功后,更新该redis值-1 + * @Date 2020/5/13 10:56 + **/ + public Long subtractWorkGrassrootsPartyAuthRedDotValue(String gridId) { + Long auditingPartyMemberCount = 0L; + try { + String workGrassrootsPartyAuthRedDotKey = ResiPartyMemberRedisKeys.getWorkGrassrootsPartyAuthRedDotKey(gridId); + auditingPartyMemberCount = redisUtils.incrementAndGet(workGrassrootsPartyAuthRedDotKey); + logger.info(String.format("居民端党员认证补充信息提交,更新redis-reddot值成功,key[%s],Value[%s]", workGrassrootsPartyAuthRedDotKey, auditingPartyMemberCount)); + } catch (Exception e) { + logger.error(String.format("居民端党员认证补充信息提交,更新redis-reddot值异常%s", e.getMessage())); + e.printStackTrace(); + } + return auditingPartyMemberCount; + } + + /** + * @param gridId + * @return java.lang.Long + * @Author yinzuomei + * @Description 查询网格下待审核热心居民总数 + * @Date 2020/5/13 22:44 + **/ + public Long queryResiProcessingCount(String gridId) { + Long auditingResiWarmHeartedCount = 0L; + try { + String workGrassrootsResiRedDotKey = ResiPartyMemberRedisKeys.getWorkGrassrootsResiRedDotKey(gridId); + auditingResiWarmHeartedCount = (Long) redisUtils.get(workGrassrootsResiRedDotKey); + } catch (Exception e) { + logger.error(String.format("网格id%s,查询网格下待审核热心居民总数异常%s", gridId, e.getMessage())); + e.printStackTrace(); + } + return auditingResiWarmHeartedCount; + } + + /** + * @param gridId + * @return java.lang.Long + * @Author yinzuomei + * @Description 查询网格下待审核党员总数 + * @Date 2020/5/13 22:44 + **/ + public Long queryPartyAuthProcessingCount(String gridId) { + Long auditingParyMember = 0L; + try { + String workGrassrootsResiRedDotKey = ResiPartyMemberRedisKeys.getWorkGrassrootsPartyAuthRedDotKey(gridId); + auditingParyMember = (Long) redisUtils.get(workGrassrootsResiRedDotKey); + } catch (Exception e) { + logger.error(String.format("网格id%s,查询网格下待审核党员总数异常%s", gridId, e.getMessage())); + e.printStackTrace(); + } + return auditingParyMember; + } +} \ No newline at end of file