Browse Source

Merge remote-tracking branch 'remotes/origin/dev_screen_data_2.0' into dev_temp

master
jianjun 5 years ago
parent
commit
88115623d4
  1. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java
  2. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java
  3. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  4. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexOriginExtractController.java
  5. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java
  6. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java
  7. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java
  8. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java
  9. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java
  10. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySubScoreEntity.java
  11. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java
  12. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectOrgPeriodDailyService.java
  13. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java
  14. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java
  15. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectMainDailyServiceImpl.java
  16. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectOrgPeriodDailyServiceImpl.java
  17. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java
  18. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java
  19. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  20. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  21. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  22. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  23. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyService.java
  24. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java
  25. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java
  26. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java
  27. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityDeptMonthlyServiceImpl.java
  28. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java
  29. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java
  30. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java
  31. 92
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictDepartmentServiceImpl.java
  32. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java
  33. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java
  34. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java
  35. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java
  36. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java
  37. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java
  38. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java
  39. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  40. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml
  41. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml
  42. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml
  43. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml
  44. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml
  45. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml
  46. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml
  47. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java

@ -76,6 +76,11 @@ public class AgencyScoreDTO implements Serializable {
*/ */
private String isTotal; private String isTotal;
/**
* 参与计算的原始值
*/
private String originValue;
/** /**
* 分值 * 分值
*/ */

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java

@ -74,6 +74,11 @@ public class FactIndexCommunityScoreDTO implements Serializable {
*/ */
private String isTotal; private String isTotal;
/**
* 参与计算指标的原始值
*/
private String originValue;
/** /**
* 分值 * 分值
*/ */

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

@ -33,6 +33,8 @@ import com.epmet.service.evaluationindex.extract.CalGridIndexService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.evaluationindex.indexcoll.IndexCollCommunityService;
import com.epmet.service.evaluationindex.indexcoll.IndexCollStreetService;
import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.DimCustomerPartymemberService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -92,6 +94,10 @@ public class DemoController {
private FactOriginTopicMainDailyService factOriginTopicMainDailyService; private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired @Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService; private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
private IndexCollCommunityService indexCollCommunityService;
@Autowired
private IndexCollStreetService indexCollStreetService;
@GetMapping("testAlarm") @GetMapping("testAlarm")
public void testAlarm() { public void testAlarm() {
@ -614,5 +620,16 @@ public class DemoController {
} }
return new Result(); return new Result();
} }
@PostMapping("indexCollCommunity")
public Result indexCollCommunity(@RequestBody CustomerIdAndDateIdFormDTO formDTO){
indexCollCommunityService.saveCommunityAbility(formDTO.getCustomerId(), formDTO.getDateId());
return new Result();
}
@PostMapping("indexCollStreet")
public Result indexCollStreet(@RequestBody CustomerIdAndDateIdFormDTO formDTO){
indexCollStreetService.saveStreetAbility(formDTO.getCustomerId(), formDTO.getDateId());
return new Result();
}
} }

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexOriginExtractController.java

@ -1,8 +1,8 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.service.evaluationindex.extract.FactOriginExtractService; import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("indexorigin") @RequestMapping("indexorigin")
public class IndexOriginExtractController { public class IndexOriginExtractController {
@Autowired @Autowired
private FactOriginExtractService factOriginExtractService; private IndexOriginExtractService indexOriginExtractService;
/** /**
@ -30,8 +30,8 @@ public class IndexOriginExtractController {
* @return * @return
*/ */
@PostMapping("extractall") @PostMapping("extractall")
public Result extractAll(@RequestBody ExtractFormDTO extractFormDTO) { public Result extractAll(@RequestBody ExtractIndexFormDTO extractFormDTO) {
factOriginExtractService.extractAll(extractFormDTO); indexOriginExtractService.indexOriginExtractAll(extractFormDTO);
return new Result(); return new Result();
} }
} }

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.stats; package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.DimDepartmentDTO;
import com.epmet.entity.stats.DimDepartmentEntity; import com.epmet.entity.stats.DimDepartmentEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -44,4 +45,13 @@ public interface DimDepartmentDao extends BaseDao<DimDepartmentEntity> {
DimDepartmentEntity getLatestCreatedDimEntity(); DimDepartmentEntity getLatestCreatedDimEntity();
DimDepartmentEntity getLatestUpdatedDimEntity(); DimDepartmentEntity getLatestUpdatedDimEntity();
/**
* 获取区直部门
* @author zhaoqifeng
* @date 2020/9/21 14:51
* @param customerId
* @return java.util.List<com.epmet.dto.stats.DimDepartmentDTO>
*/
List<DimDepartmentDTO> getDistrictDepByCustomer(@Param("customerId") String customerId);
} }

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java

@ -18,10 +18,14 @@
package com.epmet.dao.stats; package com.epmet.dao.stats;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO;
import com.epmet.dto.stats.FactArticlePublishedDepartmentDailyDTO;
import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 文章发布数量部门日统计表 * 文章发布数量部门日统计表
* *
@ -38,4 +42,14 @@ public interface FactArticlePublishedDepartmentDailyDao extends BaseDao<FactArti
* @return * @return
*/ */
int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* 获取组织文章数量
* @author zhaoqifeng
* @date 2020/9/20 22:46
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO>
*/
List<FactArticlePublishedDepartmentDailyDTO> selectDeptCount(@Param("customerId")String customerId, @Param("monthId")String monthId);
} }

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java

@ -72,6 +72,11 @@ public class AgencySubScoreEntity extends BaseEpmetEntity {
*/ */
private String isTotal; private String isTotal;
/**
* 计算指标时的原始值 字符串类型
*/
private String originValue;
/** /**
* 分值 * 分值
*/ */

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java

@ -68,6 +68,11 @@ public class CpcSubScoreEntity extends BaseEpmetEntity {
*/ */
private String userId; private String userId;
/**
* 计算指标时的原始值 字符串类型
*/
private String originValue;
/** /**
* 分值 * 分值
*/ */

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java

@ -67,6 +67,11 @@ public class DeptSubScoreEntity extends BaseEpmetEntity {
*/ */
private String monthId; private String monthId;
/**
* 计算指标时的原始值 字符串类型
*/
private String originValue;
/** /**
* 分值 * 分值
*/ */

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySubScoreEntity.java

@ -48,6 +48,11 @@ public class FactIndexCommunitySubScoreEntity extends BaseEpmetEntity {
*/ */
private String monthId; private String monthId;
/**
* 计算指标时的原始值 字符串类型
*/
private String originValue;
/** /**
* 分值 * 分值
*/ */

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java

@ -77,6 +77,11 @@ public class GridSubScoreEntity extends BaseEpmetEntity {
*/ */
private String isTotal; private String isTotal;
/**
* 计算指标时的原始值 字符串类型
*/
private String originValue;
/** /**
* 分值 * 分值
*/ */

26
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectOrgPeriodDailyService.java

@ -0,0 +1,26 @@
package com.epmet.service.evaluationindex.extract;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/21 16:46
*/
public interface FactOriginProjectOrgPeriodDailyService extends BaseService<FactOriginProjectOrgPeriodDailyEntity> {
/**
* 项目响应度
* @author zhaoqifeng
* @date 2020/9/21 16:57
* @param customerId
* @param monthId
* @param level
* @param orgType
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getResponsiveness(String customerId, String monthId, String level, String orgType);
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java

@ -7,6 +7,7 @@ import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.service.evaluationindex.extract.CalCpcIndexService; import com.epmet.service.evaluationindex.extract.CalCpcIndexService;
import com.epmet.service.evaluationindex.extract.CalGridIndexService; import com.epmet.service.evaluationindex.extract.CalGridIndexService;
import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService; import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService;
import com.epmet.service.evaluationindex.indexcoll.IndexCollCommunityService;
import com.epmet.service.evaluationindex.indexcoll.IndexCollStreetService; import com.epmet.service.evaluationindex.indexcoll.IndexCollStreetService;
import com.epmet.service.stats.DimCustomerService; import com.epmet.service.stats.DimCustomerService;
import com.epmet.util.DimIdGenerator; import com.epmet.util.DimIdGenerator;
@ -42,6 +43,8 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
private DimCustomerService dimCustomerService; private DimCustomerService dimCustomerService;
@Autowired @Autowired
private IndexCollStreetService indexCollStreetService; private IndexCollStreetService indexCollStreetService;
@Autowired
private IndexCollCommunityService indexCollCommunityService;
/** /**
* desc从统计库对象抽取指标数据 * desc从统计库对象抽取指标数据
@ -58,7 +61,7 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
List<String> customerIds = new ArrayList<>(); List<String> customerIds = new ArrayList<>();
if (StringUtils.isNotBlank(customerId)) { if (StringUtils.isNotBlank(customerId)) {
customerIds.add(customerId); customerIds.add(customerId);
} } else {
int pageNo = NumConstant.ONE; int pageNo = NumConstant.ONE;
int pageSize = NumConstant.ONE_HUNDRED; int pageSize = NumConstant.ONE_HUNDRED;
customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize);
@ -66,6 +69,7 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
log.error("indexOriginExtractAll 获取客户Id为空"); log.error("indexOriginExtractAll 获取客户Id为空");
return; return;
} }
}
String finalMonthId = monthId; String finalMonthId = monthId;
customerIds.forEach(cId -> { customerIds.forEach(cId -> {
@ -108,6 +112,11 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
}catch (Exception e){ }catch (Exception e){
log.error("抽取【街道治理能力-街道党建能力】发生异常,参数:" + JSON.toJSONString(param), e); log.error("抽取【街道治理能力-街道党建能力】发生异常,参数:" + JSON.toJSONString(param), e);
} }
try{
indexCollCommunityService.saveCommunityAbility(customerId, monthId);
}catch (Exception e){
log.error("抽取【社区治理能力-社区党建能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
}); });
} }
} }

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

@ -19,11 +19,13 @@ package com.epmet.service.evaluationindex.extract.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO;
@ -48,6 +50,7 @@ import java.util.stream.Collectors;
* @since v1.0.0 2020-09-16 * @since v1.0.0 2020-09-16
*/ */
@Service @Service
@DataSource(DataSourceConstant.STATS)
public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOriginProjectLogDailyDao, FactOriginProjectLogDailyEntity> implements FactOriginProjectLogDailyService { public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOriginProjectLogDailyDao, FactOriginProjectLogDailyEntity> implements FactOriginProjectLogDailyService {
@Autowired @Autowired

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

@ -19,11 +19,13 @@ package com.epmet.service.evaluationindex.extract.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
@ -47,6 +49,7 @@ import java.util.Map;
* @since v1.0.0 2020-09-16 * @since v1.0.0 2020-09-16
*/ */
@Service @Service
@DataSource(DataSourceConstant.STATS)
public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactOriginProjectMainDailyDao, FactOriginProjectMainDailyEntity> implements FactOriginProjectMainDailyService { public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactOriginProjectMainDailyDao, FactOriginProjectMainDailyEntity> implements FactOriginProjectMainDailyService {
@Override @Override

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

@ -0,0 +1,26 @@
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginProjectOrgPeriodDailyService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/21 16:48
*/
@Service
@DataSource(DataSourceConstant.STATS)
public class FactOriginProjectOrgPeriodDailyServiceImpl extends BaseServiceImpl<FactOriginProjectOrgPeriodDailyDao, FactOriginProjectOrgPeriodDailyEntity> implements FactOriginProjectOrgPeriodDailyService {
@Override
public List<OrgStatisticsResultDTO> getResponsiveness(String customerId, String monthId, String level, String orgType) {
return baseDao.selectResponsiveness(customerId, monthId, level, orgType);
}
}

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java

@ -314,6 +314,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService {
child.setAllParentIndexCode(o.getAllParentIndexCode()); child.setAllParentIndexCode(o.getAllParentIndexCode());
child.setScore(o.getScore()); child.setScore(o.getScore());
child.setWeight(o.getWeight()); child.setWeight(o.getWeight());
child.setOriginValue(o.getOriginValue());
subList.add(child); subList.add(child);
}); });

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java

@ -322,6 +322,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
deptSubScore.setAllParentIndexCode(detail.getAllParentIndexCode()); deptSubScore.setAllParentIndexCode(detail.getAllParentIndexCode());
deptSubScore.setScore(detail.getScore()); deptSubScore.setScore(detail.getScore());
deptSubScore.setWeight(detail.getWeight()); deptSubScore.setWeight(detail.getWeight());
deptSubScore.setOriginValue(detail.getOriginValue());
deptSubScoreEntityList.add(deptSubScore); deptSubScoreEntityList.add(deptSubScore);
} }
}); });

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -376,6 +376,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
gridSubScoreEntity.setAllParentIndexCode(detail.getAllParentIndexCode()); gridSubScoreEntity.setAllParentIndexCode(detail.getAllParentIndexCode());
gridSubScoreEntity.setScore(detail.getScore()); gridSubScoreEntity.setScore(detail.getScore());
gridSubScoreEntity.setWeight(detail.getWeight()); gridSubScoreEntity.setWeight(detail.getWeight());
gridSubScoreEntity.setOriginValue(detail.getOriginValue());
gridSubScoreList.add(gridSubScoreEntity); gridSubScoreList.add(gridSubScoreEntity);
} }
}); });
@ -458,7 +459,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
minValue = contactMassesAblityMap.get(StrConstant.MIN); minValue = contactMassesAblityMap.get(StrConstant.MIN);
maxValue = contactMassesAblityMap.get(StrConstant.MAX); maxValue = contactMassesAblityMap.get(StrConstant.MAX);
} else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(index.getIndexCode())) { } else if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(index.getIndexCode())) {
// log.info("组织内党员的参与议事能力考评分平均值) 单独处理"); // log.info("组织内党员的参与议事能力考评分平均值) 单独处理");
Map<String, BigDecimal> joinIssueAblityMap = this.getJoinIssueAblityMap(formDTO); Map<String, BigDecimal> joinIssueAblityMap = this.getJoinIssueAblityMap(formDTO);
minValue = joinIssueAblityMap.get(StrConstant.MIN); minValue = joinIssueAblityMap.get(StrConstant.MIN);
maxValue = joinIssueAblityMap.get(StrConstant.MAX); maxValue = joinIssueAblityMap.get(StrConstant.MAX);

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java

@ -458,6 +458,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
s.setScore(fiveDetail.getScore()); s.setScore(fiveDetail.getScore());
s.setAllParentIndexCode(fiveDetail.getAllParentIndexCode()); s.setAllParentIndexCode(fiveDetail.getAllParentIndexCode());
s.setWeight(fiveDetail.getWeight()); s.setWeight(fiveDetail.getWeight());
s.setOriginValue(fiveDetail.getOriginValue());
pid.forEach((agency, parentAgency) -> { pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) { if (k.equals(agency)) {
s.setParentAgencyId(parentAgency); s.setParentAgencyId(parentAgency);

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java

@ -435,6 +435,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); s.setAllParentIndexCode(streetScore.getAllParentIndexCode());
s.setDataType(IndexCalConstant.DISTRICT_LEVEL); s.setDataType(IndexCalConstant.DISTRICT_LEVEL);
s.setWeight(streetScore.getWeight()); s.setWeight(streetScore.getWeight());
s.setOriginValue(streetScore.getOriginValue());
pid.forEach((agency, parentAgency) -> { pid.forEach((agency, parentAgency) -> {
//todo 确认 //todo 确认
if (k != null && k.equals(agency)) { if (k != null && k.equals(agency)) {

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

@ -463,6 +463,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
s.setDataType(IndexCalConstant.STREET_LEVEL); s.setDataType(IndexCalConstant.STREET_LEVEL);
s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); s.setAllParentIndexCode(streetScore.getAllParentIndexCode());
s.setWeight(streetScore.getWeight()); s.setWeight(streetScore.getWeight());
s.setOriginValue(streetScore.getOriginValue());
pid.forEach((agency, parentAgency) -> { pid.forEach((agency, parentAgency) -> {
if (k.equals(agency)) { if (k.equals(agency)) {
s.setParentAgencyId(parentAgency); s.setParentAgencyId(parentAgency);

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyService.java

@ -0,0 +1,21 @@
package com.epmet.service.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/21 15:24
*/
public interface FactIndexGovrnAblityDeptMonthlyService extends BaseService<FactIndexGovrnAblityDeptMonthlyEntity> {
/**
* 根据客户清空数据
* @author zhaoqifeng
* @date 2020/9/20 20:33
* @param customerId
* @param monthId
* @return void
*/
void deleteByCustomer(String customerId, String monthId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java

@ -40,4 +40,13 @@ public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService<FactI
* @date 2020/9/19 4:31 下午 * @date 2020/9/19 4:31 下午
*/ */
Integer deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId); Integer deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId);
/**
* 批量插入
* @author zhaoqifeng
* @date 2020/9/21 17:08
* @param list
* @return void
*/
void saveList(List<FactIndexGovrnAblityOrgMonthlyEntity> list);
} }

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java

@ -39,4 +39,13 @@ public interface FactIndexPartyAblityOrgMonthlyService extends BaseService<FactI
* @date 2020/9/19 10:45 上午 * @date 2020/9/19 10:45 上午
*/ */
Integer deleteOldPartyAbility(String customerId,String monthId); Integer deleteOldPartyAbility(String customerId,String monthId);
/**
* 批量插入
* @author zhaoqifeng
* @date 2020/9/21 17:08
* @param list
* @return void
*/
void saveList(List<FactIndexPartyAblityOrgMonthlyEntity> list);
} }

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java

@ -7,4 +7,14 @@ package com.epmet.service.evaluationindex.indexcoll;
* @date 2020/9/18 10:43 * @date 2020/9/18 10:43
*/ */
public interface IndexCollDistrictDepartmentService { public interface IndexCollDistrictDepartmentService {
/**
* 区直部门能力统计
*
* @param customerId
* @param dateId
* @return void
* @author zhaoqifeng
* @date 2020/9/21 14:42
*/
void saveDepartmentAbility(String customerId, String dateId);
} }

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityDeptMonthlyServiceImpl.java

@ -0,0 +1,24 @@
package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyService;
import org.springframework.stereotype.Service;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/21 15:25
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class FactIndexGovrnAblityDeptMonthlyServiceImpl extends BaseServiceImpl<FactIndexGovrnAblityDeptMonthlyDao, FactIndexGovrnAblityDeptMonthlyEntity> implements FactIndexGovrnAblityDeptMonthlyService {
@Override
public void deleteByCustomer(String customerId, String monthId) {
baseDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, monthId);
}
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java

@ -10,6 +10,7 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthly
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
@ -39,4 +40,10 @@ public class FactIndexGovrnAblityOrgMonthlyServiceImpl extends BaseServiceImpl<F
public Integer deleteOldGovernAbilityRecord(String customerId, String monthId) { public Integer deleteOldGovernAbilityRecord(String customerId, String monthId) {
return governAbilityDao.deleteOldGovernAbilityRecord(customerId, monthId); return governAbilityDao.deleteOldGovernAbilityRecord(customerId, monthId);
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void saveList(List<FactIndexGovrnAblityOrgMonthlyEntity> list) {
insertBatch(list);
}
} }

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java

@ -39,4 +39,10 @@ public class FactIndexPartyAblityOrgMonthlyServiceImpl extends BaseServiceImpl<F
public Integer deleteOldPartyAbility(String customerId, String monthId) { public Integer deleteOldPartyAbility(String customerId, String monthId) {
return partyAbilityGridDao.deleteOldPartyAbility(customerId, monthId); return partyAbilityGridDao.deleteOldPartyAbility(customerId, monthId);
} }
@Override
public void saveList(List<FactIndexPartyAblityOrgMonthlyEntity> list) {
insertBatch(list);
}
} }

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java

@ -1,11 +1,8 @@
package com.epmet.service.evaluationindex.indexcoll.impl; package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant; import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO;
@ -13,6 +10,7 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthly
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectOrgPeriodDailyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.IndexCollCommunityService; import com.epmet.service.evaluationindex.indexcoll.IndexCollCommunityService;
@ -37,7 +35,6 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
@Slf4j @Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class IndexCollCommunityServiceImpl implements IndexCollCommunityService { public class IndexCollCommunityServiceImpl implements IndexCollCommunityService {
@Autowired @Autowired
private DimAgencyService dimAgencyService; private DimAgencyService dimAgencyService;
@ -46,7 +43,7 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
@Autowired @Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService; private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired @Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; private FactOriginProjectOrgPeriodDailyService factOriginProjectOrgPeriodDailyService;
@Autowired @Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired @Autowired
@ -57,7 +54,7 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
@Override @Override
public void saveCommunityAbility(String customerId, String dateId) { public void saveCommunityAbility(String customerId, String dateId) {
//当前日期前一天 //当前日期前一天
Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD)); Date date = DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM);
//获取日期相关维度 //获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//获取社区列表 //获取社区列表
@ -92,7 +89,7 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
} }
//社区项目响应度 //社区项目响应度
List<OrgStatisticsResultDTO> responsiveness = factOriginProjectOrgPeriodDailyDao.selectResponsiveness(customerId, dimId.getMonthId(), List<OrgStatisticsResultDTO> responsiveness = factOriginProjectOrgPeriodDailyService.getResponsiveness(customerId, dimId.getMonthId(),
OrgTypeConstant.COMMUNITY, OrgTypeConstant.AGENCY); OrgTypeConstant.COMMUNITY, OrgTypeConstant.AGENCY);
if (null != responsiveness && !responsiveness.isEmpty()) { if (null != responsiveness && !responsiveness.isEmpty()) {
list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> { list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> {
@ -123,7 +120,7 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
if (sa.getCount() != NumConstant.ZERO) { if (sa.getCount() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(sa.getCount()); BigDecimal count = new BigDecimal(sa.getCount());
BigDecimal sum = new BigDecimal(sa.getSum()); BigDecimal sum = new BigDecimal(sa.getSum());
entity.setOverdueProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); entity.setSatisfactionRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP));
} }
})); }));
} }
@ -132,19 +129,20 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month"); Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> responseMap = factOriginProjectLogDailyService.getAgencyResponseRatio(customerId,dimId.getMonthId(),"month"); Map<String,BigDecimal> responseMap = factOriginProjectLogDailyService.getAgencyResponseRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{ list.forEach(entity ->{
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId())); entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
BigDecimal element = entity.getClosedProjectRatio(); BigDecimal element = entity.getClosedProjectRatio();
if (entity.getTransferedCount() != NumConstant.ZERO) {
//办结率 //办结率
entity.setClosedProjectRatio( entity.setClosedProjectRatio(
element.divide(new BigDecimal(entity.getTransferedCount()), NumConstant.SIX, RoundingMode.HALF_UP) element.divide(new BigDecimal(entity.getTransferedCount()), NumConstant.SIX, RoundingMode.HALF_UP)
); );
}
//响应度 //响应度
entity.setRespProjectRatio(responseMap.get(entity.getAgencyId()));
}); });
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY);
factIndexGovrnAblityOrgMonthlyService.insertBatch(list); factIndexGovrnAblityOrgMonthlyService.saveList(list);
//2.党建能力 //2.党建能力
//获取社区发文数量 //获取社区发文数量
@ -169,7 +167,7 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
})); }));
} }
factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY);
factIndexPartyAblityOrgMonthlyService.insertBatch(partyList); factIndexPartyAblityOrgMonthlyService.saveList(partyList);
} }
} }

92
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictDepartmentServiceImpl.java

@ -1,11 +1,32 @@
package com.epmet.service.evaluationindex.indexcoll.impl; package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.DimDepartmentDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.IndexCollDistrictDepartmentService; import com.epmet.service.evaluationindex.indexcoll.IndexCollDistrictDepartmentService;
import com.epmet.service.stats.DimDepartmentService;
import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author zhaoqifeng * @author zhaoqifeng
* @dscription * @dscription
@ -13,6 +34,75 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
@Slf4j @Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrictDepartmentService { public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrictDepartmentService {
@Autowired
private DimDepartmentService dimDepartmentService;
@Autowired
private FactIndexGovrnAblityDeptMonthlyService factIndexGovrnAblityDeptMonthlyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService;
@Autowired
private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService;
@Override
public void saveDepartmentAbility(String customerId, String dateId) {
{
//当前日期前一天
Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM));
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//获取区直部门列表
List<DimDepartmentDTO> departmentList = dimDepartmentService.getDistrictDepByCustomer(customerId);
//区直部门数据初始化
List<FactIndexGovrnAblityDeptMonthlyEntity> list = departmentList.stream().map(department ->{
FactIndexGovrnAblityDeptMonthlyEntity entity = new FactIndexGovrnAblityDeptMonthlyEntity();
entity.setCustomerId(customerId);
entity.setAgencyId(department.getAgencyId());
entity.setDeptId(department.getId());
entity.setYearId(dimId.getYearId());
entity.setQuarterId(dimId.getQuarterId());
entity.setMonthId(dimId.getMonthId());
entity.setTransferedCount(NumConstant.ZERO);
entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO));
entity.setClosedProjectCount(NumConstant.ZERO);
entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO));
return entity;
}).collect(Collectors.toList());
//1.治理能力
//被吹哨次数统计
List<OrgStatisticsResultDTO> transferCount = factOriginProjectLogDailyService.getDepTransferCount(customerId, dimId.getMonthId(),
OrgTypeConstant.DISTRICT);
if (null != transferCount && !transferCount.isEmpty()) {
list.forEach(entity -> transferCount.stream().filter(dto -> dto.getOrgId().equals(entity.getDeptId())).forEach(count -> {
entity.setTransferedCount(count.getCount());
}));
}
//区直部门项目响应度
List<OrgStatisticsResultDTO> responsiveness = factOriginProjectOrgPeriodDailyDao.selectResponsiveness(customerId, dimId.getMonthId(),
OrgTypeConstant.DISTRICT, "dept");
if (null != responsiveness && !responsiveness.isEmpty()) {
list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getDeptId())).forEach(response -> {
if (response.getCount() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(response.getCount());
BigDecimal sum = new BigDecimal(response.getSum());
entity.setRespProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//TODO 区直部门办结项目满意度 暂时无法统计
factIndexGovrnAblityDeptMonthlyService.deleteByCustomer(customerId, dimId.getMonthId());
factIndexGovrnAblityDeptMonthlyService.insertBatch(list);
}
}
} }

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java

@ -1,11 +1,8 @@
package com.epmet.service.evaluationindex.indexcoll.impl; package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant; import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO;
@ -13,13 +10,13 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthly
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectOrgPeriodDailyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.IndexCollStreetService; import com.epmet.service.evaluationindex.indexcoll.IndexCollStreetService;
import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; import com.epmet.service.stats.FactArticlePublishedAgencyDailyService;
import com.epmet.util.DimIdGenerator; import com.epmet.util.DimIdGenerator;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -38,7 +35,6 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
@Slf4j @Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class IndexCollStreetServiceImpl implements IndexCollStreetService { public class IndexCollStreetServiceImpl implements IndexCollStreetService {
@Autowired @Autowired
private DimAgencyService dimAgencyService; private DimAgencyService dimAgencyService;
@ -47,7 +43,7 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
@Autowired @Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService; private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired @Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; private FactOriginProjectOrgPeriodDailyService factOriginProjectOrgPeriodDailyService;
@Autowired @Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService; private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired @Autowired
@ -58,7 +54,7 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
@Override @Override
public void saveStreetAbility(String customerId, String dateId) { public void saveStreetAbility(String customerId, String dateId) {
//当前日期前一天 //当前日期前一天
Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD)); Date date = DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMM);
//获取日期相关维度 //获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//获取社区列表 //获取社区列表
@ -96,7 +92,7 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
} }
//社区项目响应度 //社区项目响应度
List<OrgStatisticsResultDTO> responsiveness = factOriginProjectOrgPeriodDailyDao.selectResponsiveness(customerId, dimId.getMonthId(), List<OrgStatisticsResultDTO> responsiveness = factOriginProjectOrgPeriodDailyService.getResponsiveness(customerId, dimId.getMonthId(),
OrgTypeConstant.STREET, OrgTypeConstant.AGENCY); OrgTypeConstant.STREET, OrgTypeConstant.AGENCY);
if (null != responsiveness && !responsiveness.isEmpty()) { if (null != responsiveness && !responsiveness.isEmpty()) {
list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> { list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> {
@ -115,7 +111,7 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
if (sa.getCount() != NumConstant.ZERO) { if (sa.getCount() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(sa.getCount()); BigDecimal count = new BigDecimal(sa.getCount());
BigDecimal sum = new BigDecimal(sa.getSum()); BigDecimal sum = new BigDecimal(sa.getSum());
entity.setOverdueProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); entity.setSatisfactionRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP));
} }
})); }));
} }
@ -123,18 +119,19 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month"); Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> responseMap = factOriginProjectLogDailyService.getAgencyResponseRatio(customerId,dimId.getMonthId(),"month"); Map<String,BigDecimal> responseMap = factOriginProjectLogDailyService.getAgencyResponseRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{ list.forEach(entity ->{
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId())); entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
BigDecimal element = entity.getClosedProjectRatio(); BigDecimal element = entity.getClosedProjectRatio();
if (entity.getTransferedCount() != NumConstant.ZERO) {
//办结率 //办结率
entity.setClosedProjectRatio( entity.setClosedProjectRatio(
element.divide(new BigDecimal(entity.getTransferedCount()), NumConstant.SIX, RoundingMode.HALF_UP) element.divide(new BigDecimal(entity.getTransferedCount()), NumConstant.SIX, RoundingMode.HALF_UP)
); );
}
//响应度 //响应度
entity.setRespProjectRatio(responseMap.get(entity.getAgencyId()));
}); });
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET); factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET);
factIndexGovrnAblityOrgMonthlyService.insertBatch(list); factIndexGovrnAblityOrgMonthlyService.saveList(list);
//2.党建能力 //2.党建能力
@ -159,6 +156,6 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
})); }));
} }
factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET); factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET);
factIndexPartyAblityOrgMonthlyService.insertBatch(partyList); factIndexPartyAblityOrgMonthlyService.saveList(partyList);
} }
} }

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java

@ -110,4 +110,14 @@ public interface DimDepartmentService extends BaseService<DimDepartmentEntity> {
DimDepartmentEntity getLatestCreatedDimEntity(); DimDepartmentEntity getLatestCreatedDimEntity();
DimDepartmentEntity getLatestUpdatedDimEntity(); DimDepartmentEntity getLatestUpdatedDimEntity();
/**
* 获取区直部门列表
* @author zhaoqifeng
* @date 2020/9/21 14:50
* @param customerId
* @return java.util.List<com.epmet.dto.stats.DimDepartmentDTO>
*/
List<DimDepartmentDTO> getDistrictDepByCustomer(String customerId);
} }

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java

@ -18,9 +18,11 @@
package com.epmet.service.stats; package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.stats.FactArticlePublishedDepartmentDailyDTO;
import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity;
import java.util.Collection; import java.util.Collection;
import java.util.List;
/** /**
* 文章发布数量部门日统计表 * 文章发布数量部门日统计表
@ -41,4 +43,14 @@ public interface FactArticlePublishedDepartmentDailyService extends BaseService<
*/ */
boolean deleteAndInsertBatch(String customerId, String dateId, Collection<FactArticlePublishedDepartmentDailyEntity> values); boolean deleteAndInsertBatch(String customerId, String dateId, Collection<FactArticlePublishedDepartmentDailyEntity> values);
/**
* 获取区直部门文章数量
* @author zhaoqifeng
* @date 2020/9/20 22:49
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO>
*/
List<FactArticlePublishedDepartmentDailyDTO> getDeptCount(String customerId, String monthId);
} }

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java

@ -158,4 +158,9 @@ public class DimDepartmentServiceImpl extends BaseServiceImpl<DimDepartmentDao,
public DimDepartmentEntity getLatestUpdatedDimEntity() { public DimDepartmentEntity getLatestUpdatedDimEntity() {
return baseDao.getLatestUpdatedDimEntity(); return baseDao.getLatestUpdatedDimEntity();
} }
@Override
public List<DimDepartmentDTO> getDistrictDepByCustomer(String customerId) {
return baseDao.getDistrictDepByCustomer(customerId);
}
} }

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java

@ -21,6 +21,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.stats.FactArticlePublishedDepartmentDailyDao; import com.epmet.dao.stats.FactArticlePublishedDepartmentDailyDao;
import com.epmet.dto.stats.FactArticlePublishedDepartmentDailyDTO;
import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity;
import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService; import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -28,6 +29,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.Collection; import java.util.Collection;
import java.util.List;
/** /**
* 文章发布数量部门日统计表 * 文章发布数量部门日统计表
@ -51,4 +53,9 @@ public class FactArticlePublishedDepartmentDailyServiceImpl extends BaseServiceI
this.insertBatch(values, 100); this.insertBatch(values, 100);
return true; return true;
} }
@Override
public List<FactArticlePublishedDepartmentDailyDTO> getDeptCount(String customerId, String monthId) {
return baseDao.selectDeptCount(customerId, monthId);
}
} }

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

@ -79,7 +79,7 @@ public class BatchScoreCalculator {
result.setDetails(new ArrayList<>()); result.setDetails(new ArrayList<>());
scoreCountOfSamples.put(sampleId, result); scoreCountOfSamples.put(sampleId, result);
} }
IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), normalizeValue, idx.getWeight()); IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), String.valueOf(vo.getSampleValue()), normalizeValue, idx.getWeight());
result.getDetails().add(sampleScore); result.getDetails().add(sampleScore);
result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP));
} }

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java

@ -22,6 +22,10 @@ public class IndexScoreVo implements Serializable {
* 所有指标code拼接的字符串 冒号隔开 * 所有指标code拼接的字符串 冒号隔开
*/ */
private String allParentIndexCode; private String allParentIndexCode;
/**
* 参与计算的原始值
*/
private String originValue;
/** /**
* 分值 * 分值
*/ */

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -48,7 +48,7 @@
SELECT SELECT
f.CUSTOMER_ID, f.CUSTOMER_ID,
f.ORG_ID AS "agencyId", f.ORG_ID AS "agencyId",
SUM( PERIOD_TILL_REPLY_FIRSTLY ) AS "sum", SUM( TOTAL_PERIOD ) AS "sum",
COUNT( f.ID ) AS "count" COUNT( f.ID ) AS "count"
FROM FROM
fact_origin_project_org_period_daily f fact_origin_project_org_period_daily f
@ -57,7 +57,7 @@
WHERE WHERE
f.ORG_TYPE = #{orgType} f.ORG_TYPE = #{orgType}
AND DATE_FORMAT(INFORMED_DATE, '%Y%m') = #{monthId} AND DATE_FORMAT(INFORMED_DATE, '%Y%m') = #{monthId}
AND PERIOD_TILL_REPLY_FIRSTLY != 0 AND TOTAL_PERIOD != 0
AND f.CUSTOMER_ID = #{customerId} AND f.CUSTOMER_ID = #{customerId}
GROUP BY GROUP BY
f.CUSTOMER_ID, f.CUSTOMER_ID,

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml

@ -5,7 +5,7 @@
<!-- 【街道】中间表插入 --> <!-- 【街道】中间表插入 -->
<insert id="insertStreetRecord"> <insert id="insertStreetRecord">
INSERT INTO fact_index_agency_sub_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, INSERT INTO fact_index_agency_sub_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, ORIGIN_VALUE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE,
WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES VALUES
<foreach collection="lists" item="item" separator=","> <foreach collection="lists" item="item" separator=",">
@ -18,6 +18,7 @@
#{item.quarterId}, #{item.quarterId},
#{item.monthId}, #{item.monthId},
#{item.dataType}, #{item.dataType},
#{item.originValue},
#{item.score}, #{item.score},
#{item.indexCode}, #{item.indexCode},
#{item.allParentIndexCode}, #{item.allParentIndexCode},

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml

@ -5,7 +5,7 @@
<!-- 党建能力【社区】中间表插入 --> <!-- 党建能力【社区】中间表插入 -->
<insert id="insertCommunityPartyRecord"> <insert id="insertCommunityPartyRecord">
INSERT INTO fact_index_community_sub_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, INSERT INTO fact_index_community_sub_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, ORIGIN_VALUE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE,
WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES VALUES
<foreach collection="lists" item="item" separator=","> <foreach collection="lists" item="item" separator=",">
@ -17,6 +17,7 @@
#{item.yearId}, #{item.yearId},
#{item.quarterId}, #{item.quarterId},
#{item.monthId}, #{item.monthId},
#{item.originValue},
#{item.score}, #{item.score},
#{item.indexCode}, #{item.indexCode},
#{item.allParentIndexCode}, #{item.allParentIndexCode},

19
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml

@ -14,24 +14,9 @@
</if> </if>
</delete> </delete>
<resultMap type="com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity" id="cpcScoreMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="userId" column="USER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="getPartScore" resultType="com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity"> <select id="getPartScore" resultType="com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity">
select select
CUSTOMER_ID,AGENCY_ID,GRID_ID,YEAR_ID,MONTH_ID,USER_ID,SCORE,INDEX_CODE FROM fact_index_cpc_sub_score CUSTOMER_ID,AGENCY_ID,GRID_ID,YEAR_ID,MONTH_ID,USER_ID,ORIGIN_VALUE,SCORE,INDEX_CODE FROM fact_index_cpc_sub_score
WHERE WHERE
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
and MONTH_ID = #{monthId,jdbcType=VARCHAR} and MONTH_ID = #{monthId,jdbcType=VARCHAR}
@ -110,6 +95,7 @@
`YEAR_ID`, `YEAR_ID`,
`MONTH_ID`, `MONTH_ID`,
`USER_ID`, `USER_ID`,
`ORIGIN_VALUE`,
`SCORE`, `SCORE`,
`INDEX_CODE`, `INDEX_CODE`,
`ALL_PARENT_INDEX_CODE`, `ALL_PARENT_INDEX_CODE`,
@ -131,6 +117,7 @@
#{item.yearId}, #{item.yearId},
#{item.monthId}, #{item.monthId},
#{item.userId}, #{item.userId},
#{item.originValue},
#{item.score}, #{item.score},
#{item.indexCode}, #{item.indexCode},
#{item.allParentIndexCode}, #{item.allParentIndexCode},

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml

@ -13,6 +13,7 @@
QUARTER_ID, QUARTER_ID,
YEAR_ID, YEAR_ID,
MONTH_ID, MONTH_ID,
ORIGIN_VALUE,
SCORE, SCORE,
INDEX_CODE, INDEX_CODE,
ALL_PARENT_INDEX_CODE, ALL_PARENT_INDEX_CODE,
@ -33,6 +34,7 @@
#{item.quarterId}, #{item.quarterId},
#{item.yearId}, #{item.yearId},
#{item.monthId}, #{item.monthId},
#{item.originValue},
#{item.score}, #{item.score},
#{item.indexCode}, #{item.indexCode},
#{item.allParentIndexCode}, #{item.allParentIndexCode},

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml

@ -14,6 +14,7 @@
`QUARTER_ID`, `QUARTER_ID`,
`YEAR_ID`, `YEAR_ID`,
`MONTH_ID`, `MONTH_ID`,
`ORIGIN_VALUE`,
`SCORE`, `SCORE`,
`INDEX_CODE`, `INDEX_CODE`,
ALL_PARENT_INDEX_CODE, ALL_PARENT_INDEX_CODE,
@ -36,6 +37,7 @@
#{item.quarterId}, #{item.quarterId},
#{item.yearId}, #{item.yearId},
#{item.monthId}, #{item.monthId},
#{item.originValue},
#{item.score}, #{item.score},
#{item.indexCode}, #{item.indexCode},
#{item.allParentIndexCode}, #{item.allParentIndexCode},

12
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml

@ -52,4 +52,16 @@
order by UPDATED_TIME desc order by UPDATED_TIME desc
limit 1 limit 1
</select> </select>
<select id="getDistrictDepByCustomer" resultType="com.epmet.dto.stats.DimDepartmentDTO">
SELECT
dd.ID,
dd.CUSTOMER_ID,
dd.AGENCY_ID
FROM
dim_department dd
INNER JOIN dim_agency da ON dd.AGENCY_ID = da.ID
AND da.`LEVEL` = 'district'
WHERE
dd.CUSTOMER_ID = #{customerId}
</select>
</mapper> </mapper>

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml

@ -31,7 +31,8 @@
MAX(f.ARTICLE_TOTAL_COUNT) AS "articleTotalCount" MAX(f.ARTICLE_TOTAL_COUNT) AS "articleTotalCount"
FROM FROM
fact_article_published_agency_daily f fact_article_published_agency_daily f
INNER JOIN dim_agency da ON da.CUSTOMER_ID = #{customerId} INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.CUSTOMER_ID = #{customerId}
AND da.`LEVEL` = #{level} AND da.`LEVEL` = #{level}
WHERE WHERE
f.MONTH_ID = #{monthId} f.MONTH_ID = #{monthId}

13
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml

@ -25,6 +25,19 @@
<delete id="deleteByDateId"> <delete id="deleteByDateId">
DELETE FROM fact_article_published_department_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} DELETE FROM fact_article_published_department_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR}
</delete> </delete>
<select id="selectDeptCount" resultType="com.epmet.dto.stats.FactArticlePublishedDepartmentDailyDTO">
SELECT
f.DEPARTMENT_ID,
MAX(f.ARTICLE_TOTAL_COUNT) AS "articleTotalCount"
FROM
fact_article_published_department_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.CUSTOMER_ID = #{customerId}
AND da.`LEVEL` = 'district'
WHERE
f.MONTH_ID = #{monthId}
GROUP BY f.DEPARTMENT_ID
</select>
</mapper> </mapper>
Loading…
Cancel
Save