Browse Source

话题暂存

master
yinzuomei 5 years ago
parent
commit
8f591e262c
  1. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java
  3. 62
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  4. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java
  5. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java
  6. 9
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java

@ -64,7 +64,7 @@ public class TopicOriginInfoDTO implements Serializable {
/** /**
* 话题关闭时的状态已解决 resolved未解决 unresolved * 话题关闭时的状态已解决 resolved未解决 unresolved
*/ */
private String closedStatus; // private String closedStatus;
/** /**
* 网格id ( 其实就是小组所属的网格id) * 网格id ( 其实就是小组所属的网格id)

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java

@ -10,5 +10,5 @@ public interface DimObjectActionConstant {
/** /**
* 发布话题 * 发布话题
*/ */
String TOPIC_PUBLISH="disscussing"; String TOPIC_PUBLISH="discussing";
} }

62
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -1,5 +1,6 @@
package com.epmet.controller; package com.epmet.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
@ -11,6 +12,8 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDa
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dao.stats.DimCustomerDao;
import com.epmet.dao.stats.DimDateDao;
import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
@ -18,15 +21,16 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthl
import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimAgencyEntity;
import com.epmet.entity.stats.DimCustomerEntity;
import com.epmet.entity.stats.DimDateEntity;
import com.epmet.service.StatsDemoService; import com.epmet.service.StatsDemoService;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimAgencyService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -57,6 +61,24 @@ public class DemoController {
private DeptScoreService deptScoreService; private DeptScoreService deptScoreService;
@Autowired @Autowired
private IndexCalculateDistrictService indexCalculateDistrictService; private IndexCalculateDistrictService indexCalculateDistrictService;
@Autowired
private GridScoreDao gridScoreDao;
@Autowired
private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao;
@Autowired
private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao;
@Autowired
private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao;
@Autowired
private ScreenCustomerGridDao screenCustomerGridDao;
@Autowired
private CpcIndexCalculateService cpcIndexCalculateService;
@Autowired
private DimDateDao dimDateDao;
@Autowired
private DimCustomerDao dimCustomerDao;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@GetMapping("testAlarm") @GetMapping("testAlarm")
public void testAlarm() { public void testAlarm() {
@ -147,19 +169,6 @@ public class DemoController {
return new Result(); return new Result();
} }
@Autowired
private GridScoreDao gridScoreDao;
@Autowired
private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao;
@Autowired
private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao;
@Autowired
private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao;
@Autowired
private ScreenCustomerGridDao screenCustomerGridDao;
@Autowired
private CpcIndexCalculateService cpcIndexCalculateService;
// private static Integer testcal=100;
@PostMapping("testcal") @PostMapping("testcal")
public Result testCal(){ public Result testCal(){
@ -487,4 +496,23 @@ public class DemoController {
c.setMonthId(monthId); c.setMonthId(monthId);
deptScoreService.calculateDeptCorreLation(c); deptScoreService.calculateDeptCorreLation(c);
} }
@PostMapping("inserttopicorigin")
public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
factOriginTopicMainDailyService.topicCleaning(customerId,dateId);
}else{
QueryWrapper<DimCustomerEntity> customerEntityQueryWrapper = new QueryWrapper<>();
List<DimCustomerEntity> customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper);
QueryWrapper<DimDateEntity> wrapper = new QueryWrapper<>();
List<DimDateEntity> dimDateEntityList= dimDateDao.selectList(wrapper);
for(DimCustomerEntity customerEntity:customerEntityList){
for(DimDateEntity dateEntity:dimDateEntityList){
factOriginTopicMainDailyService.topicCleaning(customerEntity.getId(),dateEntity.getId());
}
}
}
return new Result();
}
} }

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java

@ -2,15 +2,12 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.service.evaluationindex.extract.IssueExtractService; import com.epmet.service.evaluationindex.extract.IssueExtractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import com.epmet.commons.tools.utils.Result;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
@ -36,7 +33,6 @@ public class FactOriginController {
return new Result(); return new Result();
} }
/** /**
* @param customerId yyyyMMdd * @param customerId yyyyMMdd
* @param dateId yyyyMMdd * @param dateId yyyyMMdd
@ -46,7 +42,7 @@ public class FactOriginController {
* @Date 2020/9/15 13:39 * @Date 2020/9/15 13:39
**/ **/
@PostMapping("topic") @PostMapping("topic")
public Result topicDataCleaning(String customerId, String dateId) { public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) {
factOriginTopicMainDailyService.topicCleaning(customerId,dateId); factOriginTopicMainDailyService.topicCleaning(customerId,dateId);
} }

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java

@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DimObjectActionConstant; import com.epmet.constant.DimObjectActionConstant;
@ -148,7 +149,8 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
GridInfoDTO gridInfoDTO=gridMap.get(topicOriginInfoDTO.getGridId()); GridInfoDTO gridInfoDTO=gridMap.get(topicOriginInfoDTO.getGridId());
if(null==gridInfoDTO){ if(null==gridInfoDTO){
log.error("没有找到 gridId="+topicOriginInfoDTO.getGridId()+" 的基本信息"); log.error("没有找到 gridId="+topicOriginInfoDTO.getGridId()+" 的基本信息");
continue; // continue;
throw new RenException("xxxxxx");
} }
// 一年的第几周 // 一年的第几周
String weekId = DateUtils.format(topicOriginInfoDTO.getOriginalBusinessTime(), DateUtils.DATE_PATTERN_YYYY).concat("W").concat(String.valueOf(DateUtils.getWeekOfYear(topicOriginInfoDTO.getOriginalBusinessTime()))); String weekId = DateUtils.format(topicOriginInfoDTO.getOriginalBusinessTime(), DateUtils.DATE_PATTERN_YYYY).concat("W").concat(String.valueOf(DateUtils.getWeekOfYear(topicOriginInfoDTO.getOriginalBusinessTime())));

9
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml

@ -150,7 +150,12 @@
<select id="selectListTopicOriginInfo" parameterType="map" resultType="com.epmet.dto.topic.TopicOriginInfoDTO"> <select id="selectListTopicOriginInfo" parameterType="map" resultType="com.epmet.dto.topic.TopicOriginInfoDTO">
SELECT SELECT
rto.TOPIC_ID, rto.TOPIC_ID,
rto.OPERATION_TYPE as ACTION_CODE, (case
when rto.OPERATION_TYPE='closed' and rt.CLOSED_STATUS='resolved' then 'closed_resolved'
when rto.OPERATION_TYPE='closed' and rt.CLOSED_STATUS='unresolved' then 'closed_unresolved'
else rto.OPERATION_TYPE
end
)as ACTION_CODE,
rto.CREATED_BY as OPERATE_USER_ID, rto.CREATED_BY as OPERATE_USER_ID,
DATE_FORMAT(rto.CREATED_TIME,'%Y%m%d') as DATE_ID, DATE_FORMAT(rto.CREATED_TIME,'%Y%m%d') as DATE_ID,
DATE_FORMAT(rto.CREATED_TIME,'%Y%m') as MONTH_ID, DATE_FORMAT(rto.CREATED_TIME,'%Y%m') as MONTH_ID,
@ -158,7 +163,6 @@
rto.CREATED_TIME AS ORIGINAL_BUSINESS_TIME, rto.CREATED_TIME AS ORIGINAL_BUSINESS_TIME,
rt.GROUP_ID, rt.GROUP_ID,
rt.STATUS as TOPIC_STATUS, rt.STATUS as TOPIC_STATUS,
RT.CLOSED_STATUS,
rg.GRID_ID, rg.GRID_ID,
RG.CUSTOMER_ID RG.CUSTOMER_ID
FROM FROM
@ -180,7 +184,6 @@
rtc.CREATED_TIME AS ORIGINAL_BUSINESS_TIME, rtc.CREATED_TIME AS ORIGINAL_BUSINESS_TIME,
rt.GROUP_ID , rt.GROUP_ID ,
rt.STATUS as TOPIC_STATUS, rt.STATUS as TOPIC_STATUS,
RT.CLOSED_STATUS,
rg.GRID_ID, rg.GRID_ID,
rg.CUSTOMER_ID rg.CUSTOMER_ID
FROM FROM

Loading…
Cancel
Save