Browse Source

待办提醒接口改造

dev
zhaoqifeng 4 years ago
parent
commit
7f58a18520
  1. 2
      epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java
  2. 32
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java

2
epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java

@ -23,7 +23,7 @@ public class RedDotFormDTO implements Serializable {
/**
* 网格ID
*/
@NotBlank(message = "网格id不能为空")
//@NotBlank(message = "网格id不能为空")
private String gridId;
}

32
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java

@ -14,6 +14,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Collections;
@ -228,6 +229,11 @@ public class RemindServiceImpl implements RemindService {
Result<List<GridProcessingCountResultDTO>> groupResult = resiGroupFeignClient.queryGroupProcessingCount(gridIdList);
if (groupResult.success() && !CollectionUtils.isEmpty(groupResult.getData())) {
groupResult.getData().forEach(groupDto -> {
if (StringUtils.isEmpty(formDTO.getGridId())) {
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_GROUP);
details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_GROUP, groupDto.getCount()));
redDotResultDTO.setOtherGridRedDot(false);
} else {
//当前网格
if (formDTO.getGridId().equals(groupDto.getGridId()) && groupDto.getCount() > 0) {
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_GROUP);
@ -237,6 +243,7 @@ public class RemindServiceImpl implements RemindService {
if (!formDTO.getGridId().equals(groupDto.getGridId()) && groupDto.getCount() > 0) {
redDotResultDTO.setOtherGridRedDot(true);
}
}
});
}
@ -244,6 +251,11 @@ public class RemindServiceImpl implements RemindService {
Result<List<GridProcessingCountResultDTO>> resiResult = resiPartymemberFeignClient.queryResiProcessingCount(gridIdList);
if (resiResult.success() && !CollectionUtils.isEmpty(resiResult.getData())) {
resiResult.getData().forEach(resiDto -> {
if (StringUtils.isEmpty(formDTO.getGridId())) {
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_RESI);
details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_RESI, resiDto.getCount()));
redDotResultDTO.setOtherGridRedDot(false);
} else {
//当前网格
if (formDTO.getGridId().equals(resiDto.getGridId()) && resiDto.getCount() > 0) {
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_RESI);
@ -253,6 +265,7 @@ public class RemindServiceImpl implements RemindService {
if (!formDTO.getGridId().equals(resiDto.getGridId()) && resiDto.getCount() > 0) {
redDotResultDTO.setOtherGridRedDot(true);
}
}
});
}
@ -260,6 +273,11 @@ public class RemindServiceImpl implements RemindService {
Result<List<GridProcessingCountResultDTO>> partyResult = resiPartymemberFeignClient.queryPartyMemberProcessingCount(gridIdList);
if (partyResult.success() && !CollectionUtils.isEmpty(partyResult.getData())) {
partyResult.getData().forEach(partyDto -> {
if (StringUtils.isEmpty(formDTO.getGridId())) {
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_PARTYAUTH);
details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_PARTYAUTH, partyDto.getCount()));
redDotResultDTO.setOtherGridRedDot(false);
} else {
//当前网格
if (formDTO.getGridId().equals(partyDto.getGridId()) && partyDto.getCount() > 0) {
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_PARTYAUTH);
@ -269,6 +287,7 @@ public class RemindServiceImpl implements RemindService {
if (!formDTO.getGridId().equals(partyDto.getGridId()) && partyDto.getCount() > 0) {
redDotResultDTO.setOtherGridRedDot(true);
}
}
});
}
@ -276,6 +295,11 @@ public class RemindServiceImpl implements RemindService {
Result<List<GridProcessingCountResultDTO>> issueResult = govIssueFeignClient.queryVotingIssueCount(gridIdList);
if (issueResult.success() && !CollectionUtils.isEmpty(issueResult.getData())) {
issueResult.getData().forEach(issueDto -> {
if (StringUtils.isEmpty(formDTO.getGridId())) {
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE);
details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE, issueDto.getCount()));
redDotResultDTO.setOtherGridRedDot(false);
} else {
//当前网格
if (formDTO.getGridId().equals(issueDto.getGridId()) && issueDto.getCount() > 0) {
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE);
@ -285,6 +309,7 @@ public class RemindServiceImpl implements RemindService {
if (!formDTO.getGridId().equals(issueDto.getGridId()) && issueDto.getCount() > 0) {
redDotResultDTO.setOtherGridRedDot(true);
}
}
});
}
@ -292,6 +317,12 @@ public class RemindServiceImpl implements RemindService {
Result<List<GridAuditingBadgeCountResultDTO>> badgeResult = epmetUserOpenFeignClient.queryGridAuditingBadgeCount(gridIdList);
if (badgeResult.success() && !CollectionUtils.isEmpty(badgeResult.getData())) {
badgeResult.getData().forEach(badgeDto -> {
if (StringUtils.isEmpty(formDTO.getGridId())) {
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_BADGE);
details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_BADGE, badgeDto.getCount()));
redDotResultDTO.setOtherGridRedDot(false);
} else {
//当前网格
if (formDTO.getGridId().equals(badgeDto.getGridId()) && badgeDto.getCount() > 0) {
functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_BADGE);
@ -301,6 +332,7 @@ public class RemindServiceImpl implements RemindService {
if (!formDTO.getGridId().equals(badgeDto.getGridId()) && badgeDto.getCount() > 0) {
redDotResultDTO.setOtherGridRedDot(true);
}
}
});
}
redDotResultDTO.setFunctionList(functionList);

Loading…
Cancel
Save