Browse Source

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

# Conflicts:
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
#	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectMainDailyService.java
#	epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
dev_shibei_match
yinzuomei 5 years ago
parent
commit
ddbd1d1421
  1. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java
  2. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridHeartedFormDTO.java
  3. 41
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/ExtractGroupMemberActionRecordResultDTO.java
  4. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/FinishOrgDTO.java
  5. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java
  6. 36
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridAttributesResultDTO.java
  7. 30
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/FactExtractOpenFeignClient.java
  8. 184
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/FactExtractOpenFeignClientFallBack.java
  9. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java
  10. 75
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  11. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  12. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  13. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java
  14. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java
  15. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java
  16. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java
  17. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java
  18. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java
  19. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  20. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java
  21. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java
  22. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectMainDailyService.java
  23. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java
  24. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginExtractServiceImpl.java
  25. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java
  26. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectMainDailyServiceImpl.java
  27. 116
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java
  28. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectExtractServiceImpl.java
  29. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java
  30. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java
  31. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java
  32. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollStreetService.java
  33. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java
  34. 96
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java
  35. 93
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java
  36. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java
  37. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java
  38. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java
  39. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java
  40. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java
  41. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java
  42. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java
  43. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java
  44. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  45. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  46. 178
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  47. 33
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  48. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  49. 34
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  50. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml
  51. 58
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml
  52. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml
  53. 15
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml
  54. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml
  55. 33
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml
  56. 23
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java
  57. 30
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java
  58. 48
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java

@ -18,7 +18,11 @@
package com.epmet.dto.extract;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import lombok.Data;
@ -146,4 +150,6 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审
*/
private Date updatedTime;
private List<ExtractGroupMemberActionRecordResultDTO> members = new ArrayList();
}

20
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridHeartedFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.extract.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @ClassName GridHeartedFormDTO
* @Auth wangc
* @Date 2020-09-20 12:42
*/
@Data
public class GridHeartedFormDTO implements Serializable {
private static final long serialVersionUID = 9069263069122734316L;
private String userId;
private String gridId;
}

41
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/ExtractGroupMemberActionRecordResultDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.group.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
* @ClassName ExtractGroupMemberActionRecordResultDTO
* @Auth wangc
* @Date 2020-09-18 21:18
*/
@Data
public class ExtractGroupMemberActionRecordResultDTO implements Serializable {
private static final long serialVersionUID = -74883228267461785L;
private String customerId;
private String groupId;
private String memberId;
private String leaderFlag;
private String dateId;
private String weekId;
private String monthId;
private String quarterId;
private String yearId;
private Date joinDate;
/**
* 目前只有join leader也是join
* */
private String actionCode;
}

20
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/FinishOrgDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.project;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/20 21:08
*/
@Data
public class FinishOrgDTO implements Serializable {
private static final long serialVersionUID = -5684606755705833962L;
private String projectId;
private String orgIdPath;
private String pIdPath;
}

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java

@ -86,4 +86,10 @@ public class ProjectOrgPeriodResultDTO implements Serializable {
* */
private Date periodTillReplyFirstly;
private String customerId;
private String staffId;
private String isResolved;
}

36
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridAttributesResultDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.stats.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @ClassName GridAttributesResultDTO
* @Auth wangc
* @Date 2020-09-20 12:50
*/
@Data
public class GridAttributesResultDTO implements Serializable {
private static final long serialVersionUID = 466974582608407121L;
/**
* 网格ID
*/
private String gridId;
/**
* 网格所属机关ID
*/
private String agencyId;
/**
* 机关的上级ID
*/
private String parentId;
/**
* 所有上级Id
* */
private String pids;
}

30
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/FactExtractOpenFeignClient.java

@ -0,0 +1,30 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.feign.impl.FactExtractOpenFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* desc: 数据抽取 对外feign client
*
* @return:
* @date: 2020/6/22 17:39
* @author: jianjun liu
*/
@FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallback = FactExtractOpenFeignClientFallBack.class)
public interface FactExtractOpenFeignClient {
/**
* desc: 抽取业务数据到统计库 小组 话题 议题 项目
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@PostMapping(value = "data/stats/factorigin/extractall")
Result extractall(@RequestBody(required = false) ExtractFormDTO formDTO);
}

184
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/FactExtractOpenFeignClientFallBack.java

@ -0,0 +1,184 @@
package com.epmet.feign.impl;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.group.form.GroupStatsFormDTO;
import com.epmet.dto.issue.form.IssueJobFromDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import org.springframework.stereotype.Component;
/**
* desc:
*
* @return:
* @date: 2020/6/22 9:38
* @author: jianjun liu
* email:liujianjun@git.elinkit.com.cn
*/
@Component
public class FactExtractOpenFeignClientFallBack implements DataStatisticalOpenFeignClient {
/**
* desc: 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result articleSummaryDailyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "articleSummaryDailyStatsjob", formDTO);
}
/**
* desc: 定时任务 统计文章总数及在线文章总数 包含 机关 部门 网格
*
* @return:
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedDailyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedDailyStatsjob", formDTO);
}
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedMonthlyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedMonthlyStatsjob", formDTO);
}
/**
* desc: 统计发表文章最多的分类 包含 机关 部门 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagUsedQuarterlyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedQuarterlyStatsjob", formDTO);
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedDailyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedDailyStatsjob", formDTO);
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedMonthlyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedMonthlyStatsjob", formDTO);
}
/**
* desc: 统计阅读最多的标签 包含 机关 网格
*
* @param formDTO
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result tagViewedQuarterlyStatsjob(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedQuarterlyStatsjob", formDTO);
}
@Override
public Result groupGridDaily(GroupStatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupGridDaily", formDTO);
}
@Override
public Result groupAgencyDaily(GroupStatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyDaily", formDTO);
}
@Override
public Result groupAgencyMonthly(GroupStatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyMonthly", formDTO);
}
@Override
public Result agencyGridIssueStats() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStats");
}
@Override
public Result agencyGridIssueStatsOfDate(IssueJobFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStatsOfDate");
}
/**
* @Description 数据统计-项目-机关日月统计
* @Author sun
*/
@Override
public Result agencyProjectStats(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyProjectStats", formDTO);
}
/**
* @Description 数据统计-项目-网格日月统计
* @Author sun
*/
@Override
public Result gridProjectStats(StatsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridProjectStats", formDTO);
}
@Override
public Result initAllDims() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initAllDims");
}
/**
* @param
* @return
* @Description 执行用户统计
* @author wangc
* @date 2020.06.29 09:26
**/
@Override
public Result execUserStatistical(String date) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execUserStatistical", date);
}
/**
* @param
* @return
* @Description 执行话题统计
* @author wangc
* @date 2020.06.29 09:27
**/
@Override
public Result execTopicStatistical(String date) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execTopicStatistical", date);
}
@Override
public Result getPartyInfo(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPartyInfo", customerIdAndDateIdFormDTO);
}
@Override
public Result processPenddingCalculate() {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "processPenddingCalculate");
}
}

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

@ -4,10 +4,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.service.evaluationindex.extract.FactOriginExtractService;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.IssueExtractService;
import com.epmet.service.evaluationindex.extract.ProjectExtractService;
import com.epmet.service.evaluationindex.extract.*;
import com.epmet.util.DimIdGenerator;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -36,11 +33,13 @@ public class FactOriginController {
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private ProjectExtractService projectExtractService;
@Autowired
private GroupExtractService groupExtractService;
/**
* desc:
* desc:抽取业务数据到统计库
*
* @param extractFormDTO
* @param extractFormDTO 默认统计前一天
* @return
*/
@PostMapping("extractall")
@ -107,4 +106,30 @@ public class FactOriginController {
projectExtractService.saveOriginProjectDaily(extractFormDTO);
return new Result();
}
/**
* @Description 项目节点历时数据清洗
* @param param
* @return
* @author wangc
* @date 2020.09.20 16:11
**/
@PostMapping("projectorgperiodcleanning")
public Result projectOrgPeriodCleaning(@RequestBody ExtractFormDTO param){
projectExtractService.extractProjectPeriodData(param);
return new Result();
}
/**
* @Description 小组数据清洗
* @param
* @return
* @author wangc
* @date 2020.09.20 16:11
**/
@PostMapping("groupdatacleaning")
public Result groupDataCleaning(@RequestBody ExtractFormDTO param){
groupExtractService.extractGroupData(param);
return new Result();
}
}

75
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java

@ -19,6 +19,9 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -43,6 +46,78 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
*/
List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 查询是否存在该客户下的数据
* @param customerId
* @return
* @author wangc
* @date 2020.09.18 23:30
**/
int selectIfExist(@Param("customerId")String customerId);
/**
* @Description 按照客户Id清除组数据
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 09:58
**/
void deleteBatchByCustomerId(@Param("customerId")String customerId);
/**
* @Description 按照客户Id清除组员数据
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 09:58
**/
void deleteBatchMemberByCustomerId(@Param("customerId")String customerId);
/**
* @Description 按照组Id清除组和组员数据
* @param list
* @return
* @author wangc
* @date 2020.09.20 12:16
**/
void deleteBatchByGroupId(@Param("list") List<String> list);
/**
* @Description 更新群主的党员信息
* @param list
* @return
* @author wangc
* @date 2020.09.20 12:44
**/
int updatePartyFlag(@Param("list") List<String> list);
/**
* @Description 更新群主的热心居民信息
* @param list
* @return
* @author wangc
* @date 2020.09.20 12:44
**/
int updateHeartedFlag(@Param("list") List<GridHeartedFormDTO> list);
/**
* @Description 批量插入组主表
* @param list
* @return
* @author wangc
* @date 2020.09.20 15:37
**/
int insertBatchMain(@Param("list") List<FactOriginGroupMainDailyDTO> list);
/**
* @Description 批量插入组员表
* @param list
* @return
* @author wangc
* @date 2020.09.20 15:37
**/
int insertBatchMembers(List<ExtractGroupMemberActionRecordResultDTO> list);
/**
* @param customerId
* @param groupOwnerId

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java

@ -40,11 +40,13 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
* 机关被吹哨次数
* @author zhaoqifeng
* @date 2020/9/18 14:46
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectAgencyTransferCount(@Param("monthId") String monthId, @Param("level")String level);
List<OrgStatisticsResultDTO> selectAgencyTransferCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level);
/**
* @Description 查询未被退回的项目数
@ -77,8 +79,21 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
* 根据日期删除数据
* @author zhaoqifeng
* @date 2020/9/18 17:32
* @param customerId
* @param date
* @return void
*/
void deleteByDate(@Param("date") String date);
void deleteByDate(@Param("customerId") String customerId, @Param("date") String date);
/**
* 办结项目满意度
* @author zhaoqifeng
* @date 2020/9/20 16:44
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -59,10 +59,11 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* 项目超期数
* @author zhaoqifeng
* @date 2020/9/18 16:28
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOverdueCount(@Param("monthId") String monthId);
List<OrgStatisticsResultDTO> selectOverdueCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @Description 网格办结项目数
@ -78,9 +79,11 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* 根据日期删除数据
* @author zhaoqifeng
* @date 2020/9/18 17:32
* @param customerId
* @param date
* @return void
*/
void deleteByDate(@Param("customerId") String customerId, @Param("date") String date);
void deleteByDate(@Param("date") String date);
/**

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -55,13 +56,16 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginPr
* 获取项目响应度
* @author zhaoqifeng
* @date 2020/9/18 15:52
* @param customerId
* @param monthId
* @param level
* @param orgType
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
// List<OrgStatisticsResultDTO> selectResponsiveness(@Param("monthId") String monthId, @Param("level")String level,
// @Param("orgType")String orgType);
List<OrgStatisticsResultDTO> selectResponsiveness(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level,
@Param("orgType")String orgType);
void deleteByProjectId(@Param("list") List<String> list);
/**

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java

@ -66,4 +66,15 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao<FactIndexGovr
* @date 2020/8/26 1:40 下午
*/
List<Map<String,Object>> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level);
/**
* 根据组织类型删除数据
* @author zhaoqifeng
* @date 2020/9/20 20:52
* @param customerId
* @param monthId
* @param type
* @return java.lang.Integer
*/
Integer deleteByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("type") String type);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java

@ -1,5 +1,6 @@
package com.epmet.dao.group;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.group.form.GridGroupPeopleFormDTO;
import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO;
import com.epmet.dto.group.form.GridGroupTotalFormDTO;
@ -80,4 +81,13 @@ public interface GroupDataDao {
* @author zxc
*/
List<GroupPeopleCountResultDTO> getAgencyGrid(@Param("gridIds")List<String> gridIds);
/**
* @Description 抽取小组数据
* @param customerId
* @return
* @author wangc
* @date 2020.09.18 22:45
**/
List<FactOriginGroupMainDailyDTO> groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java

@ -18,6 +18,7 @@
package com.epmet.dao.project;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
@ -109,7 +110,7 @@ public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
* @date 2020/9/18 18:01
* @param customerId
* @param date
* @return java.util.List<com.epmet.entity.project.ProjectProcessEntity>
* @return java.util.List<com.epmet.dto.project.FinishOrgDTO>
*/
List<ProjectProcessEntity> selectFinishOrg(@Param("customerId") String customerId, @Param("date") String date);
List<FinishOrgDTO> selectFinishOrg(@Param("customerId") String customerId, @Param("date") String date);
}

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

@ -135,4 +135,14 @@ public interface DimAgencyDao extends BaseDao<DimAgencyEntity> {
* @date 2020/9/15 6:15 下午
*/
List<AgencyInfoResultDTO> selectAgencyInfo(@Param("agencyIds")List<String> agencyIds);
/**
* 根据级别获取组织信息
* @author zhaoqifeng
* @date 2020/9/20 17:31
* @param customerId
* @param level
* @return java.util.List<com.epmet.dto.stats.DimAgencyDTO>
*/
List<DimAgencyDTO> selectDimAgencyByLevel(@Param("customerId")String customerId, @Param("level")String level);
}

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

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridInfoResultDTO;
import com.epmet.dto.group.result.SubAgencyIdResultDTO;
import com.epmet.dto.stats.result.GridAttributesResultDTO;
import com.epmet.dto.stats.result.GridBelongAgencyResultDTO;
import com.epmet.entity.stats.DimGridEntity;
import org.apache.ibatis.annotations.Mapper;
@ -69,4 +70,13 @@ public interface DimGridDao extends BaseDao<DimGridEntity> {
* @date 2020/9/17 2:34 下午
*/
List<GridBelongAgencyResultDTO> selectGridBelongAgencyInfo(@Param("gridIds") List<String> gridIds);
/**
* @Description 查询网格的所有所属上级属性
* @param gridIds
* @return
* @author wangc
* @date 2020.09.20 13:01
**/
List<GridAttributesResultDTO> selectGridAttributes(@Param("gridIds") List<String> gridIds);
}

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java

@ -1,5 +1,6 @@
package com.epmet.dao.user;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.result.UserPartyResultDTO;
import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO;
import org.apache.ibatis.annotations.Mapper;
@ -105,5 +106,9 @@ public interface UserDao {
* @author zxc
* @date 2020/9/15 4:23 下午
*/
List<UserPartyResultDTO> selectUserIsParty(@Param("userIds") List<String> userIds);;
List<UserPartyResultDTO> selectUserIsParty(@Param("userIds") List<String> userIds);
List<String> selectPartymembersByCustomerId(@Param("customerId")String customerId);
List<GridHeartedFormDTO> selectWarmHeartedByCustomerId(@Param("customerId")String customerId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java

@ -83,7 +83,7 @@ public class FactOriginProjectOrgPeriodDailyEntity extends BaseEpmetEntity {
/**
* 截至第一次响应时长从流转到第一次处理(响应结案流转)耗时大于等于上一项值
*/
private Integer periodTillReplyFirstly;
private Date periodTillReplyFirstly;
/**
* resloved unresolved

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java

@ -101,11 +101,12 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
* 机关被吹哨次数
* @author zhaoqifeng
* @date 2020/9/18 14:53
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getAgencyTransferCount(String monthId, String level);
List<OrgStatisticsResultDTO> getAgencyTransferCount(String customerId, String monthId, String level);
/**
* @Description 查询未被退回的项目数
@ -129,10 +130,11 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
* 根据日期删除数据
* @author zhaoqifeng
* @date 2020/9/18 17:30
* @param customerId
* @param date
* @return void
*/
void deleteByDate(String date);
void deleteByDate(String customerId, String date);
/**
* @Description 网格项目自治率查询
@ -142,4 +144,15 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
* @date 2020/9/18 5:25 下午
*/
List<AutoNoMyResultDTO> selectProjectAutoNoMy(String customerId,String monthId);
/**
* 办结项目满意度
* @author zhaoqifeng
* @date 2020/9/20 16:43
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getSatisfaction(String customerId, String monthId, String level);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectMainDailyService.java

@ -127,18 +127,21 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* 项目超期数
* @author zhaoqifeng
* @date 2020/9/18 16:29
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOverdueCount(String monthId);
List<OrgStatisticsResultDTO> getOverdueCount(String customerId, String monthId);
/**
* 根据日期删除数据
* @author zhaoqifeng
* @date 2020/9/18 17:30
* @param customerId
* @param date
* @return void
*/
void deleteByDate(String customerId, String date);
void deleteByDate(String date);
/**

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

@ -4,6 +4,8 @@ import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import java.util.List;
import com.epmet.dto.extract.form.ExtractFormDTO;
/**
* @Desc 业务数据抽取 - 组相关
* @Author wangc
@ -20,4 +22,13 @@ public interface GroupExtractService {
*/
List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(String customerId,String monthId);
/**
* @Description 业务抽取 - 小组祥光
* @param param
* @return
* @author wangc
* @date 2020.09.18 21:07
**/
void extractGroupData(ExtractFormDTO param);
}

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

@ -4,10 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.service.evaluationindex.extract.FactOriginExtractService;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.IssueExtractService;
import com.epmet.service.evaluationindex.extract.ProjectExtractService;
import com.epmet.service.evaluationindex.extract.*;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.util.DimIdGenerator;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
@ -42,6 +39,8 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
private ProjectExtractService projectExtractService;
@Autowired
private DimCustomerService dimCustomerService;
@Autowired
private GroupExtractService groupExtractService;
@Override
@ -74,6 +73,13 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
}
private void submitJob(ExtractFormDTO param) {
threadPool.submit(() -> {
try {
groupExtractService.extractGroupData(param);
} catch (Exception e) {
log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
});
threadPool.submit(() -> {
try {
factOriginTopicMainDailyService.topicCleaning(param);

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

@ -102,8 +102,8 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
}
@Override
public List<OrgStatisticsResultDTO> getAgencyTransferCount(String monthId, String level) {
return baseDao.selectAgencyTransferCount(monthId, level);
public List<OrgStatisticsResultDTO> getAgencyTransferCount(String customerId, String monthId, String level) {
return baseDao.selectAgencyTransferCount(customerId, monthId, level);
}
/**
@ -131,8 +131,8 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
}
@Override
public void deleteByDate(String date) {
baseDao.deleteByDate(date);
public void deleteByDate(String customerId, String date) {
baseDao.deleteByDate(customerId, date);
}
/**
@ -147,4 +147,9 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
return baseDao.selectProjectAutoNoMy(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getSatisfaction(String customerId, String monthId, String level) {
return baseDao.selectSatisfaction(customerId, monthId, level);
}
}

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

@ -112,8 +112,8 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
}
@Override
public List<OrgStatisticsResultDTO> getOverdueCount(String monthId) {
return baseDao.selectOverdueCount(monthId);
public List<OrgStatisticsResultDTO> getOverdueCount(String customerId, String monthId) {
return baseDao.selectOverdueCount(customerId, monthId);
}
/**
@ -130,8 +130,8 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
}
@Override
public void deleteByDate(String date) {
baseDao.deleteByDate(date);
public void deleteByDate(String customerId, String date) {
baseDao.deleteByDate(customerId, date);
}
/**

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

@ -2,10 +2,34 @@ package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.dto.stats.result.GridAttributesResultDTO;
import com.epmet.service.evaluationindex.extract.GroupExtractService;
import com.epmet.service.group.GroupDataService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimGridService;
import com.epmet.service.user.UserService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.List;
@ -33,4 +57,96 @@ public class GroupExtractServiceImpl implements GroupExtractService {
public List<PartyCreateGroupCountResultDTO> selectPartyCreateGroupCount(String customerId, String monthId) {
return groupMainDailyDao.selectPartyCreateGroupCount(customerId, monthId);
}
@Autowired
private GroupDataService groupDataService;
@Autowired
private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao;
@Autowired
private UserService userService;
@Autowired
private DimGridService dimGridService;
/**
* @Description 业务抽取 - 小组祥光
* @param param
* @return
* @author wangc
* @date 2020.09.18 21:07
**/
@Override
public void extractGroupData(ExtractFormDTO param) {
int count = factOriginGroupMainDailyDao.selectIfExist(param.getCustomerId());
if(StringUtils.isBlank(param.getDateId())){
Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24);
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
param.setDateId(format.format(yesterday));
}
//原生数据,如果是首次,则为全部组,如果非首次,则只有新创建以及新进人的组
//但是每个组每天都要更新一次组长的身份信息
List<FactOriginGroupMainDailyDTO> originGroupData = groupDataService.extractGroupData(
count <= NumConstant.ZERO ? true : false,
param.getCustomerId(), param.getDateId());
List<ExtractGroupMemberActionRecordResultDTO> memberList = new LinkedList<>();
if (!CollectionUtils.isEmpty(originGroupData)) {
List<GridAttributesResultDTO> gridList = dimGridService.getGridAttributes(originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList()));
if (!CollectionUtils.isEmpty(gridList)) {
Map<String, GridAttributesResultDTO> gridMap =
gridList.stream().collect(Collectors.toMap(GridAttributesResultDTO::getGridId, Function.identity(), (key1, key2) -> key2));
if (!CollectionUtils.isEmpty(originGroupData)) {
originGroupData.forEach(group -> {
if (!CollectionUtils.isEmpty(group.getMembers())) {
group.setMemberTotal(group.getMembers().size());
group.getMembers().forEach(member -> {
DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(member.getJoinDate());
member.setDateId(dateInfo.getDateId());
member.setWeekId(dateInfo.getWeekId());
member.setMonthId(dateInfo.getMonthId());
member.setQuarterId(dateInfo.getQuarterId());
member.setYearId(dateInfo.getYearId());
memberList.add(member);
});
}
GridAttributesResultDTO attr = gridMap.get(group.getGridId());
if (null != attr) {
group.setAgencyId(attr.getAgencyId());
group.setParentId(attr.getParentId());
group.setPids(attr.getPids());
}
if(null != group.getCreatedTime()){
DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(group.getCreatedTime());
group.setDateId(dateInfo.getDateId());
group.setWeekId(dateInfo.getWeekId());
group.setMonthId(dateInfo.getMonthId());
group.setQuarterId(dateInfo.getQuarterId());
group.setYearId(dateInfo.getYearId());
}
});
}
if (count <= NumConstant.ZERO) {
//isFirst
factOriginGroupMainDailyDao.deleteBatchByCustomerId(param.getCustomerId());
factOriginGroupMainDailyDao.deleteBatchMemberByCustomerId(param.getCustomerId());
factOriginGroupMainDailyDao.insertBatchMain(originGroupData);
factOriginGroupMainDailyDao.insertBatchMembers(memberList);
} else {
factOriginGroupMainDailyDao.deleteBatchByGroupId(originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList()));
factOriginGroupMainDailyDao.insertBatchMembers(memberList);
}
}
List<String> partyIds = userService.getPartymembersByCustomerId(param.getCustomerId());
List<GridHeartedFormDTO> heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId());
factOriginGroupMainDailyDao.updatePartyFlag(partyIds);
factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds);
}
}
}

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

@ -11,6 +11,7 @@ import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.party.PartyMemberDTO;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
@ -75,6 +76,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
//获取已关闭项目列表
List<ProjectProcessEntity> closedList = projectProcessService.getClosedProjectList(customerId, dateString);
List<FactOriginProjectMainDailyDTO> pendingList = factOriginProjectMainDailyService.getPendingList(customerId);
List<FinishOrgDTO> finishOrgList= projectProcessService.getFinishOrg(customerId, dateString);
if (null != closedList && !closedList.isEmpty()) {
List<FactOriginProjectMainDailyEntity> closeProjects =
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
@ -85,6 +87,17 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setUpdatedTime(process.getUpdatedTime());
return entity;
})).collect(Collectors.toList());
if (null != finishOrgList && !finishOrgList.isEmpty()) {
closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> {
String[] orgIds = dto.getPIdPath().split(":");
if (orgIds.length > NumConstant.ONE) {
close.setFinishOrgIds(orgIds[orgIds.length - 1]);
} else {
close.setFinishOrgIds(orgIds[0]);
}
}));
}
//更新状态
if (!closeProjects.isEmpty()) {
factOriginProjectMainDailyService.updateBatchById(closeProjects);
@ -141,9 +154,17 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
list.forEach(entity -> partyMemberList.stream().filter(partyMemberDTO -> partyMemberDTO.getGridId().equals(entity.getGridId()) && partyMemberDTO.getUserId().equals(entity.getTopicCreatorId())).forEach(partyMember -> {
entity.setIsParty(NumConstant.ONE_STR);
}));
list.forEach(entity -> finishOrgList.stream().filter(finish -> entity.getId().equals(finish.getProjectId())).forEach(dto -> {
String[] orgIds = dto.getPIdPath().split(":");
if (orgIds.length > NumConstant.ONE) {
entity.setFinishOrgIds(orgIds[orgIds.length - 1]);
} else {
entity.setFinishOrgIds(orgIds[0]);
}
}));
//插入数据
if (!list.isEmpty()) {
factOriginProjectMainDailyService.deleteByDate(dateString);
factOriginProjectMainDailyService.deleteByDate(customerId, dateString);
factOriginProjectMainDailyService.insertBatch(list);
}
}
@ -222,7 +243,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}).collect(Collectors.toList()));
if (!logList.isEmpty()) {
factOriginProjectLogDailyService.deleteByDate(dateString);
factOriginProjectLogDailyService.deleteByDate(customerId, dateString);
factOriginProjectLogDailyService.insertBatch(logList);
}
}

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

@ -6,7 +6,6 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.service.evaluationindex.extract.ProjectPeriodExtractService;
import com.epmet.service.project.ProjectProcessService;

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

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

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java

@ -12,8 +12,20 @@ public interface IndexCollCommunityService {
*
* @author zhaoqifeng
* @date 2020/9/18 13:52
* @param
* @param customerId
* @param dateId
* @return void
*/
void saveCommunityAbility();
void saveCommunityAbility(String customerId, String dateId);
/**
* 社区党建能力统计
*
* @author zhaoqifeng
* @date 2020/9/18 13:52
* @param customerId
* @param dateId
* @return void
*/
void saveCommunityPartyAbility(String customerId, String dateId);
}

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

@ -7,4 +7,14 @@ package com.epmet.service.evaluationindex.indexcoll;
* @date 2020/9/18 10:35
*/
public interface IndexCollStreetService {
/**
* 街道治理能力统计
*
* @author zhaoqifeng
* @date 2020/9/18 13:52
* @param customerId
* @param dateId
* @return void
*/
void saveStreetAbility(String customerId, String dateId);
}

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

@ -0,0 +1,23 @@
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.FactIndexGovrnAblityOrgMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import org.springframework.stereotype.Service;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/20 20:29
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class FactIndexGovrnAblityOrgMonthlyServiceImpl extends BaseServiceImpl<FactIndexGovrnAblityOrgMonthlyDao, FactIndexGovrnAblityOrgMonthlyEntity> implements FactIndexGovrnAblityOrgMonthlyService {
@Override
public void deleteByCustomer(String customerId, String monthId, String type) {
baseDao.deleteByCustomer(customerId, monthId, type);
}
}

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

@ -1,21 +1,30 @@
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.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.IndexCollCommunityService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
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
@ -27,7 +36,9 @@ import java.util.List;
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class IndexCollCommunityServiceImpl implements IndexCollCommunityService {
@Autowired
private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao;
private DimAgencyService dimAgencyService;
@Autowired
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
@ -36,19 +47,90 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Override
public void saveCommunityAbility() {
public void saveCommunityAbility(String customerId, String dateId) {
//当前日期前一天
Date date = DateUtils.getBeforeDay(new Date());
Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD));
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//获取社区列表
List<DimAgencyDTO>agencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.COMMUNITY);
//社区数据初始化
List<FactIndexGovrnAblityOrgMonthlyEntity> list = agencyList.stream().map(agency ->{
FactIndexGovrnAblityOrgMonthlyEntity entity = new FactIndexGovrnAblityOrgMonthlyEntity();
entity.setCustomerId(customerId);
entity.setAgencyId(agency.getId());
entity.setParentId(agency.getPid());
entity.setYearId(dimId.getYearId());
entity.setQuarterId(dimId.getQuarterId());
entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.COMMUNITY);
entity.setTransferedCount(NumConstant.ZERO);
entity.setClosedProjectCount(NumConstant.ZERO);
entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO));
entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO));
return entity;
}).collect(Collectors.toList());
//被吹哨次数统计
List<OrgStatisticsResultDTO> transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(dimId.getMonthId(), "community");
List<OrgStatisticsResultDTO> transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(),
OrgTypeConstant.COMMUNITY);
if (null != transferCount && !transferCount.isEmpty()) {
list.forEach(entity -> transferCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(count -> {
entity.setTransferedCount(count.getCount());
}));
}
//社区项目响应度
// List<OrgStatisticsResultDTO> responsiveness = factOriginProjectOrgPeriodDailyDao.selectResponsiveness(dimId.getMonthId(), "community",
// "agency");
List<OrgStatisticsResultDTO> responsiveness = factOriginProjectOrgPeriodDailyDao.selectResponsiveness(customerId, dimId.getMonthId(),
OrgTypeConstant.COMMUNITY, OrgTypeConstant.AGENCY);
if (null != responsiveness && !responsiveness.isEmpty()) {
list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).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));
}
}));
}
//社区超期项目率
List<OrgStatisticsResultDTO> overdueCount = factOriginProjectMainDailyService.getOverdueCount(dimId.getMonthId());
List<OrgStatisticsResultDTO> overdueCount = factOriginProjectMainDailyService.getOverdueCount(customerId, dimId.getMonthId());
if (null != overdueCount && !overdueCount.isEmpty()) {
list.forEach(entity -> overdueCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(overdue -> {
if (overdue.getSum() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(overdue.getCount());
BigDecimal sum = new BigDecimal(overdue.getSum());
entity.setOverdueProjectRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//社区办结项目满意度
List<OrgStatisticsResultDTO> satisfaction = factOriginProjectLogDailyService.getSatisfaction(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY);
if (null != satisfaction && !satisfaction.isEmpty()) {
list.forEach(entity -> satisfaction.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(sa -> {
if (sa.getCount() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(sa.getCount());
BigDecimal sum = new BigDecimal(sa.getSum());
entity.setOverdueProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY);
factIndexGovrnAblityOrgMonthlyService.insertBatch(list);
}
@Override
public void saveCommunityPartyAbility(String customerId, String dateId) {
//当前日期前一天
Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD));
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//获取社区列表
List<DimAgencyDTO>agencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.COMMUNITY);
//获取社区发文数量
}
}

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

@ -1,11 +1,30 @@
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.utils.DateUtils;
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.DimAgencyDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.IndexCollStreetService;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
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
* @dscription
@ -15,4 +34,78 @@ import org.springframework.stereotype.Service;
@Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class IndexCollStreetServiceImpl implements IndexCollStreetService {
@Autowired
private DimAgencyService dimAgencyService;
@Autowired
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Override
public void saveStreetAbility(String customerId, String dateId) {
//当前日期前一天
Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD));
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date);
//获取社区列表
List<DimAgencyDTO>agencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.STREET);
//社区数据初始化
List<FactIndexGovrnAblityOrgMonthlyEntity> list = agencyList.stream().map(agency ->{
FactIndexGovrnAblityOrgMonthlyEntity entity = new FactIndexGovrnAblityOrgMonthlyEntity();
entity.setCustomerId(customerId);
entity.setAgencyId(agency.getId());
entity.setParentId(agency.getPid());
entity.setYearId(dimId.getYearId());
entity.setQuarterId(dimId.getQuarterId());
entity.setMonthId(dimId.getMonthId());
entity.setDataType(OrgTypeConstant.STREET);
entity.setTransferedCount(NumConstant.ZERO);
entity.setClosedProjectCount(NumConstant.ZERO);
entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO));
entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO));
entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO));
return entity;
}).collect(Collectors.toList());
//被吹哨次数统计
List<OrgStatisticsResultDTO> transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(),
OrgTypeConstant.STREET);
if (null != transferCount && !transferCount.isEmpty()) {
list.forEach(entity -> transferCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(count -> {
entity.setTransferedCount(count.getCount());
}));
}
//社区项目响应度
List<OrgStatisticsResultDTO> responsiveness = factOriginProjectOrgPeriodDailyDao.selectResponsiveness(customerId, dimId.getMonthId(),
OrgTypeConstant.STREET, OrgTypeConstant.AGENCY);
if (null != responsiveness && !responsiveness.isEmpty()) {
list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).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));
}
}));
}
//社区办结项目满意度
List<OrgStatisticsResultDTO> satisfaction = factOriginProjectLogDailyService.getSatisfaction(customerId, dimId.getMonthId(), OrgTypeConstant.STREET);
if (null != satisfaction && !satisfaction.isEmpty()) {
list.forEach(entity -> satisfaction.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(sa -> {
if (sa.getCount() != NumConstant.ZERO) {
BigDecimal count = new BigDecimal(sa.getCount());
BigDecimal sum = new BigDecimal(sa.getSum());
entity.setOverdueProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET);
factIndexGovrnAblityOrgMonthlyService.insertBatch(list);
}
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java

@ -1,5 +1,6 @@
package com.epmet.service.group;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.group.result.*;
import com.epmet.util.DimIdGenerator;
import org.apache.ibatis.annotations.Param;
@ -55,4 +56,14 @@ public interface GroupDataService {
*/
List<GroupPeopleCountResultDTO> getAgencyGrid(@Param("gridIds") List<String> gridIds);
/**
* @Description 业务抽取 - 小组数据
* @param isFirst
* @param customerId
* @return
* @author wangc
* @date 2020.09.18 22:52
**/
List<FactOriginGroupMainDailyDTO> extractGroupData(Boolean isFirst,String customerId,String dateId);
}

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java

@ -4,6 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.group.GroupDataDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.group.form.GridGroupPeopleFormDTO;
import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO;
import com.epmet.dto.group.form.GridGroupTotalFormDTO;
@ -12,9 +13,12 @@ import com.epmet.dto.group.result.*;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.service.group.GroupDataService;
import com.epmet.util.DimIdGenerator;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.util.StringUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
@ -193,4 +197,18 @@ public class GroupDataServiceImpl implements GroupDataService {
}
/**
* @Description 业务抽取 - 小组数据
* * @param isFirst
* @param customerId
* @return
* @author wangc
* @date 2020.09.18 22:52
**/
@Override
public List<FactOriginGroupMainDailyDTO> extractGroupData(Boolean isFirst ,String customerId,String dateId) {
return groupDataDao.groupExtracting(customerId,isFirst?null:dateId);
}
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java

@ -18,6 +18,7 @@
package com.epmet.service.project;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.entity.project.ProjectEntity;
@ -90,4 +91,14 @@ public interface ProjectProcessService extends BaseService<ProjectProcessEntity>
* @date 2020.09.18 13:38
**/
List<ProjectOrgPeriodResultDTO> getProjectPeriod(Boolean isFirst,String customerId,String date);
/**
* 获取办结组织
* @author zhaoqifeng
* @date 2020/9/20 21:11
* @param customerId
* @param date
* @return java.util.List<com.epmet.dto.project.FinishOrgDTO>
*/
List<FinishOrgDTO> getFinishOrg(String customerId, String date);
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java

@ -23,6 +23,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.project.ProjectProcessDao;
import com.epmet.dto.form.CommonStaffIdFormDTO;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
@ -117,6 +118,11 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
return new ArrayList<>();
}
@Override
public List<FinishOrgDTO> getFinishOrg(String customerId, String date) {
return baseDao.selectFinishOrg(customerId, date);
}
/**
* @Description 跨级分组 eg -> transfer ; response response transfer ; return ; response close.
* @param dest - Map<String,List<ProjectOrgPeriodResultDTO>> 需要填充的数据
@ -143,19 +149,16 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
if(StringUtils.equalsAny(staffResponseTraceUnit.get(index).getOperation(),
"transfer","return","close")){
replaceFirstResponseDate(dest,index,staffResponseTraceUnit,false);
replaceFirstResponseDate(dest,index,staffResponseTraceUnit,true);
lastEndCount = index;
}else{
if(lastEndCount == NumConstant.ONE_NEG) continue;
if(index - NumConstant.ONE == lastEndCount){
replaceFirstResponseDate(dest,index,staffResponseTraceUnit,true);
replaceFirstResponseDate(dest,index,staffResponseTraceUnit,false);
}else{continue;}
}
}
}
});
@ -169,7 +172,9 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
List<ProjectOrgPeriodResultDTO> processSingleList =
dest.get(staffResponseTraceUnit.get(index).getProcessId());
if(!CollectionUtils.isEmpty(processSingleList)){
ProjectOrgPeriodResultDTO element = processSingleList.get(NumConstant.ZERO);
//ProjectOrgPeriodResultDTO element = processSingleList.get(NumConstant.ZERO);
ProjectOrgPeriodResultDTO element = processSingleList.stream().filter(node ->
StringUtils.equals(node.getStaffId(),staffResponseTraceUnit.get(index).getStaffId())).findFirst().get();
if(!ifResponsed && null == element.getHandledDate()){
log.warn("com.epmet.service.project.impl.ProjectProcessServiceImpl.skipLevelGrouping::已流出节点没有办结日期,节点ID{}",element.getProcessId() );
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java

@ -25,6 +25,7 @@ import com.epmet.dto.stats.DimAgencyDTO;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.stats.DimAgencyEntity;
import javax.xml.soap.SAAJResult;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -176,4 +177,14 @@ public interface DimAgencyService extends BaseService<DimAgencyEntity> {
DimAgencyEntity getLatestCreatedAgencyDimEntity();
DimAgencyEntity getLatestUpdatedAgencyDimEntity();
/**
* 根据级别获取组织信息
* @author zhaoqifeng
* @date 2020/9/20 17:29
* @param customerId
* @param level
* @return java.util.List<com.epmet.dto.stats.DimAgencyDTO>
*/
List<DimAgencyDTO> getAgencyByLevel(String customerId, String level);
}

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

@ -23,6 +23,7 @@ import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridInfoResultDTO;
import com.epmet.dto.group.result.SubAgencyIdResultDTO;
import com.epmet.dto.stats.DimGridDTO;
import com.epmet.dto.stats.result.GridAttributesResultDTO;
import com.epmet.dto.stats.result.GridBelongAgencyResultDTO;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.entity.stats.LastExecRecordEntity;
@ -138,4 +139,13 @@ public interface DimGridService extends BaseService<DimGridEntity> {
* @date 2020/9/17 2:34 下午
*/
List<GridBelongAgencyResultDTO> selectGridBelongAgencyInfo(List<String> gridIds);
/**
* @Description 查询网格的所有所属上级属性
* @param gridIds
* @return
* @author wangc
* @date 2020.09.20 13:01
**/
List<GridAttributesResultDTO> getGridAttributes(List<String> gridIds);
}

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

@ -276,4 +276,9 @@ public class DimAgencyServiceImpl extends BaseServiceImpl<DimAgencyDao, DimAgenc
return baseDao.getLatestUpdatedAgencyDimEntity();
}
@Override
public List<DimAgencyDTO> getAgencyByLevel(String customerId, String level) {
return baseDao.selectDimAgencyByLevel(customerId, level);
}
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java

@ -34,6 +34,7 @@ import com.epmet.dto.group.AgencyDTO;
import com.epmet.dto.group.result.AgencyGridInfoResultDTO;
import com.epmet.dto.group.result.SubAgencyIdResultDTO;
import com.epmet.dto.stats.DimGridDTO;
import com.epmet.dto.stats.result.GridAttributesResultDTO;
import com.epmet.dto.stats.result.GridBelongAgencyResultDTO;
import com.epmet.entity.stats.DimGridEntity;
import com.epmet.service.stats.DimGridService;
@ -41,11 +42,9 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 客户网格维度
@ -177,4 +176,17 @@ public class DimGridServiceImpl extends BaseServiceImpl<DimGridDao, DimGridEntit
public List<GridBelongAgencyResultDTO> selectGridBelongAgencyInfo(List<String> gridIds) {
return baseDao.selectGridBelongAgencyInfo(gridIds);
}
/**
* @Description 查询网格的所有所属上级属性
* @param gridIds
* @return
* @author wangc
* @date 2020.09.20 13:01
**/
@Override
public List<GridAttributesResultDTO> getGridAttributes(List<String> gridIds) {
if(CollectionUtils.isEmpty(gridIds)) return Collections.EMPTY_LIST;
return baseDao.selectGridAttributes(gridIds);
}
}

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java

@ -1,8 +1,10 @@
package com.epmet.service.user;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.stats.user.result.UserStatisticalData;
import com.epmet.util.DimIdGenerator;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@ -35,4 +37,22 @@ public interface UserService {
* @date 2020/9/15 4:23 下午
*/
Map<String,Integer> selectUserIsParty(List<String> userIds);
/**
* @Description 查询客户下的党员userId
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 15:01
**/
List<String> getPartymembersByCustomerId(String customerId);
/**
* @Description 查询客户下的热心居民Id以及所在网格Id
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 15:01
**/
List<GridHeartedFormDTO> getWarmHeartedByCustomerId(String customerId);
}

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

@ -6,6 +6,7 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.ExtractConstant;
import com.epmet.dao.user.UserDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.result.UserPartyResultDTO;
import com.epmet.dto.stats.user.*;
import com.epmet.dto.stats.user.result.UserStatisticalData;
@ -152,6 +153,30 @@ public class UserServiceImpl implements UserService {
return result;
}
/**
* @Description 查询客户下的党员userId
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 15:01
**/
@Override
public List<String> getPartymembersByCustomerId(String customerId) {
return userDao.selectPartymembersByCustomerId(customerId);
}
/**
* @Description 查询客户下的热心居民Id以及所在网格Id
* @param customerId
* @return
* @author wangc
* @date 2020.09.20 15:01
**/
@Override
public List<GridHeartedFormDTO> getWarmHeartedByCustomerId(String customerId) {
return userDao.selectWarmHeartedByCustomerId(customerId);
}
/**
* @Description 初始化机关-所有下级网格Map

178
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml

@ -28,6 +28,184 @@
AND t1.GROUP_OWNER_ID = #{groupOwnerId}
</select>
<select id="selectIfExist" resultType="int">
SELECT COUNT(*)
FROM
fact_origin_group_main_daily
WHERE
DEL_FLAG = '0'
AND
CUSTOMER_ID = #{customerId}
</select>
<delete id="deleteBatchByCustomerId" >
DELETE FROM
fact_origin_group_main_daily
WHERE
CUSTOMER_ID = #{customerId}
</delete>
<delete id="deleteBatchMemberByCustomerId">
DELETE FROM
fact_origin_group_member_daily
WHERE
CUSTOMER_ID = #{customerId}
</delete>
<delete id="deleteBatchByGroupId" parameterType="java.util.List">
DELETE FROM
fact_origin_group_main_daily
<where>
<foreach collection="list" item="groupId" separator=" OR " close=" ;">
ID = #{groupId}
</foreach>
</where>
</delete>
<update id="updatePartyFlag" parameterType="java.util.List">
UPDATE fact_origin_group_main_daily
SET IS_OWNER_PARTY = 1
<where>
DEL_FLAG = '0'
AND
<foreach collection="list" item="ownerId" open="( " separator=" OR " close=" ) ">
GROUP_OWNER_ID = #{ownerId}
</foreach>
</where>
</update>
<update id="updateHeartedFlag" parameterType="java.util.List">
UPDATE fact_origin_group_main_daily
SET IS_OWNER_HEARTED = 1
<where>
DEL_FLAG = '0'
AND
<foreach collection="list" item="item" open="( " separator=" OR " close=" ) ">
(GROUP_OWNER_ID = #{item.userId} AND GRID_ID = #{item.gridId})
</foreach>
</where>
</update>
<insert id="insertBatchMain" parameterType="java.util.List">
INSERT INTO fact_origin_group_main_daily
(
id,
customer_id,
group_state,
grid_id,
agency_id,
parent_id,
pids,
date_id,
week_id,
month_id,
quarter_id,
year_id,
resi_member_count,
member_total,
group_owner_id,
is_owner_hearted,
is_owner_party,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time
)VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id},
#{item.customerId},
#{item.groupState},
#{item.gridId},
#{item.agencyId},
#{item.parentId},
#{item.pids},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
0,
#{item.memberTotal},
#{item.groupOwnerId},
<choose>
<when test='null == item.isOwnerHearted or "" == item.isOwnerHearted'>
0,
</when>
<otherwise>
#{item.isOwnerHearted},
</otherwise>
</choose>
<choose>
<when test='null == item.isOwnerParty or "" == item.isOwnerParty'>
0,
</when>
<otherwise>
#{item.isOwnerParty},
</otherwise>
</choose>
'0',
0,
'CRAWLER_ROBOT',
now(),
'CRAWLER_ROBOT',
now()
)
</foreach>
</insert>
<insert id="insertBatchMembers" parameterType="java.util.List">
INSERT INTO fact_origin_group_member_daily
(
id,
group_id,
member_id,
customer_id,
leader_flag,
date_id,
week_id,
month_id,
quarter_id,
year_id,
action_code,
revision,
del_flag,
created_by,
created_time,
updated_by,
updated_time
)VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.groupId},
#{item.memberId},
#{item.customerId},
#{item.leaderFlag},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.actionCode},
'0',
0,
'CRAWLER_ROBOT',
now(),
'CRAWLER_ROBOT',
now()
)
</foreach>
</insert>
<!-- 查询组成员数(去重) -->
<select id="selectGroupMemberList" parameterType="map" resultType="java.lang.String">
SELECT DISTINCT

33
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -5,8 +5,9 @@
<delete id="deleteByDate">
DELETE FROM
fact_origin_project_log_daily
WHERE
CUSTOMER_ID = #{customerId}
<if test='null != date and "" != date'>
WHERE
DATE_ID = #{date}
</if>
</delete>
@ -24,6 +25,7 @@
fopld.IS_ACTIVE = 0
AND fopld.ACTION_CODE = 'transfer'
AND fopld.MONTH_ID = #{monthId}
AND fopld.CUSTOMER_ID = #{customerId}
GROUP BY
fopld.CUSTOMER_ID,
fopld.AGENCY_ID
@ -84,5 +86,34 @@
OR l.ACTION_CODE = 'unresolved'
OR l.ACTION_CODE = 'created')
</select>
<select id="selectSatisfaction" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
AGENCY_ID,
COUNT( ID ) AS "count",
SUM( IFNULL( b.score, 0 ) ) AS "sum"
FROM
( SELECT f.ID, f.AGENCY_ID FROM fact_origin_project_main_daily f
INNER JOIN dim_agency da ON f.FINISH_ORG_IDS LIKE concat('%', da.ID, '%')
AND da.AGENCY_DIM_TYPE = 'all'
AND da.`LEVEL` = #{level}
AND da.CUSTOMER_ID = #{customerId}
WHERE 1=1
AND f.MONTH_ID = #{monthId}) a
LEFT JOIN (
SELECT
PROJECT_ID,
SUM( CASE ACTION_CODE WHEN 'bad' THEN 60 WHEN 'perfect' THEN 100 ELSE 80 END ) AS score
FROM
fact_origin_project_log_daily
WHERE
(ACTION_CODE = 'bad'
OR ACTION_CODE = 'good'
OR ACTION_CODE = 'perfect')
AND CUSTOMER_ID = #{customerId}
GROUP BY
PROJECT_ID
) b ON a.ID = b.PROJECT_ID
GROUP BY AGENCY_ID
</select>
</mapper>

8
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -61,8 +61,9 @@
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.`LEVEL` = 'community'
WHERE
f.IS_OVERDUE = 0
f.PROJECT_STATUS = 'closed'
AND f.MONTH_ID = #{monthId}
AND f.CUSTOMER_ID = #{customerId}
GROUP BY
f.CUSTOMER_ID,
f.AGENCY_ID
@ -78,7 +79,9 @@
AND da.`LEVEL` = 'community'
WHERE
f.IS_OVERDUE = 1
AND f.PROJECT_STATUS = 'closed'
AND f.MONTH_ID = #{monthId}
AND f.CUSTOMER_ID = #{customerId}
GROUP BY
f.CUSTOMER_ID,
f.AGENCY_ID
@ -102,8 +105,9 @@
<delete id="deleteByDate">
DELETE FROM
fact_origin_project_main_daily
WHERE
CUSTOMER_ID = #{customerId}
<if test='null != date and "" != date'>
WHERE
DATE_ID = #{date}
</if>
</delete>

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

@ -29,7 +29,7 @@
<select id="selectIfExisted" resultType="int">
SELECT COUNT(*) FROM fact_origin_project_org_period_daily WHERE DEL_FLAG = '0'
<if test='null != customerId and "" != customerId'>
CUSTOMER_ID = #{customerId}
AND CUSTOMER_ID = #{customerId}
</if>
</select>
@ -58,6 +58,7 @@
f.ORG_TYPE = #{orgType}
AND DATE_FORMAT(INFORMED_DATE, '%Y%m') = #{monthId}
AND PERIOD_TILL_REPLY_FIRSTLY != 0
AND f.CUSTOMER_ID = #{customerId}
GROUP BY
f.CUSTOMER_ID,
f.ORG_ID
@ -90,24 +91,27 @@
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{projectId},
#{orgId},
#{orgType},
#{pid},
#{pids},
#{informedDate},
#{handledDate},
#{totalPeriod},
#{periodTillReplyFirstly},
#{isResolved},
#{operation},
#{item.customerId},
#{item.projectId},
#{item.orgId},
#{item.orgType},
<choose >
<when test="null == item.pid">0,</when>
<otherwise>#{item.pid},</otherwise>
</choose>
#{item.pids},
#{item.informedDate},
#{item.handledDate},
#{item.totalPeriod},
#{item.periodTillReplyFirstly},
#{item.isResolved},
#{item.operation},
'0',
0,
'CRAWLER_ROBOT',
now(),
'CRAWLER_ROBOT',
now()
now(),
'CRAWLER_ROBOT'
)
</foreach>
</insert>

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml

@ -33,6 +33,12 @@
AND MONTH_ID = #{monthId}
limit 1000;
</delete>
<delete id="deleteByCustomer">
delete from fact_index_govrn_ablity_org_monthly
where CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND DATA_TYPE = #{type}
</delete>
<insert id="batchInsertFactIndexGovrnAblityOrgMonthly" parameterType="map">
insert into fact_index_govrn_ablity_org_monthly

58
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml

@ -155,5 +155,61 @@
rgm.resi_group_id
</foreach>
</select>
<resultMap id="groupExtracting" type="com.epmet.dto.extract.FactOriginGroupMainDailyDTO">
<id column="ID" property="id"></id>
<result column="CUSTOMER_ID" property="customerId"/>
<result column="groupState" property="groupState"/>
<result column="GRID_ID" property="gridId"/>
<result column="createdTime" property="createdTime" />
<result column="groupOwnerId" property="groupOwnerId"/>
<collection property="members" ofType="com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO">
<result property="customerId" column="CUSTOMER_ID"/>
<result property="joinDate" column="joinDate" />
<result property="actionCode" column="actionCode" />
<result property="memberId" column="memberId" />
<result property="leaderFlag" column="leaderFlag" />
<result property="groupId" column="ID" />
</collection>
</resultMap>
<!-- 抽取小组数据 -->
<select id="groupExtracting" resultMap="groupExtracting">
SELECT
groupp.ID ,
groupp.CUSTOMER_ID,
groupp.STATE AS groupState,
groupp.GRID_ID,
oper.CUSTOMER_USER_ID AS memberId,
groupoper.UPDATED_TIME AS createdTime,
oper.UPDATED_TIME AS joinDate,
IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'leader','member') AS leaderFlag,
groupp.CREATED_BY AS groupOwnerId,
'join' AS actionCode
FROM
RESI_GROUP groupp
LEFT JOIN
GROUP_MEMEBER_OPERATION oper
ON groupp.ID = oper.GROUP_ID AND oper.DEL_FLAG = '0'
AND oper.OPERATE_STATUS = 'approved'
LEFT JOIN
RESI_GROUP_OPERATION groupoper
ON groupp.ID = groupoper.RESI_GROUP_ID AND groupoper.DEL_FLAG = '0' AND groupoper.STATE = 'approved'
WHERE
groupp.DEL_FLAG = '0'
AND
groupp.CUSTOMER_ID = #{customerId}
AND
groupp.STATE = 'approved'
<if test='null != dateId and "" != dateId'>
AND(
DATE_FORMAT(groupoper.UPDATED_TIME, '%Y%m%d') = #{dateId}
OR
DATE_FORMAT(oper.UPDATED_TIME, '%Y%m%d') = #{dateId}
)
</if>
</select>
</mapper>

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

@ -90,11 +90,14 @@
staff.ORG_ID,
staff.DEPARTMENT_ID,
staff.GRID_ID,
staff.CREATED_BY AS staffId,
staff.ORG_ID_PATH,
IF(staff.IS_HANDLE='handle',timestampdiff(MINUTE , staff.CREATED_TIME , staff.UPDATED_TIME),0) AS TOTAL_PERIOD,
staff.CREATED_TIME AS informedDate,
-- 转入时间
IF(staff.IS_HANDLE='handle',staff.UPDATED_TIME,null) AS handledDate
IF(staff.IS_HANDLE='handle','resolved','unresolved') AS isResolved,
IF(staff.IS_HANDLE='handle',staff.UPDATED_TIME,null) AS handledDate,
IF(staff.IS_HANDLE='handle',staff.UPDATED_TIME,null) AS periodTillReplyFirstly
FROM PROJECT_STAFF staff
LEFT JOIN PROJECT project ON staff.PROJECT_ID = project.ID AND project.DEL_FLAG = '0'
@ -102,7 +105,7 @@
LEFT JOIN PROJECT_PROCESS selfAction ON staff.PROJECT_ID = selfAction.PROJECT_ID AND selfAction.DEL_FLAG = '0' AND staff.UPDATED_TIME = selfAction.CREATED_TIME AND staff.STAFF_ID = selfAction.STAFF_ID
WHERE staff.DEL_FLAG = '0'
AND project.CUSTOMER_ID = #{customerId}
<!-- 如果不传projectStatus则默认查全部 -->
<if test='null != projectStatus and "" != projectStatus'>
AND project.STATUS = #{projectStatus}
</if>
@ -114,7 +117,7 @@
)
</if>
AND process.OPERATION <![CDATA[ <> ]]> 'response'
ORDER BY process.PROJECT_ID,staff.CREATED_TIME ASC -- 按照立项-流转的顺序
ORDER BY process.PROJECT_ID,staff.CREATED_TIME ASC
</select>
<!-- 查询项目-机关各个节点的响应列表 -->
@ -141,11 +144,11 @@
)
ORDER BY process.STAFF_ID , process.CREATED_TIME ASC
</select>
<select id="selectFinishOrg" resultType="com.epmet.entity.project.ProjectProcessEntity">
<select id="selectFinishOrg" resultType="com.epmet.dto.project.FinishOrgDTO">
SELECT
a.PROJECT_ID,
a.ORG_ID_PATH,
b.ORG_ID_PATH
b.ORG_ID_PATH AS pIdPath
FROM
(
SELECT
@ -158,12 +161,19 @@
AND pp.PROJECT_ID = ps.PROJECT_ID
AND ps.IS_HANDLE = 'handle'
AND pp.CREATED_TIME = ps.UPDATED_TIME
AND ps.CUSTOMER_ID = #{customerId}
WHERE
pp.OPERATION = 'close'
<if test="date != null and date.trim() != ''">
AND pp.CREATED_TIME = #{date}
</if>
) a
LEFT JOIN (
SELECT PROJECT_ID, ORG_ID_PATH, MIN( LENGTH( ORG_ID_PATH ))
FROM project_staff GROUP BY PROJECT_ID
FROM project_staff
WHERE CUSTOMER_ID = #{customerId}
GROUP BY PROJECT_ID
) b ON a.PROJECT_ID = b.PROJECT_ID
</select>
</mapper>

15
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml

@ -315,5 +315,20 @@
</foreach>
)
</select>
<select id="selectDimAgencyByLevel" resultType="com.epmet.dto.stats.DimAgencyDTO">
SELECT
id AS id,
customer_id AS customerId,
level AS level,
pid AS pid,
pids AS pids
FROM
dim_agency
WHERE
del_flag = '0'
AND AGENCY_DIM_TYPE = 'all'
AND customer_id = #{customerId}
AND LEVEL = #{level}
</select>
</mapper>

19
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml

@ -89,4 +89,23 @@
)
</select>
<select id="selectGridAttributes" resultType="com.epmet.dto.stats.result.GridAttributesResultDTO">
SELECT
dg.id AS gridId,
dg.AGENCY_ID AS agencyId,
da.PID AS parentId,
da.PIDS
FROM
dim_grid dg
LEFT JOIN dim_agency da ON da.id = dg.agency_id
WHERE
dg.DEL_FLAG = '0'
AND da.DEL_FLAG = '0'
AND
(
<foreach collection="gridIds" item="gridId" separator=" OR ">
dg.id = #{gridId}
</foreach>
)
</select>
</mapper>

33
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

@ -424,4 +424,37 @@
</foreach>
)
</select>
<select id="selectPartymembersByCustomerId" resultType="string">
SELECT
DISTINCT
role.USER_ID
FROM
USER_ROLE role
LEFT JOIN EPMET_ROLE rolename
ON role.ROLE_ID = rolename.ID AND rolename.DEL_FLAG = '0'
WHERE
role.DEL_FLAG = '0'
AND
role.CUSTOMER_ID = #{customerId}
AND
rolename.ROLE_KEY = 'partymember'
</select>
<select id="selectWarmHeartedByCustomerId" resultType="com.epmet.dto.extract.form.GridHeartedFormDTO">
SELECT
DISTINCT
role.USER_ID,
role.GRID_ID
FROM
USER_ROLE role
LEFT JOIN EPMET_ROLE rolename
ON role.ROLE_ID = rolename.ID AND rolename.DEL_FLAG = '0'
WHERE
role.DEL_FLAG = '0'
AND
role.CUSTOMER_ID = #{customerId}
AND
rolename.ROLE_KEY = 'warmhearted'
</select>
</mapper>

23
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java

@ -0,0 +1,23 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractFormDTO;
/**
* desc: 业务数据抽取到统计库服务类
*
* @return:
* @date: 2020/6/22 10:24
* @author: jianjun liu
*/
public interface FactOriginExtractTaskService {
/**
* desc: 抽取 小组 话题 议题 项目数据到统计库
*
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
Result factOriginExtractJob(ExtractFormDTO formDTO);
}

30
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java

@ -0,0 +1,30 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.feign.FactExtractOpenFeignClient;
import com.epmet.service.FactOriginExtractTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* desc数据统计 任务服务类
*/
@Service
public class FactOriginExtractTaskServiceImpl implements FactOriginExtractTaskService {
@Autowired
private FactExtractOpenFeignClient factExtractOpenFeignClient;
/**
* desc: 抽取 小组 话题 议题 项目数据到统计库
*
* @param formDTO
* @date: 2020/6/22 9:09
* @author: jianjun liu
*/
@Override
public Result factOriginExtractJob(ExtractFormDTO formDTO) {
return factExtractOpenFeignClient.extractall(formDTO);
}
}

48
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java

@ -0,0 +1,48 @@
package com.epmet.task;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.service.FactOriginExtractTaskService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* desc:数据抽取定时任务 定时任务
*/
@Component("factOriginExtractTask")
public class FactOriginExtractTask implements ITask {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private FactOriginExtractTaskService factOriginExtractTaskService;
@Override
public void run(String params) {
logger.info("FactOriginExtractTask定时任务正在执行,参数为:{}", params);
ExtractFormDTO formDTO = new ExtractFormDTO();
if (StringUtils.isNotBlank(params)) {
formDTO = JSON.parseObject(params, ExtractFormDTO.class);
}
Result result = factOriginExtractTaskService.factOriginExtractJob(formDTO);
if (result.success()) {
logger.info("FactOriginExtractTask定时任务执行成功");
} else {
logger.error("FactOriginExtractTask定时任务执行失败:" + result.getMsg());
}
}
public static void main(String[] args) {
StatsFormDTO formDTO = new StatsFormDTO();
String params = "{'date':'\"2020-06-20','customerId':'123'}";
if (StringUtils.isNotBlank(params)) {
formDTO = JSON.parseObject(params, StatsFormDTO.class);
}
System.out.println(JSON.toJSONString(formDTO));
}
}
Loading…
Cancel
Save