59 changed files with 1963 additions and 353 deletions
@ -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; |
||||
|
} |
||||
|
|
||||
@ -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; |
||||
|
} |
||||
|
|
||||
@ -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<String> functionList; |
||||
|
} |
||||
|
|
||||
@ -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"; |
||||
|
} |
||||
|
|
||||
@ -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<com.epmet.dto.result.RedDotResultDTO> |
||||
|
* @param formDTO |
||||
|
* @Author yinzuomei |
||||
|
* @Description 根据网格id,查询基层治理下网格各功能菜单是否显示红点,以及除当前网格外,其他网格是否有待办事项 |
||||
|
* @Date 2020/5/13 14:28 |
||||
|
**/ |
||||
|
@PostMapping("reddot") |
||||
|
public Result<RedDotResultDTO> queryGridRedDot(@LoginUser TokenDto tokenDto, @RequestBody RedDotFormDTO formDTO){ |
||||
|
formDTO.setStaffId(tokenDto.getUserId()); |
||||
|
ValidatorUtils.validateEntity(formDTO); |
||||
|
RedDotResultDTO redDotResultDTO=remindService.queryGridRedDot(formDTO); |
||||
|
return new Result<RedDotResultDTO>().ok(redDotResultDTO); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("test") |
||||
|
public Result<TestResultDTO1> test( ){ |
||||
|
TestFormDTO1 testFormDTO1=new TestFormDTO1(); |
||||
|
testFormDTO1.setId("111"); |
||||
|
testFormDTO1.setName("啊啊啊"); |
||||
|
TestResultDTO1 testResultDTO1=remindService.test(testFormDTO1); |
||||
|
return new Result<TestResultDTO1>().ok(testResultDTO1); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -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; |
||||
|
} |
||||
|
|
||||
@ -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; |
||||
|
} |
||||
|
|
||||
@ -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<String> gridIdList); |
||||
|
} |
||||
@ -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<List<CustomerGridByUserIdResultDTO>> getMyGrids(@PathVariable("userId") String userId); |
||||
|
|
||||
|
} |
||||
@ -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<String> gridIdList) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryVotingIssueCount", gridIdList); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -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<List<CustomerGridByUserIdResultDTO>> getMyGrids(String userId) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getMyGrids", userId); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
@ -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<List<CustomerGridByUserIdResultDTO>> govOrgResult = govOrgFeignClient.getMyGrids(formDTO.getStaffId()); |
||||
|
if (!govOrgResult.success()) { |
||||
|
logger.error(String.format("调用gov-org-server服务查询工作人员网格列表失败返回结果", govOrgResult.toString())); |
||||
|
} |
||||
|
List<CustomerGridByUserIdResultDTO> gridList = govOrgResult.getData(); |
||||
|
for (CustomerGridByUserIdResultDTO gridInfo : gridList) { |
||||
|
if(formDTO.getGridId().equals(gridInfo)){ |
||||
|
//查询非当前网格的
|
||||
|
break; |
||||
|
} |
||||
|
//其他网格,只要存在有待办事项的网格,就需要在工作首页网格名称后面显示红点
|
||||
|
List<String> functionList = this.getRedDotFunctionList(gridInfo.getGridId()); |
||||
|
if (null != functionList && functionList.size() > 0) { |
||||
|
redDotResultDTO.setOtherGridRedDot(true); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
return redDotResultDTO; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public List<String> getRedDotFunctionList(String gridId) { |
||||
|
List<String> functionList = new ArrayList<>(); |
||||
|
List<String> 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<String> gridIdList) { |
||||
|
Result<List<GridProcessingCountResultDTO>> 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<String> gridIdList) { |
||||
|
Result<List<GridProcessingCountResultDTO>> 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<String> gridIdList) { |
||||
|
Result<List<GridProcessingCountResultDTO>> 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<String> gridIdList) { |
||||
|
Result<List<GridProcessingCountResultDTO>> 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<TestResultDTO1> resultDTO1Result = resiGroupFeignClient.test(testFormDTO1); |
||||
|
if (resultDTO1Result.success()) { |
||||
|
logger.info("gov-grid服务,接收返参:" + JSON.toJSONString(resultDTO1Result.getData())); |
||||
|
return resultDTO1Result.getData(); |
||||
|
} |
||||
|
return new TestResultDTO1(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -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; |
||||
|
} |
||||
|
|
||||
@ -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)); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -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; |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -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; |
||||
|
} |
||||
|
|
||||
@ -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; |
||||
|
|
||||
|
} |
||||
|
|
||||
@ -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<String> gridIdList); |
||||
|
} |
||||
@ -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<List<GridProcessingCountResultDTO>> queryGroupProcessingCount(@RequestBody List<String> gridIdList); |
||||
|
} |
||||
@ -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<List<GridProcessingCountResultDTO>> queryResiProcessingCount(@RequestBody List<String> 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<List<GridProcessingCountResultDTO>> queryPartyMemberProcessingCount(@RequestBody List<String> gridIdList); |
||||
|
|
||||
|
} |
||||
@ -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<String> gridIdList) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryVotingIssueCount", gridIdList); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -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<List<GridProcessingCountResultDTO>> queryGroupProcessingCount(List<String> gridIdList) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "queryGroupProcessingCount", gridIdList); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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<List<GridProcessingCountResultDTO>> queryResiProcessingCount(List<String> gridIdList) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "queryResiProcessingCount", gridIdList); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<List<GridProcessingCountResultDTO>> queryPartyMemberProcessingCount(List<String> gridIdList) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "queryPartyMemberProcessingCount", gridIdList); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,53 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* <p> |
||||
|
* https://www.renren.io
|
||||
|
* <p> |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
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)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
|
|
||||
@ -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; |
||||
|
} |
||||
|
|
||||
@ -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; |
||||
|
} |
||||
|
|
||||
@ -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; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,35 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* <p> |
||||
|
* https://www.renren.io
|
||||
|
* <p> |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
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)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,168 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* 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. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
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; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue