diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index b23c50ee42..80885587be 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -129,6 +129,7 @@ public enum EpmetErrorCode { OPER_UPLOAD_IMG_TYPE_ERROR(8716, "请上传PNG格式的图片"), OPER_UPLOAD_IMG_SIZE_ERROR(8717, "请上传200*200的图片"), OPER_CORS_CONFIG_ERROR(8718, "跨域配置错误"), + ACCESS_CONFIG_ERROR(8719, "权限配置错误"), // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), 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 9c9e8b0333..de2d896d08 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 @@ -1130,37 +1130,38 @@ public class DataStatsServiceImpl implements DataStatsService { } ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId()); if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) { - - List subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), agencyDTO.getAreaCode()); - if (CollectionUtils.isEmpty(subAgencyIds)) { - subAgencyIds = new ArrayList<>(); - } - subAgencyIds.add(formDTO.getAgencyId()); - List list = dataStatsDao.getAgencyGovernDaily(subAgencyIds, formDTO.getDateId()); - if (CollectionUtils.isNotEmpty(list)) { - //问题解决总数 - Integer problemResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getProblemResolvedCount).sum(); - //未出小组即未转议题的:话题关闭已解决数 - Integer inGroupTopicResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getInGroupTopicResolvedCount).sum(); - //未出小组即未转议题的:话题关闭无需解决数 - Integer inGroupTopicUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getInGroupTopicUnResolvedCount).sum(); - //未出当前网格的,结案项目数 - Integer gridSelfGovernProjectTotal = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getGridSelfGovernProjectTotal).sum(); - //由社区结案的项目总数 - Integer communityClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getCommunityClosedCount).sum(); - //由街道结案的项目总数 - Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getStreetClosedCount).sum(); - //由区直部门结案的项目总数 - Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getDistrictDeptClosedCount).sum(); - - resultDTO.setProblemResolvedCount(problemResolvedCount); - resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); - resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, problemResolvedCount)); - resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, problemResolvedCount)); - resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, problemResolvedCount)); - resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, problemResolvedCount)); - - return resultDTO; + if (OrgConstant.PROVINCE.equals(agencyDTO.getLevel()) || OrgConstant.CITY.equals(agencyDTO.getLevel()) || OrgConstant.DISTRICT.equals(agencyDTO.getLevel())) { + List subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), agencyDTO.getAreaCode()); + if (CollectionUtils.isEmpty(subAgencyIds)) { + subAgencyIds = new ArrayList<>(); + } + subAgencyIds.add(formDTO.getAgencyId()); + List list = dataStatsDao.getAgencyGovernDaily(subAgencyIds, formDTO.getDateId()); + if (CollectionUtils.isNotEmpty(list)) { + //问题解决总数 + Integer problemResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getProblemResolvedCount).sum(); + //未出小组即未转议题的:话题关闭已解决数 + Integer inGroupTopicResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getInGroupTopicResolvedCount).sum(); + //未出小组即未转议题的:话题关闭无需解决数 + Integer inGroupTopicUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getInGroupTopicUnResolvedCount).sum(); + //未出当前网格的,结案项目数 + Integer gridSelfGovernProjectTotal = list.stream().mapToInt(FactAgencyGovernDailyEntity::getGridSelfGovernProjectTotal).sum(); + //由社区结案的项目总数 + Integer communityClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getCommunityClosedCount).sum(); + //由街道结案的项目总数 + Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getStreetClosedCount).sum(); + //由区直部门结案的项目总数 + Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getDistrictDeptClosedCount).sum(); + + resultDTO.setProblemResolvedCount(problemResolvedCount); + resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); + resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, problemResolvedCount)); + resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, problemResolvedCount)); + resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, problemResolvedCount)); + resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, problemResolvedCount)); + + return resultDTO; + } } } //1.按日期查询当前组织事件治理指数 @@ -1381,12 +1382,14 @@ public class DataStatsServiceImpl implements DataStatsService { if (OrgConstant.AGENCY.equals(formDTO.getOrgType())) { ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getOrgId()); if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) { - ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), agencyDTO.getAreaCode(), formDTO.getDateId()); - resultDTO.setGovernRatio(getPercentage(governData.getGovernCount(), governData.getClosedCount())); - resultDTO.setResolvedRatio(getPercentage(governData.getResolvedCount(), governData.getClosedCount())); - resultDTO.setResponseRatio(getPercentage(governData.getResponseCount(), governData.getTransferCount())); - resultDTO.setSatisfactionRatio(getPercentage(governData.getSatisfactionCount(), governData.getClosedProjectCount())); - return resultDTO; + if (OrgConstant.PROVINCE.equals(agencyDTO.getLevel()) || OrgConstant.CITY.equals(agencyDTO.getLevel()) || OrgConstant.DISTRICT.equals(agencyDTO.getLevel())) { + ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), agencyDTO.getAreaCode(), formDTO.getDateId()); + resultDTO.setGovernRatio(getPercentage(governData.getGovernCount(), governData.getClosedCount())); + resultDTO.setResolvedRatio(getPercentage(governData.getResolvedCount(), governData.getClosedCount())); + resultDTO.setResponseRatio(getPercentage(governData.getResponseCount(), governData.getTransferCount())); + resultDTO.setSatisfactionRatio(getPercentage(governData.getSatisfactionCount(), governData.getClosedProjectCount())); + return resultDTO; + } } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml index ccc4ef9b35..3e95accc9d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml @@ -84,7 +84,7 @@ SUM(RESOLVED_COUNT) AS resolvedCount, SUM(CLOSED_COUNT) AS closedCount, SUM(GOVERN_COUNT) AS governCount, - SUM(SATISFACTION_PROJECT_COUNT) AS satisfactionProjectCount, + SUM(SATISFACTION_COUNT) AS satisfactionCount, SUM(CLOSED_PROJECT_COUNT) AS closedProjectCount FROM screen_govern_rank_data_daily diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java index 42a67c936f..ce778cf651 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java @@ -21,4 +21,9 @@ public class RootAgencyFormDTO implements Serializable { @NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class}) private String agencyId; + /** + * token中客户Id + */ + private String customerId; + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java index 3a2f5cfebb..29d8cb939b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java @@ -1,5 +1,7 @@ package com.epmet.datareport.controller.fact; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.fact.FactIndexService; @@ -98,8 +100,9 @@ public class FactIndexController { * @author sun */ @PostMapping("index/rootagency") - public Result rootAgency(@RequestBody RootAgencyFormDTO formDTO) { + public Result rootAgency(@LoginUser TokenDto tokenDto, @RequestBody RootAgencyFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(factIndexService.rootAgency(formDTO)); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 4dd7253eba..a951b18406 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -100,7 +100,7 @@ public interface ScreenCustomerAgencyDao { * @Description 根据组织ID判断是否根组织 * @author sun */ - int selectRootAgency(@Param("agencyId") String agencyId); + int selectRootAgency(@Param("agencyId") String agencyId, @Param("customerId") String customerId); /** * desc: 根据orgId获取组织信息 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index 7a5eeee0d1..80d2161ebb 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -486,7 +486,7 @@ public class FactIndexServiceImpl implements FactIndexService { public RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO) { RootAgencyResultDTO resultDTO = new RootAgencyResultDTO(); //1.根据agencyId查询是否为根级组织 - int num = screenCustomerAgencyDao.selectRootAgency(formDTO.getAgencyId()); + int num = screenCustomerAgencyDao.selectRootAgency(formDTO.getAgencyId(), formDTO.getCustomerId()); if (num < NumConstant.ONE) { resultDTO.setIsRoot(false); } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 7852232a1c..83770370b5 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -116,6 +116,7 @@ del_flag = '0' AND pid = '0' AND agency_id = #{agencyId} + AND customer_id = #{customerId} + UPDATE gov_staff_role