Browse Source

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

master
zxc 5 years ago
parent
commit
7bee0b6dc5
  1. 4
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  2. 43
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  3. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java
  4. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.java
  5. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.java
  6. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.java
  7. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java
  8. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java
  9. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java
  10. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java
  11. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java
  12. 100
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexAgencySelfSubScoreEntity.java
  13. 95
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreEntity.java
  14. 100
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.java
  15. 52
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginGroupMainDailyService.java
  16. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java
  17. 54
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java
  18. 199
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java
  19. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java
  20. 65
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginGroupMainDailyServiceImpl.java
  21. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java
  22. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java
  23. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java
  24. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java
  25. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java
  26. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyService.java
  27. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java
  28. 70
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityCpcMonthlyServiceImpl.java
  29. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java
  30. 54
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexServiceAblityGridMonthlyServiceImpl.java
  31. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java
  32. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java
  33. 61
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java
  34. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java
  35. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java
  36. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java
  37. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java
  38. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml
  39. 15
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml
  40. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml
  41. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml
  42. 29
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml
  43. 28
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.xml
  44. 29
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.xml
  45. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml
  46. 1
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml
  47. 14
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml
  48. 15
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml
  49. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml
  50. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml

4
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java

@ -193,7 +193,7 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result factOriginExtractAll(ExtractFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO);
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractAll", formDTO);
}
/**
@ -205,6 +205,6 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
*/
@Override
public Result indexOriginExtractAll(ExtractIndexFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "indexOriginExtractAll", formDTO);
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "extractAll", formDTO);
}
}

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

@ -14,6 +14,7 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthly
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dao.stats.DimCustomerDao;
import com.epmet.dao.stats.DimDateDao;
import com.epmet.dao.stats.DimMonthDao;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.ExtractFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
@ -25,7 +26,9 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.stats.DimAgencyEntity;
import com.epmet.entity.stats.DimCustomerEntity;
import com.epmet.entity.stats.DimDateEntity;
import com.epmet.entity.stats.DimMonthEntity;
import com.epmet.service.StatsDemoService;
import com.epmet.service.evaluationindex.extract.CalCpcIndexService;
import com.epmet.service.evaluationindex.extract.CalGridIndexService;
import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
@ -82,6 +85,8 @@ public class DemoController {
@Autowired
private DimDateDao dimDateDao;
@Autowired
private DimMonthDao dimMonthDao;
@Autowired
private DimCustomerDao dimCustomerDao;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@ -571,5 +576,43 @@ public class DemoController {
);
}
@Autowired
private CalCpcIndexService calCpcIndexService;
@PostMapping("calCpcPartyAbility")
public Result calCpcPartyAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId")String monthId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)) {
calCpcIndexService.calCpcPartyAbility(customerId,monthId);
}else{
QueryWrapper<DimCustomerEntity> customerEntityQueryWrapper = new QueryWrapper<>();
List<DimCustomerEntity> customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper);
QueryWrapper<DimMonthEntity> wrapper = new QueryWrapper<>();
List<DimMonthEntity> dimMonthEntityList= dimMonthDao.selectList(wrapper);
for(DimCustomerEntity customerEntity:customerEntityList){
for(DimMonthEntity monthEntity:dimMonthEntityList) {
calCpcIndexService.calCpcPartyAbility(customerEntity.getId(),monthEntity.getId());
}
}
}
return new Result();
}
@PostMapping("calGridIndexServiceAbility")
public Result calGridIndexServiceAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId")String monthId) {
if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)) {
calGridIndexService.calGridIndexServiceAbility(customerId,monthId);
}else{
QueryWrapper<DimCustomerEntity> customerEntityQueryWrapper = new QueryWrapper<>();
List<DimCustomerEntity> customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper);
QueryWrapper<DimMonthEntity> wrapper = new QueryWrapper<>();
List<DimMonthEntity> dimMonthEntityList= dimMonthDao.selectList(wrapper);
// for(DimCustomerEntity customerEntity:customerEntityList){
for(DimMonthEntity monthEntity:dimMonthEntityList) {
calGridIndexService.calGridIndexServiceAbility("3ef7e4bb195eb9e622d68b52509aa940",monthEntity.getId());
}
// }
}
return new Result();
}
}

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

@ -64,6 +64,15 @@ public interface FactOriginIssueMainDailyDao extends BaseDao<FactOriginIssueMain
*/
List<GridIssueCountResultDTO> selectIssueTotal(@Param("customerId") String customerId,@Param("monthId") String monthId);
/**
* @Description 查询俩月的网格议题总数
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 10:20 上午
*/
List<GridIssueCountResultDTO> selectIssueTotalTwoMonthPlus(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("minusMonthId") String minusMonthId);
/**
* @Description 网格总项目数
* @param customerId

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.indexcal.FactIndexAgencySelfSubScoreEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* /街道相关 自身和下级分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
@Mapper
public interface FactIndexAgencySelfSubScoreDao extends BaseDao<FactIndexAgencySelfSubScoreEntity> {
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.indexcal.FactIndexCommunitySelfSubScoreEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 社区相关 自身/下级分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
@Mapper
public interface FactIndexCommunitySelfSubScoreDao extends BaseDao<FactIndexCommunitySelfSubScoreEntity> {
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.evaluationindex.indexcal.FactIndexGridSelfSubScoreEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格相关自身/下级分值记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
@Mapper
public interface FactIndexGridSelfSubScoreDao extends BaseDao<FactIndexGridSelfSubScoreEntity> {
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java

@ -134,5 +134,5 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao<FactIndexGov
* @author zxc
* @date 2020/9/19 4:31 下午
*/
void deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId);
Integer deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java

@ -114,5 +114,5 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao<FactIndexPar
* @author zxc
* @date 2020/9/19 10:45 上午
*/
void deleteOldPartyAbility(@Param("customerId")String customerId,@Param("monthId")String monthId);
Integer deleteOldPartyAbility(@Param("customerId")String customerId,@Param("monthId")String monthId);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/ActInfoDao.java

@ -41,4 +41,13 @@ public interface ActInfoDao{
* @Date 2020/9/21 10:41
**/
List<Map<String, Integer>> selectActGroupByGridId(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @return java.util.List<java.lang.String>
* @param regUserIds
* @author yinzuomei
* @description 根据userId,查询用户是否是志愿者返回是志愿者的用户集合
* @Date 2020/9/21 13:55
**/
List<String> selectGridRegUserVolunteer(@Param("list") List<String> regUserIds);
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java

@ -36,4 +36,12 @@ public interface PartyMemberDao{
*/
List<PartyMemberDTO> selectPartyMemberByCustomer(@Param("customerId") String customerId);
/**
* @return java.util.List<java.lang.String>
* @param volunteerUserIds
* @author yinzuomei
* @description 志愿者中同时是党员的人数
* @Date 2020/9/21 14:13
**/
List<String> selectVolunteerPartyUserIds(@Param("list") List<String> volunteerUserIds);
}

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

@ -111,4 +111,14 @@ public interface UserDao {
List<String> selectPartymembersByCustomerId(@Param("customerId")String customerId);
List<GridHeartedFormDTO> selectWarmHeartedByCustomerId(@Param("customerId")String customerId);
/**
* @param customerId
* @param gridId
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 查询当前网格下首次注册的用户ids
* @Date 2020/9/21 13:46
**/
List<String> selectGridRegUserIds(@Param("customerId") String customerId, @Param("gridId") String gridId);
}

100
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexAgencySelfSubScoreEntity.java

@ -0,0 +1,100 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.evaluationindex.indexcal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* /街道相关 自身和下级分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_agency_self_sub_score")
public class FactIndexAgencySelfSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织id(eg社区或者街道id)
*/
private String agencyId;
/**
* 上级组织id
*/
private String parentAgencyId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 数据类型 district 全区street街道
*/
private String dataType;
/**
* 分数类型self自身得分sub下级得分
*/
private String scoreType;
/**
* 分值
*/
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli街道相关jiedaoxiangguan全区相关:quanquxiangguan
*/
private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 权重
*/
private BigDecimal weight;
}

95
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreEntity.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.evaluationindex.indexcal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 社区相关 自身/下级分数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_community_self_sub_score")
public class FactIndexCommunitySelfSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 组织id
*/
private String agencyId;
/**
* 社区上一级组织id
*/
private String parentAgencyId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 分数类型self自身得分sub下级得分
*/
private String scoreType;
/**
* 分值
*/
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli社区相关shequxiangguan
*/
private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 权重
*/
private BigDecimal weight;
}

100
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/FactIndexGridSelfSubScoreEntity.java

@ -0,0 +1,100 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.evaluationindex.indexcal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 网格相关自身/下级分值记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("fact_index_grid_self_sub_score")
public class FactIndexGridSelfSubScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 网格Id
*/
private String gridId;
/**
* 网格所属的机关Id
*/
private String agencyId;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 年度ID: yyyy
*/
private String yearId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 分数类型self自身得分sub下级得分
*/
private String scoreType;
/**
* 分值
*/
private BigDecimal score;
/**
* 党建能力dangjiannengli治理能力zhilinengli服务能力fuwunengli网格相关wanggexiangguan
*/
private String indexCode;
/**
* 所有指标code拼接的字符串 冒号隔开
*/
private String allParentIndexCode;
/**
* 权重
*/
private BigDecimal weight;
}

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

@ -0,0 +1,52 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import java.util.List;
/**
* 业务数据抽取-小组相关
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
public interface FactOriginGroupMainDailyService extends BaseService<FactOriginGroupMainDailyEntity> {
/**
* @return java.util.List<java.lang.String>
* @param customerId
* @param userId
* @author yinzuomei
* @description 查询当前用户建了多少个组
* @Date 2020/9/21 16:12
**/
List<String> selectGroupIds(String customerId, String userId);
/**
* @return java.util.List<java.lang.String>
* @param groupIdList
* @author yinzuomei
* @description 根据组查询组里面的成员去重
* @Date 2020/9/21 16:13
**/
List<String> selectGroupMemberList(List<String> groupIdList);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java

@ -42,6 +42,15 @@ public interface IssueExtractService {
*/
List<GridIssueCountResultDTO> selectIssueTotal(String customerId, String monthId);
/**
* @Description 查询俩月的网格议题总数
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 10:20 上午
*/
List<GridIssueCountResultDTO> selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId);
/**
* @Description 网格总项目数
* @param customerId

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

@ -1,14 +1,11 @@
package com.epmet.service.evaluationindex.extract.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.IndexCalConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.service.evaluationindex.extract.*;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -35,8 +32,6 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
@Autowired
private DimCustomerPartymemberService dimCustomerPartymemberService;
@Autowired
private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao;
@Autowired
private FactOriginTopicMainDailyService factOriginTopicMainDailyService;
@Autowired
private FactOriginTopicLogDailyService factOriginTopicLogDailyService;
@ -45,7 +40,9 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
@Autowired
private FactOriginProjectMainDailyService factOriginProjectMainDailyService;
@Autowired
private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao;
private FactIndexPartyAblityCpcMonthlyService factIndexPartyAblityCpcMonthlyService;
@Autowired
private FactOriginGroupMainDailyService factOriginGroupMainDailyService;
/**
* @param customerId 客户id
@ -66,7 +63,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
String quarterId= DateUtils.getQuarterId(monthId);
String yearId=DateUtils.getYearId(monthId);
//2、删除之前统计过的
deleteFactIndexPartyAblityCpcMonthly(customerId, monthId);
factIndexPartyAblityCpcMonthlyService.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId);
//1、党员提出话题数
@ -132,7 +129,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//4、分批插入批量插入
List<List<FactIndexPartyAblityCpcMonthlyEntity>> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE);
partition.forEach(list -> {
this.saveFactIndexPartyAblityCpcMonthlyEntity(list);
factIndexPartyAblityCpcMonthlyService.saveFactIndexPartyAblityCpcMonthlyEntity(list);
});
}
@ -150,7 +147,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
Map<String, List<String>> map = new HashMap<>();
for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) {
//查询当前党员建了多少个组
List<String> groupIdList = factOriginGroupMainDailyDao.selectGroupIds(customerId, partyMember.getUserId());
List<String> groupIdList=factOriginGroupMainDailyService.selectGroupIds(customerId,partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
map.put(partyMember.getUserId(), new ArrayList<>());
continue;
@ -259,12 +256,14 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//查询当前党员建了多少个组
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群群众人数】赋值0");
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}
//去重组里面的成员
List<String> memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList);
List<String> memberIdList=factOriginGroupMainDailyService.selectGroupMemberList(groupIdList);
if (CollectionUtils.isEmpty(memberIdList)) {
//memberIdList肯定不会为空,因为起码会有群主一个人
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
} else {
@ -303,11 +302,12 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
//1、查询当前党员建了多少个组
List<String> groupIdList = userCreatedGroups.get(partyMember.getUserId());
if (CollectionUtils.isEmpty(groupIdList)) {
log.info("当前党员userId="+partyMember.getUserId()+"没有创建过小组, 【党员相关-党员自建群活跃群众人数】赋值0");
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
}
//2、去重组里面的成员
List<String> memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList);
List<String> memberIdList = factOriginGroupMainDailyService.selectGroupMemberList(groupIdList);
if (CollectionUtils.isEmpty(memberIdList)) {
map.put(partyMember.getUserId(), NumConstant.ZERO);
continue;
@ -396,7 +396,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
continue;
}
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(6);
numberFormat.setMaximumFractionDigits(NumConstant.SIX);
String topicToIssueRatioStr = numberFormat.format((float) projectTotal / issueTotal);
BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr);
map.put(partyMember.getUserId(), topicToIssueRatio);
@ -404,32 +404,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService {
return map;
}
/**
* @param customerId
* @param monthId
* @return void
* @author yinzuomei
* @description 删除这个客户这个月 党员相关-党建能力的数据
* @Date 2020/9/18 10:20
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX)
public void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId) {
int deleteNum;
do {
deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId);
} while (deleteNum > NumConstant.ZERO);
}
/**
* @param list
* @return void
* @author yinzuomei
* @description 批量插入党员相关党建能力表
* @Date 2020/9/18 10:27
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX)
private void saveFactIndexPartyAblityCpcMonthlyEntity(List<FactIndexPartyAblityCpcMonthlyEntity> list) {
factIndexPartyAblityCpcMonthlyDao.insertBatchEntity(list);
}
}

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

@ -9,8 +9,7 @@ import com.epmet.constant.ExtractConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.constant.ProjectEvaluateConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao;
import com.epmet.dao.heart.ActInfoDao;
import com.epmet.dao.partymember.PartyMemberDao;
import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO;
import com.epmet.dto.extract.form.GridIssueCountResultDTO;
import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO;
@ -19,8 +18,12 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMont
import com.epmet.service.evaluationindex.extract.*;
import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService;
import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService;
import com.epmet.service.heart.ActInfoService;
import com.epmet.service.partymember.PartyMemberService;
import com.epmet.service.stats.FactArticlePublishedGridDailyService;
import com.epmet.service.stats.user.FactRegUserGridMonthlyService;
import com.epmet.service.user.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -29,6 +32,13 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -68,9 +78,14 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
@Autowired
private FactIndexServiceAbilityGridMonthlyService factIndexServiceAbilityGridMonthlyService;
@Autowired
private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao;
private FactIndexServiceAblityGridMonthlyService factIndexServiceAblityGridMonthlyService;
@Autowired
private ActInfoDao actInfoDao;
private ActInfoService actInfoService;
@Autowired
private UserService userService;
@Autowired
private PartyMemberService partyMemberService;
/**
* @Description 计算网格指标党建能力
* @param customerId
@ -97,7 +112,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
// 网格的发文数量
List<PublishCountResultDTO> publishCountList = articlePublishedGridDailyService.selectArticlePublishCount(customerId, monthId);
// 网格议题转项目率
List<GridIssueCountResultDTO> gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId);
List<GridIssueCountResultDTO> gridIssueTotalList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, minusMonthId(monthId));
List<GridProjectCountResultDTO> gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT);
List<GridProjectCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList);
// 建群党员数
@ -216,7 +231,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
});
}
});
delAndInsertPartyAbility(result,customerId,monthId);
delPartyAbility(customerId, monthId);
List<List<PartyAbilityGridMonthlyFormDTO>> partition = ListUtils.partition(result, NumConstant.ONE_HUNDRED);
partition.forEach(r -> {
insertPartyAbility(r);
});
return true;
}
@ -239,7 +258,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
//网格总项目数
List<GridProjectCountResultDTO> gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT);
//网格议题转项目率
List<GridProjectCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList);
List<GridIssueCountResultDTO> gridIssueCountList = issueExtractService.selectIssueTotalTwoMonth(customerId, monthId, minusMonthId(monthId));
List<GridProjectCountResultDTO> gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueCountList, gridProjectTotalList);
//网格自治项目数 从议题创建到项目关闭,包括处理人,自始至终没有出过议题所属网格
List<AutoNoMyResultDTO> projectAutoNoMyList = projectLogService.selectProjectAutoNoMy(customerId, monthId);
Map<String,Integer> autoMap = new HashMap<>(16);
@ -364,7 +384,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
}
});
});
delAndInsertGovernAbility(result,customerId,monthId);
delGovernAbility(customerId, monthId);
List<List<GovernAbilityGridMonthlyFormDTO>> resultList = ListUtils.partition(result, NumConstant.ONE_HUNDRED);
resultList.forEach(r -> {
insertGovernAbility(r);
});
return true;
}
@ -380,29 +404,67 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
//1、构造好初始数据,各指标赋值0
List<FactIndexServiceAblityGridMonthlyEntity> entityList=factIndexServiceAbilityGridMonthlyService.initAllGridList(customerId);
if(CollectionUtils.isEmpty(entityList)){
log.info("screen_customer_grid do not any records");
log.info("customerId:"+customerId+",screen_customer_grid do not any records");
return true;
}
String quarterId= DateUtils.getQuarterId(monthId);
String yearId=DateUtils.getYearId(monthId);
//各个网格这个月举办的活动
Map<String,Integer> activityCountMap=calActivityCountMap(customerId,monthId);
//各个网格这个月举办的活动 :活动状态已结束并且实际结束时间在评价周期内的
Map<String,Integer> activityCountMap=actInfoService.calActivityCountMap(customerId,monthId);
//2、遍历网格,赋值每个网格指标
for(FactIndexServiceAblityGridMonthlyEntity entity:entityList){
entity.setMonthId(monthId);
entity.setQuarterId(quarterId);
entity.setYearId(yearId);
//网格活动组织次数 爱心活动
//网格活动组织次数 爱心活动 : 活动状态已结束并且实际结束时间在评价周期内的
if(activityCountMap.containsKey(entity.getGridId())){
entity.setActivityCount(activityCountMap.get(entity.getGridId()));
}
//网格志愿者占比 todo
// entity.setVolunteerRatio();
//网格党员志愿者率 todo
// entity.setPartyVolunteerRatio();
List<String> volunteerUserIds=new ArrayList<>();
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.SIX);
//网格志愿者占比 : 所有注册用户中,注册了志愿者的用户占比
//(1)网格内的注册用户有哪些?
List<String> regUserIds=userService.getGridRegUserIds(customerId,entity.getGridId());
if(CollectionUtils.isEmpty(regUserIds)){
log.info(String.format("当前网格%s下没有注册用户,所以【网格志愿者占比】volunteerRatio赋值0",entity.getGridId()));
entity.setVolunteerRatio(BigDecimal.ZERO);
}else{
//(2)网格内注册用户中,那些人注册了志愿者?
volunteerUserIds=actInfoService.getGridRegUserVolunteer(regUserIds);
if(CollectionUtils.isEmpty(volunteerUserIds)){
log.info(String.format("当前网格%s下注册用户%s个,其中志愿者为0个,所以【网格志愿者占比】volunteerRatio赋值0",entity.getGridId(),regUserIds.size()));
entity.setVolunteerRatio(BigDecimal.ZERO);
}else{
int volunteerTotal=volunteerUserIds.size();
int regUserTotal=regUserIds.size();
String volunteerRatioStr = numberFormat.format((float) volunteerTotal / regUserTotal);
BigDecimal volunteerRatio = new BigDecimal(volunteerRatioStr);
entity.setVolunteerRatio(volunteerRatio);
}
}
//网格党员志愿者率 : 所有志愿者中,同时是党员的占比
if(CollectionUtils.isEmpty(volunteerUserIds)){
log.info(String.format("当前网格%s下志愿者人数0个,所以【网格党员志愿者率】partyVolunteerRatio赋值为0",entity.getGridId()));
entity.setPartyVolunteerRatio(BigDecimal.ZERO);
}else{
List<String> paryUserIds=partyMemberService.getVolunteerPartyUserIds(volunteerUserIds);
if(CollectionUtils.isEmpty(paryUserIds)){
log.info(String.format("当前网格%s下志愿者%s个,同时是党员的0个,所以【网格党员志愿者率】partyVolunteerRatio赋值为0",entity.getGridId(),volunteerUserIds.size()));
entity.setPartyVolunteerRatio(BigDecimal.ZERO);
}else{
int volunteerCount=volunteerUserIds.size();
int partyUserCount=paryUserIds.size();
String partyVolunteerRatioStr = numberFormat.format((float) partyUserCount / volunteerCount);
BigDecimal partyVolunteerRatio = new BigDecimal(partyVolunteerRatioStr);
entity.setPartyVolunteerRatio(partyVolunteerRatio);
}
}
}
//3、批量删
deleteBatchIndexServiceAblityGridMonthly(customerId,monthId);
factIndexServiceAblityGridMonthlyService.deleteBatchIndexServiceAblityGridMonthly(customerId,monthId);
//4、批量增
List<List<FactIndexServiceAblityGridMonthlyEntity>> partition = ListUtils.partition(entityList, IndexCalConstant.INSERT_SIZE);
partition.forEach(list -> {
@ -411,41 +473,16 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
return true;
}
/**
* @return java.util.Map<java.lang.String,java.lang.Integer>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 网格活动组织次数 爱心活动 值得是 活动状态已结束并且实际结束时间在评价周期内的
* @Date 2020/9/21 10:23
**/
@DataSource(DataSourceConstant.EPMET_HEART)
private Map<String, Integer> calActivityCountMap(String customerId, String monthId) {
List<Map<String, Integer>> mapList = actInfoDao.selectActGroupByGridId(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (Map<String, Integer> map : mapList) {
for (Map.Entry<String, Integer> m : map.entrySet()) {
resultMap.put(m.getKey(), m.getValue());
}
}
return resultMap;
}
/*public static void main(String[] args) {
NumberFormat numberFormat = NumberFormat.getInstance();
numberFormat.setMaximumFractionDigits(NumConstant.SIX);
int volunteerCount=7;
int partyUserCount=6;
String partyVolunteerRatioStr = numberFormat.format((float) partyUserCount / volunteerCount);
BigDecimal partyVolunteerRatio = new BigDecimal(partyVolunteerRatioStr);
System.out.println(partyVolunteerRatio);
}*/
/**
* @return void
* @param customerId
* @param monthId
* @author yinzuomei
* @description 批量删除网格相关-服务能力指标表
* @Date 2020/9/21 10:16
**/
@DataSource(DataSourceConstant.EVALUATION_INDEX)
private void deleteBatchIndexServiceAblityGridMonthly(String customerId, String monthId) {
int deleteNum;
do {
deleteNum = factIndexServiceAblityGridMonthlyDao.deleteFactIndexServiceAblityGridMonthly(customerId, monthId);
} while (deleteNum > NumConstant.ZERO);
}
/**
* @param list
@ -490,30 +527,78 @@ public class CalGridIndexServiceImpl implements CalGridIndexService {
}
/**
* @Description 删除并插入党建能力的记录
* @Description 插入党建能力的记录
* @param result
* @author zxc
* @date 2020/9/19 4:06 下午
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsertPartyAbility(List<PartyAbilityGridMonthlyFormDTO> result,String customerId,String monthId){
public void insertPartyAbility(List<PartyAbilityGridMonthlyFormDTO> result){
if (!CollectionUtils.isEmpty(result)){
partyAbilityOrgMonthlyService.deleteOldPartyAbility(customerId, monthId);
partyAbilityOrgMonthlyService.insertPartyAbility(result);
}
}
/**
* @Description 删除并插入治理能力的记录
* @Description 删除党建能力的记录
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/19 4:06 下午
*/
@Transactional(rollbackFor = Exception.class)
public void delPartyAbility(String customerId,String monthId){
Integer delNum;
do {
delNum = partyAbilityOrgMonthlyService.deleteOldPartyAbility(customerId, monthId);
}while (delNum > NumConstant.ZERO);
}
/**
* @Description 插入治理能力的记录
* @param result
* @author zxc
* @date 2020/9/19 4:06 下午
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsertGovernAbility(List<GovernAbilityGridMonthlyFormDTO> result,String customerId,String monthId){
public void insertGovernAbility(List<GovernAbilityGridMonthlyFormDTO> result){
if (!CollectionUtils.isEmpty(result)){
governAbilityOrgMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId);
governAbilityOrgMonthlyService.insertGovernAbilityRecord(result);
}
}
/**
* @Description 删除治理能力的记录
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/19 4:06 下午
*/
@Transactional(rollbackFor = Exception.class)
public void delGovernAbility(String customerId,String monthId){
Integer delNum;
do {
delNum = governAbilityOrgMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId);
}while (delNum > NumConstant.ZERO);
}
/**
* @Description 根据monthIdyyyyMM获取上一个月份ID
* @param monthId
* @author zxc
* @date 2020/9/21 2:43 下午
*/
public String minusMonthId(String monthId){
String minusMonthId = null;
SimpleDateFormat sft = new SimpleDateFormat("yyyyMM");
try {
Date parse = sft.parse(monthId);
LocalDate birth = parse.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
LocalDate localDate = birth.minusMonths(NumConstant.ONE);
minusMonthId = localDate.toString().substring(NumConstant.ZERO, NumConstant.FOUR).concat(localDate.toString().substring(NumConstant.FIVE, NumConstant.SEVEN));
} catch (ParseException e) {
e.printStackTrace();
}
return minusMonthId;
}
}

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

@ -32,6 +32,7 @@ public class FactIndexServiceAbilityGridMonthlyServiceImpl implements FactIndexS
* @Date 2020/9/21 9:38
**/
@Override
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public List<FactIndexServiceAblityGridMonthlyEntity> initAllGridList(String customerId) {
return baseDao.initAllGridList(customerId);
}
@ -44,6 +45,7 @@ public class FactIndexServiceAbilityGridMonthlyServiceImpl implements FactIndexS
* @Date 2020/9/21 10:05
**/
@Override
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public void insertBatchEntity(List<FactIndexServiceAblityGridMonthlyEntity> list) {
baseDao.insertBatchEntity(list);
}

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

@ -0,0 +1,65 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao;
import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity;
import com.epmet.service.evaluationindex.extract.FactOriginGroupMainDailyService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 业务数据抽取-小组相关
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
@Service
public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl<FactOriginGroupMainDailyDao, FactOriginGroupMainDailyEntity> implements FactOriginGroupMainDailyService {
/**
* @return java.util.List<java.lang.String>
* @param customerId
* @param userId
* @author yinzuomei
* @description 查询当前用户建了多少个组
* @Date 2020/9/21 16:13
**/
@Override
public List<String> selectGroupIds(String customerId, String userId) {
List<String> groupIdList = baseDao.selectGroupIds(customerId,userId);
return groupIdList;
}
/**
* @param groupIdList
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 根据组查询组里面的成员去重
* @Date 2020/9/21 16:13
**/
@Override
public List<String> selectGroupMemberList(List<String> groupIdList) {
List<String> memberIdList = baseDao.selectGroupMemberList(groupIdList);
return memberIdList;
}
}

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

@ -137,9 +137,12 @@ public class GroupExtractServiceImpl implements GroupExtractService {
List<String> partyIds = userService.getPartymembersByCustomerId(param.getCustomerId());
List<GridHeartedFormDTO> heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId());
factOriginGroupMainDailyDao.updatePartyFlag(partyIds,param.getCustomerId());
factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds,param.getCustomerId());
if(!partyIds.isEmpty()) {
factOriginGroupMainDailyDao.updatePartyFlag(partyIds, param.getCustomerId());
}
if(!heartedIds.isEmpty()) {
factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds, param.getCustomerId());
}
}
}
}

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

@ -238,6 +238,18 @@ public class IssueExtractServiceImpl implements IssueExtractService {
return issueMainDailyDao.selectIssueTotal(customerId, monthId);
}
/**
* @Description 查询俩月的网格议题总数
* @param customerId
* @param monthId
* @author zxc
* @date 2020/9/18 10:20 上午
*/
@Override
public List<GridIssueCountResultDTO> selectIssueTotalTwoMonth(String customerId, String monthId, String minusMonthId) {
return issueMainDailyDao.selectIssueTotalTwoMonthPlus(customerId, monthId, minusMonthId);
}
/**
* @Description 网格总项目数
* @param customerId

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

@ -39,5 +39,5 @@ public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService<FactI
* @author zxc
* @date 2020/9/19 4:31 下午
*/
void deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId);
Integer deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId);
}

51
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyService.java

@ -0,0 +1,51 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import java.util.List;
/**
* 党建能力-党员相关的事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
public interface FactIndexPartyAblityCpcMonthlyService extends BaseService<FactIndexPartyAblityCpcMonthlyEntity> {
/**
* @return void
* @param customerId
* @param monthId
* @author yinzuomei
* @description 删除这个客户这个月 党员相关-党建能力的数据
* @Date 2020/9/21 16:01
**/
void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId);
/**
* @return void
* @param list
* @author yinzuomei
* @description 批量插入党员相关党建能力表
* @Date 2020/9/21 16:04
**/
void saveFactIndexPartyAblityCpcMonthlyEntity(List<FactIndexPartyAblityCpcMonthlyEntity> list);
}

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

@ -38,5 +38,5 @@ public interface FactIndexPartyAblityOrgMonthlyService extends BaseService<FactI
* @author zxc
* @date 2020/9/19 10:45 上午
*/
void deleteOldPartyAbility(String customerId,String monthId);
Integer deleteOldPartyAbility(String customerId,String monthId);
}

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyService.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.indexcoll;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity;
/**
* 服务能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
public interface FactIndexServiceAblityGridMonthlyService extends BaseService<FactIndexServiceAblityGridMonthlyEntity> {
/**
* @return void
* @param customerId
* @param monthId
* @author yinzuomei
* @description 批量删除网格相关-服务能力指标表
* @Date 2020/9/21 16:38
**/
void deleteBatchIndexServiceAblityGridMonthly(String customerId, String monthId);
}

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

@ -36,7 +36,7 @@ public class FactIndexGovrnAblityOrgMonthlyServiceImpl extends BaseServiceImpl<F
}
@Override
public void deleteOldGovernAbilityRecord(String customerId, String monthId) {
governAbilityDao.deleteOldGovernAbilityRecord(customerId, monthId);
public Integer deleteOldGovernAbilityRecord(String customerId, String monthId) {
return governAbilityDao.deleteOldGovernAbilityRecord(customerId, monthId);
}
}

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

@ -0,0 +1,70 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity;
import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 党建能力-党员相关的事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
@Service
public class FactIndexPartyAblityCpcMonthlyServiceImpl extends BaseServiceImpl<FactIndexPartyAblityCpcMonthlyDao, FactIndexPartyAblityCpcMonthlyEntity> implements FactIndexPartyAblityCpcMonthlyService {
/**
* @param customerId
* @param monthId
* @return void
* @author yinzuomei
* @description 删除这个客户这个月 党员相关-党建能力的数据
* @Date 2020/9/18 10:20
**/
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX)
public void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId) {
int deleteNum;
do {
deleteNum = baseDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId);
} while (deleteNum > NumConstant.ZERO);
}
/**
* @param list
* @return void
* @author yinzuomei
* @description 批量插入党员相关党建能力表
* @Date 2020/9/18 10:27
**/
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX)
public void saveFactIndexPartyAblityCpcMonthlyEntity(List<FactIndexPartyAblityCpcMonthlyEntity> list) {
baseDao.insertBatchEntity(list);
}
}

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

@ -36,7 +36,7 @@ public class FactIndexPartyAblityOrgMonthlyServiceImpl extends BaseServiceImpl<F
}
@Override
public void deleteOldPartyAbility(String customerId, String monthId) {
partyAbilityGridDao.deleteOldPartyAbility(customerId, monthId);
public Integer deleteOldPartyAbility(String customerId, String monthId) {
return partyAbilityGridDao.deleteOldPartyAbility(customerId, monthId);
}
}

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

@ -0,0 +1,54 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
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.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity;
import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService;
import org.springframework.stereotype.Service;
/**
* 服务能力-网格相关事实表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-21
*/
@Service
public class FactIndexServiceAblityGridMonthlyServiceImpl extends BaseServiceImpl<FactIndexServiceAblityGridMonthlyDao, FactIndexServiceAblityGridMonthlyEntity> implements FactIndexServiceAblityGridMonthlyService {
/**
* @return void
* @param customerId
* @param monthId
* @author yinzuomei
* @description 批量删除网格相关-服务能力指标表
* @Date 2020/9/21 10:16
**/
@Override
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public void deleteBatchIndexServiceAblityGridMonthly(String customerId, String monthId) {
int deleteNum;
do {
deleteNum = baseDao.deleteFactIndexServiceAblityGridMonthly(customerId, monthId);
} while (deleteNum > NumConstant.ZERO);
}
}

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

@ -27,6 +27,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@ -127,6 +128,21 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
}));
}
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month");
Map<String,BigDecimal> responseMap = factOriginProjectLogDailyService.getAgencyResponseRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()));
BigDecimal element = entity.getClosedProjectRatio();
//办结率
entity.setClosedProjectRatio(
element.divide(new BigDecimal(entity.getTransferedCount()), NumConstant.SIX, RoundingMode.HALF_UP)
);
//响应度
entity.setRespProjectRatio(responseMap.get(entity.getAgencyId()));
});
factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY);
factIndexGovrnAblityOrgMonthlyService.insertBatch(list);

31
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/ActInfoService.java

@ -0,0 +1,31 @@
package com.epmet.service.heart;
import java.util.List;
import java.util.Map;
/**
* 活动信息
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/21 16:39
*/
public interface ActInfoService {
/**
* @return java.util.List<java.lang.String>
* @param regUserIds
* @author yinzuomei
* @description 根据userId,查询用户是否是志愿者返回是志愿者的用户集合
* @Date 2020/9/21 16:41
**/
List<String> getGridRegUserVolunteer(List<String> regUserIds);
/**
* @return java.util.Map<java.lang.String,java.lang.Integer>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 网格活动组织次数 爱心活动 值得是 活动状态已结束并且实际结束时间在评价周期内的
* @Date 2020/9/21 16:43
**/
Map<String, Integer> calActivityCountMap(String customerId, String monthId);
}

61
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/ActInfoServiceImpl.java

@ -0,0 +1,61 @@
package com.epmet.service.heart.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.heart.ActInfoDao;
import com.epmet.service.heart.ActInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 活动信息
*
* @author yinzuomei@elink-cn.com
* @date 2020/9/21 16:40
*/
@Slf4j
@Service
@DataSource(DataSourceConstant.EPMET_HEART)
public class ActInfoServiceImpl implements ActInfoService {
@Autowired
private ActInfoDao baseDao;
/**
* @return java.util.List<java.lang.String>
* @param regUserIds
* @author yinzuomei
* @description 根据userId,查询用户是否是志愿者返回是志愿者的用户集合
* @Date 2020/9/21 13:50
**/
@Override
@DataSource(DataSourceConstant.EPMET_HEART)
public List<String> getGridRegUserVolunteer(List<String> regUserIds) {
return baseDao.selectGridRegUserVolunteer(regUserIds);
}
/**
* @return java.util.Map<java.lang.String,java.lang.Integer>
* @param customerId
* @param monthId
* @author yinzuomei
* @description 网格活动组织次数 爱心活动 值得是 活动状态已结束并且实际结束时间在评价周期内的
* @Date 2020/9/21 10:23
**/
@Override
@DataSource(DataSourceConstant.EPMET_HEART)
public Map<String, Integer> calActivityCountMap(String customerId, String monthId) {
List<Map<String, Integer>> mapList = baseDao.selectActGroupByGridId(customerId, monthId);
Map<String, Integer> resultMap = new HashMap<>();
for (Map<String, Integer> map : mapList) {
for (Map.Entry<String, Integer> m : map.entrySet()) {
resultMap.put(m.getKey(), m.getValue());
}
}
return resultMap;
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java

@ -29,4 +29,12 @@ public interface PartyMemberService {
*/
List<PartyMemberDTO> getPartyMemberByCustomer(String customerId);
/**
* @return java.util.List<java.lang.String>
* @param volunteerUserIds
* @author yinzuomei
* @description 志愿者中同时是党员的人数
* @Date 2020/9/21 16:46
**/
List<String> getVolunteerPartyUserIds(List<String> volunteerUserIds);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java

@ -41,4 +41,16 @@ public class PartyMemberServiceImpl implements PartyMemberService {
return partyMemberDao.selectPartyMemberByCustomer(customerId);
}
/**
* @return java.util.List<java.lang.String>
* @param volunteerUserIds
* @author yinzuomei
* @description 志愿者中同时是党员的人数
* @Date 2020/9/21 14:10
**/
@Override
@DataSource(DataSourceConstant.PARTY_MEMBER)
public List<String> getVolunteerPartyUserIds(List<String> volunteerUserIds) {
return partyMemberDao.selectVolunteerPartyUserIds(volunteerUserIds);
}
}

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

@ -55,4 +55,14 @@ public interface UserService {
* @date 2020.09.20 15:01
**/
List<GridHeartedFormDTO> getWarmHeartedByCustomerId(String customerId);
/**
* @return java.util.List<java.lang.String>
* @param customerId
* @param gridId
* @author yinzuomei
* @description 查询当前网格下首次注册的用户ids
* @Date 2020/9/21 16:44
**/
List<String> getGridRegUserIds(String customerId, String gridId);
}

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

@ -719,4 +719,20 @@ public class UserServiceImpl implements UserService {
System.out.println(format.format(calendar.getTime()));
System.out.println(format2.format(calendar.getTime()));
}
/**
* @return java.util.List<java.lang.String>
* @param customerId
* @param gridId
* @author yinzuomei
* @description 查询当前网格下首次注册的用户ids
* @Date 2020/9/21 13:44
**/
@Override
@DataSource(DataSourceConstant.EPMET_USER)
public List<String> getGridRegUserIds(String customerId, String gridId) {
return userDao.selectGridRegUserIds(customerId,gridId);
}
}

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

@ -71,8 +71,7 @@
<where>
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND
<foreach collection="list" item="ownerId" open="( " separator=" OR " close=" ) ">
<foreach collection="list" item="ownerId" open="AND ( " separator=" OR " close=" ) ">
GROUP_OWNER_ID = #{ownerId}
</foreach>
</where>
@ -84,8 +83,7 @@
<where>
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND
<foreach collection="list" item="item" open="( " separator=" OR " close=" ) ">
<foreach collection="list" item="item" open="AND ( " separator=" OR " close=" ) ">
(GROUP_OWNER_ID = #{item.userId} AND GRID_ID = #{item.gridId})
</foreach>
</where>

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

@ -108,7 +108,6 @@
fact_origin_issue_main_daily t1
WHERE
t1.DEL_FLAG = '0'
-- AND t1.TOPIC_USER_IS_PARTY = '1'
AND t1.CUSTOMER_ID = #{customerId}
AND t1.MONTH_ID = #{monthId}
AND ISNULL(T1.CREATE_TOPIC_USER_ID)=0
@ -153,4 +152,18 @@
LIMIT 2
)t
</select>
<!-- 查询俩月的网格议题总数 -->
<select id="selectIssueTotalTwoMonthPlus" resultType="com.epmet.dto.extract.form.GridIssueCountResultDTO">
SELECT
COUNT( ID ) AS issueTotal,
GRID_ID
FROM
fact_origin_issue_main_daily
WHERE
DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND (MONTH_ID = #{monthId} OR MONTH_ID = #{minusMonthId})
GROUP BY GRID_ID
</select>
</mapper>

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

@ -77,7 +77,6 @@
t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId}
AND t1.MONTH_ID = #{monthId}
-- AND t1.OPERATE_USER_IS_PARTY = '1'
AND t1.ACTION_CODE = 'comment'
GROUP BY
t1.OPERATE_USER_ID
@ -107,20 +106,21 @@
SELECT
COUNT( 1 ) AS TOTAL
FROM
fact_origin_topic_main_daily T1
fact_origin_topic_log_daily T1
WHERE
T1.DEL_FLAG = '0'
AND T1.CUSTOMER_ID = #{customerId}
AND T1.MONTH_ID = #{monthId}
AND T1.OPERATE_USER_ID = #{userId}
AND t1.ACTION_CODE = 'comment'
</select>
<!-- 组内的所有话题id -->
<select id="selectTopicIds" parameterType="map" resultType="java.lang.String">
SELECT
T1.TOPIC_ID
T1.ID AS TOPIC_ID
FROM
fact_origin_topic_log_daily T1
fact_origin_topic_main_daily T1
WHERE
T1.DEL_FLAG = '0'
AND

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

@ -72,7 +72,6 @@
fact_origin_topic_main_daily t1
WHERE
t1.DEL_FLAG = '0'
-- AND t1.CREATE_TOPIC_USER_IS_PARTY = '1'
and t1.MONTH_ID=#{monthId}
and t1.CUSTOMER_ID=#{customerId}
GROUP BY

29
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexAgencySelfSubScoreDao.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.indexcal.FactIndexAgencySelfSubScoreDao">
<resultMap type="com.epmet.entity.evaluationindex.indexcal.FactIndexAgencySelfSubScoreEntity" id="factIndexAgencySelfSubScoreMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="parentAgencyId" column="PARENT_AGENCY_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="dataType" column="DATA_TYPE"/>
<result property="scoreType" column="SCORE_TYPE"/>
<result property="score" column="SCORE"/>
<result property="indexCode" column="INDEX_CODE"/>
<result property="allParentIndexCode" column="ALL_PARENT_INDEX_CODE"/>
<result property="weight" column="WEIGHT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

28
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexCommunitySelfSubScoreDao.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.indexcal.FactIndexCommunitySelfSubScoreDao">
<resultMap type="com.epmet.entity.evaluationindex.indexcal.FactIndexCommunitySelfSubScoreEntity" id="factIndexCommunitySelfSubScoreMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="parentAgencyId" column="PARENT_AGENCY_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="scoreType" column="SCORE_TYPE"/>
<result property="score" column="SCORE"/>
<result property="indexCode" column="INDEX_CODE"/>
<result property="allParentIndexCode" column="ALL_PARENT_INDEX_CODE"/>
<result property="weight" column="WEIGHT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

29
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/FactIndexGridSelfSubScoreDao.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.indexcal.FactIndexGridSelfSubScoreDao">
<resultMap type="com.epmet.entity.evaluationindex.indexcal.FactIndexGridSelfSubScoreEntity" id="factIndexGridSelfSubScoreMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="allParentIds" column="ALL_PARENT_IDS"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="scoreType" column="SCORE_TYPE"/>
<result property="score" column="SCORE"/>
<result property="indexCode" column="INDEX_CODE"/>
<result property="allParentIndexCode" column="ALL_PARENT_INDEX_CODE"/>
<result property="weight" column="WEIGHT"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml

@ -246,5 +246,6 @@
DELETE FROM fact_index_govrn_ablity_grid_monthly
WHERE CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
LIMIT 1000
</delete>
</mapper>

1
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml

@ -265,5 +265,6 @@
WHERE
CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
LIMIT 1000
</delete>
</mapper>

14
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/ActInfoDao.xml

@ -18,4 +18,18 @@
GROUP BY
ai.SPONSOR_ID
</select>
<!-- 根据userId,查询用户是否是志愿者,返回是志愿者的用户集合 -->
<select id="selectGridRegUserVolunteer" parameterType="map" resultType="java.lang.String">
SELECT
DISTINCT vi.USER_ID
FROM
volunteer_info vi
WHERE
vi.DEL_FLAG = '0'
AND
<foreach collection="list" item="userId" separator="or" open="(" close=")">
vi.USER_ID =#{userId}
</foreach>
</select>
</mapper>

15
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml

@ -29,4 +29,19 @@
CUSTOMER_ID = #{customerId}
AND (FIRST_REGISTER = 1 OR REGISTER = 1)
</select>
<!-- 志愿者中,同时是党员的人数 -->
<select id="selectVolunteerPartyUserIds" parameterType="map" resultType="java.lang.String">
SELECT DISTINCT
pi.USER_ID
FROM
partymember_info pi
WHERE
pi.DEL_FLAG = '0'
AND ( pi.CONFIRM_RESULT = 'auto_confirm_success' OR pi.CONFIRM_RESULT = 'approved' )
AND
<foreach collection="list" item="userId" separator="or" open="(" close=")">
pi.USER_ID =#{userId}
</foreach>
</select>
</mapper>

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml

@ -76,7 +76,7 @@
0 as JOIN_TOPIC_COUNT,
0 as SHIFT_ISSUE_COUNT,
0 as SHIFT_PROJECT_COUNT,
0 as OIN_THREE_MEETS_COUNT,
0 as JOIN_THREE_MEETS_COUNT,
0 as GROUP_USER_COUNT,
0 as GROUP_ACTIVE_USER_COUNT,
0 as GROUP_TOPIC_COUNT,

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

@ -457,4 +457,17 @@
AND
rolename.ROLE_KEY = 'warmhearted'
</select>
<!-- 查询当前网格下,首次注册的用户ids -->
<select id="selectGridRegUserIds" parameterType="map" resultType="java.lang.String">
SELECT DISTINCT
USER_ID
FROM
register_relation rr
WHERE
rr.DEL_FLAG = '0'
AND rr.CUSTOMER_ID =#{customerId}
and rr.GRID_ID=#{gridId}
AND rr.FIRST_REGISTER = '1'
</select>
</mapper>

Loading…
Cancel
Save