diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java index d709731f77..77bcd7cc34 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java +++ b/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; + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 31cf2174d6..ac426b81d7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/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; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 181e037830..6358be4f68 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/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()); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index ce3f133191..681c057922 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/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 @@ agency_id = #{agencyId} - ORDER BY problem_resolved_count DESC + ORDER BY problemResolvedCount DESC @@ -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 @@ #{orgId} - 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 @@ #{orgId} - AND rankData.MONTH_ID =#{monthId} + AND rankData.DATE_ID =#{monthId} ) ORDER BY RESPONSE_RATIO DESC diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java index 3f9c614f8a..a550775779 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java +++ b/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; + /** * 未出当前网格的,结案项目数 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java index 778ffcb9a4..b8d585f00f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java +++ b/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 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java index 1b6697f1ec..6e8c7b153e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java +++ b/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"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java index 2f37f9a113..95f48fdeee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java +++ b/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; /** * 未出当前网格的,结案项目数 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java index 22fa2b2b67..827a6fdf75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java +++ b/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; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java index fcc4193885..d38e74cabb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java +++ b/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; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index 52b1cdfc11..6bc96d1006 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/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); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index f766873cea..52b6310caf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/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 projectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, dateId, ProjectConstant.RESOLVED, OrgTypeConstant.AGENCY); - Map 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 { - OrgStatisticsResultDTO dto = eventProjectResolvedTotal.get(item.getAgencyId()); - int sum = item.getApprovalProjectResolvedCount(); - if (null != dto) { - sum = sum + dto.getSum(); - } - item.setApprovalProjectResolvedCount(sum); - }); - } - // 当前组织内:来源于议题的项目:结案无需解决数 + + // 当前组织内:项目立项:结案无需解决数 Map projectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, dateId, ProjectConstant.UNRESOLVED, OrgTypeConstant.AGENCY); - Map 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 { - OrgStatisticsResultDTO dto = eventProjectUnResolvedTotal.get(item.getAgencyId()); - int sum = item.getApprovalProjectUnResolvedCount(); - if (null != dto) { - sum = sum + dto.getSum(); - } - item.setApprovalProjectUnResolvedCount(sum); - }); - } + + } + + //2021.12.15 当前组织内:来源于事件的项目:结案已解决数 + Map 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 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 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> projectCount = factOriginProjectMainDailyService.getAgencyClosedProjectStatic(customerId, dateId); if (!gridSelfCount.isEmpty()) { agencyGovernDailyList.forEach(item -> { @@ -294,7 +299,9 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl 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 currentGridClosedProjectList = factOriginProjectMainDailyService.getGridClosedProjectList(customerId, gridId, ProjectConstant.CLOSED,null,null); @@ -339,6 +349,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl projectLogDTOList) { List 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 relationInfo = relationService.selectSubCustomer(customerId); - List customerIds = new ArrayList<>(); - customerIds.add(customerId); List result = new ArrayList<>(); if (CollectionUtils.isEmpty(relationInfo)){ // one customer @@ -169,12 +167,13 @@ public class ScreenProjectCategoryGridAndOrgDailyServiceImpl implements ScreenPr List 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 allAgencies = screenCustomerAgencyDao.selectParentSonAgency(subCustomerIds, PingYinConstant.KONG_CUN_CUSTOMER_ID); + log.info("父子客户所有的组织{}",JSON.toJSONString(allAgencies)); List> partition = ListUtils.partition(allAgencies, NumConstant.FIFTY); List allOrgCategoryList = result; partition.forEach(p -> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 94ed20f557..4e28cbb74b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/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 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 <= #{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 <= #{dateId} ) b ON b.PIDS LIKE CONCAT( '%', a.ID, '%' ) WHERE a.CUSTOMER_ID = #{customerId} GROUP BY a.ID, - a.`LEVEL` + b.`LEVEL` diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 85e8316cd3..9a2ec5b096 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/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 diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 2c65bcea65..ac84d4d820 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/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; diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java index 71d5f177e2..d713004471 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java +++ b/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/"; /** * 项目附件-允许上传的文件类型 diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java index 386f5521ef..7016cf1431 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java +++ b/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> getGridListByGridIds(List gridIdList) { Result> result = new Result>(); - if (gridIdList.size() < NumConstant.ONE) { - logger.error("根据网格Id集合获取网格列表信息-传入的网格Id集合为空数组!"); + if (CollectionUtils.isEmpty(gridIdList)) { + logger.warn("根据网格Id集合获取网格列表信息-传入的网格Id集合为空数组!"); return result; } List list = baseDao.selectGridByIds(gridIdList); diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 2725a3f9f3..6cafe080f3 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -3149,4 +3149,4 @@ public class ProjectServiceImpl extends BaseServiceImpl implements BaseDisputeProcessService { @Resource @@ -90,44 +92,50 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl deptMap, Map userMap, List list) { - if (CollectionUtils.isNotEmpty(list)) { + if (CollectionUtils.isEmpty(list)) { + log.warn("no event data to save table base_conflicts_resolve"); + return; + } - List 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 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()); } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java index de8c542864..44da2f6a91 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java +++ b/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 userIds; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 531d6791ac..4be5398b9e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/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> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO){ + public Result> getStaffInfoList(@RequestHeader("customerId") String customerId,@RequestBody UserIdsFormDTO formDTO){ + formDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(formDTO); return new Result>().ok(customerStaffService.getStaffInfoList(formDTO)); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 648c0e8245..e97ba4e662 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/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 getStaffInfoList(UserIdsFormDTO formDTO) { List userIds = formDTO.getUserIds(); // 1. 根据userId查询人员基本信息 - List staffInfoList = customerStaffDao.getStaffInfoList(userIds); + List 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 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 staffInfoList = customerStaffDao.getStaffInfoList(userIds); if (staffInfoList.size() == NumConstant.ZERO){ return staffInfoList; } @@ -619,7 +640,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl>> errorRows = new ThreadLocal<>(); + String fileName; + + // 判断是否有错误信息,以确定文件名 + boolean hasError = false; + Map> tableAndErrorRows = errorRows.get(); + for (Map.Entry> 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")); diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xls b/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xls deleted file mode 100644 index 9afbfdd669..0000000000 Binary files a/epmet-user/epmet-user-server/src/main/resources/excel/ic_resi_info_cid_for_easy_excel.xls and /dev/null differ