diff --git a/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java b/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java index 0349eaac8d..bb95213c1f 100644 --- a/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java +++ b/epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java @@ -137,6 +137,10 @@ class EpmetWebFilter implements WebFilter, ResultDataResolver { } List accessControlAllowOrigins = configMap.get(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN); + + logger.info("accessControlAllowOrigins:" + accessControlAllowOrigins); + logger.info("origin:" + origin); + if (CollectionUtils.isEmpty(accessControlAllowOrigins)) { return false; } 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 fd3115d370..a753c7f00a 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 @@ -1300,22 +1300,22 @@ public class DataStatsServiceImpl implements DataStatsService { } //1.查询组织直属网格列表【网格维度】 - List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + List gridList = indexService.getSubGridList(formDTO.getAgencyId()); if (gridList.size() < NumConstant.ONE) { return resultList; } - List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + List gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); //2.按日期查找组织直属网格事件治理指数列表 List list = dataStatsDao.getGridGovern(gridIds, formDTO.getDateId()); //3.封装数据 - for (DimGridEntity gr : gridList) { + for (ScreenCustomerGridDTO gr : gridList) { GridGovrnResultDTO dto = new GridGovrnResultDTO(); - dto.setGridId(gr.getId()); + dto.setGridId(gr.getGridId()); dto.setGridName(gr.getGridName()); for (GridGovrnResultDTO re : list) { - if (gr.getId().equals(re.getGridId())) { + if (gr.getGridId().equals(re.getGridId())) { dto.setProblemResolvedCount(re.getProblemResolvedCount()); dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio()); dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio()); 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 2ebc6b4613..175525d16d 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 @@ -7,7 +7,6 @@ import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.epmetuser.StaffPatrolRecordDao; import com.epmet.dataaggre.dao.epmetuser.StaffRoleDao; import com.epmet.dataaggre.dao.epmetuser.UserBaseInfoDao; -import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; import com.epmet.dataaggre.dto.epmetuser.StaffPatrolDetailDTO; import com.epmet.dataaggre.dto.epmetuser.StaffPatrolRecordDTO; import com.epmet.dataaggre.dto.epmetuser.form.PatrolDateListFormDTO; @@ -21,9 +20,7 @@ import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService; import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService; import com.epmet.dataaggre.service.govorg.GovOrgService; import lombok.extern.slf4j.Slf4j; -import oracle.sql.NUMBER; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -78,6 +75,7 @@ public class EpmetUserServiceImpl implements EpmetUserService { /** * @Param formDTO * @Description 001、各人员巡查记录列表查询 + * @remark 因为是yi以人为单位的数据 所以要内存分页 * @author sun */ @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql new file mode 100644 index 0000000000..7bc2a498dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql @@ -0,0 +1,2 @@ +-- epmet_evaluation_index库执行以下sql: 增加群众不满得分 +alter table screen_project_data add COLUMN `SATISFACTION_SCORE` decimal(10,6) DEFAULT NULL COMMENT '满意度得分' AFTER LATITUDE; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml index b38ec6cce5..b738c0f217 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml @@ -52,7 +52,14 @@ 0 AS RESPONSE_RATIO, 0 AS RESOLVED_RATIO, 0 AS GOVERN_RATIO, - 0 AS SATISFACTION_RATIO + 0 AS SATISFACTION_RATIO, + 0 AS RESPONSE_COUNT, + 0 AS TRANSFER_COUNT, + 0 AS RESOLVED_COUNT, + 0 AS CLOSED_COUNT, + 0 AS GOVERN_COUNT, + 0 AS SATISFACTION_COUNT, + 0 AS CLOSED_PROJECT_COUNT FROM screen_customer_agency WHERE @@ -69,7 +76,14 @@ 0 AS RESPONSE_RATIO, 0 AS RESOLVED_RATIO, 0 AS GOVERN_RATIO, - 0 AS SATISFACTION_RATIO + 0 AS SATISFACTION_RATIO, + 0 AS RESPONSE_COUNT, + 0 AS TRANSFER_COUNT, + 0 AS RESOLVED_COUNT, + 0 AS CLOSED_COUNT, + 0 AS GOVERN_COUNT, + 0 AS SATISFACTION_COUNT, + 0 AS CLOSED_PROJECT_COUNT FROM screen_customer_grid WHERE diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/InitPointRuleResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/InitPointRuleResultDTO.java index 4f486cba66..205b69db19 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/InitPointRuleResultDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/InitPointRuleResultDTO.java @@ -42,4 +42,6 @@ public class InitPointRuleResultDTO implements Serializable { * 已经初始化总数 */ private Integer initedTotal; -} \ No newline at end of file + + private String InitedDetail; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java index 55d2970a5e..8093ad3fee 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java @@ -36,7 +36,7 @@ public interface EpmetPointOpenFeignClient { * @author sun **/ @PostMapping("/point/opback/initpointrule") - Result initPointRule(); + Result initPointRule(String customerId); /** * 获取小组积分 diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java index a54f0b5eab..04e953edc9 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java @@ -10,6 +10,7 @@ import com.epmet.dto.form.GroupPointFormDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.feign.EpmetPointOpenFeignClient; import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestParam; /** * @Description @@ -25,8 +26,8 @@ public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignCli } @Override - public Result initPointRule() { - return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "initPointRule"); + public Result initPointRule(@RequestParam String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "initPointRule",customerId); } /** diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java index cbbbbeebf5..047ae55ce6 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java @@ -9,10 +9,7 @@ import com.epmet.dto.InitPointRuleResultDTO; import com.epmet.dto.form.PointRuleFormDTO; import com.epmet.service.PointRuleService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -44,12 +41,12 @@ public class BackDoorController { /** * desc:批量添加规则 * - * @param list + * @param customerId * @return */ - @PostMapping(value = "initpointrule") - public Result initPointRule() { - InitPointRuleResultDTO resultDTO = pointRuleService.initPointRule(); + @GetMapping(value = "initpointrule") + public Result initPointRule(@RequestParam(required = false) String customerId) { + InitPointRuleResultDTO resultDTO = pointRuleService.initPointRule(customerId); return new Result().ok(resultDTO); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java index cd39750f34..101261fe55 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java @@ -69,7 +69,7 @@ public interface PointRuleService extends BaseService { **/ PointRuleEntity getByEventCodeAndCustomerId(String customerId,String eventCode); - InitPointRuleResultDTO initPointRule(); + InitPointRuleResultDTO initPointRule(String customerId); /** * 获取小组积分规则 @@ -79,4 +79,4 @@ public interface PointRuleService extends BaseService { * @return com.epmet.dto.result.GroupPointRuleResultDTO */ GroupPointRuleResultDTO getGroupRule(String customerId); -} \ No newline at end of file +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java index 2f0c8fc5ba..8974935a07 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java @@ -16,7 +16,6 @@ */ package com.epmet.service.impl; - import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.common.enu.PointUnitEnum; @@ -289,14 +288,23 @@ public class PointRuleServiceImpl extends BaseServiceImpl> customerListResult = operCrmOpenFeignClient.getAllCustomerList(); - log.info("initPointRule operCrmOpenFeignClient.getAllCustomerList result:{}",JSON.toJSONString(customerListResult)); - if (!customerListResult.success() || CollectionUtils.isEmpty(customerListResult.getData())) { - throw new RenException("获取所有客户列表失败"); + List customerDTOList = null; + if (StringUtils.isBlank(customerId)){ + Result> customerListResult = operCrmOpenFeignClient.getAllCustomerList(); + log.info("initPointRule operCrmOpenFeignClient.getAllCustomerList result:{}",JSON.toJSONString(customerListResult)); + if (!customerListResult.success() || CollectionUtils.isEmpty(customerListResult.getData())) { + throw new RenException("获取所有客户列表失败"); + } + customerDTOList = customerListResult.getData(); + }else{ + customerDTOList = new ArrayList<>(); + CustomerDTO customerDTO = new CustomerDTO(); + customerDTO.setId(customerId); + customerDTOList.add(customerDTO); } - List customerDTOList = customerListResult.getData(); + //获取默认规则列表 List ruleDefaultEntities = pointRuleDefaultDao.selectList(null); if (CollectionUtils.isEmpty(ruleDefaultEntities)) { @@ -314,7 +322,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl> customerRuleMap = customerRule.stream().collect(Collectors.groupingBy(PointRuleEntity :: getCustomerId)); - customerRuleMap.forEach((customerId,ruleList) -> { + customerRuleMap.forEach((cId,ruleList) -> { if(null != ruleList){ List event = new LinkedList<>(defaultEventCodeList); //取差集,event只剩下当前客户没有的积分规则 @@ -327,7 +335,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl resultPoint = epmetPointOpenFeignClient.initPointRule(); + Result resultPoint = epmetPointOpenFeignClient.initPointRule(formDTO.getCustomerId()); if (!resultPoint.success()) { throw new RenException(resultPoint.getCode(), resultPoint.getInternalMsg()); }