Browse Source

Merge branch 'dev'

dev
sunyuchao 4 years ago
parent
commit
f68f925b38
  1. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java
  2. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  3. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  4. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java
  5. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java
  6. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java
  7. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java
  8. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java
  9. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java
  10. 81
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java
  11. 66
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
  12. 69
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  13. 22
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  14. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  15. 6
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java
  16. 5
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java
  17. 5
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java
  18. 5
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java

@ -151,6 +151,15 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity {
*/
private Integer inGroupTopicUnResolvedCount;
/**
* 11当前组织内来源于事件的项目结案已解决数
*/
private Integer eventResolvedCount;
/**
* 12当前组织内来源于事件的项目结案无需解决数
*/
private Integer eventUnResolvedCount;
/**
* 未出当前网格的结案项目数
*/
@ -171,4 +180,5 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity {
*/
private Integer districtDeptClosedCount;
}

17
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -1186,13 +1186,20 @@ public class DataStatsServiceImpl implements DataStatsService {
Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getStreetClosedCount).sum();
//由区直部门结案的项目总数
Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getDistrictDeptClosedCount).sum();
Integer issueResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getIssueProjectResolvedCount).sum();
Integer issueUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getIssueProjectUnResolvedCount).sum();
Integer projectResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getApprovalProjectResolvedCount).sum();
Integer projectUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getApprovalProjectUnResolvedCount).sum();
Integer eventResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getEventResolvedCount).sum();
Integer eventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getEventUnResolvedCount).sum();
Integer closedProjectTotal = issueResolvedCount + issueUnResolvedCount+projectResolvedCount
+ projectUnResolvedCount + eventResolvedCount + eventUnResolvedCount;
resultDTO.setProblemResolvedCount(problemResolvedCount);
resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount));
resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, problemResolvedCount));
resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, problemResolvedCount));
resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, problemResolvedCount));
resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, problemResolvedCount));
resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, closedProjectTotal));
resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, closedProjectTotal));
resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, closedProjectTotal));
resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, closedProjectTotal));
return resultDTO;
}

8
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml

@ -675,7 +675,13 @@
GRID_SELF_GOVERN_PROJECT_TOTAL,
COMMUNITY_CLOSED_COUNT,
STREET_CLOSED_COUNT,
DISTRICT_DEPT_CLOSED_COUNT
DISTRICT_DEPT_CLOSED_COUNT,
ISSUE_PROJECT_RESOLVED_COUNT,
ISSUE_PROJECT_UN_RESOLVED_COUNT,
APPROVAL_PROJECT_RESOLVED_COUNT,
APPROVAL_PROJECT_UN_RESOLVED_COUNT,
EVENT_RESOLVED_COUNT,
EVENT_UN_RESOLVED_COUNT
FROM
fact_agency_govern_daily
WHERE

9
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java

@ -129,6 +129,15 @@ public class FactAgencyGovernDailyDTO implements Serializable {
*/
private Integer inGroupTopicUnResolvedCount;
/**
* 11当前组织内来源于事件的项目结案已解决数
*/
private Integer eventResolvedCount;
/**
* 12当前组织内来源于事件的项目结案无需解决数
*/
private Integer eventUnResolvedCount;
/**
* 未出当前网格的结案项目数
*/

9
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java

@ -140,6 +140,15 @@ public class FactGridGovernDailyDTO implements Serializable {
*/
private Integer fromAgencyUnResolvedInGridCount;
/**
* 15当前组织内来源于事件的项目结案已解决数
*/
private Integer eventResolvedCount;
/**
* 16当前组织内来源于事件的项目结案无需解决数
*/
private Integer eventUnResolvedCount;
/**
* 15未出当前网格的结案项目数=11+12+13+14
*/

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java

@ -24,4 +24,6 @@ public interface DimObjectActionConstant {
// perfect 非常满意
// created 立项
String PROJECT_RETURN="return";
String PROJECT_CLOSE="close";
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java

@ -150,7 +150,14 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity {
* 10当前组织内未出小组即未转议题的话题关闭无需解决数
*/
private Integer inGroupTopicUnResolvedCount;
/**
* 11当前组织内来源于事件的项目结案已解决数
*/
private Integer eventResolvedCount;
/**
* 12当前组织内来源于事件的项目结案无需解决数
*/
private Integer eventUnResolvedCount;
/**
* 未出当前网格的结案项目数
*/

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java

@ -169,6 +169,15 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity {
*/
private Integer gridSelfGovernProjectTotal;
/**
* 15当前组织内来源于事件的项目结案已解决数
*/
private Integer eventResolvedCount;
/**
* 16当前组织内来源于事件的项目结案无需解决数
*/
private Integer eventUnResolvedCount;
/**
* 当前网格内出来的项目由社区结案(已解决+未解决)的项目总数
@ -208,6 +217,8 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity {
this.issueProjectUnResolvedCount=NumConstant.ZERO;
this.approvalProjectResolvedCount=NumConstant.ZERO;
this.approvalProjectUnResolvedCount=NumConstant.ZERO;
this.eventResolvedCount=NumConstant.ZERO;
this.eventUnResolvedCount=NumConstant.ZERO;
this.inGroupTopicResolvedCount=NumConstant.ZERO;
this.inGroupTopicUnResolvedCount=NumConstant.ZERO;
this.fromIssueResolvedInGridCount=NumConstant.ZERO;

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java

@ -51,6 +51,8 @@ public class GovernGridClosedTotalCommonDTO implements Serializable {
*/
private Integer districtDeptClosedCount;
private Integer gridSelfGovernProjectTotal;
public GovernGridClosedTotalCommonDTO(){
this.gridId = StrConstant.EPMETY_STR;
this.fromIssueResolvedInGridCount=NumConstant.ZERO;
@ -60,5 +62,6 @@ public class GovernGridClosedTotalCommonDTO implements Serializable {
this.communityClosedCount=NumConstant.ZERO;
this.streetClosedCount=NumConstant.ZERO;
this.districtDeptClosedCount=NumConstant.ZERO;
this.gridSelfGovernProjectTotal=NumConstant.ZERO;
}
}

81
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java

@ -29,7 +29,6 @@ import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.util.DimIdGenerator;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
@ -202,13 +201,11 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
});
}
// 当前组织内:来源于议题的项目:结案已解决数
// 当前组织内:项目立项:结案已解决数
Map<String, OrgStatisticsResultDTO> projectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.RESOLVED,
OrgTypeConstant.AGENCY);
Map<String, OrgStatisticsResultDTO> eventProjectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.RESOLVED,
ProjectConstant.PROJECT_ORIGIN_EVENT);
if (!projectResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = projectResolvedTotal.get(item.getAgencyId());
@ -219,23 +216,12 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
item.setApprovalProjectResolvedCount(sum);
});
}
if (!eventProjectResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = eventProjectResolvedTotal.get(item.getAgencyId());
int sum = item.getApprovalProjectResolvedCount();
if (null != dto) {
sum = sum + dto.getSum();
}
item.setApprovalProjectResolvedCount(sum);
});
}
// 当前组织内:来源于议题的项目:结案无需解决数
// 当前组织内:项目立项:结案无需解决数
Map<String, OrgStatisticsResultDTO> projectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.UNRESOLVED,
OrgTypeConstant.AGENCY);
Map<String, OrgStatisticsResultDTO> eventProjectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.UNRESOLVED,
ProjectConstant.PROJECT_ORIGIN_EVENT);
if (!projectUnResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = projectUnResolvedTotal.get(item.getAgencyId());
@ -246,17 +232,34 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
item.setApprovalProjectUnResolvedCount(sum);
});
}
if (!eventProjectUnResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = eventProjectUnResolvedTotal.get(item.getAgencyId());
int sum = item.getApprovalProjectUnResolvedCount();
if (null != dto) {
sum = sum + dto.getSum();
}
item.setApprovalProjectUnResolvedCount(sum);
});
}
}
//2021.12.15 当前组织内:来源于事件的项目:结案已解决数
Map<String, OrgStatisticsResultDTO> eventProjectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.RESOLVED,
ProjectConstant.PROJECT_ORIGIN_EVENT);
if (!eventProjectResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = eventProjectResolvedTotal.get(item.getAgencyId());
if (null != dto) {
item.setEventResolvedCount(dto.getSum());
}
});
}
//2021.12.15 当前组织内:来源于事件的项目:结案无需解决数
Map<String, OrgStatisticsResultDTO> eventProjectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.UNRESOLVED,
ProjectConstant.PROJECT_ORIGIN_EVENT);
if (!eventProjectUnResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = eventProjectUnResolvedTotal.get(item.getAgencyId());
if (null != dto) {
item.setEventUnResolvedCount(dto.getSum());
}
});
}
// 2.党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
agencyGovernDailyList.forEach(item -> {
int count = item.getInGroupTopicResolvedCount() + item.getInGroupTopicUnResolvedCount();
@ -267,14 +270,16 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
item.setGroupSelfGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
}
});
// 3.网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格)
// 3.网格解决占比:当前组织下,由网格结案的项目数与已结案项目之比
Map<String, OrgStatisticsResultDTO> gridSelfCount = factOriginProjectLogDailyService.getAgencyGridSelfDaily(customerId, dateId);
if (!gridSelfCount.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = gridSelfCount.get(item.getAgencyId());
if (null != dto) {
int count = dto.getCount();
int sum = item.getProblemResolvedCount();
//已结案项目数 = 来源议题的项目结案已解决数+来源议题的项目结案无需解决数+项目立项结案已解决数+项目立项结案无需解决数+来源事件的项目结案已解决数+来源事件的项目结案已解决数
int sum = item.getIssueProjectResolvedCount() + item.getIssueProjectUnResolvedCount() + item.getApprovalProjectResolvedCount()
+ item.getApprovalProjectUnResolvedCount() + item.getEventResolvedCount() + item.getEventUnResolvedCount();
if (sum != NumConstant.ZERO) {
BigDecimal resolveCount = new BigDecimal(sum);
BigDecimal selfCount = new BigDecimal(count);
@ -284,9 +289,9 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
}
});
}
// 4.社区解决占比:当前组织下,由社区结案的项目数与问题解决总数之比
// 5.区直部门解决占比:当前组织下,由区级部门结案的项目数与问题解决总数之比
// 6.街道解决占比:当前组织下,由街道结案的项目数与问题解决总数之比
// 4.社区解决占比:当前组织下,由社区结案的项目数与已结案项目之比
// 6.街道解决占比:当前组织下,由街道结案的项目数与已结案项目之比
// 6.区县解决占比:当前组织下,由区县结案的项目数与已结案项目之比
Map<String, List<OrgStatisticsResultDTO>> projectCount = factOriginProjectMainDailyService.getAgencyClosedProjectStatic(customerId, dateId);
if (!gridSelfCount.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
@ -294,7 +299,9 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
if (CollectionUtils.isNotEmpty(list)) {
Map<String, OrgStatisticsResultDTO> map = list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getLevel,
Function.identity()));
int sum = item.getProblemResolvedCount();
//已结案项目数 = 来源议题的项目结案已解决数+来源议题的项目结案无需解决数+项目立项结案已解决数+项目立项结案无需解决数+来源事件的项目结案已解决数+来源事件的项目结案已解决数
int sum = item.getIssueProjectResolvedCount() + item.getIssueProjectUnResolvedCount() + item.getApprovalProjectResolvedCount()
+ item.getApprovalProjectUnResolvedCount() + item.getEventResolvedCount() + item.getEventUnResolvedCount();
BigDecimal resolveCount = new BigDecimal(sum);
if (sum != NumConstant.ZERO) {
// 社区解决占比
@ -316,7 +323,7 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
// 区直部门解决占比
OrgStatisticsResultDTO districtDept = map.get(ScreenConstant.DISTRICT);
if (null != districtDept) {
int count = districtDept.getCount();
int count = districtDept.getSum();
BigDecimal selfCount = new BigDecimal(count);
item.setDistrictDeptClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
item.setDistrictDeptClosedCount(count);
@ -387,6 +394,8 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
entity.setIssueProjectUnResolvedCount(NumConstant.ZERO);
entity.setApprovalProjectResolvedCount(NumConstant.ZERO);
entity.setApprovalProjectUnResolvedCount(NumConstant.ZERO);
entity.setEventResolvedCount(NumConstant.ZERO);
entity.setEventUnResolvedCount(NumConstant.ZERO);
entity.setInGroupTopicResolvedCount(NumConstant.ZERO);
entity.setInGroupTopicUnResolvedCount(NumConstant.ZERO);
entity.setGridSelfGovernProjectTotal(NumConstant.ZERO);

66
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java

@ -148,20 +148,25 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
if(approvalProjectResolvedMap.containsKey(insertEntity.getGridId())){
resolveCount = resolveCount + approvalProjectResolvedMap.get(insertEntity.getGridId());
}
if(eventProjectResolvedMap.containsKey(insertEntity.getGridId())){
resolveCount = resolveCount + eventProjectResolvedMap.get(insertEntity.getGridId());
}
insertEntity.setApprovalProjectResolvedCount(resolveCount);
// 8、当前网格内:项目立项,结案无需解决数;默认为0,
int unResolveCount = 0;
if(approvalProjectUnResolvedMap.containsKey(insertEntity.getGridId())){
unResolveCount = resolveCount + approvalProjectUnResolvedMap.get(insertEntity.getGridId());
}
insertEntity.setApprovalProjectUnResolvedCount(unResolveCount);
// 当前组织内:来源于事件的项目:结案已解决数
if(eventProjectResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setEventResolvedCount(eventProjectResolvedMap.get(insertEntity.getGridId()));
}
// 当前组织内:来源于事件的项目:结案无需解决数
if(eventProjectUnResolvedMap.containsKey(insertEntity.getGridId())){
unResolveCount = resolveCount + eventProjectUnResolvedMap.get(insertEntity.getGridId());
insertEntity.setEventUnResolvedCount(eventProjectUnResolvedMap.get(insertEntity.getGridId()));
}
insertEntity.setApprovalProjectUnResolvedCount(unResolveCount);
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
// 9、当前网格内,未出小组即未转议题的:话题关闭已解决数
if(inGroupTopicResolvedMap.containsKey(insertEntity.getGridId())){
@ -183,8 +188,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
insertEntity.setFromAgencyUnResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromAgencyUnResolvedInGridCount());
// 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决
// 15、未出当前网格的,结案项目数=11+12+13+14
insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+
insertEntity.getFromAgencyResolvedInGridCount()+insertEntity.getFromAgencyUnResolvedInGridCount());
insertEntity.setGridSelfGovernProjectTotal(dtoMap.get(insertEntity.getGridId()).getGridSelfGovernProjectTotal());
//当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数
insertEntity.setCommunityClosedCount(dtoMap.get(insertEntity.getGridId()).getCommunityClosedCount());
@ -199,7 +203,13 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
+insertEntity.getIssueResolvedCount()+insertEntity.getIssueUnResolvedCount()
+insertEntity.getIssueProjectResolvedCount()+insertEntity.getIssueProjectUnResolvedCount()
+insertEntity.getApprovalProjectResolvedCount()+insertEntity.getApprovalProjectUnResolvedCount());
//结案项目数
int projectClosedTotal = insertEntity.getIssueProjectResolvedCount()
+ insertEntity.getIssueProjectUnResolvedCount()
+ insertEntity.getApprovalProjectResolvedCount()
+ insertEntity.getApprovalProjectUnResolvedCount()
+ insertEntity.getEventResolvedCount()
+ insertEntity.getEventUnResolvedCount();
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
//界面展示:2、党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数
int groupSelfGovernRatioFz=insertEntity.getInGroupTopicResolvedCount()+insertEntity.getInGroupTopicUnResolvedCount();
@ -212,37 +222,37 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
// 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格)
//界面展示:3、网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数
if(NumConstant.ZERO==insertEntity.getGridSelfGovernProjectTotal()||NumConstant.ZERO == insertEntity.getProblemResolvedCount()){
if(NumConstant.ZERO==insertEntity.getGridSelfGovernProjectTotal()||NumConstant.ZERO == projectClosedTotal){
insertEntity.setGridSelfGovernRatio(BigDecimal.ZERO);
}else{
String gridSelfGovernRatioStr = numberFormat.format((float) insertEntity.getGridSelfGovernProjectTotal() / insertEntity.getProblemResolvedCount());
String gridSelfGovernRatioStr = numberFormat.format((float) insertEntity.getGridSelfGovernProjectTotal() / projectClosedTotal);
insertEntity.setGridSelfGovernRatio(new BigDecimal(gridSelfGovernRatioStr));
}
//界面展示:4、社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
//网格内出来的项目,最终由社区结案的项目数
if (NumConstant.ZERO == insertEntity.getCommunityClosedCount()||NumConstant.ZERO == insertEntity.getProblemResolvedCount()) {
if (NumConstant.ZERO == insertEntity.getCommunityClosedCount()||NumConstant.ZERO == projectClosedTotal) {
insertEntity.setCommunityClosedRatio(BigDecimal.ZERO);
}else{
String setCommunityClosedRatioStr = numberFormat.format((float) insertEntity.getCommunityClosedCount() / insertEntity.getProblemResolvedCount());
String setCommunityClosedRatioStr = numberFormat.format((float) insertEntity.getCommunityClosedCount() / projectClosedTotal);
insertEntity.setCommunityClosedRatio(new BigDecimal(setCommunityClosedRatioStr));
}
// 界面展示:5、街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
//网格内出来的项目,最终由街道结案的项目数
if (NumConstant.ZERO == insertEntity.getStreetClosedCount() || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) {
if (NumConstant.ZERO == insertEntity.getStreetClosedCount() || NumConstant.ZERO == projectClosedTotal) {
insertEntity.setStreetClosedRatio(BigDecimal.ZERO);
} else {
String streetClosedRatioStr = numberFormat.format((float) insertEntity.getStreetClosedCount() / insertEntity.getProblemResolvedCount());
String streetClosedRatioStr = numberFormat.format((float) insertEntity.getStreetClosedCount() / projectClosedTotal);
insertEntity.setStreetClosedRatio(new BigDecimal(streetClosedRatioStr));
}
//界面展示:6、区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数
//网格内出来的项目,最终由区直部门结案的项目数
if (NumConstant.ZERO == insertEntity.getDistrictDeptClosedCount() || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) {
if (NumConstant.ZERO == insertEntity.getDistrictDeptClosedCount() || NumConstant.ZERO == projectClosedTotal) {
insertEntity.setDistrictDeptClosedRatio(BigDecimal.ZERO);
} else {
String setDistrictDeptClosedRatioStr = numberFormat.format((float) insertEntity.getDistrictDeptClosedCount() / insertEntity.getProblemResolvedCount());
String setDistrictDeptClosedRatioStr = numberFormat.format((float) insertEntity.getDistrictDeptClosedCount() / projectClosedTotal);
insertEntity.setDistrictDeptClosedRatio(new BigDecimal(setDistrictDeptClosedRatioStr));
}
@ -310,7 +320,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
int streetClosedCount=NumConstant.ZERO;;
// 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
int districtDeptClosedCount=NumConstant.ZERO;
int gridSelfGovernProjectTotal=NumConstant.ZERO;
//当前网格内已结案的项目
List<GovernProjectInfoDTO> currentGridClosedProjectList = factOriginProjectMainDailyService.getGridClosedProjectList(customerId, gridId,
ProjectConstant.CLOSED,null,null);
@ -339,6 +349,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
fromAgencyUnResolvedInGridCount += 1;
}
}
gridSelfGovernProjectTotal += 1;
} else {
// 3、出了网格的判断是由谁解决的?
String resolveOrgType=getProjectResolveOrgType(governProjectInfoDTO.getProjectLogDTOList());
@ -350,10 +361,12 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
// 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
log.info("projectId=【"+governProjectInfoDTO.getId()+"】属于街道解决");
streetClosedCount+=1;
}else if("districtdept".equals(resolveOrgType)){
// 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数
}else if("district".equals(resolveOrgType)){
// 当前网格内出来的项目:由区县结案(已解决+未解决)的项目总数
log.info("projectId=【"+governProjectInfoDTO.getId()+"】属于区直部门解决");
districtDeptClosedCount+=1;
} else if ("grid".equals(resolveOrgType)) {
gridSelfGovernProjectTotal += 1;
}
// todo 可能是 市级解决、省级解决呢???
}
@ -366,6 +379,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
governGridClosedTotalCommonDTO.setCommunityClosedCount(communityClosedCount);
governGridClosedTotalCommonDTO.setStreetClosedCount(streetClosedCount);
governGridClosedTotalCommonDTO.setDistrictDeptClosedCount(districtDeptClosedCount);
governGridClosedTotalCommonDTO.setGridSelfGovernProjectTotal(gridSelfGovernProjectTotal);
resultMap.put(gridId, governGridClosedTotalCommonDTO);
}
return resultMap;
@ -380,7 +394,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
private String getProjectResolveOrgType(List<FactOriginProjectLogDailyDTO> projectLogDTOList) {
List<Integer> handleLevelList=new ArrayList<>();
for (FactOriginProjectLogDailyDTO logDailyDTO : projectLogDTOList) {
if(logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)||NumConstant.ZERO==logDailyDTO.getIsActive()){
if(!logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_CLOSE)||NumConstant.ZERO==logDailyDTO.getIsActive()){
//当前操作如果是退回,不参与比较
continue;
}
@ -395,32 +409,42 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
// orgType: 网格grid,部门department,组织:agency
if ("grid".equals(logDailyDTO.getOrgType())) {
handleLevelList.add(NumConstant.ONE);
return "grid";
} else if ("agency".equals(logDailyDTO.getOrgType())) {
CustomerAgencyEntity agencyEntity=customerAgencyService.getAgencyById(logDailyDTO.getOrgId());
if("community".equals(agencyEntity.getLevel())){
handleLevelList.add(NumConstant.TWO);
return "community";
}else if("street".equals(agencyEntity.getLevel())){
handleLevelList.add(NumConstant.THREE);
return "street";
}else if("district".equals(agencyEntity.getLevel())){
handleLevelList.add(NumConstant.FOUR);
return "district";
}else if("city".equals(agencyEntity.getLevel())){
handleLevelList.add(NumConstant.FIVE);
return "city";
}else if("province".equals(agencyEntity.getLevel())){
handleLevelList.add(NumConstant.SIX);
return "province";
}
} else if ("department".equals(logDailyDTO.getOrgType())) {
CustomerAgencyEntity deptAgencyEntity=customerAgencyService.getAgencyByDeptId(logDailyDTO.getOrgId());
if("district".equals(deptAgencyEntity.getLevel())){
// 区直部门直接返回
return "districtdept";
return "district";
}else if("community".equals(deptAgencyEntity.getLevel())){
handleLevelList.add(NumConstant.TWO);
return "community";
}else if("street".equals(deptAgencyEntity.getLevel())){
handleLevelList.add(NumConstant.THREE);
return "street";
}else if("city".equals(deptAgencyEntity.getLevel())){
handleLevelList.add(NumConstant.FIVE);
return "city";
}else if("province".equals(deptAgencyEntity.getLevel())){
handleLevelList.add(NumConstant.SIX);
return "province";
}
}
}

69
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -843,54 +843,35 @@
AND m.PROJECT_ID = #{projectId}
</select>
<select id="selectAgencyGridSelfDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
da.ID AS AGENCY_ID,
COUNT( fm.ID ) AS "sum",
IFNULL( a.count, 0 ) AS "count"
a.ID AS AGENCY_ID,
a.`LEVEL`,
COUNT( b.PROJECT_ID ) AS "count"
FROM
dim_agency da
INNER JOIN fact_origin_project_main_daily fm ON fm.PIDS LIKE CONCAT( '%', da.ID, '%' )
LEFT JOIN (
SELECT
agency.ID,
orgId,
COUNT( PROJECT_ID ) AS "count"
FROM
dim_agency agency
INNER JOIN (
SELECT
AGENCY_ID,
PIDS,
ORG_ID AS orgId,
PROJECT_ID
FROM
fact_origin_project_log_daily
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND ( ACTION_CODE = 'response' OR ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'created' )
AND PROJECT_ID IN ( SELECT ID FROM fact_origin_project_main_daily WHERE DEL_FLAG = 0 AND PROJECT_STATUS = 'closed' AND ORIGIN = 'issue'
AND CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId})
GROUP BY
PROJECT_ID
HAVING
COUNT(
DISTINCT ( ORG_ID )) = 1
) a ON a.PIDS LIKE CONCAT( '%', agency.ID, '%' )
WHERE
agency.CUSTOMER_ID = #{customerId}
GROUP BY
agency.ID
) a ON a.ID = da.ID
dim_agency a
INNER JOIN (
SELECT
PROJECT_ID,
main.PIDS,
ORG_TYPE
FROM
fact_origin_project_main_daily main
INNER JOIN fact_origin_project_log_daily log ON main.ID = log.PROJECT_ID
AND ACTION_CODE = 'close'
AND ORG_TYPE = 'grid'
AND log.DEL_FLAG = '0'
AND log.CUSTOMER_ID = #{customerId}
WHERE
main.CUSTOMER_ID = #{customerId}
AND main.DATE_ID &lt;= #{dateId}
) b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' )
WHERE
PROJECT_STATUS = 'closed'
AND ORIGIN = "issue"
AND da.CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
a.CUSTOMER_ID = #{customerId}
GROUP BY
da.ID
a.ID,
a.`LEVEL`
</select>
<select id="getProjectResponseCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT

22
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -1071,20 +1071,26 @@
a.ID AS AGENCY_ID,
a.`LEVEL`,
COUNT( b.PROJECT_ID ) AS "sum",
SUM(IF( b.ORG_TYPE = 'department', 1, 0 )) AS "count"
SUM(IF( b.ORG_TYPE = 'department', 1, 0 )) AS "count"
FROM
dim_agency a
INNER JOIN (
SELECT
PROJECT_ID,
PIDS,
ORG_TYPE
PROJECT_ID,
main.PIDS,
ORG_TYPE
FROM
fact_origin_project_log_daily
WHERE
CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
fact_origin_project_main_daily main
INNER JOIN fact_origin_project_log_daily log ON main.ID = log.PROJECT_ID
AND ACTION_CODE = 'close'
AND (ORG_TYPE = 'agency' OR ORG_TYPE = 'department')
AND log.DEL_FLAG = '0'
AND log.CUSTOMER_ID = #{customerId}
WHERE
main.CUSTOMER_ID = #{customerId}
AND main.DATE_ID &lt;= #{dateId}
) b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' )
WHERE
a.CUSTOMER_ID = #{customerId}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
@ -47,7 +46,6 @@ import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService;
import com.epmet.util.ModuleConstant;
@ -596,8 +594,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
@Override
public Result<List<AllGridsByUserIdResultDTO>> getGridListByGridIds(List<String> gridIdList) {
Result<List<AllGridsByUserIdResultDTO>> result = new Result<List<AllGridsByUserIdResultDTO>>();
if (gridIdList.size() < NumConstant.ONE) {
logger.error("根据网格Id集合获取网格列表信息-传入的网格Id集合为空数组!");
if (CollectionUtils.isEmpty(gridIdList)) {
logger.warn("根据网格Id集合获取网格列表信息-传入的网格Id集合为空数组!");
return result;
}
List<AllGridsByUserIdResultDTO> list = baseDao.selectGridByIds(gridIdList);

6
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java

@ -3,6 +3,7 @@ package com.epmet.opendata.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
@ -68,7 +69,10 @@ public class OpenDataOrgChangeEventListener implements MessageListenerConcurrent
logger.info("【开放数据事件监听器】-组织信息变更-收到消息内容:{},操作:{}", msg, tags);
OrgOrStaffMQMsg obj = JSON.parseObject(msg, OrgOrStaffMQMsg.class);
//只推送平阴数据
if (!StrConstant.PY_CUSTOMER.equals(obj.getCustomerId())) {
return;
}
RLock lock = null;
try {
lock = distributedLock.getLock(String.format("lock:open_data_org:%s", obj.getOrgId()),

5
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java

@ -3,6 +3,7 @@ package com.epmet.opendata.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.StaffPatrolMQMsg;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
@ -69,6 +70,10 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr
logger.info("【开放数据事件监听器】-巡查记录信息变更-收到消息内容:{}, 操作:{}", msg, tags);
StaffPatrolMQMsg msgObj = JSON.parseObject(msg, StaffPatrolMQMsg.class);
//只推送平阴数据
if (!StrConstant.PY_CUSTOMER.equals(msgObj.getCustomerId())) {
return;
}
if (msgObj == null) {
log.warn("consumeMessage msg body is blank");
return;

5
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java

@ -3,6 +3,7 @@ package com.epmet.opendata.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.DisputeProcessMQMsg;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
@ -72,6 +73,10 @@ public class OpenDataProjectChangeEventListener implements MessageListenerConcur
logger.info("【开放数据事件监听器】-项目信息变更-收到消息内容:{}, 操作:{}, pendingMsgLabel:{}", msg, tags, pendingMsgLabel);
DisputeProcessMQMsg obj = JSON.parseObject(msg, DisputeProcessMQMsg.class);
//只推送平阴数据
if (!StrConstant.PY_CUSTOMER.equals(obj.getCustomerId())) {
return;
}
EventInfoFormDTO formDTO = ConvertUtils.sourceToTarget(obj, EventInfoFormDTO.class);
RLock lock = null;

5
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java

@ -3,6 +3,7 @@ package com.epmet.opendata.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
@ -72,6 +73,10 @@ public class OpenDataStaffChangeEventListener implements MessageListenerConcurre
logger.info("【开放数据事件监听器】-工作人员信息变更-收到消息内容:{}, 操作:{}, blockedMsgLabel:{}", msg, tags, pendingMsgLabel);
OrgOrStaffMQMsg obj = JSON.parseObject(msg, OrgOrStaffMQMsg.class);
//只推送平阴数据
if (!StrConstant.PY_CUSTOMER.equals(obj.getCustomerId())) {
return;
}
RLock lock = null;
try {

Loading…
Cancel
Save