|
|
@ -6,19 +6,19 @@ import com.epmet.constant.WorkGrassRootsFunctionConstant; |
|
|
|
import com.epmet.controller.TestFormDTO1; |
|
|
|
import com.epmet.controller.TestResultDTO1; |
|
|
|
import com.epmet.dto.form.RedDotFormDTO; |
|
|
|
import com.epmet.dto.result.CustomerGridByUserIdResultDTO; |
|
|
|
import com.epmet.dto.result.GridAuditingBadgeCountResultDTO; |
|
|
|
import com.epmet.dto.result.GridProcessingCountResultDTO; |
|
|
|
import com.epmet.dto.result.RedDotResultDTO; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.feign.*; |
|
|
|
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 org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 基层治理待办事项提醒 |
|
|
@ -48,10 +48,16 @@ public class RemindServiceImpl implements RemindService { |
|
|
|
public RedDotResultDTO queryGridRedDot(RedDotFormDTO formDTO) { |
|
|
|
RedDotResultDTO redDotResultDTO = new RedDotResultDTO(); |
|
|
|
redDotResultDTO.setOtherGridRedDot(false); |
|
|
|
//当前基层治理以下图标需要显示红点提醒
|
|
|
|
//1、群组管理(待审核的小组申请、变更小组申请)
|
|
|
|
//2、居民管理(待审核的热心居民申请)
|
|
|
|
//3、党员认证(待审核的认证党员申请)
|
|
|
|
//4、议题管理(待审核的议题、表决中的议题)
|
|
|
|
//5、徽章审核(待审核的徽章)
|
|
|
|
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())); |
|
|
|
logger.warn(String.format("调用gov-org-server服务查询工作人员网格列表失败返回结果", govOrgResult.toString())); |
|
|
|
}else{ |
|
|
|
List<CustomerGridByUserIdResultDTO> gridList = govOrgResult.getData(); |
|
|
|
logger.info("我的网格列表"+gridList.size()); |
|
|
@ -76,18 +82,23 @@ public class RemindServiceImpl implements RemindService { |
|
|
|
List<String> functionList = new ArrayList<>(); |
|
|
|
List<String> gridIdList = new ArrayList<>(); |
|
|
|
gridIdList.add(gridId); |
|
|
|
//1、群组管理(待审核的小组申请、变更小组申请)
|
|
|
|
if (this.getWorkGrassRootsGroup(gridIdList)) { |
|
|
|
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_GROUP); |
|
|
|
} |
|
|
|
//2、居民管理(待审核的热心居民申请)
|
|
|
|
if (this.getWorkGrassRootsResi(gridIdList)) { |
|
|
|
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_RESI); |
|
|
|
} |
|
|
|
//3、党员认证(待审核的认证党员申请)
|
|
|
|
if (this.getWorkGrassRootsPartyAuth(gridIdList)) { |
|
|
|
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_PARTYAUTH); |
|
|
|
} |
|
|
|
//4、议题管理(待审核的议题、表决中的议题)
|
|
|
|
if (this.getWorkGrassRootsIssue(gridIdList)) { |
|
|
|
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE); |
|
|
|
} |
|
|
|
//5、徽章审核(待审核的徽章)
|
|
|
|
if(this.getWorkGrassRootsBadge(gridIdList)){ |
|
|
|
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_BADGE); |
|
|
|
} |
|
|
@ -108,7 +119,7 @@ public class RemindServiceImpl implements RemindService { |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
logger.error(String.format("查询群组管理待办事项数失败,%s",groupProcessingCountResult.getMsg())); |
|
|
|
logger.warn(String.format("查询群组管理待办事项数失败,%s",groupProcessingCountResult.getMsg())); |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
@ -126,7 +137,7 @@ public class RemindServiceImpl implements RemindService { |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
logger.error(String.format("查询网格内待审核热心居民数失败,%s",resiGroupProcessingCountResult.getMsg())); |
|
|
|
logger.warn(String.format("查询网格内待审核热心居民数失败,%s",resiGroupProcessingCountResult.getMsg())); |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
@ -144,7 +155,7 @@ public class RemindServiceImpl implements RemindService { |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
logger.error(String.format("查询网格内待审核党员总数失败,%s",partyMemberProcessingCountResult.getMsg())); |
|
|
|
logger.warn(String.format("查询网格内待审核党员总数失败,%s",partyMemberProcessingCountResult.getMsg())); |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
@ -162,7 +173,7 @@ public class RemindServiceImpl implements RemindService { |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
logger.error("查询网格表决中议题总数失败,%s",issueResult.getMsg()); |
|
|
|
logger.warn("查询网格表决中议题总数失败,%s",issueResult.getMsg()); |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
@ -179,7 +190,7 @@ public class RemindServiceImpl implements RemindService { |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
logger.error(String.format("查询网格待审核徽章申请失败,%s",badgeResult.getMsg())); |
|
|
|
logger.warn(String.format("查询网格待审核徽章申请失败,%s",badgeResult.getMsg())); |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
@ -192,5 +203,115 @@ public class RemindServiceImpl implements RemindService { |
|
|
|
} |
|
|
|
return new TestResultDTO1(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.dto.result.RedDotResultDTO |
|
|
|
* @author yinzuomei |
|
|
|
* @description 根据网格id,查询基层治理下网格各功能菜单是否显示红点,以及除当前网格外,其他网格是否有待办事项 |
|
|
|
* @Date 2020/12/25 10:49 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public RedDotResultDTO queryGridRedDotV2(RedDotFormDTO formDTO) { |
|
|
|
RedDotResultDTO redDotResultDTO = new RedDotResultDTO(); |
|
|
|
redDotResultDTO.setOtherGridRedDot(false); |
|
|
|
redDotResultDTO.setFunctionList(Collections.EMPTY_LIST); |
|
|
|
|
|
|
|
Result<List<CustomerGridByUserIdResultDTO>> govOrgResult = govOrgFeignClient.getMyGrids(formDTO.getStaffId()); |
|
|
|
|
|
|
|
if (govOrgResult.success() && !CollectionUtils.isEmpty(govOrgResult.getData())) { |
|
|
|
List<String> functionList = new ArrayList<>(); |
|
|
|
List<RedDotDetialDTO> details = new ArrayList<>(); |
|
|
|
List<String> gridIdList = govOrgResult.getData().stream().map(CustomerGridByUserIdResultDTO::getGridId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
//1、群组管理(待审核的小组申请、变更小组申请)
|
|
|
|
Result<List<GridProcessingCountResultDTO>> groupResult = resiGroupFeignClient.queryGroupProcessingCount(gridIdList); |
|
|
|
if (groupResult.success() && !CollectionUtils.isEmpty(groupResult.getData())) { |
|
|
|
groupResult.getData().forEach(groupDto -> { |
|
|
|
//当前网格
|
|
|
|
if (formDTO.getGridId().equals(groupDto.getGridId()) && groupDto.getCount() > 0) { |
|
|
|
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_GROUP); |
|
|
|
details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_GROUP, groupDto.getCount())); |
|
|
|
} |
|
|
|
//其他网格
|
|
|
|
if (!formDTO.getGridId().equals(groupDto.getGridId()) && groupDto.getCount() > 0) { |
|
|
|
redDotResultDTO.setOtherGridRedDot(true); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//2、居民管理(待审核的热心居民申请)
|
|
|
|
Result<List<GridProcessingCountResultDTO>> resiResult = resiPartymemberFeignClient.queryResiProcessingCount(gridIdList); |
|
|
|
if (resiResult.success() && !CollectionUtils.isEmpty(resiResult.getData())) { |
|
|
|
resiResult.getData().forEach(resiDto -> { |
|
|
|
//当前网格
|
|
|
|
if (formDTO.getGridId().equals(resiDto.getGridId()) && resiDto.getCount() > 0) { |
|
|
|
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_RESI); |
|
|
|
details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_RESI, resiDto.getCount())); |
|
|
|
} |
|
|
|
//其他网格
|
|
|
|
if (!formDTO.getGridId().equals(resiDto.getGridId()) && resiDto.getCount() > 0) { |
|
|
|
redDotResultDTO.setOtherGridRedDot(true); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//3、党员认证(待审核的认证党员申请)
|
|
|
|
Result<List<GridProcessingCountResultDTO>> partyResult = resiPartymemberFeignClient.queryPartyMemberProcessingCount(gridIdList); |
|
|
|
if (partyResult.success() && !CollectionUtils.isEmpty(partyResult.getData())) { |
|
|
|
partyResult.getData().forEach(partyDto -> { |
|
|
|
//当前网格
|
|
|
|
if (formDTO.getGridId().equals(partyDto.getGridId()) && partyDto.getCount() > 0) { |
|
|
|
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_PARTYAUTH); |
|
|
|
details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_PARTYAUTH, partyDto.getCount())); |
|
|
|
} |
|
|
|
//其他网格
|
|
|
|
if (!formDTO.getGridId().equals(partyDto.getGridId()) && partyDto.getCount() > 0) { |
|
|
|
redDotResultDTO.setOtherGridRedDot(true); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//4、议题管理(待审核的议题、表决中的议题)
|
|
|
|
Result<List<GridProcessingCountResultDTO>> issueResult = govIssueFeignClient.queryVotingIssueCount(gridIdList); |
|
|
|
if (issueResult.success() && !CollectionUtils.isEmpty(issueResult.getData())) { |
|
|
|
issueResult.getData().forEach(issueDto -> { |
|
|
|
//当前网格
|
|
|
|
if (formDTO.getGridId().equals(issueDto.getGridId()) && issueDto.getCount() > 0) { |
|
|
|
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE); |
|
|
|
details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE, issueDto.getCount())); |
|
|
|
} |
|
|
|
//其他网格
|
|
|
|
if (!formDTO.getGridId().equals(issueDto.getGridId()) && issueDto.getCount() > 0) { |
|
|
|
redDotResultDTO.setOtherGridRedDot(true); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//5、徽章审核(待审核的徽章)
|
|
|
|
Result<List<GridAuditingBadgeCountResultDTO>> badgeResult = epmetUserOpenFeignClient.queryGridAuditingBadgeCount(gridIdList); |
|
|
|
if (badgeResult.success() && !CollectionUtils.isEmpty(badgeResult.getData())) { |
|
|
|
badgeResult.getData().forEach(badgeDto -> { |
|
|
|
//当前网格
|
|
|
|
if (formDTO.getGridId().equals(badgeDto.getGridId()) && badgeDto.getCount() > 0) { |
|
|
|
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_BADGE); |
|
|
|
details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_BADGE, badgeDto.getCount())); |
|
|
|
} |
|
|
|
//其他网格
|
|
|
|
if (!formDTO.getGridId().equals(badgeDto.getGridId()) && badgeDto.getCount() > 0) { |
|
|
|
redDotResultDTO.setOtherGridRedDot(true); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
redDotResultDTO.setFunctionList(functionList); |
|
|
|
redDotResultDTO.setDetails(details); |
|
|
|
} else { |
|
|
|
logger.warn(String.format("基层治理红点查询,获取工作人员所属网格失败,当前staffId=%s", formDTO.getStaffId())); |
|
|
|
} |
|
|
|
return redDotResultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|