Browse Source

Merge branch 'dev_data_fusion' into develop

master
zhaoqifeng 4 years ago
parent
commit
829f41a7cb
  1. 4
      epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java
  2. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  3. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  4. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql
  5. 18
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml
  6. 4
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/InitPointRuleResultDTO.java
  7. 2
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java
  8. 5
      epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java
  9. 13
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java
  10. 4
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java
  11. 29
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java
  12. 2
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

4
epmet-gateway/src/main/java/com/epmet/config/CorsConfig.java

@ -137,6 +137,10 @@ class EpmetWebFilter implements WebFilter, ResultDataResolver {
}
List<String> accessControlAllowOrigins = configMap.get(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN);
logger.info("accessControlAllowOrigins:" + accessControlAllowOrigins);
logger.info("origin:" + origin);
if (CollectionUtils.isEmpty(accessControlAllowOrigins)) {
return false;
}

10
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<DimGridEntity> gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId());
List<ScreenCustomerGridDTO> gridList = indexService.getSubGridList(formDTO.getAgencyId());
if (gridList.size() < NumConstant.ONE) {
return resultList;
}
List<String> gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList());
List<String> gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList());
//2.按日期查找组织直属网格事件治理指数列表
List<GridGovrnResultDTO> 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());

4
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

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

18
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

4
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;
}
private String InitedDetail;
}

2
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<InitPointRuleResultDTO> initPointRule();
Result<InitPointRuleResultDTO> initPointRule(String customerId);
/**
* 获取小组积分

5
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<InitPointRuleResultDTO> initPointRule() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "initPointRule");
public Result<InitPointRuleResultDTO> initPointRule(@RequestParam String customerId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "initPointRule",customerId);
}
/**

13
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<InitPointRuleResultDTO> initPointRule() {
InitPointRuleResultDTO resultDTO = pointRuleService.initPointRule();
@GetMapping(value = "initpointrule")
public Result<InitPointRuleResultDTO> initPointRule(@RequestParam(required = false) String customerId) {
InitPointRuleResultDTO resultDTO = pointRuleService.initPointRule(customerId);
return new Result<InitPointRuleResultDTO>().ok(resultDTO);
}

4
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> {
**/
PointRuleEntity getByEventCodeAndCustomerId(String customerId,String eventCode);
InitPointRuleResultDTO initPointRule();
InitPointRuleResultDTO initPointRule(String customerId);
/**
* 获取小组积分规则
@ -79,4 +79,4 @@ public interface PointRuleService extends BaseService<PointRuleEntity> {
* @return com.epmet.dto.result.GroupPointRuleResultDTO
*/
GroupPointRuleResultDTO getGroupRule(String customerId);
}
}

29
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<PointRuleDao, PointRul
@Override
@Transactional(rollbackFor = Exception.class)
public InitPointRuleResultDTO initPointRule() {
public InitPointRuleResultDTO initPointRule(String customerId) {
//得到所有客户Id
Result<List<CustomerDTO>> customerListResult = operCrmOpenFeignClient.getAllCustomerList();
log.info("initPointRule operCrmOpenFeignClient.getAllCustomerList result:{}",JSON.toJSONString(customerListResult));
if (!customerListResult.success() || CollectionUtils.isEmpty(customerListResult.getData())) {
throw new RenException("获取所有客户列表失败");
List<CustomerDTO> customerDTOList = null;
if (StringUtils.isBlank(customerId)){
Result<List<CustomerDTO>> 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<CustomerDTO> customerDTOList = customerListResult.getData();
//获取默认规则列表
List<PointRuleDefaultEntity> ruleDefaultEntities = pointRuleDefaultDao.selectList(null);
if (CollectionUtils.isEmpty(ruleDefaultEntities)) {
@ -314,7 +322,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
//key :: customerId || value :: 客户规则集合
Map<String,List<PointRuleEntity>> customerRuleMap =
customerRule.stream().collect(Collectors.groupingBy(PointRuleEntity :: getCustomerId));
customerRuleMap.forEach((customerId,ruleList) -> {
customerRuleMap.forEach((cId,ruleList) -> {
if(null != ruleList){
List<String> event = new LinkedList<>(defaultEventCodeList);
//取差集,event只剩下当前客户没有的积分规则
@ -327,7 +335,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
entity.setCreatedTime(new Date());
entity.setUpdatedBy("");
entity.setUpdatedTime(new Date());
entity.setCustomerId(customerId);
entity.setCustomerId(cId);
insertList.add(entity);
return entity;
}).collect(Collectors.toList());
@ -374,6 +382,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
InitPointRuleResultDTO result = new InitPointRuleResultDTO();
result.setCustomerTotal(customerDTOList.size());
result.setInitedTotal(insertList.size());
result.setInitedDetail(JSON.toJSONString(insertList));
return result;
}
@ -430,4 +439,4 @@ public class PointRuleServiceImpl extends BaseServiceImpl<PointRuleDao, PointRul
}
return resultStaff.getData();
}
}
}

2
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

@ -569,7 +569,7 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
//2021.1.25 sun 新增初始化客户积分规则和评价指标权重 start
//8.客户初始化已有的积分规则
Result<InitPointRuleResultDTO> resultPoint = epmetPointOpenFeignClient.initPointRule();
Result<InitPointRuleResultDTO> resultPoint = epmetPointOpenFeignClient.initPointRule(formDTO.getCustomerId());
if (!resultPoint.success()) {
throw new RenException(resultPoint.getCode(), resultPoint.getInternalMsg());
}

Loading…
Cancel
Save