Browse Source

Merge branch 'dev' into dev_ic_data

# Conflicts:
#	epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
master
wangxianzhang 4 years ago
parent
commit
ca068bdff3
  1. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java
  2. 19
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  3. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  4. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml
  5. 7
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java
  6. 39
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java
  7. 15
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java
  8. 5
      epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
  9. 12
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml
  10. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java
  11. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java
  12. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java
  13. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java
  14. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java
  15. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java
  16. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java
  17. 81
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java
  18. 66
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
  19. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridAndOrgDailyServiceImpl.java
  20. 69
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  21. 26
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  22. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
  23. 11
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  24. 4
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java
  25. 4
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java
  26. 4
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java
  27. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  28. 6
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java
  29. 5
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java
  30. 5
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java
  31. 5
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java
  32. 82
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java
  33. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java
  34. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  35. 31
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  36. 17
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  37. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xls

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;
}

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

@ -1188,13 +1188,20 @@ public class DataStatsServiceImpl implements DataStatsService {
Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getStreetClosedCount).sum();
//由区直部门结案的项目总数
Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getDistrictDeptClosedCount).sum();
resultDTO.setProblemResolvedCount(problemResolvedCount);
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(closedProjectTotal);
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;
}

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -604,6 +604,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
log.error("getStaffInfo have any agency staffId:{}",staffId);
return null;
}
result.setStaffId(staffEntity.getUserId());
result.setAgencyId(agencyDTO.getId());
result.setAgencyName(agencyDTO.getOrganizationName());
result.setAgencyPIds(agencyDTO.getPids());

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

@ -624,7 +624,9 @@
SELECT
agency_id AS agencyId,
`level` AS level,
problem_resolved_count AS problemResolvedCount,
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 AS problemResolvedCount,
concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio,
concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio,
concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio,
@ -638,13 +640,15 @@
<foreach item="agencyId" collection="agencyIds" open="AND (" separator="or" close=")" index="">
agency_id = #{agencyId}
</foreach>
ORDER BY problem_resolved_count DESC
ORDER BY problemResolvedCount DESC
</select>
<select id="getGridGovern" resultType="com.epmet.dataaggre.dto.datastats.result.GridGovrnResultDTO">
SELECT
grid_id AS gridId,
problem_resolved_count AS problemResolvedCount,
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 AS problemResolvedCount,
concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio,
concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio,
concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio,
@ -675,7 +679,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

7
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.project.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
@ -61,4 +62,10 @@ public class ProjectDifficultRankResultDTO implements Serializable {
* */
private Integer handledCount;
/**
* 项目评价分数
* 直接取整数位展示
*/
private BigDecimal score;
}

39
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java

@ -243,34 +243,41 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
@Override
public List<GovernCapacityRankResultDTO> governCapacityRank(AgencyAndNumFormDTO param) {
List<GovernCapacityResultDTO> orderList = new ArrayList<>();
if(null == param.getTopNum()) param.setTopNum(NumConstant.FIVE);
if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX);
if(null == param.getTopNum()) {
param.setTopNum(NumConstant.FIVE);
}
if(NumConstant.ZERO == param.getTopNum()) {
param.setTopNum(NumConstant.MAX);
}
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
String monthId = dateUtils.getCurrentMonthId();
String dateId = com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(NumConstant.ONE);
if (StringUtils.isNotEmpty(param.getAreaCode())){
List<String> nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId());
if (CollectionUtils.isEmpty(nextAgencyIds)){
return new ArrayList<>();
}
orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds);
int time = NumConstant.TWELVE;
while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null ,monthId);
orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(dateId,nextAgencyIds);
int time = NumConstant.ONE;
while(CollectionUtils.isEmpty(orderList) && time < NumConstant.TEN){
time++;
dateId = com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(time);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds);
orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(dateId,nextAgencyIds);
}
}else {
orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId());
int time = NumConstant.TWELVE;
while (CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE) {
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null, monthId);
orderList = screenGovernRankDataDao.selectGovernCapacityRatio(dateId, param.getAgencyId());
int time = NumConstant.ONE;
while (CollectionUtils.isEmpty(orderList) && time < NumConstant.TEN) {
time++;
dateId = com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(time);
PageHelper.startPage(NumConstant.ONE, param.getTopNum());
orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId());
orderList = screenGovernRankDataDao.selectGovernCapacityRatio(dateId, param.getAgencyId());
}
}
if(null == orderList || orderList.isEmpty()) return new ArrayList<>();
if(null == orderList || orderList.isEmpty()) {
return new ArrayList<>();
}
List<GovernCapacityRankResultDTO> result = new LinkedList<>();
orderList.forEach(o -> {
GovernCapacityRankResultDTO rank = new GovernCapacityRankResultDTO();

15
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java

@ -200,13 +200,14 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
logger.info("机关名:"+m.getName()+",总数="+m.getTotal());
}
//2021.5.25 平音客户热心居民改网格员 sun start
if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) {
//2021.121.17 应胡科家要求在改回去
/*if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) {
dimList.forEach(d->{
if("热心居民".equals(d.getType())){
d.setType("网格员");
}
});
}
}*/
//2021.5.25 平音客户热心居民改网格员 sun end
return dimList;
}
@ -333,13 +334,14 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
logger.info("网格名:"+m.getName()+",总数="+m.getTotal());
}
//2021.5.25 平音客户热心居民改网格员 sun start
if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) {
//2021.121.17 应胡科家要求在改回去
/*if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) {
dimList.forEach(d->{
if("热心居民".equals(d.getType())){
d.setType("网格员");
}
});
}
}*/
//2021.5.25 平音客户热心居民改网格员 sun end
return dimList;
}
@ -507,13 +509,14 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
resultList.add(party);
}
//2021.5.25 平音客户热心居民改网格员 sun start
if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) {
//2021.121.17 应胡科家要求在改回去
/*if (StrConstant.PY_CUSTOMER.equals(tokenDto.getCustomerId())) {
resultList.forEach(d->{
if("热心居民".equals(d.getType())){
d.setType("网格员");
}
});
}
}*/
//2021.5.25 平音客户热心居民改网格员 sun end
return resultList;
}

5
epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml

@ -278,7 +278,9 @@
diff.EVENT_IMG_URL AS imgUrl,
floor(diff.EVENT_COST_TIME/60) AS totalHours,
diff.EVENT_RE_ORG AS reOrg,
diff.EVENT_HANDLED_COUNT AS handledCount
diff.EVENT_HANDLED_COUNT AS handledCount,
CASE WHEN diff.org_type = 'grid' AND diff.EVENT_STATUS_CODE = 'closed' THEN IFNULL(spd.SATISFACTION_SCORE,80)
ELSE spd.SATISFACTION_SCORE END AS score
FROM
(
select scg.AREA_CODE,sdd1.* from screen_difficulty_data sdd1
@ -333,6 +335,7 @@
AND sdd2.EVENT_STATUS_CODE in('closed','10','5')
</if>
) diff
LEFT JOIN screen_project_data spd ON (spd.PROJECT_ID = diff.EVENT_ID AND spd.DEL_FLAG = '0' AND spd.CLOSE_CASE_TIME IS NOT NULL and spd.SATISFACTION_SCORE is not null)
ORDER BY
CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME
WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT

12
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml

@ -14,14 +14,14 @@
rankData.SATISFACTION_RATIO,
agency.AGENCY_NAME AS parentAgencyName
FROM
screen_govern_rank_data rankData
screen_govern_rank_data_daily rankData
LEFT JOIN
screen_customer_agency agency
ON rankData.PARENT_ID = agency.AGENCY_ID AND agency.DEL_FLAG = '0' AND agency.AGENCY_ID = #{agencyId}
WHERE
rankData.DEL_FLAG = '0'
AND rankData.PARENT_ID = #{agencyId}
AND rankData.MONTH_ID = #{monthId}
AND rankData.DATE_ID = #{monthId}
ORDER BY
rankData.RESPONSE_RATIO DESC
</select>
@ -41,7 +41,7 @@
left join screen_customer_agency pa
on(agency.PARENT_AREA_CODE=pa.AREA_CODE
and pa.DEL_FLAG='0')
left join screen_govern_rank_data rankData
left join screen_govern_rank_data_daily rankData
ON (agency.AGENCY_ID =rankData.org_id
AND rankData.DEL_FLAG = '0'
and rankData.org_type='agency')
@ -51,7 +51,7 @@
<foreach collection="orgIds" item="orgId" open="(" close=")" separator=",">
#{orgId}
</foreach>
AND rankData.MONTH_ID =#{monthId}
AND rankData.DATE_ID =#{monthId}
)
union
(
@ -67,7 +67,7 @@
FROM screen_customer_grid grid
left join screen_customer_agency ca
on (ca.agency_id = grid.parent_agency_id)
left join screen_govern_rank_data rankData
left join screen_govern_rank_data_daily rankData
ON (grid.grid_id=rankData.org_id
AND grid.DEL_FLAG = 0
and rankData.org_type='grid')
@ -76,7 +76,7 @@
<foreach collection="orgIds" item="orgId" open="(" close=")" separator=",">
#{orgId}
</foreach>
AND rankData.MONTH_ID =#{monthId}
AND rankData.DATE_ID =#{monthId}
)
ORDER BY
RESPONSE_RATIO DESC

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;
}
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java

@ -88,7 +88,7 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
threadPool.submit(() -> {
try {
long startCpc = System.currentTimeMillis();
//calCpcIndexService.calCpcPartyAbility(customerId, monthId);
calCpcIndexService.calCpcPartyAbility(customerId, monthId);
log.error("党员相关-党建能力执行完毕======总耗时:{}ms,customerId:{}",System.currentTimeMillis()-startCpc, param.getCustomerId());
} catch (Exception e) {
log.error("抽取【党员相关数据】发生异常,参数:" + JSON.toJSONString(param), e);

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";
}
}
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridAndOrgDailyServiceImpl.java

@ -142,8 +142,6 @@ public class ScreenProjectCategoryGridAndOrgDailyServiceImpl implements ScreenPr
log.info("开始执行组织项目分类统计");
long start = System.currentTimeMillis();
List<CustomerRelationEntity> relationInfo = relationService.selectSubCustomer(customerId);
List<String> customerIds = new ArrayList<>();
customerIds.add(customerId);
List<GridAndOrgCategoryCountResultDTO> result = new ArrayList<>();
if (CollectionUtils.isEmpty(relationInfo)){
// one customer
@ -169,12 +167,13 @@ public class ScreenProjectCategoryGridAndOrgDailyServiceImpl implements ScreenPr
List<String> subCustomerIds = relationInfo.stream().map(CustomerRelationEntity::getCustomerId).collect(Collectors.toList());
for (int i = NumConstant.ZERO; i < subCustomerIds.size(); i++) {
if (subCustomerIds.get(i).equals(PingYinConstant.KONG_CUN_CUSTOMER_ID)){
customerIds.remove(i);
subCustomerIds.remove(i);
continue;
}
}
subCustomerIds.add(customerId);
List<GridAndOrgCategoryCountResultDTO> allAgencies = screenCustomerAgencyDao.selectParentSonAgency(subCustomerIds, PingYinConstant.KONG_CUN_CUSTOMER_ID);
log.info("父子客户所有的组织{}",JSON.toJSONString(allAgencies));
List<List<GridAndOrgCategoryCountResultDTO>> partition = ListUtils.partition(allAgencies, NumConstant.FIFTY);
List<GridAndOrgCategoryCountResultDTO> allOrgCategoryList = result;
partition.forEach(p -> {

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

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

@ -1069,28 +1069,34 @@
<select id="selectAgencyClosedProjectStaticDaily" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.ID AS AGENCY_ID,
a.`LEVEL`,
b.`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,
da.`LEVEL`
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}
INNER JOIN dim_agency da ON log.AGENCY_ID = da.ID AND da.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}
GROUP BY
a.ID,
a.`LEVEL`
b.`LEVEL`
</select>

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

@ -200,7 +200,7 @@
+ s.PERFECT_COUNT * 100
)/s.SHOULD_EVALUATE_COUNT
,
0
80
) AS score
FROM
project_satisfaction_statistics s

11
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

@ -219,7 +219,9 @@ public class OssController {
if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType())
&& !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType())
&& !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType())
&& !ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) {
&& !ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())
&& !file.getContentType().startsWith(ModuleConstant.FILE_CONTENT_TYPE_VEDIO_PREFIX)
) {
log.error("uploadArticleImg file type:{} is not support 2 upload", file.getContentType());
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg());
@ -232,6 +234,13 @@ public class OssController {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg());
}
} else if (file.getContentType().startsWith(ModuleConstant.FILE_CONTENT_TYPE_VEDIO_PREFIX)) {
// 校验文件大小,不超过5m
long maxSize = 25 * 1024 * 1024;
if (size > maxSize) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg());
}
} else {
// 校验文件大小,不超过2m
long maxSize = 2 * 1024 * 1024;

4
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java

@ -30,6 +30,10 @@ public interface ModuleConstant extends Constant {
* pdf文件类型
*/
String FILE_CONTENT_TYPE_PDF = "application/pdf";
/**
* vedio文件类型前缀 不具体什么视频格式了
*/
String FILE_CONTENT_TYPE_VEDIO_PREFIX = "video/";
/**
* 项目附件-允许上传的文件类型

4
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java

@ -131,12 +131,12 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl<IssueVoteDetailD
public void vote(VoteFormDTO formDTO) {
IssueVoteDetailEntity entity = new IssueVoteDetailEntity();
BeanUtils.copyProperties(formDTO,entity);
VoteRedisFormDTO redisData = issueVoteDetailRedis.get(formDTO.getIssueId());
VoteRedisFormDTO redisData = issueVoteDetailRedis.getVoteStatistical(formDTO.getIssueId());
if (redisData==null){
VoteRedisFormDTO voteRedisFormDTO = new VoteRedisFormDTO();
voteRedisFormDTO.setIssueId(formDTO.getIssueId());
issueVoteDetailRedis.set(voteRedisFormDTO);
redisData = issueVoteDetailRedis.get(formDTO.getIssueId());
redisData = voteRedisFormDTO;
}
redisData.setIssueId(formDTO.getIssueId());
if (formDTO.getAttitude().equals(IssueConstant.SUPPORT)){

4
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java

@ -163,7 +163,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
voteResultDTO.setVoteFlag(false);
} else {
voteResultDTO.setVoteFlag(true);
VoteRedisFormDTO redisData = issueVoteDetailRedis.get(issueId.getIssueId());
VoteRedisFormDTO redisData = issueVoteDetailRedis.getVoteStatistical(issueId.getIssueId());
voteResultDTO.setVoteType(voteStatus);
voteResultDTO.setSupportCount(redisData.getSupportAmount());
voteResultDTO.setOppositionCount(redisData.getOppositionAmount());
@ -181,7 +181,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl<IssueVoteSt
@Override
public VotingTrendResultDTO votingTrend(IssueIdFormDTO issueId) {
//缓存获取议题表决详情
VoteRedisFormDTO voteRedisFormDTO = issueVoteDetailRedis.get(issueId.getIssueId());
VoteRedisFormDTO voteRedisFormDTO = issueVoteDetailRedis.getVoteStatistical(issueId.getIssueId());
VotingTrendResultDTO votingTrendResultDTO = new VotingTrendResultDTO();
BeanUtils.copyProperties(voteRedisFormDTO, votingTrendResultDTO);
votingTrendResultDTO.setRealityVoteCount(voteRedisFormDTO.getSupportAmount() + voteRedisFormDTO.getOppositionAmount());

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

@ -594,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 {

82
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java

@ -31,6 +31,7 @@ import com.epmet.opendata.service.BaseConflictsResolveService;
import com.epmet.opendata.service.BaseDisputeProcessService;
import com.epmet.opendata.service.ExDeptService;
import com.epmet.opendata.service.ExUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -47,6 +48,7 @@ import java.util.stream.Collectors;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
@Slf4j
@Service
public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputeProcessDao, BaseDisputeProcessEntity> implements BaseDisputeProcessService {
@Resource
@ -90,44 +92,50 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputePr
}
private void saveEvent(EventInfoFormDTO formDTO, Map<String, Integer> deptMap, Map<String, Integer> userMap, List<EventInfoResultDTO> list) {
if (CollectionUtils.isNotEmpty(list)) {
if (CollectionUtils.isEmpty(list)) {
log.warn("no event data to save table base_conflicts_resolve");
return;
}
List<BaseConflictsResolveEntity> resolveList = list.stream().map(item -> {
BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity();
entity.setId(item.getId().concat("_PY"));
entity.setCustomerId(item.getCustomerId());
entity.setGridId(deptMap.get(item.getOrgId()));
entity.setGridName(item.getOrgName());
entity.setEventName(item.getEventName());
entity.setHappenDate(item.getHappenDate());
entity.setHappenPlace(item.getHappenPlace());
String eventDescription = item.getEventDescription();
//如果不为空 长度控制1000以内
if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > NumConstant.ONE_THOUSAND){
eventDescription = eventDescription.substring(NumConstant.ZERO,NumConstant.ONE_THOUSAND);
}
entity.setEventDescription(eventDescription);
entity.setLng(null == item.getLng()?null:item.getLng().toPlainString());
entity.setLat(null == item.getLat()?null:item.getLat().toPlainString());
entity.setCreateBy(null == userMap.get(item.getReporterId())?null:String.valueOf(userMap.get(item.getReporterId())));
entity.setCreateDate(item.getReportTime());
entity.setUpdateDate(new Date());
entity.setStatus(item.getStatus());
//业务不确定
if (("03").equals(item.getStatus())) {
entity.setSuccessfulOrNot("Y");
}
entity.setEventNo(("py_").concat(item.getId()));
entity.setFirstEventCategory(item.getParentEventCategory());
entity.setSource("01");
entity.setSecondEventCategory(item.getEventCategory());
entity.setResolveWay(item.getWaysOfResolving());
entity.setResolveGridLevel(item.getCompleteLevel());
entity.setResolveTime(item.getCompleteTime());
return entity;
}).collect(Collectors.toList());
List<BaseConflictsResolveEntity> resolveList = list.stream().map(item -> {
BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity();
entity.setId(item.getId().concat("_PY"));
entity.setCustomerId(item.getCustomerId());
entity.setGridId(deptMap.get(item.getOrgId()));
entity.setGridName(item.getOrgName());
entity.setEventName(item.getEventName());
entity.setHappenDate(item.getHappenDate());
entity.setHappenPlace(item.getHappenPlace());
String eventDescription = item.getEventDescription();
//如果不为空 长度控制1000以内
if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > NumConstant.ONE_THOUSAND) {
eventDescription = eventDescription.substring(NumConstant.ZERO, NumConstant.ONE_THOUSAND);
}
entity.setEventDescription(eventDescription);
entity.setLng(null == item.getLng() ? null : item.getLng().toPlainString());
entity.setLat(null == item.getLat() ? null : item.getLat().toPlainString());
entity.setCreateBy(null == userMap.get(item.getReporterId()) ? null : String.valueOf(userMap.get(item.getReporterId())));
entity.setCreateDate(item.getReportTime());
entity.setUpdateDate(new Date());
entity.setStatus(item.getStatus());
//业务不确定
if (("03").equals(item.getStatus())) {
entity.setSuccessfulOrNot("Y");
}
//业务不包含 一级分类里 如果是03 矛盾纠纷 则涉及人数写2(目前业务不支持 所以应产品需求 填2)
if ("03".equals(item.getParentEventCategory())) {
entity.setNumberInvolved(NumConstant.TWO);
}
entity.setEventNo(("py_").concat(item.getId()));
entity.setFirstEventCategory(item.getParentEventCategory());
entity.setSource("01");
entity.setSecondEventCategory(item.getEventCategory());
entity.setResolveWay(item.getWaysOfResolving());
entity.setResolveGridLevel(item.getCompleteLevel());
entity.setResolveTime(item.getCompleteTime());
return entity;
}).collect(Collectors.toList());
baseConflictsResolveService.saveOrUpdateBatch(resolveList, formDTO.getPageSize());
}
baseConflictsResolveService.saveOrUpdateBatch(resolveList, formDTO.getPageSize());
}
}

6
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java

@ -2,6 +2,8 @@ package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
@ -14,5 +16,9 @@ public class UserIdsFormDTO implements Serializable {
private static final long serialVersionUID = -6168528618954442905L;
@NotBlank(message = "客户ID不能为空")
private String customerId;
@NotEmpty(message = "工作人员Id 不能为空")
private List<String> userIds;
}

6
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -21,7 +21,6 @@ import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -40,12 +39,10 @@ import com.epmet.excel.CustomerStaffExcel;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerStaffService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Map;
@ -367,7 +364,8 @@ public class CustomerStaffController {
* @date 2020/8/13 1:45 下午
*/
@PostMapping("getstaffinfolist")
public Result<List<StaffSinGridResultDTO>> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO){
public Result<List<StaffSinGridResultDTO>> getStaffInfoList(@RequestHeader("customerId") String customerId,@RequestBody UserIdsFormDTO formDTO){
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return new Result<List<StaffSinGridResultDTO>>().ok(customerStaffService.getStaffInfoList(formDTO));
}

31
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.entity.DataScope;
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.ServiceConstant;
@ -54,7 +53,6 @@ import com.epmet.feign.AuthFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerStaffService;
import com.epmet.service.GovStaffRoleService;
import com.epmet.service.StaffRoleService;
@ -64,7 +62,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -603,7 +600,31 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
public List<StaffSinGridResultDTO> getStaffInfoList(UserIdsFormDTO formDTO) {
List<String> userIds = formDTO.getUserIds();
// 1. 根据userId查询人员基本信息
List<StaffSinGridResultDTO> staffInfoList = customerStaffDao.getStaffInfoList(userIds);
List<StaffSinGridResultDTO> staffInfoList = new ArrayList<>();
userIds.forEach(staffId->{
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), staffId);
if (staffInfo ==null){
log.error("getStaffInfoList fail customerId:{}, staffId:{} not exist in db",formDTO.getCustomerId(), staffId);
return;
}
StaffSinGridResultDTO resultDTO = new StaffSinGridResultDTO();
resultDTO.setStaffId(staffId);
resultDTO.setStaffName(staffInfo.getRealName());
resultDTO.setHeadPhoto(staffInfo.getHeadPhoto());
resultDTO.setGender(staffInfo.getGender());
List<RoleResultDTO> roleInfoList = new ArrayList<>();
staffInfo.getRoleMap().forEach((key,value) ->{
RoleResultDTO dto = new RoleResultDTO();
dto.setRoleKey(key);
dto.setRoleName(value);
roleInfoList.add(dto);
});
resultDTO.setRoleList(roleInfoList);
staffInfoList.add(resultDTO);
});
/*List<StaffSinGridResultDTO> staffInfoList = customerStaffDao.getStaffInfoList(userIds);
if (staffInfoList.size() == NumConstant.ZERO){
return staffInfoList;
}
@ -619,7 +640,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
}
});
staffInfo.setRoleList(roleResult);
});
});*/
return staffInfoList;
}

17
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -918,9 +918,22 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
* @throws IOException
*/
public void downLoadResults(HttpServletResponse response) throws IOException {
//public static final ThreadLocal<Map<String, List<ErrorRow>>> errorRows = new ThreadLocal<>();
String fileName;
// 判断是否有错误信息,以确定文件名
boolean hasError = false;
Map<String, List<ErrorRow>> tableAndErrorRows = errorRows.get();
for (Map.Entry<String, List<ErrorRow>> entry:tableAndErrorRows.entrySet()) {
if (entry.getValue().size() != 0) {
hasError = true;
}
}
String fileName = "导入失败条目清单.xls";
if (hasError) {
fileName = "导入失败条目清单.xls";
} else {
fileName = "导入成功.xls";
}
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8"));

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xls

Binary file not shown.
Loading…
Cancel
Save