Browse Source

治理能力统计

master
zhaoqifeng 5 years ago
parent
commit
55844b307f
  1. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  2. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java
  3. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java
  4. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectOrgPeriodDailyService.java
  5. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java
  6. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java
  7. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectMainDailyServiceImpl.java
  8. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectOrgPeriodDailyServiceImpl.java
  9. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyService.java
  10. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java
  11. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java
  12. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java
  13. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityDeptMonthlyServiceImpl.java
  14. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java
  15. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java
  16. 30
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java
  17. 92
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictDepartmentServiceImpl.java
  18. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java
  19. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java
  20. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java
  21. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java
  22. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java
  23. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  24. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml
  25. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml
  26. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml

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/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);
} }

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);
}

8
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从统计库对象抽取指标数据
@ -109,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);
}
}

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);
}
} }

30
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( //办结率
element.divide(new BigDecimal(entity.getTransferedCount()), NumConstant.SIX, RoundingMode.HALF_UP) entity.setClosedProjectRatio(
); 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);
}
}
} }

31
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( //办结率
element.divide(new BigDecimal(entity.getTransferedCount()), NumConstant.SIX, RoundingMode.HALF_UP) entity.setClosedProjectRatio(
); 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);
}
} }

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,

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