Browse Source

先进排行统计

master
zhaoqifeng 5 years ago
parent
commit
312dd358d6
  1. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java
  2. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  3. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java
  4. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  5. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java
  6. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  7. 23
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java
  8. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java
  9. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java
  10. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java
  11. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java
  12. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java
  13. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  14. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  15. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java
  16. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java
  17. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java
  18. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  19. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  20. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java
  21. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java
  22. 182
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  23. 260
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java
  24. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenOrgRankDataService.java
  25. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenOrgRankDataServiceImpl.java
  26. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java
  27. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java
  28. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java
  29. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java
  30. 26
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  31. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  32. 68
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  33. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  34. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml
  35. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml
  36. 57
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml
  37. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml
  38. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml

3
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author zhaoqifeng
@ -17,5 +18,5 @@ public class OrgStatisticsResultDTO implements Serializable {
private String orgId;
private Integer count;
private Integer sum;
private String ratio;
private BigDecimal ratio;
}

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

@ -105,6 +105,8 @@ public class DemoController {
private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService;
@Autowired
private GovernRankDataExtractService governRankDataExtractService;
@Autowired
private OrgRankExtractService orgRankExtractService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -699,5 +701,12 @@ public class DemoController {
return new Result();
}
@PostMapping("orgRank")
public Result orgRank(@RequestBody CustomerIdAndDateIdFormDTO formDTO){
orgRankExtractService.extractGridData(formDTO.getCustomerId(), formDTO.getDateId());
orgRankExtractService.extractCommunityData(formDTO.getCustomerId(), formDTO.getDateId());
orgRankExtractService.extractStreetData(formDTO.getCustomerId(), formDTO.getDateId());
return new Result();
}
}

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

@ -18,6 +18,9 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.GridHeartedFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
@ -159,4 +162,25 @@ public interface FactOriginGroupMainDailyDao extends BaseDao<FactOriginGroupMain
* @date 2020/9/27 2:31 下午
*/
List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(@Param("customerId") String customerId, @Param("groupField") String groupField);
/**
* 获取网格内小组数量
* @author zhaoqifeng
* @date 2020/9/27 14:37
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 获取组织内网格数量
* @author zhaoqifeng
* @date 2020/9/27 14:37
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.IssueMainDailyFormDTO;
import com.epmet.dto.extract.result.GridProjectCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.ShiftProjectCountResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -183,4 +184,26 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
**/
Integer getAgencyShiftProjectTotal(@Param("customerId")String customerId,
@Param("agencyPath")String agencyPath);
/**
* 网格内议题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 组织内议题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

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

@ -136,4 +136,26 @@ public interface FactOriginProjectLogDailyDao extends BaseDao<FactOriginProjectL
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgResponse(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level")String level);
/**
* 网格满意率
* @author zhaoqifeng
* @date 2020/9/27 15:52
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 组织满意率
* @author zhaoqifeng
* @date 2020/9/27 15:52
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level")String level);
}

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

@ -84,7 +84,6 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return void
*/
void deleteByDate(@Param("customerId") String customerId, @Param("date") String date);
void deleteByDate(@Param("date") String date);
/**
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Integer>>
@ -169,4 +168,27 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId);
/**
* 网格解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:16
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridProjectCount(@Param("customerId") String customerId, @Param("monthId")String monthId);
/**
* 组织解决项目数
* @author zhaoqifeng
* @date 2020/9/25 15:16
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgProjectCount(@Param("customerId") String customerId, @Param("monthId")String monthId,
@Param("level") String level);
}

23
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java

@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -116,4 +117,26 @@ public interface FactOriginTopicMainDailyDao extends BaseDao<FactOriginTopicMain
Integer getAgencyPartyTopicTotal(@Param("customerId") String customerId,
@Param("agencyPath")String agencyPath,
@Param("createTopicUserIsParty") String createTopicUserIsParty);
/**
* 网格内话题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectGridTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 组织内话题总数
* @author zhaoqifeng
* @date 2020/9/27 14:59
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> selectOrgTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

34
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenOrgRankDataDao.java

@ -56,4 +56,38 @@ public interface ScreenOrgRankDataDao extends BaseDao<ScreenOrgRankDataEntity> {
* @Date 10:52 2020-08-18
**/
void batchInsertOrgRankData(@Param("list") List<OrgRankDataFormDTO> list, @Param("customerId")String customerId);
/**
* 初始化组织数据
* @author zhaoqifeng
* @date 2020/9/27 10:14
* @param customerId
* @param level
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity>
*/
List<ScreenOrgRankDataEntity> initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level);
/**
* 初始化网格数据
* @author zhaoqifeng
* @date 2020/9/27 10:14
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity>
*/
List<ScreenOrgRankDataEntity> initGridDataList(@Param("customerId") String customerId);
/**
* 删除旧数据
* @author zhaoqifeng
* @date 2020/9/27 10:27
* @param customerId
* @param orgType
* @param monthId
* @param deleteSize
* @param orgIds
* @return java.lang.Integer
*/
Integer deleteRankData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("monthId") String monthId,
@Param("deleteSize") Integer deleteSize,
@Param("orgIds")List<String> orgIds);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java

@ -40,4 +40,17 @@ public interface FactRegUserAgencyMonthlyDao extends BaseDao<FactRegUserAgencyMo
void deleteByParams(@Param("monthId") String monthId, @Param("customerId") String customerId);
List<GridUserCountResultDTO> selectAgencyUserCount(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* 查询机关下各用户数量
* @author zhaoqifeng
* @date 2020/9/27 16:39
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO>
*/
List<FactRegUserAgencyMonthlyDTO> selectOrgUserCountByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId,
@Param("level") String level);
}

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

@ -48,4 +48,14 @@ public interface FactRegUserGridMonthlyDao extends BaseDao<FactRegUserGridMonthl
*/
List<GridUserCountResultDTO> selectGridUserCount(String customerId, String monthId);
/**
* 查询网格下各用户数量
* @author zhaoqifeng
* @date 2020/9/27 13:59
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO>
*/
List<FactRegUserGridMonthlyDTO> selectGridUserCountByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId);
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
@ -84,4 +85,25 @@ public interface FactOriginGroupMainDailyService extends BaseService<FactOriginG
* @date 2020/9/27 2:24 下午
*/
List<GridGroupUserCountResultDTO> selectDistinctGroupMemberCount(String customerId, String groupField);
/**
* 获取网格内小组数量
* @author zhaoqifeng
* @date 2020/9/27 14:35
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridGroupCount(String customerId, String monthId);
/**
* 获取组织内小组数量
* @author zhaoqifeng
* @date 2020/9/27 14:35
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgGroupCount(String customerId, String monthId, String level);
}

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java

@ -18,8 +18,11 @@
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import java.util.List;
/**
* 议题主表
*
@ -86,4 +89,25 @@ public interface FactOriginIssueMainDailyService extends BaseService<FactOriginI
* @Date 2020/9/24 17:04
**/
Integer getAgencyShiftProjectTotal(String customerId, String agencyPath);
/**
* 网格内议题数
* @author zhaoqifeng
* @date 2020/9/27 15:11
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridIssueCount(String customerId, String monthId);
/**
* 组织内议题数
* @author zhaoqifeng
* @date 2020/9/27 15:11
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgIssueCount(String customerId, String monthId, String level);
}

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

@ -218,4 +218,25 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
*/
List<OrgStatisticsResultDTO> getOrgResponse(String customerId, String monthId, String level);
/**
* 网格满意率
* @author zhaoqifeng
* @date 2020/9/27 16:06
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridSatisfaction(String customerId, String monthId);
/**
* 组织满意率
* @author zhaoqifeng
* @date 2020/9/27 16:06
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgSatisfaction(String customerId, String monthId, String level);
}

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

@ -216,4 +216,25 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridResolveProject(String customerId, String monthId);
/**
* 网格项目数
* @author zhaoqifeng
* @date 2020/9/27 15:18
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridProjectCount(String customerId, String monthId);
/**
* 组织项目数
* @author zhaoqifeng
* @date 2020/9/27 15:19
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgProjectCount(String customerId, String monthId, String level);
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java

@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity;
import java.util.List;
@ -90,4 +91,25 @@ public interface FactOriginTopicMainDailyService extends BaseService<FactOriginT
* @Date 2020/9/24 15:49
**/
Integer getAgencyPartyTopicTotal(String customerId, String agencyPath,String createTopicUserIsParty);
/**
* 网格内话题数
* @author zhaoqifeng
* @date 2020/9/27 15:05
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getGridTopicCount(String customerId, String monthId);
/**
* 组织内话题数
* @author zhaoqifeng
* @date 2020/9/27 15:05
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.extract.result.OrgStatisticsResultDTO>
*/
List<OrgStatisticsResultDTO> getOrgTopicCount(String customerId, String monthId, String level);
}

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

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dto.extract.FactOriginGroupMainDailyDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.extract.result.GridGroupUserCountResultDTO;
import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
@ -120,4 +121,14 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOri
return baseDao.selectDistinctGroupMemberCount(customerId, groupField);
}
@Override
public List<OrgStatisticsResultDTO> getGridGroupCount(String customerId, String monthId) {
return baseDao.selectGridGroupCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgGroupCount(String customerId, String monthId, String level) {
return baseDao.selectOrgGroupCount(customerId, monthId, level);
}
}

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

@ -21,11 +21,14 @@ 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.FactOriginIssueMainDailyDao;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 议题主表
*
@ -114,4 +117,14 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl<FactOri
public Integer getAgencyShiftProjectTotal(String customerId, String agencyPath) {
return baseDao.getAgencyShiftProjectTotal(customerId,agencyPath);
}
@Override
public List<OrgStatisticsResultDTO> getGridIssueCount(String customerId, String monthId) {
return baseDao.selectGridIssueCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgIssueCount(String customerId, String monthId, String level) {
return baseDao.selectOrgIssueCount(customerId, monthId, level);
}
}

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

@ -277,5 +277,15 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
return baseDao.selectOrgResponse(customerId, monthId, level);
}
@Override
public List<OrgStatisticsResultDTO> getGridSatisfaction(String customerId, String monthId) {
return baseDao.selectGridSatisfaction(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgSatisfaction(String customerId, String monthId, String level) {
return baseDao.selectOrgSatisfaction(customerId, monthId, level);
}
}

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

@ -213,4 +213,14 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
public List<OrgStatisticsResultDTO> getGridResolveProject(String customerId, String monthId) {
return baseDao.getGridResolveProject(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getGridProjectCount(String customerId, String monthId) {
return baseDao.getGridProjectCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgProjectCount(String customerId, String monthId, String level) {
return baseDao.getOrgProjectCount(customerId, monthId, level);
}
}

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

@ -30,6 +30,7 @@ import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao;
import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.result.CreateTopicCountResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.topic.TopicOriginInfoDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity;
@ -313,4 +314,14 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl<FactOri
return baseDao.getAgencyPartyTopicTotal(customerId,agencyPath,createTopicUserIsParty);
}
@Override
public List<OrgStatisticsResultDTO> getGridTopicCount(String customerId, String monthId) {
return baseDao.selectGridTopicCount(customerId, monthId);
}
@Override
public List<OrgStatisticsResultDTO> getOrgTopicCount(String customerId, String monthId, String level) {
return baseDao.selectOrgTopicCount(customerId, monthId, level);
}
}

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/OrgRankExtractService.java

@ -0,0 +1,41 @@
package com.epmet.service.evaluationindex.extract.toscreen;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/27 9:37
*/
public interface OrgRankExtractService {
/**
* 网格先进排行
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:16
*/
void extractGridData(String customerId, String monthId);
/**
* 社区先进排行
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractCommunityData(String customerId, String monthId);
/**
* 街道先进排行
*
* @param customerId
* @param monthId
* @return void
* @author zhaoqifeng
* @date 2020/9/24 15:17
*/
void extractStreetData(String customerId, String monthId);
}

182
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java

@ -50,38 +50,57 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getGridSatisfaction(customerId, monthId);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//自治率
List<FactIndexGovrnAblityGridMonthlyEntity> gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> {
BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount());
//自治率
BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount());
if(grid.getResolveProjectCount()!= NumConstant.ZERO) {
entity.setGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
}
//满意率
entity.setSatisfactionRatio(grid.getSatisfactionRatio());
}));
if (!CollectionUtils.isEmpty(gridList)) {
list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> {
BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount());
BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount());
if (grid.getResolveProjectCount() != NumConstant.ZERO) {
entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getGridResponse(customerId, monthId);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(responseList)) {
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getGridResolveProject(customerId, monthId);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(resolveList)) {
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, monthId, IndexCalConstant.DELETE_SIZE, list);
}
@ -92,39 +111,58 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
List<FactIndexGovrnAblityOrgMonthlyEntity> orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> {
//满意率
entity.setSatisfactionRatio(org.getSatisfactionRatio());
}));
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.COMMUNITY);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(responseList)) {
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//自制率 自治项目数/办结项目数
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.COMMUNITY);
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(selfList)) {
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId,
OrgTypeConstant.COMMUNITY);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(resolveList)) {
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
@ -134,39 +172,57 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
List<FactIndexGovrnAblityOrgMonthlyEntity> orgList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId,
OrgTypeConstant.STREET);
list.forEach(entity -> orgList.stream().filter(orgAbility -> entity.getOrgId().equals(orgAbility.getAgencyId())).forEach(org -> {
//满意率
entity.setSatisfactionRatio(org.getSatisfactionRatio());
}));
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//响应率 响应次数/流转到网格的次数
List<OrgStatisticsResultDTO> responseList = factOriginProjectLogDailyService.getOrgResponse(customerId, monthId, OrgTypeConstant.STREET);
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(responseList)) {
list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//自制率 自治项目数/办结项目数
List<OrgStatisticsResultDTO> selfList = factOriginProjectMainDailyService.getSelfProject(customerId, monthId, OrgTypeConstant.STREET);
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(selfList)) {
list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//解决率 已解决项目数/办结项目数
List<OrgStatisticsResultDTO> resolveList = factOriginProjectMainDailyService.getResolveProject(customerId, monthId,
OrgTypeConstant.STREET);
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}));
if (!CollectionUtils.isEmpty(resolveList)) {
list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list);
}
}

260
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/OrgRankExtractServiceImpl.java

@ -0,0 +1,260 @@
package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO;
import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
import com.epmet.service.evaluationindex.extract.todata.*;
import com.epmet.service.evaluationindex.extract.toscreen.OrgRankExtractService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.screen.ScreenOrgRankDataService;
import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService;
import com.epmet.service.stats.user.FactRegUserGridMonthlyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/9/27 9:37
*/
@Service
@Slf4j
public class OrgRankExtractServiceImpl implements OrgRankExtractService {
@Autowired
private ScreenOrgRankDataService screenOrgRankDataService;
@Autowired
private FactRegUserGridMonthlyService factRegUserGridMonthlyService;
@Autowired
private FactOriginGroupMainDailyService factOriginGroupMainDailyService;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private FactOriginIssueMainDailyService factOriginIssueMainDailyService;
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService;
@Autowired
private FactOriginProjectLogDailyService factOriginProjectLogDailyService;
@Autowired
private FactRegUserAgencyMonthlyService factRegUserAgencyMonthlyService;
@Autowired
private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService;
@Override
public void extractGridData(String customerId, String monthId) {
List<ScreenOrgRankDataEntity> list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.GRID, null);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//党员数
List<FactRegUserGridMonthlyDTO> partyMemberList = factRegUserGridMonthlyService.getGridUserCountByCustomer(customerId, monthId);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getGridGroupCount(customerId, monthId);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getGridTopicCount(customerId, monthId);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getGridIssueCount(customerId, monthId);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getGridProjectCount(customerId, monthId);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityGridMonthlyEntity> abilityList = factIndexGovrnAblityGridMonthlyService.getGridByCustomer(customerId, monthId);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getGridId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getProjectTotal() != NumConstant.ZERO) {
BigDecimal total = new BigDecimal(dto.getProjectTotal());
BigDecimal closed = new BigDecimal(dto.getResolveProjectCount());
entity.setCloseProjectRatio(closed.multiply(hundred).divide(total, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getGridSatisfaction(customerId, monthId);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
}
@Override
public void extractCommunityData(String customerId, String monthId) {
List<ScreenOrgRankDataEntity> list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.COMMUNITY);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//党员数
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setCloseProjectRatio(dto.getClosedProjectRatio());
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
}
@Override
public void extractStreetData(String customerId, String monthId) {
List<ScreenOrgRankDataEntity> list = screenOrgRankDataService.initList(customerId, OrgTypeConstant.AGENCY, OrgTypeConstant.STREET);
if (CollectionUtils.isEmpty(list)) {
return;
}
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
list.forEach(entity -> {
entity.setYearId(monthId.substring(NumConstant.ZERO, NumConstant.FOUR));
entity.setMonthId(monthId);
});
//党员数
List<FactRegUserAgencyMonthlyDTO> partyMemberList = factRegUserAgencyMonthlyService.getOrgUserCountByCustomer(customerId, monthId,
OrgTypeConstant.COMMUNITY);
if (!CollectionUtils.isEmpty(partyMemberList)) {
list.forEach(entity -> partyMemberList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setPartyTotal(dto.getPartymemberTotal());
}));
}
//小组数
List<OrgStatisticsResultDTO> groupList = factOriginGroupMainDailyService.getOrgGroupCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(groupList)) {
list.forEach(entity -> groupList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setGroupTotal(dto.getCount());
}));
}
//话题数
List<OrgStatisticsResultDTO> topicList = factOriginTopicMainDailyService.getOrgTopicCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(topicList)) {
list.forEach(entity -> topicList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setTopicTotal(dto.getCount());
}));
}
//议题数
List<OrgStatisticsResultDTO> issueList = factOriginIssueMainDailyService.getOrgIssueCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(issueList)) {
list.forEach(entity -> issueList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setIssueTotal(dto.getCount());
}));
}
//项目数
List<OrgStatisticsResultDTO> projectList = factOriginProjectMainDailyService.getOrgProjectCount(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(projectList)) {
list.forEach(entity -> projectList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> {
entity.setProjectTotal(dto.getCount());
}));
}
//结案率 结案数/项目数
List<FactIndexGovrnAblityOrgMonthlyEntity> abilityList = factIndexGovrnAblityOrgMonthlyService.getOrgByCustomer(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(abilityList)) {
list.forEach(entity -> abilityList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
entity.setCloseProjectRatio(dto.getClosedProjectRatio());
}));
}
//满意率 满意和非常满意占比
List<OrgStatisticsResultDTO> satisfactionList = factOriginProjectLogDailyService.getOrgSatisfaction(customerId, monthId, OrgTypeConstant.STREET);
if (!CollectionUtils.isEmpty(satisfactionList)) {
list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> {
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP));
}
}));
}
}
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenOrgRankDataService.java

@ -20,6 +20,8 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
import java.util.List;
/**
* 党建引领-组织先进排行榜
*
@ -27,4 +29,31 @@ import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
* @since v1.0.0 2020-09-22
*/
public interface ScreenOrgRankDataService extends BaseService<ScreenOrgRankDataEntity> {
/**
* 构造screen_govern_rank_data 初始数据先赋值为0
*
* @param customerId
* @param orgType
* @param agencyLevel
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity>
* @author zhaoqifeng
* @date 2020/9/24 14:41
*/
List<ScreenOrgRankDataEntity> initList(String customerId, String orgType, String agencyLevel);
/**
* 保存抽取结果
*
* @param customerId
* @param orgType
* @param monthId
* @param deleteSize
* @param entityList
* @return void
* @author zhaoqifeng
* @date 2020/9/25 10:32
*/
void delAndSaveRankData(String customerId, String orgType, String monthId, Integer deleteSize, List<ScreenOrgRankDataEntity> entityList);
}

47
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenOrgRankDataServiceImpl.java

@ -18,12 +18,21 @@
package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenOrgRankDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenOrgRankDataService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 党建引领-组织先进排行榜
*
@ -31,7 +40,45 @@ import org.springframework.stereotype.Service;
* @since v1.0.0 2020-09-22
*/
@Service
@Slf4j
public class ScreenOrgRankDataServiceImpl extends BaseServiceImpl<ScreenOrgRankDataDao, ScreenOrgRankDataEntity> implements ScreenOrgRankDataService {
@Override
@DataSource(DataSourceConstant.STATS)
public List<ScreenOrgRankDataEntity> initList(String customerId, String orgType, String agencyLevel) {
List<ScreenOrgRankDataEntity> list = new ArrayList<>();
switch (orgType) {
case OrgTypeConstant.AGENCY:
log.info("组织级别统计");
list = baseDao.initAgencyDataList(customerId, agencyLevel);
break;
case OrgTypeConstant.GRID:
log.info("网格级别统计");
list = baseDao.initGridDataList(customerId);
break;
default:
log.info("部门级别统计");
break;
}
return list;
}
@Override
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public void delAndSaveRankData(String customerId, String orgType, String monthId, Integer deleteSize, List<ScreenOrgRankDataEntity> entityList) {
if (CollectionUtils.isEmpty(entityList)) {
return;
}
List<String> orgIds = new ArrayList<>();
for (ScreenOrgRankDataEntity entity : entityList) {
orgIds.add(entity.getOrgId());
}
int deleteNum;
do {
deleteNum = baseDao.deleteRankData(customerId, orgType, monthId, deleteSize, orgIds);
} while (deleteNum != NumConstant.ZERO);
insertBatch(entityList);
}
}

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

@ -104,4 +104,16 @@ public interface FactRegUserAgencyMonthlyService extends BaseService<FactRegUser
* @date 2020/9/27 3:45 下午
*/
List<GridUserCountResultDTO> selectAgencyUserCount(String customerId, String monthId);
/**
* 查询机关下各用户数量
*
* @author zhaoqifeng
* @date 2020/9/27 14:02
* @param customerId
* @param monthId
* @param level
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO>
*/
List<FactRegUserAgencyMonthlyDTO> getOrgUserCountByCustomer(String customerId, String monthId, String level);
}

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

@ -103,4 +103,15 @@ public interface FactRegUserGridMonthlyService extends BaseService<FactRegUserGr
* @date 2020/9/19 11:10 上午
*/
List<GridUserCountResultDTO> selectGridUserCount(String customerId,String monthId);
/**
* 查询网格下各用户数量
*
* @author zhaoqifeng
* @date 2020/9/27 14:02
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO>
*/
List<FactRegUserGridMonthlyDTO> getGridUserCountByCustomer(String customerId, String monthId);
}

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

@ -104,4 +104,9 @@ public class FactRegUserAgencyMonthlyServiceImpl extends BaseServiceImpl<FactReg
return baseDao.selectAgencyUserCount(customerId, monthId);
}
@Override
public List<FactRegUserAgencyMonthlyDTO> getOrgUserCountByCustomer(String customerId, String monthId, String level) {
return baseDao.selectOrgUserCountByCustomer(customerId, monthId, level);
}
}

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

@ -112,4 +112,9 @@ public class FactRegUserGridMonthlyServiceImpl extends BaseServiceImpl<FactRegUs
return baseDao.selectGridUserCount(customerId, monthId);
}
@Override
public List<FactRegUserGridMonthlyDTO> getGridUserCountByCustomer(String customerId, String monthId) {
return baseDao.selectGridUserCountByCustomer(customerId, monthId);
}
}

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

@ -279,4 +279,30 @@
AND CUSTOMER_ID = #{customerId}
GROUP by ${groupField,jdbcType=VARCHAR}
</select>
<select id="selectGridGroupCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_group_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
AND GROUP_STATE = 'approved'
GROUP BY GRID_ID
</select>
<select id="selectOrgGroupCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_group_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
AND f.GROUP_STATE = 'approved'
GROUP BY f.AGENCY_ID
</select>
</mapper>

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml

@ -267,4 +267,28 @@
AND t1.CUSTOMER_ID = #{customerId}
and t1.PIDS LIKE CONCAT(#{agencyPath},'%')
</select>
<select id="selectGridIssueCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_issue_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY GRID_ID
</select>
<select id="selectOrgIssueCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_issue_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY f.AGENCY_ID
</select>
</mapper>

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

@ -252,4 +252,72 @@
GROUP BY f.AGENCY_ID ) b
ON a.AGENCY_ID = b.AGENCY_ID
</select>
<select id="selectGridSatisfaction" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.ORG_ID,
a.sum,
IFNULL(b.count, 0) AS "count"
FROM
(SELECT
ORG_ID,
COUNT( ID ) AS "sum"
FROM
fact_origin_project_log_daily
WHERE
1 = 1
AND ( ACTION_CODE = 'bad' OR ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY
ORG_ID) a
LEFT JOIN
(SELECT
ORG_ID,
COUNT( ID ) AS "count"
FROM
fact_origin_project_log_daily
WHERE
1 = 1
AND ( ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY
ORG_ID) b
ON a.ORG_ID = b.ORG_ID
</select>
<select id="selectOrgSatisfaction" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
a.AGENCY_ID,
a.sum,
IFNULL(b.count, 0) AS "count"
FROM
(SELECT
f.AGENCY_ID,
COUNT( f.ID ) AS "sum"
FROM
fact_origin_project_log_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID AND da.`LEVEL` = #{level}
WHERE
1 = 1
AND ( ACTION_CODE = 'bad' OR ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY
f.AGENCY_ID) a
LEFT JOIN
(SELECT
f.AGENCY_ID,
COUNT( f.ID ) AS "count"
FROM
fact_origin_project_log_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID AND da.`LEVEL` = #{level}
WHERE
1 = 1
AND ( ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' )
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY
f.AGENCY_ID) b
ON a.AGENCY_ID = b.AGENCY_ID
</select>
</mapper>

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

@ -282,4 +282,28 @@
fm.GRID_ID) b
ON a.GRID_ID = b.GRID_ID
</select>
<select id="getGridProjectCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_project_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY GRID_ID
</select>
<select id="getOrgProjectCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_project_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY f.AGENCY_ID
</select>
</mapper>

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml

@ -153,4 +153,28 @@
AND m.CUSTOMER_ID = #{customerId}
AND m.PIDS LIKE CONCAT(#{agencyPath},'%')
</select>
<select id="selectGridTopicCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
GRID_ID AS "orgId",
COUNT(ID) AS "count"
FROM fact_origin_topic_main_daily
WHERE
1=1
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
GROUP BY GRID_ID
</select>
<select id="selectOrgTopicCount" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
f.AGENCY_ID,
COUNT(f.ID) AS "count"
FROM fact_origin_topic_main_daily f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
1=1
AND f.CUSTOMER_ID = #{customerId}
AND f.MONTH_ID = #{monthId}
GROUP BY f.AGENCY_ID
</select>
</mapper>

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

@ -120,7 +120,8 @@
AGENCY_ID,
MONTH_ID,
YEAR_ID,
SATISFACTION_RATIO
SATISFACTION_RATIO,
CLOSED_PROJECT_RATIO
FROM
fact_index_govrn_ablity_org_monthly
WHERE

57
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml

@ -8,6 +8,63 @@
where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId}
limit 1000;
</delete>
<delete id="deleteRankData">
delete from screen_org_rank_data
where CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
<if test='null != orgType and "" != orgType'>
and ORG_TYPE=#{orgType}
</if>
<if test='null!=orgIds and orgIds.size()>0'>
and
(
<foreach collection="orgIds" item="orgId" separator=" OR ">
ORG_ID = #{orgId}
</foreach>
)
</if>
limit #{deleteSize}
</delete>
<select id="initAgencyDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity">
SELECT
CUSTOMER_ID,
'agency' AS ORG_TYPE,
ID AS ORG_ID,
PID AS PARENT_ID,
AGENCY_NAME AS ORG_NAME,
0 AS PARTY_TOTAL,
0 AS GROUP_TOTAL,
0 AS TOPIC_TOTAL,
0 AS ISSUE_TOTAL,
0 AS PROJECT_TOTAL,
0 AS CLOSE_PROJECT_RATIO,
0 AS SATISFACTION_RATIO
FROM
dim_agency
WHERE
CUSTOMER_ID = #{customerId}
AND `LEVEL` = #{level}
AND AGENCY_DIM_TYPE = 'all'
</select>
<select id="initGridDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenOrgRankDataEntity">
SELECT DISTINCT
CUSTOMER_ID,
'grid' AS ORG_TYPE,
ID AS ORG_ID,
AGENCY_ID AS PARENT_ID,
GRID_NAME AS ORG_NAME,
0 AS PARTY_TOTAL,
0 AS GROUP_TOTAL,
0 AS TOPIC_TOTAL,
0 AS ISSUE_TOTAL,
0 AS PROJECT_TOTAL,
0 AS CLOSE_PROJECT_RATIO,
0 AS SATISFACTION_RATIO
FROM
dim_grid
WHERE
CUSTOMER_ID = #{customerId}
</select>
<insert id="batchInsertOrgRankData" parameterType="map">
insert into screen_org_rank_data

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

@ -101,6 +101,19 @@
AND CUSTOMER_ID = #{customerId}
</if>
</delete>
<select id="selectOrgUserCountByCustomer" resultType="com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO">
SELECT
AGENCY_ID,
PARTYMEMBER_TOTAL
FROM
fact_reg_user_agency_monthly f
INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID
AND da.LEVEL = #{level}
WHERE
f.DEL_FLAG = '0'
AND f.CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
<select id="selectAgencyUserCount" resultType="com.epmet.dto.extract.result.GridUserCountResultDTO">
SELECT

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml

@ -120,6 +120,17 @@
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
<select id="selectGridUserCountByCustomer" resultType="com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO">
SELECT
GRID_ID,
PARTYMEMBER_TOTAL
FROM
fact_reg_user_grid_monthly
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
</select>
</mapper>
Loading…
Cancel
Save