Browse Source

Merge branch 'dev_customize' into dev_temp

# Conflicts:
#	epmet-gateway/pom.xml
#	epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml
#	epmet-module/data-statistical/data-statistical-server/pom.xml
#	epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql
#	epmet-module/epmet-ext/epmet-ext-server/pom.xml
#	epmet-module/gov-access/gov-access-server/pom.xml
#	epmet-module/oper-customize/oper-customize-server/pom.xml
#	epmet-user/epmet-user-server/pom.xml
master
sunyuchao 5 years ago
parent
commit
6095c3a018
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java
  2. 2
      epmet-gateway/pom.xml
  3. 2
      epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml
  4. 2
      epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml
  5. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java
  6. 2
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml
  7. 2
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml
  8. 2
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml
  9. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java
  10. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  11. 24
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java
  12. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java
  13. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java
  14. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java
  15. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java
  16. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  17. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java
  18. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  19. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  20. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java
  21. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java
  22. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  23. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  24. 38
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java
  25. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  26. 595
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java
  27. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java
  28. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/IndexGroupDetailServiceImpl.java
  29. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java
  30. 60
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml
  31. 61
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml
  32. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml
  33. 55
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml
  34. 57
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml
  35. 11
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml
  36. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml
  37. 24
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml
  38. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml
  39. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml
  40. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml
  41. 2
      epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml
  42. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml
  43. 4
      epmet-module/epmet-third/epmet-third-server/pom.xml
  44. 2
      epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml
  45. 21
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java
  46. 9
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java
  47. 12
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionRoleDao.java
  48. 12
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java
  49. 113
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java
  50. 4
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionRoleServiceImpl.java
  51. 15
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionRoleDao.xml
  52. 2
      epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml
  53. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetRoleKeyListFormDTO.java
  54. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  55. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  56. 2
      epmet-user/epmet-user-server/deploy/docker-compose-prod.yml
  57. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java
  58. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java
  59. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java
  60. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java
  61. 26
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java
  62. 12
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml
  63. 12
      epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java

@ -40,6 +40,7 @@ public class CustomerApplicationRunner implements ApplicationRunner {
public void run(ApplicationArguments args) {
//发送启动成功消息
EnvEnum currentEnv = EnvEnum.getCurrentEnv();
logger.info(currentEnv);
if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode())) {
InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class);
String serverIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();

2
epmet-gateway/pom.xml

@ -182,7 +182,7 @@
<!-- <gateway.routes.data-report-server.uri>http://localhost:8109</gateway.routes.data-report-server.uri>-->
<!-- 29、统计服务 -->
<gateway.routes.data-statistical-server.uri>lb://data-statistical-server</gateway.routes.data-statistical-server.uri>
<!-- <gateway.routes.data-statistical-server.uri>http://localhost:8108</gateway.routes.data-statistical-server.uri>-->
<!--<gateway.routes.data-statistical-server.uri>http://localhost:8108</gateway.routes.data-statistical-server.uri>-->
<!-- 30、内容审核服务 -->
<gateway.routes.epmet-openapi-scan.uri>lb://epmet-openapi-scan</gateway.routes.epmet-openapi-scan.uri>
<!-- <gateway.routes.epmet-openapi-scan.uri>http://localhost:8107</gateway.routes.epmet-openapi-scan.uri>-->

2
epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
data-report-server:
container_name: data-report-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.27
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.36
ports:
- "8108:8108"
network_mode: host # 使用现有网络

2
epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
data-report-server:
container_name: data-report-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-report-server:0.3.27
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-report-server:0.3.36
ports:
- "8108:8108"
network_mode: host # 使用现有网络

10
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexGridScoreDTO.java

@ -54,6 +54,16 @@ public class FactIndexGridScoreDTO implements Serializable {
*/
private String gridId;
/**
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
/**
* 季度id: yyyyQ1yyyyQ2yyyyQ3yyyyQ4
*/
private String quarterId;
/**
* 月维度Id: yyyyMM
*/

2
epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml

@ -15,4 +15,4 @@ services:
resources:
limits:
cpus: '0.1'
memory: 300M
memory: 300M

2
epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
data-statistical-server:
container_name: data-statistical-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.42
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.48
ports:
- "8108:8108"
network_mode: host # 使用现有网络

2
epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
data-statistical-server:
container_name: data-statistical-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.42
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.47
ports:
- "8108:8108"
network_mode: host # 使用现有网络

18
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/OrgTypeConstant.java

@ -9,7 +9,7 @@
package com.epmet.constant;
/**
* 组织类别 常量
* 组织类别/机关级别 常量
*
* @author sun
* @since 1.0.0
@ -30,4 +30,20 @@ public interface OrgTypeConstant {
* 组织
*/
String AGENCY = "agency";
/**
* 街道
*/
String STREET = "street";
/**
* 区县级
*/
String DISTRICT = "district";
/**
* 社区级
*/
String COMMUNITY = "community";
}

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

@ -1,8 +1,10 @@
package com.epmet.controller;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.indexcal.GridScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
@ -167,7 +169,7 @@ public class DemoController {
// deptScoreService.calculateDeptCorreLation(formDTO);
return new Result();
}
@DataSource(DataSourceConstant.EVALUATION_INDEX)
@PostMapping("insertgridinfo")
public Result insertScreenCustomerGrid(){
ScreenCustomerGridEntity entity1=new ScreenCustomerGridEntity();
@ -205,6 +207,7 @@ public class DemoController {
return new Result();
}
@DataSource(DataSourceConstant.EVALUATION_INDEX)
@PostMapping("inserttestdata")
public Result test(){
//网格相关-党建能力
@ -253,7 +256,7 @@ public class DemoController {
entity1.setPartyAvgShiftProjectCount(50); //网格党员人均提出的议题转项目数
entity1.setUserAvgShiftProjectCount(50); //网格群众人均提出的议题转项目数
entity1.setCreateGroupPartyCount(35); //建群党员数(累计值) 去重
entity1.setPublishArticleCount(35); //网格发文数
entity1.setPublishArticleCount(50); //网格发文数
entity1.setIssueToProjectRatio(new BigDecimal("50")); //网格议题转项目率
entity1.setCreateThreeMeetsCount(10); //组织三会一课次数
entity1.setJoinThreeMeetsCount(30); //党员参加三会一课人次
@ -284,7 +287,7 @@ public class DemoController {
entity2.setCreateGroupPartyCount(30); //建群党员数(累计值) 去重
entity2.setPublishArticleCount(30); //网格发文数
entity2.setIssueToProjectRatio(new BigDecimal("30")); //网格议题转项目率
entity2.setCreateThreeMeetsCount(25); //组织三会一课次数
entity2.setCreateThreeMeetsCount(35); //组织三会一课次数
entity2.setJoinThreeMeetsCount(20); //党员参加三会一课人次
entity2.setCreatedBy(IndexCalConstant.insertUser);
@ -462,4 +465,22 @@ public class DemoController {
String monthId = "202008";
indexCalculateDistrictService.calDistrictAll(customerId,monthId);
}
@PostMapping("gridZxc")
public void getGrid(){
String customerId = "b09527201c4409e19d1dbc5e3c3429a1";
String monthId = "202008";
CalculateCommonFormDTO c = new CalculateCommonFormDTO();
c.setCustomerId(customerId);
c.setMonthId(monthId);
gridCorreLationService.calculateGridCorreLation(c);
}
@PostMapping("deptZxc")
public void getDept(){
String customerId = "b09527201c4409e19d1dbc5e3c3429a1";
String monthId = "202008";
CalculateCommonFormDTO c = new CalculateCommonFormDTO();
c.setCustomerId(customerId);
c.setMonthId(monthId);
deptScoreService.calculateDeptCorreLation(c);
}
}

24
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.AgencyScoreDTO;
import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO;
import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -69,7 +70,7 @@ public interface AgencyScoreDao extends BaseDao<AgencyScoreEntity> {
* @author zxc
* @date 2020/8/31 1:51 下午
*/
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType);
/**
@ -81,4 +82,25 @@ public interface AgencyScoreDao extends BaseDao<AgencyScoreEntity> {
* @Date 10:43 2020-09-03
**/
List<AgencyScoreDTO> selectListAgencyScore(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* 批量插入区/街道相关分数表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertAgencyScoreData(@Param("list") List<AgencyScoreEntity> list, @Param("customerId")String customerId);
/**
* 根据入参查询 /街道相关分数表id
* @param customerId
* @param monthId
* @return java.util.List<java.lang.String>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListAgencyId(@Param("customerId")String customerId, @Param("monthId")String monthId);
}

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

@ -18,8 +18,8 @@
package com.epmet.dao.evaluationindex.indexcal;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.DeptScoreDTO;
import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO;
import com.epmet.dto.indexcal.DeptScoreDTO;
import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -45,6 +45,27 @@ public interface DeptScoreDao extends BaseDao<DeptScoreEntity> {
**/
List<DeptScoreDTO> selectListDeptScore(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* 批量插入 区直部门分值表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertDeptScoreData(@Param("list") List<DeptScoreEntity> list, @Param("customerId")String customerId);
/**
* 根据入参查询 区直部门分值表id
* @param customerId
* @param monthId
* @return java.lang.String
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListDeptId(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* @Description 所有直属部门治理能力平均值
@ -56,4 +77,14 @@ public interface DeptScoreDao extends BaseDao<DeptScoreEntity> {
*/
List<SubAgencyScoreAvgResultDTO> selectGovernDeptScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
/**
* @return int
* @param customerId
* @param monthId
* @param deptId
* @author yinzuomei
* @description
* @Date 2020/9/7 14:30
**/
int deleteByDeptIdAndMonthId(@Param("customerId") String customerId, @Param("monthId")String monthId,@Param("deptId") String deptId);
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java

@ -18,8 +18,6 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcal.SubCommunityGovernAvgResultDTO;
import com.epmet.dto.indexcal.SubCommunityPartyAvgResultDTO;
import com.epmet.dto.indexcal.SubCommunityAvgResultDTO;
import com.epmet.dto.screen.FactIndexCommunityScoreDTO;
import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity;
@ -82,4 +80,24 @@ public interface FactIndexCommunityScoreDao extends BaseDao<FactIndexCommunitySc
*/
List<SubCommunityAvgResultDTO> selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
/**
* 批量插入 社区相关分数表
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 11:11 2020-09-04
**/
void batchInsertCommunityScoreData(@Param("list") List<FactIndexCommunityScoreEntity> list, @Param("customerId")String customerId);
/**
* 根据入参查询 查询社区id
* @param customerId
* @param monthId
* @return java.util.List<java.util.String>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListCommunityId(@Param("customerId")String customerId, @Param("monthId")String monthId);
}

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java

@ -19,9 +19,7 @@ package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.FactIndexGridScoreDTO;
import com.epmet.dto.screen.result.SubGridGovernAvgResultDTO;
import com.epmet.dto.screen.result.SubGridAvgResultDTO;
import com.epmet.dto.screen.result.SubGridServiceAvgResultDTO;
import com.epmet.entity.evaluationindex.screen.FactIndexGridScoreEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -47,30 +45,33 @@ public interface FactIndexGridScoreDao extends BaseDao<FactIndexGridScoreEntity>
List<SubGridAvgResultDTO> selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode);
/**
* @Description 社区下属所有网格治理能力汇总平均值
* 根据入参查询 网格相关分值记录
* @param customerId
* @param monthId
* @author zxc
* @date 2020/8/31 9:19 上午
*/
List<SubGridGovernAvgResultDTO> selectSubGridGovernAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId);
* @return java.util.List<com.epmet.dto.screen.FactIndexGridScoreDTO>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<FactIndexGridScoreDTO> selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* @Description 社区下级所有网格服务能力得分平均值
* 根据入参查询 网格id
* @param customerId
* @param monthId
* @author zxc
* @date 2020/8/31 1:51 下午
*/
List<SubGridServiceAvgResultDTO> selectSubGridServiceAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId);
* @return java.util.List<java.util.String>
* @Author zhangyong
* @Date 10:43 2020-09-03
**/
List<String> selectListGridId(@Param("customerId")String customerId, @Param("monthId")String monthId);
/**
* 根据入参查询 网格相关分值记录
* 批量插入 网格相关分值表
*
* @param list
* @param customerId
* @param monthId
* @return java.util.List<com.epmet.dto.screen.FactIndexGridScoreDTO>
* @return void
* @Author zhangyong
* @Date 10:43 2020-09-03
* @Date 11:11 2020-09-04
**/
List<FactIndexGridScoreDTO> selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId);
void batchInsertGridScoreData(@Param("list") List<FactIndexGridScoreDTO> list,@Param("customerId")String customerId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/IndexGroupDetailDao.java

@ -34,6 +34,4 @@ import java.util.List;
public interface IndexGroupDetailDao extends BaseDao<IndexGroupDetailEntity> {
List<IndexGroupDetailEntity> getDetailListByParentCode(@Param("customerId") String customerId, @Param("indexCode") String indexCode);
List<IndexGroupDetailEntity> getDetailListLikeParentCode(@Param("customerId") String customerId, @Param("parentIndexCode") String parentIndexCode);
}

17
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -57,13 +57,22 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
void batchInsertCustomerAgency(@Param("list") List<CustomerAgencyFormDTO> list, @Param("customerId")String customerId);
/**
* 根据客户id组织id查询区/街道 组织名称
* 返回当前客户下未匹配到的组织信息
* @param customerId 客户id
* @param agencyIds 组织id集合
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity>
* @Author zhangyong
* @Date 14:38 2020-09-04
**/
List<ScreenCustomerAgencyEntity> selectListMismatcAgencyInfo(@Param("customerId")String customerId, @Param("agencyIds") String[] agencyIds);
/**
* 根据客户id查询区/街道 组织名称id
*
* @param customerId 客户id
* @param agencyId 组织id
* @return java.util.String
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity>
* @Author zhangyong
* @Date 16:57 2020-09-03
**/
String selectParentAgencyInfo(@Param("customerId")String customerId, @Param("agencyId")String agencyId);
List<ScreenCustomerAgencyEntity> selectListAgencyInfo(@Param("customerId")String customerId);
}

32
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java

@ -22,7 +22,6 @@ import com.epmet.dto.screencoll.form.CustomerDeptFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@ -58,16 +57,6 @@ public interface ScreenCustomerDeptDao extends BaseDao<ScreenCustomerDeptEntity>
**/
void batchInsertCustomerDept(@Param("list") List<CustomerDeptFormDTO> list, @Param("customerId")String customerId);
/**
* 根据客户id部门id查询部门父级 信息
* @param customerId 客户id
* @param deptId 部门id
* @return com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity
* @Author zhangyong
* @Date 16:57 2020-09-03
**/
ScreenCustomerDeptEntity selectParentDeptInfo(@Param("customerId")String customerId, @Param("deptId")String deptId);
/**
* @param customerId
* @param deptId
@ -77,4 +66,25 @@ public interface ScreenCustomerDeptDao extends BaseDao<ScreenCustomerDeptEntity>
* @Date 2020/9/3 16:32
**/
ScreenCustomerDeptEntity selectParentAgencyId(@Param("customerId") String customerId, @Param("deptId") String deptId);
/**
* 返回当前客户下未匹配到的区直部门信息
*
* @param customerId
* @param deptIds
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity>
* @Author zhangyong
* @Date 10:45 2020-09-04
**/
List<ScreenCustomerDeptEntity> selectListMismatchDeptInfo(@Param("customerId") String customerId,
@Param("deptIds") String[] deptIds);
/**
* 根据客户id 查询部门 信息
* @param customerId 客户id
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity>
* @Author zhangyong
* @Date 16:57 2020-09-03
**/
List<ScreenCustomerDeptEntity> selectListDeptInfo(@Param("customerId")String customerId);
}

19
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java

@ -96,12 +96,23 @@ public interface ScreenCustomerGridDao extends BaseDao<ScreenCustomerGridEntity>
ScreenCustomerGridDTO selectParentAgencyId(@Param("customerId") String customerId, @Param("gridId") String gridId);
/**
* 根据客户id网格id查询网格(党支部)父级信息
* 返回当前客户下未匹配到的网格信息
*
* @param customerId
* @param gridIds
* @return java.util.List<com.epmet.dto.ScreenCustomerGridDTO>
* @Author zhangyong
* @Date 10:45 2020-09-04
**/
List<ScreenCustomerGridDTO> selectListMismatchGridInfo(@Param("customerId") String customerId,
@Param("gridIds") String[] gridIds);
/**
* 根据客户id 查询网格(党支部)详细信息
* @param customerId
* @param gridId
* @return com.epmet.dto.screen.FactIndexGridScoreDTO
* @return java.util.List<com.epmet.dto.ScreenCustomerGridDTO>
* @Author zhangyong
* @Date 16:57 2020-09-03
**/
ScreenCustomerGridDTO selectParentGridInfo(@Param("customerId")String customerId, @Param("gridId")String gridId);
List<ScreenCustomerGridDTO> selectListGridInfo(@Param("customerId")String customerId);
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java

@ -60,4 +60,16 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao<ScreenIndexDataMonthl
* @Date 10:52 2020-08-18
**/
void batchInsertIndexDataMonthly(@Param("list") List<IndexDataMonthlyFormDTO> list, @Param("customerId")String customerId);
/**
* 获取今年的各月份的平均值
* @param customerId
* @param yearId
* @param month 做除法运算
* @return java.util.List<com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO>
* @Author zhangyong
* @Date 15:51 2020-09-04
**/
List<IndexDataMonthlyFormDTO> selectListIndexDataMonthlyByYear(@Param("customerId") String customerId,
@Param("yearId") String yearId, @Param("month") String month);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/eum/IndexCodeEnum.java

@ -24,7 +24,7 @@ public enum IndexCodeEnum {
DANG_WU_HUO_DONG("dangwuhuodong", "党务活动", 4),
LIAN_XI_QUN_ZHONG("lianxiqunzhong", "联系群众", 4),
ZUZHINEIDANGYDLXQZNLKPFPJZ("zuzhineidangydlxqznlkpfpjz","组织内党员的联系群众能力考评分(平均值)",5),
ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydsyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5),
ZUZHINEIDANGYDSYYSNLKPFPJZ("zuzhineidangydcyysnlkpfpjz","组织内党员的参与议事能力考评分(平均值)",5),
XIA_SHU_SUO_YOU_WGDDJNLPJZ("xiashusuoyouwgddjnlpjz","下属所有网格的党建能力(平均值)",5),
SHE_QU_XIA_SHU_SYWGZLNLHZPJZ("shequxiashusywgzlnlhzpjz","社区下属所有网格治理能力汇总(平均值)",5),
SHE_QU_XIA_JI_SYWGFWNLDFPJZ("shequxiajisywgfwnldfpjz","社区下级所有网格服务能力得分(平均值) ",5),

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

@ -152,7 +152,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
indexMap.forEach((key, indexInputVO) -> {
if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) {
//对应的数值
String sampleValueStr = (String) recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key));
String sampleValueStr =String.valueOf(recordMap.get(indexCodeFieldReService.getFieldNameByIndexCode(key)));
//构造样本值对象
SampleValue<BigDecimal> currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.DEPT_ID), new BigDecimal(sampleValueStr));
indexInputVO.getIndexValueVOs().add(currentGridIndexValue);
@ -194,6 +194,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl<DeptScoreDao, DeptScor
deptScoreEntity.setYearId(yearId);
deptScoreEntity.setMonthId(formDTO.getMonthId());
deptScoreEntity.setScore(governAblityScore);
deptScoreDao.deleteByDeptIdAndMonthId(formDTO.getCustomerId(),formDTO.getMonthId(),deptId);
deptScoreDao.insert(deptScoreEntity);
});
}

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

@ -126,7 +126,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList);
List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE);
publishArticleList.forEach( publish -> {
ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE);
ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
publish.forEach(c -> {
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString());
@ -166,6 +166,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.error("社区下级治理能力平均分集合为空");
return;
}
if (subGridGovernAvg.size() == NumConstant.ONE) {
pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId());
sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid);
@ -205,7 +209,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList);
List<List<Map<String, Object>>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE);
governAbilityList.forEach(governAbility -> {
ScoreCalculator<Integer> sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE);
ScoreCalculator<Integer> sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
governAbility.forEach(c -> {
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString());
@ -254,7 +258,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubGridAvgResultDTO>> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE);
serviceAvgList.forEach(serviceAvg -> {
BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE);
BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
serviceAvg.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId());
@ -284,7 +288,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList);
List<List<Map<String, Object>>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE);
communityActivityList.forEach(communityActivity -> {
ScoreCalculator<Integer> sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE);
ScoreCalculator<Integer> sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
communityActivity.forEach(c -> {
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString());

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

@ -9,7 +9,6 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao;
import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao;
import com.epmet.dto.indexcal.AgencyScoreDTO;
import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO;
@ -104,7 +103,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
//党建能力平均值
indexDetailList.forEach(detail -> {
if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL);
return;
@ -147,7 +146,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList);
List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE);
publishArticleList.forEach( publish -> {
ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE);
ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
publish.forEach(c -> {
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString());
@ -184,7 +183,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
Map<String,String> pid = new HashMap<>();
detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) {
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
if (districtGovernAvgList.size() == NumConstant.ONE) {
pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),districtGovernAvgList.get(NumConstant.ZERO).getParentId());
sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid);
@ -254,7 +253,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
detailListByParentCode.forEach(detail -> {
String indexCode = detail.getIndexCode();
if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) {
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode());
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
if (subStreetAvgList.size() == NumConstant.ONE) {
pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),subStreetAvgList.get(NumConstant.ZERO).getParentId());
sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid);
@ -263,7 +262,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE);
serviceAvgList.forEach(serviceAvg -> {
BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE);
BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
serviceAvg.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId());
@ -312,6 +311,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
score.setMonthId(monthId);
score.setYearId(DateUtils.getYearId(monthId));
score.setQuarterId(DateUtils.getQuarterId(monthId));
score.setDataType(IndexCalConstant.DISTRICT_LEVEL);
score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode());
value.forEach(community -> {
score.setScore(score.getScore().add(community.getScore()));
@ -351,7 +351,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
public void deleteAndInsert(String customerId, String monthId, String indexCode, List<AgencyScoreDTO> subAllDistrict) {
if (!CollectionUtils.isEmpty(subAllDistrict)) {
agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.DISTRICT_LEVEL);
System.err.println(subAllDistrict.size());
agencyScoreDao.insertStreetRecord(subAllDistrict);
}
}

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

@ -9,10 +9,7 @@ import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.IndexCalculateForm;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.redis.IndexCodeFieldReRedis;
import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService;
import com.epmet.service.evaluationindex.indexcal.GridCorreLationService;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateCommunityService;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateService;
import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -41,6 +38,12 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
private IndexCodeFieldReRedis indexCodeFieldReRedis;
@Autowired
private IndexCalculateCommunityService indexCalculateCommunityService;
@Autowired
private IndexCalculateStreetService indexCalculateStreetService;
@Autowired
private IndexCalculateDistrictService indexCalculateDistrictService;
@Autowired
private DeptScoreService deptScoreService;
@Override
public Boolean indexCalculate(IndexCalculateForm formDTO) {
@ -87,6 +90,33 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
log.error("indexCalculate calAll exception", e);
break;
}
//计算街道
try {
indexCalculateStreetService.calStreetAll(customerId,formDTO.getMonthId());
log.info("indexCalculate calAll return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calAll exception", e);
break;
}
//计算区直属
try {
deptScoreService.calculateDeptCorreLation(calculateCommonFormDTO);
log.info("indexCalculate calAll return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calAll exception", e);
break;
}
//计算全区
try {
indexCalculateDistrictService.calDistrictAll(customerId,formDTO.getMonthId());
log.info("indexCalculate calAll return result:{}", flag);
} catch (Exception e) {
log.error("indexCalculate calAll exception", e);
break;
}
}
return flag;
} catch (Exception e) {

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

@ -152,7 +152,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList()));
List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE);
publishArticleList.forEach(publish -> {
ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE);
ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
publish.forEach(c -> {
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString());
@ -221,8 +221,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
return;
} else if (communityGovernAbility.size() > NumConstant.ONE) {
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
System.err.println(fieldNameByIndexCode);
System.err.println(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode()));
return;
@ -231,7 +229,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList);
List<List<Map<String, Object>>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE);
governAbilityList.forEach(governAbility -> {
ScoreCalculator<Integer> sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE);
ScoreCalculator<Integer> sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
System.err.println(detail.getCorrelation());
List<SampleValue> index1SampleValues = new ArrayList<>();
governAbility.forEach(c -> {
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString());
@ -278,7 +277,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubCommunityAvgResultDTO>> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE);
serviceAvgList.forEach(serviceAvg -> {
BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE);
BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
serviceAvg.forEach(c -> {
pid.put(c.getAgencyId(),c.getParentId());
@ -308,7 +307,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList);
List<List<Map<String, Object>>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE);
communityActivityList.forEach(communityActivity -> {
ScoreCalculator<Integer> sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE);
ScoreCalculator<Integer> sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>();
communityActivity.forEach(c -> {
pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString());

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

@ -1,7 +1,10 @@
package com.epmet.service.evaluationindex.indexcoll.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao;
@ -15,10 +18,17 @@ import com.epmet.dto.indexcollect.form.*;
import com.epmet.dto.screen.FactIndexCommunityScoreDTO;
import com.epmet.dto.screen.FactIndexGridScoreDTO;
import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO;
import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO;
import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity;
import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity;
import com.epmet.eum.IndexCodeEnum;
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -38,6 +48,7 @@ import java.util.stream.Collectors;
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class FactIndexCollectServiceImpl implements FactIndexCollectService {
private static final Logger log = LoggerFactory.getLogger(FactIndexCollectServiceImpl.class);
@Autowired
private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao;
@ -207,51 +218,71 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
if (NumConstant.SIX != monthId.length()){
throw new RuntimeException("入参monthId格式不正确:monthId =" + monthId);
}
String year = monthId.substring(NumConstant.ZERO, NumConstant.FOUR);
String month = monthId.substring(NumConstant.FOUR, NumConstant.SIX);
// 开始处理 网格相关分值表
this.startHandleIndexGridScore(monthId, customerId);
// 开始处理 社区相关分值表
this.startHandleIndexCommunityScore(monthId, customerId);
// 开始处理 区直部门分值表
this.startHandleIndexDeptScore(monthId, customerId);
// 开始处理 区/街道相关分数表
this.startHandleIndexAgencyScore(monthId, customerId);
// fact_index_grid_score 网格相关分值记录表 grid
List<FactIndexGridScoreDTO> gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId);
if (null != gridScoreDTOS && gridScoreDTOS.size() > NumConstant.ZERO){
this.insertIndexDataMonthlyByGridScore(month, year, customerId, gridScoreDTOS);
}
// fact_index_community_score 社区相关分数表 agency
List<FactIndexCommunityScoreDTO> communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId);
if (null != communityScoreDTOS && communityScoreDTOS.size() > NumConstant.ZERO){
this.insertIndexDataMonthlyByCommunityScore(month, year, customerId, communityScoreDTOS);
}
// fact_index_dept_score 区直部门分值表 department
List<DeptScoreDTO> deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId);
if (null != deptScoreDTOS && deptScoreDTOS.size() > NumConstant.ZERO){
this.insertIndexDataMonthlyByDeptScore(month, year, customerId, deptScoreDTOS);
}
// 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly
this.insertIndexDataYear(monthId, customerId);
}
// fact_index_agency_score 区/街道相关分数表 agency
List<AgencyScoreDTO> agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId);
if (null != agencyScoreDTOS && agencyScoreDTOS.size() > NumConstant.ZERO) {
this.insertIndexDataMonthlyByAgencyScore(month, year, customerId, agencyScoreDTOS);
/**
* 目标将网格的 党建能力治理能力服务能力总指数 得分 整理后(4条合1条) 插入 指数-指数数据(月表)
* 如果网格相关分值表 中的网格数量不全需要从 网格(党支部)信息表 先查询到缺少的网格信息赋上默认值后在插入网格相关分值表 一对四
*
* @param monthId
* @param customerId
* @return void
* @Author zhangyong
* @Date 13:44 2020-09-04
**/
private void startHandleIndexGridScore(String monthId, String customerId){
// 查询网格相关分值记录 表已经存在的网格id
List<String> indexGridIds = factIndexGridScoreDao.selectListGridId(customerId, monthId);
if (indexGridIds.size() > NumConstant.ZERO){
// 根据网格相关分值表 中查询到的网格id,去 网格(党支部)信息表 进行不匹配查询。
String[] gridIds = new String[indexGridIds.size()];
for (int i = NumConstant.ZERO; i < indexGridIds.size(); i++){
gridIds[i] = indexGridIds.get(i);
}
// 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。
List<ScreenCustomerGridDTO> mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds);
// 将 网格相关分值表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0
if (mismatchGridList.size() > NumConstant.ZERO){
this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList);
}
} else {
// 将所有的网格按照 4种类型,各赋一遍默认值
List<ScreenCustomerGridDTO> mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null);
this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList);
}
// 插入年表 screen_index_data_yearly
// 开始处理实际分数
// fact_index_grid_score 网格相关分值记录表 grid
List<FactIndexGridScoreDTO> gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId);
this.insertIndexDataMonthlyByGridScore(monthId, customerId, gridScoreDTOS);
}
/**
* 将网格相关分值记录表 数据 插入月表 screenIndexDataMonthlyDao
*
* @param month 08
* @param year 2020
* @param monthId 202008
* @param customerId 客户id
* @param gridScoreDTOS 网格相关分值记录表 当前客户所属月份数据集
* @return void
* @Author zhangyong
* @Date 14:17 2020-09-03
**/
private void insertIndexDataMonthlyByGridScore(String month, String year, String customerId, List<FactIndexGridScoreDTO> gridScoreDTOS){
private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List<FactIndexGridScoreDTO> gridScoreDTOS){
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>();
// 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据
Map<String, List<FactIndexGridScoreDTO>> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId));
// 查询网格的 上级组织id 和 组织名称
List<ScreenCustomerGridDTO> parentGridList = screenCustomerGridDao.selectListGridInfo(customerId);
String[] orgIds = new String[collect.size()];
int j = 0;
for(Map.Entry<String,List<FactIndexGridScoreDTO>> gridScore : collect.entrySet()){
@ -259,6 +290,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
// 网格id
orgIds[j] = gridScore.getKey();
j++;
// 给4个指数 赋默认值
monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO);
for ( int i = 0; i < gridScore.getValue().size(); i++){
if (NumConstant.ONE_STR.equals(gridScore.getValue().get(i).getIsTotal())){
// 是总分
@ -267,41 +300,88 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
monthlyFormDTO.setIndexTotal(gridScore.getValue().get(i).getScore());
}
} else {
// 赋值 党建能力、治理能力、服务能力
monthlyFormDTO = this.setValueAblityMonthlyFor(gridScore.getValue().get(i).getIndexCode(),
// 赋实际值 党建能力、治理能力、服务能力
monthlyFormDTO = this.setValueAbilityMonthlyFor(gridScore.getValue().get(i).getIndexCode(),
gridScore.getValue().get(i).getScore(),
monthlyFormDTO);
}
}
// 查询网格的 上级组织id 和 组织名称
ScreenCustomerGridDTO parentGridInfo = screenCustomerGridDao.selectParentGridInfo(customerId, gridScore.getKey());
if (null == parentGridInfo){
// 匹配网格的 上级组织id 和 组织名称
String parentAgencyId = "";
String gridName = "";
for (ScreenCustomerGridDTO gridDTO : parentGridList){
if (gridScore.getKey().equals(gridDTO.getGridId())){
parentAgencyId = gridDTO.getParentAgencyId();
gridName = gridDTO.getGridName();
}
}
if ("".equals(parentAgencyId)){
throw new RuntimeException("在screen_customer_grid表中未查询到该客户下的网格信息:customerId =" + customerId + ", gridId = " + gridScore.getKey());
}
// 补充表中其他字段
monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, gridScore.getKey(),
parentGridInfo.getParentAgencyId(), parentGridInfo.getGridName(), monthlyFormDTO);
monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScore.getKey(),
parentAgencyId, gridName, monthlyFormDTO);
monthlyFormDTOList.add(monthlyFormDTO);
}
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
if (monthlyFormDTOList.size() > NumConstant.ZERO){
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
}
}
/**
* 目标将社区的 党建能力治理能力服务能力总指数 得分 整理后(4条合1条) 插入 指数-指数数据(月表)
* 如果社区相关分值表 中的社区数量不全需要从 组织机构信息 先查询到缺少的社区信息赋上默认值后在插入社区相关分值表 一对四
*
* @param monthId
* @param customerId
* @return void
* @Author zhangyong
* @Date 13:44 2020-09-04
**/
private void startHandleIndexCommunityScore(String monthId, String customerId){
// 查询社区相关分值记录id
List<String> indexCommunityIds = factIndexCommunityScoreDao.selectListCommunityId(customerId, monthId);
if (indexCommunityIds.size() > NumConstant.ZERO){
// 根据社区相关分值表 中查询到的社区id,去 组织机构信息 进行不匹配查询。
String[] communityIds = new String[indexCommunityIds.size()];
for (int i = NumConstant.ZERO; i < indexCommunityIds.size(); i++){
communityIds[i] = indexCommunityIds.get(i);
}
// 进行不匹配查询(即返回社区相关分值表 中不存在的社区信息)。
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, communityIds);
// 将 社区相关分数表 中,本月份没有的社区信息,按照 4种类型,各新增一遍,赋默认值 0
if (mismatchAgencyList.size() > NumConstant.ZERO){
this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList);
}
} else {
// 将所有的社区按照 4种类型,各赋一遍默认值
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null);
this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList);
}
// 开始处理实际分数
// fact_index_community_score 社区相关分数表 agency
// 查询社区相关分值记录
List<FactIndexCommunityScoreDTO> communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId);
this.insertIndexDataMonthlyByCommunityScore(monthId, customerId, communityScoreDTOS);
}
/**
* 社区相关分数表 数据 插入月表 screenIndexDataMonthlyDao
*
* @param month 08
* @param year 2020
* @param monthId 202008
* @param customerId 客户id
* @param communityScoreDTOS 社区相关分数表 当前客户所属月份数据集
* @return void
* @Author zhangyong
* @Date 14:17 2020-09-03
**/
private void insertIndexDataMonthlyByCommunityScore(String month, String year, String customerId, List<FactIndexCommunityScoreDTO> communityScoreDTOS){
private void insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List<FactIndexCommunityScoreDTO> communityScoreDTOS){
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>();
// 根据组织id 进行分组,最后组装一条数据 一个组织id 对应 4条数据
Map<String, List<FactIndexCommunityScoreDTO>> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId));
// 根据客户id,查询区/街道 组织名称、id
List<ScreenCustomerAgencyEntity> parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId);
String[] orgIds = new String[collect.size()];
int j = 0;
for(Map.Entry<String,List<FactIndexCommunityScoreDTO>> communityScore : collect.entrySet()){
@ -309,6 +389,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
// 组织id
orgIds[j] = communityScore.getKey();
j++;
// 给4个指数 赋默认值
monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO);
for ( int i = 0; i < communityScore.getValue().size(); i++){
if (NumConstant.ONE_STR.equals(communityScore.getValue().get(i).getIsTotal())){
// 是总分
@ -318,7 +400,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
}
} else {
// 赋值 党建能力、治理能力、服务能力
monthlyFormDTO = this.setValueAblityMonthlyFor(communityScore.getValue().get(i).getIndexCode(),
monthlyFormDTO = this.setValueAbilityMonthlyFor(communityScore.getValue().get(i).getIndexCode(),
communityScore.getValue().get(i).getScore(),
monthlyFormDTO);
}
@ -326,36 +408,76 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
// 当前组织 的上级组织id
String parentAgencyId = communityScore.getValue().get(NumConstant.ZERO).getParentAgencyId();
// 查询 组织名称
String agencyName = screenCustomerAgencyDao.selectParentAgencyInfo(customerId, communityScore.getKey());
if (null == agencyName){
// 获取 组织名称
String agencyName = "";
for (ScreenCustomerAgencyEntity agencyScoreDTO : parentAgencyList) {
if (communityScore.getKey().equals(agencyScoreDTO.getAgencyId())) {
agencyName = agencyScoreDTO.getAgencyName();
}
}
if ("".equals(agencyName)){
throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + communityScore.getKey());
}
// 补充表中其他字段
monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, communityScore.getKey(),
monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, communityScore.getKey(),
parentAgencyId, agencyName, monthlyFormDTO);
// 补充表中其他字段
monthlyFormDTOList.add(monthlyFormDTO);
}
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
if (monthlyFormDTOList.size() > NumConstant.ZERO){
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
}
}
/**
* 目标将区直部门的 党建能力治理能力服务能力总指数 得分 整理后(4条合1条) 插入 指数-指数数据(月表)
* 如果 区直部门分值表 中的部门数量不全需要从 部门信息表 先查询到缺少的部门信息赋上默认值后在插入 区直部门分值表 一对四
*
* @param monthId
* @param customerId
* @return void
* @Author zhangyong
* @Date 13:44 2020-09-04
**/
private void startHandleIndexDeptScore(String monthId, String customerId){
// 查询社 区直部门分值表
List<String> indexDeptIds = deptScoreDao.selectListDeptId(customerId, monthId);
if (indexDeptIds.size() > NumConstant.ZERO){
String[] depeIds = new String[indexDeptIds.size()];
for (int i = NumConstant.ZERO; i < indexDeptIds.size(); i++){
depeIds[i] = indexDeptIds.get(i);
}
List<ScreenCustomerDeptEntity> mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds);
if (mismatchDeptList.size() > NumConstant.ZERO){
this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList);
}
} else {
List<ScreenCustomerDeptEntity> mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null);
this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList);
}
// 开始处理实际分数
// fact_index_dept_score 区直部门分值表 department
// 查询社 区直部门分值表
List<DeptScoreDTO> deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId);
this.insertIndexDataMonthlyByDeptScore(monthId, customerId, deptScoreDTOS);
}
/**
* 将区直部门分值表 数据 插入月表 screenIndexDataMonthlyDao
*
* @param month 08
* @param year 2020
* @param monthId 202008
* @param customerId 客户id
* @param deptScoreDTOS 区直部门分值表 当前客户所属月份数据集
* @return void
* @Author zhangyong
* @Date 14:17 2020-09-03
**/
private void insertIndexDataMonthlyByDeptScore(String month, String year, String customerId, List<DeptScoreDTO> deptScoreDTOS){
private void insertIndexDataMonthlyByDeptScore(String monthId, String customerId, List<DeptScoreDTO> deptScoreDTOS){
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>();
// 根据部门id 进行分组,最后组装一条数据 一个部门id 对应 4条数据
Map<String, List<DeptScoreDTO>> collect = deptScoreDTOS.stream().collect(Collectors.groupingBy(DeptScoreDTO::getDeptId));
List<ScreenCustomerDeptEntity> parentDeptList = screenCustomerDeptDao.selectListDeptInfo(customerId);
String[] orgIds = new String[collect.size()];
int j = 0;
for(Map.Entry<String,List<DeptScoreDTO>> deptScore : collect.entrySet()){
@ -363,46 +485,85 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
// 部门id
orgIds[j] = deptScore.getKey();
j++;
// 给4个指数 赋默认值
monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO);
for ( int i = 0; i < deptScore.getValue().size(); i++){
if (NumConstant.ONE_STR.equals(deptScore.getValue().get(i).getIsTotal())){
// 是总分 总指数 = IS_TOTAL = 1
monthlyFormDTO.setIndexTotal(deptScore.getValue().get(i).getScore());
} else {
// 赋值 党建能力、治理能力、服务能力
monthlyFormDTO = this.setValueAblityMonthlyFor(deptScore.getValue().get(i).getIndexCode(),
deptScore.getValue().get(i).getScore(),
monthlyFormDTO);
}
// 区直街道的总分 就是 治理能力
monthlyFormDTO.setIndexTotal(deptScore.getValue().get(i).getScore());
// 赋值 治理能力
monthlyFormDTO = this.setValueAbilityMonthlyFor(deptScore.getValue().get(i).getIndexCode(),
deptScore.getValue().get(i).getScore(),
monthlyFormDTO);
}
// 查询网格的 上级组织id 和 组织名称
ScreenCustomerDeptEntity parentDeptInfo = screenCustomerDeptDao.selectParentDeptInfo(customerId, deptScore.getKey());
if (null == parentDeptInfo){
String parentAgencyId = "";
String deptName = "";
for (ScreenCustomerDeptEntity deptEntity : parentDeptList) {
if (deptScore.getKey().equals(deptEntity.getDeptId())) {
parentAgencyId = deptEntity.getParentAgencyId();
deptName = deptEntity.getDeptName();
}
}
if ("".equals(parentAgencyId)){
throw new RuntimeException("在screen_customer_dept表中未查询到该客户下的父级信息:customerId =" + customerId + ", deptId = " + deptScore.getKey());
}
// 补充表中其他字段
monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, deptScore.getKey(),
parentDeptInfo.getParentAgencyId(), parentDeptInfo.getDeptName(), monthlyFormDTO);
monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.DEPARTMENT, deptScore.getKey(),
parentAgencyId, deptName, monthlyFormDTO);
monthlyFormDTOList.add(monthlyFormDTO);
}
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
if (monthlyFormDTOList.size() > NumConstant.ZERO){
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
}
}
/**
* 目标 /街道的 党建能力治理能力服务能力总指数 得分 整理后(4条合1条) 插入 指数-指数数据(月表)
* 如果 /街道相关分数表 中的组织数量不全需要从 组织机构信息 先查询到缺少的组织信息赋上默认值后在插入 /街道相关分数表 一对四
*
* @param monthId
* @param customerId
* @return void
* @Author zhangyong
* @Date 13:44 2020-09-04
**/
private void startHandleIndexAgencyScore(String monthId, String customerId){
List<String> indexAgencyIds = agencyScoreDaol.selectListAgencyId(customerId, monthId);
if (indexAgencyIds.size() > NumConstant.ZERO){
String[] agencyIds = new String[indexAgencyIds.size()];
for (int i = NumConstant.ZERO; i < indexAgencyIds.size(); i++){
agencyIds[i] = indexAgencyIds.get(i);
}
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencyIds);
if (mismatchAgencyList.size() > NumConstant.ZERO){
this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList);
}
} else {
List<ScreenCustomerAgencyEntity> mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null);
this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList);
}
// 开始处理实际分数
// fact_index_agency_score 区/街道相关分数表 agency
List<AgencyScoreDTO> agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId);
this.insertIndexDataMonthlyByAgencyScore(monthId, customerId, agencyScoreDTOS);
}
/**
* 将区/街道相关分数表 数据 插入月表 screenIndexDataMonthlyDao
*
* @param month 08
* @param year 2020
* @param monthId 202008
* @param customerId 客户id
* @param agencyScoreDTOS /街道相关分数表 当前客户所属月份数据集
* @return void
* @Author zhangyong
* @Date 14:17 2020-09-03
**/
private void insertIndexDataMonthlyByAgencyScore(String month, String year, String customerId, List<AgencyScoreDTO> agencyScoreDTOS){
private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List<AgencyScoreDTO> agencyScoreDTOS){
List<IndexDataMonthlyFormDTO> monthlyFormDTOList = new ArrayList<>();
// 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据
Map<String, List<AgencyScoreDTO>> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId));
List<ScreenCustomerAgencyEntity> parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId);
String[] orgIds = new String[collect.size()];
int j = 0;
for(Map.Entry<String,List<AgencyScoreDTO>> agencyScore : collect.entrySet()){
@ -410,13 +571,15 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
// 组织id(eg:社区或者街道id)
orgIds[j] = agencyScore.getKey();
j++;
// 给4个指数 赋默认值
monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO);
for ( int i = 0; i < agencyScore.getValue().size(); i++){
if (NumConstant.ONE_STR.equals(agencyScore.getValue().get(i).getIsTotal())){
// 是总分 总指数 = IS_TOTAL = 1
monthlyFormDTO.setIndexTotal(agencyScore.getValue().get(i).getScore());
} else {
// 赋值 党建能力、治理能力、服务能力
monthlyFormDTO = this.setValueAblityMonthlyFor(agencyScore.getValue().get(i).getIndexCode(),
monthlyFormDTO = this.setValueAbilityMonthlyFor(agencyScore.getValue().get(i).getIndexCode(),
agencyScore.getValue().get(i).getScore(),
monthlyFormDTO);
}
@ -424,23 +587,29 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
// 当前组织 的上级组织id
String parentAgencyId = agencyScore.getValue().get(NumConstant.ZERO).getParentAgencyId();
// 查询 组织名称
String agencyName = screenCustomerAgencyDao.selectParentAgencyInfo(customerId, agencyScore.getKey());
if (null == agencyName){
String agencyName = "";
for (ScreenCustomerAgencyEntity agencyScoreDTO : parentAgencyList) {
if (agencyScore.getKey().equals(agencyScoreDTO.getAgencyId())) {
agencyName = agencyScoreDTO.getAgencyName();
}
}
if ("".equals(agencyName)){
throw new RuntimeException("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey());
}
// 补充表中其他字段
monthlyFormDTO = this.supplementIndexDataMonthlyTable(year, month, OrgTypeConstant.GRID, agencyScore.getKey(),
monthlyFormDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.AGENCY, agencyScore.getKey(),
parentAgencyId, agencyName, monthlyFormDTO);
monthlyFormDTOList.add(monthlyFormDTO);
}
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, year, month, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
if (monthlyFormDTOList.size() > NumConstant.ZERO){
screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds);
screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId);
}
}
/**
* 指数-指数数据(每月数值) 字段补全待新增
* @param year 2020
* @param month 08
* @param monthId 202008
* @param orgType 组织类别 agency组织部门department网格grid
* @param orgId 组织Id 可以为网格机关id
* @param parentId 上级组织id
@ -450,10 +619,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
* @Author zhangyong
* @Date 15:29 2020-09-03
**/
private IndexDataMonthlyFormDTO supplementIndexDataMonthlyTable(String year, String month, String orgType, String orgId, String parentId,
private IndexDataMonthlyFormDTO supplementIndexDataMonthlyTable(String monthId, String orgType, String orgId, String parentId,
String orgName, IndexDataMonthlyFormDTO monthlyFormDTO){
monthlyFormDTO.setYearId(year);
monthlyFormDTO.setMonthId(year + month);
monthlyFormDTO.setYearId(getYearStr(monthId));
monthlyFormDTO.setMonthId(monthId);
monthlyFormDTO.setOrgType(orgType);
monthlyFormDTO.setOrgId(orgId);
// 根据网格id,查询其上级组织id、组织名称
@ -463,8 +632,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
}
/**
* 赋值 党建能力治理能力服务能力
* (总指数 赋默认值)
* 赋实际值 党建能力治理能力服务能力
* @param IndexCode 组织类别
* @param Score 分数
* @param monthlyFormDTO 待保存的数据
@ -472,17 +640,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
* @Author zhangyong
* @Date 09:26 2020-09-04
**/
private IndexDataMonthlyFormDTO setValueAblityMonthlyFor(String IndexCode, BigDecimal Score,
IndexDataMonthlyFormDTO monthlyFormDTO){
// 赋默认值
if (null == monthlyFormDTO.getIndexTotal() && null == monthlyFormDTO.getPartyDevAblity()
&& null == monthlyFormDTO.getGovernAblity() && null == monthlyFormDTO.getServiceAblity()){
BigDecimal zero = new BigDecimal(NumConstant.ZERO);
monthlyFormDTO.setIndexTotal(zero);
monthlyFormDTO.setPartyDevAblity(zero);
monthlyFormDTO.setGovernAblity(zero);
monthlyFormDTO.setServiceAblity(zero);
}
private IndexDataMonthlyFormDTO setValueAbilityMonthlyFor(String IndexCode, BigDecimal Score, IndexDataMonthlyFormDTO monthlyFormDTO){
// 赋实际值
if (IndexCodeEnum.DANG_JIAN_NENG_LI.getCode().equals(IndexCode)){
// 党建能力
@ -496,4 +654,257 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService {
}
return monthlyFormDTO;
}
/**
* 设置 指数-指数数据()
* 总指数党建能力指数治理能力服务能力 默认值 0
* @param monthlyFormDTO
* @return com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO
* @Author zhangyong
* @Date 11:01 2020-09-04
**/
private IndexDataMonthlyFormDTO setIndexDefaultValueFor(IndexDataMonthlyFormDTO monthlyFormDTO){
BigDecimal zero = new BigDecimal(NumConstant.ZERO);
monthlyFormDTO.setIndexTotal(zero);
monthlyFormDTO.setPartyDevAblity(zero);
monthlyFormDTO.setGovernAblity(zero);
monthlyFormDTO.setServiceAblity(zero);
return monthlyFormDTO;
}
/**
* 新增 网格相关分值记录表 默认值一条网格按照组织类别的不同 需要插入4次
*
* @param monthId 202008
* @param customerId
* @param mismatchGridList 网格相关分值记录表 中缺少的网格集合
* @return void
* @Author zhangyong
* @Date 14:02 2020-09-04
**/
private void insertIndexGridScoreDefaultValue(String monthId, String customerId, List<ScreenCustomerGridDTO> mismatchGridList){
List<FactIndexGridScoreDTO> insertIndexGridScoreDTOS = new ArrayList<>();
BigDecimal zero = new BigDecimal(NumConstant.ZERO);
for (ScreenCustomerGridDTO gridDTO : mismatchGridList){
FactIndexGridScoreDTO indexGridScoreDTO = new FactIndexGridScoreDTO();
// 赋默认值 - 党建能力指数
indexGridScoreDTO.setGridId(gridDTO.getGridId());
indexGridScoreDTO.setAgencyId(gridDTO.getParentAgencyId());
indexGridScoreDTO.setAllParentIds(gridDTO.getAllParentIds());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
indexGridScoreDTO.setQuarterId(DateUtils.getQuarterId(monthId));
indexGridScoreDTO.setYearId(getYearStr(monthId));
indexGridScoreDTO.setMonthId(monthId);
// 0 or 1
indexGridScoreDTO.setIsTotal(NumConstant.ZERO_STR);
indexGridScoreDTO.setScore(zero);
indexGridScoreDTO.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
indexGridScoreDTO.setDelFlag(NumConstant.ZERO_STR);
insertIndexGridScoreDTOS.add(indexGridScoreDTO);
FactIndexGridScoreDTO indexGridScoreDTO1 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class);
// 赋默认值 - 治理能力
indexGridScoreDTO1.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
insertIndexGridScoreDTOS.add(indexGridScoreDTO1);
FactIndexGridScoreDTO indexGridScoreDTO2 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class);
// 赋默认值 - 服务能力
indexGridScoreDTO2.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode());
insertIndexGridScoreDTOS.add(indexGridScoreDTO2);
FactIndexGridScoreDTO indexGridScoreDTO3 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class);
indexGridScoreDTO3.setIsTotal(NumConstant.ONE_STR);
// 赋默认值 - 网格相关
indexGridScoreDTO3.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode());
insertIndexGridScoreDTOS.add(indexGridScoreDTO3);
}
factIndexGridScoreDao.batchInsertGridScoreData(insertIndexGridScoreDTOS, customerId);
}
/**
* 新增 社区相关分数表 默认值一条组织id按照组织类别的不同 需要插入4次
*
* @param monthId
* @param customerId
* @param mismatchAgencyList
* @return void
* @Author zhangyong
* @Date 14:02 2020-09-04
**/
private void insertIndexCommunityScoreDefaultValue(String monthId, String customerId, List<ScreenCustomerAgencyEntity> mismatchAgencyList){
List<FactIndexCommunityScoreEntity> insertIndexCommunityScore = new ArrayList<>();
BigDecimal zero = new BigDecimal(NumConstant.ZERO);
for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){
FactIndexCommunityScoreEntity communityScore1 = new FactIndexCommunityScoreEntity();
// 赋默认值 - 党建能力指数
communityScore1.setAgencyId(agencyDTO.getAgencyId());
communityScore1.setParentAgencyId(agencyDTO.getPid());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
communityScore1.setQuarterId(DateUtils.getQuarterId(monthId));
communityScore1.setYearId(getYearStr(monthId));
communityScore1.setMonthId(monthId);
// 0 or 1
communityScore1.setIsTotal(NumConstant.ZERO_STR);
communityScore1.setScore(zero);
communityScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
insertIndexCommunityScore.add(communityScore1);
// 赋默认值 - 治理能力
FactIndexCommunityScoreEntity communityScore2 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class);
communityScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
insertIndexCommunityScore.add(communityScore2);
// 赋默认值 - 服务能力
FactIndexCommunityScoreEntity communityScore3 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class);
communityScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode());
insertIndexCommunityScore.add(communityScore3);
// 赋默认值 - 社区相关
FactIndexCommunityScoreEntity communityScore4 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class);
communityScore4.setIsTotal(NumConstant.ONE_STR);
communityScore4.setIndexCode(IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode());
insertIndexCommunityScore.add(communityScore4);
}
factIndexCommunityScoreDao.batchInsertCommunityScoreData(insertIndexCommunityScore, customerId);
}
/**
* 新增 区直部门分值表 默认值一条部门id按照组织类别的不同 需要插入1次
*
* @param monthId
* @param customerId
* @param mismatchDeptList
* @return void
* @Author zhangyong
* @Date 14:02 2020-09-04
**/
private void insertIndexDeptScoreDefaultValueFor(String monthId, String customerId, List<ScreenCustomerDeptEntity> mismatchDeptList){
List<DeptScoreEntity> insertIndexDeptScore = new ArrayList<>();
for (ScreenCustomerDeptEntity deptDTO : mismatchDeptList){
DeptScoreEntity deptScore2 = new DeptScoreEntity();
// 赋默认值 - 治理能力
deptScore2.setDeptId(deptDTO.getDeptId());
deptScore2.setAgencyId(deptDTO.getParentAgencyId());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
deptScore2.setQuarterId(DateUtils.getQuarterId(monthId));
deptScore2.setYearId(getYearStr(monthId));
deptScore2.setMonthId(monthId);
deptScore2.setIsTotal(NumConstant.ZERO_STR);
deptScore2.setScore(new BigDecimal(NumConstant.ZERO));
deptScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
deptScore2.setDelFlag(NumConstant.ZERO_STR);
insertIndexDeptScore.add(deptScore2);
}
deptScoreDao.batchInsertDeptScoreData(insertIndexDeptScore, customerId);
}
/**
* 新增 /街道相关分数表 默认值一条组织id按照组织类别的不同 需要插入4次
*
* @param monthId
* @param customerId
* @param mismatchAgencyList
* @return void
* @Author zhangyong
* @Date 14:02 2020-09-04
**/
private void insertIndexAgencyScoreDefaultValueFor(String monthId, String customerId, List<ScreenCustomerAgencyEntity> mismatchAgencyList){
BigDecimal zero = new BigDecimal(NumConstant.ZERO);
List<AgencyScoreEntity> insertIndexAgencyScore = new ArrayList<>();
for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){
if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel()) || OrgTypeConstant.STREET.equals(agencyDTO.getLevel())
|| OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){
AgencyScoreEntity agencyScore1 = new AgencyScoreEntity();
// 赋默认值 - 党建能力指数
agencyScore1.setAgencyId(agencyDTO.getAgencyId());
agencyScore1.setParentAgencyId(agencyDTO.getPid());
//季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4
agencyScore1.setQuarterId(DateUtils.getQuarterId(monthId));
agencyScore1.setYearId(getYearStr(monthId));
agencyScore1.setMonthId(monthId);
// 0 or 1
agencyScore1.setIsTotal(NumConstant.ZERO_STR);
agencyScore1.setScore(zero);
agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
AgencyScoreEntity agencyScore2 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class);
// 赋默认值 - 治理能力
agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
AgencyScoreEntity agencyScore3 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class);
// 赋默认值 - 服务能力
agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode());
AgencyScoreEntity agencyScore4 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class);
agencyScore4.setIsTotal(NumConstant.ONE_STR);
if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel())){
// 赋默认值 - 全区相关
agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode());
agencyScore4.setDataType(OrgTypeConstant.DISTRICT);
agencyScore1.setDataType(OrgTypeConstant.DISTRICT);
agencyScore2.setDataType(OrgTypeConstant.DISTRICT);
agencyScore3.setDataType(OrgTypeConstant.DISTRICT);
} else if (OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){
// 赋默认值 - 街道相关
agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode());
agencyScore4.setDataType(OrgTypeConstant.STREET);
agencyScore1.setDataType(OrgTypeConstant.STREET);
agencyScore2.setDataType(OrgTypeConstant.STREET);
agencyScore3.setDataType(OrgTypeConstant.STREET);
}
insertIndexAgencyScore.add(agencyScore1);
insertIndexAgencyScore.add(agencyScore2);
insertIndexAgencyScore.add(agencyScore3);
insertIndexAgencyScore.add(agencyScore4);
}
}
agencyScoreDaol.batchInsertAgencyScoreData(insertIndexAgencyScore, customerId);
}
/**
* 根据年汇总今年各项得到计算平均值后 插入年表 screen_index_data_yearly
*
* @param monthId
* @param customerId
* @return void
* @Author zhangyong
* @Date 22:06 2020-09-04
**/
private void insertIndexDataYear(String monthId, String customerId){
List<IndexDataMonthlyFormDTO> monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, getYearStr(monthId), getMonthStr(monthId));
String[] orgIds = new String[monthlyFormList.size()];
for (int i = NumConstant.ZERO; i < monthlyFormList.size(); i++){
orgIds[i] = monthlyFormList.get(i).getOrgId();
}
if (monthlyFormList.size() > NumConstant.ZERO){
screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId), orgIds);
List<IndexDataYearlyFormDTO> entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class);
screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId);
}
}
/**
* 将月份id拆分成 年份
*
* @param monthId 202008
* @return java.lang.String
* @Author zhangyong
* @Date 13:39 2020-09-04
**/
private String getYearStr(String monthId){
return monthId.substring(NumConstant.ZERO, NumConstant.FOUR);
}
/**
* 将月份id拆分成 月份
*
* @param monthId 202008
* @return java.lang.String
* @Author zhangyong
* @Date 13:39 2020-09-04
**/
private String getMonthStr(String monthId){
return monthId.substring(NumConstant.FOUR, NumConstant.SIX);
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/IndexGroupDetailService.java

@ -35,12 +35,4 @@ public interface IndexGroupDetailService extends BaseService<IndexGroupDetailEnt
* @param indexCode
*/
List<IndexGroupDetailEntity> getDetailListByParentCode(String customerId,String... indexCode);
/**
* desc获取所有 包含该指标code的
* @param customerId
* @param parentIndexCode
* @return
*/
List<IndexGroupDetailEntity> getDetailListLikeParentCode(String customerId, String parentIndexCode);
}

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

@ -51,9 +51,4 @@ public class IndexGroupDetailServiceImpl extends BaseServiceImpl<IndexGroupDetai
}
return baseDao.getDetailListByParentCode(customerId,sb.deleteCharAt(sb.length()-1).toString());
}
@Override
public List<IndexGroupDetailEntity> getDetailListLikeParentCode(String customerId, String parentIndexCode) {
return baseDao.getDetailListLikeParentCode(customerId,parentIndexCode);
}
}

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/Pinyin4jUtil.java

@ -29,7 +29,8 @@ public class Pinyin4jUtil {
duoyinMap.put('期',new String[]{"qi"});
duoyinMap.put('参',new String[]{"can"});
duoyinMap.put('均',new String[]{"jun"});
duoyinMap.put('会',new String[]{"hui"});
duoyinMap.put('会', new String[]{"hui"});
duoyinMap.put('属', new String[]{"shu"});
}
/**

60
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml

@ -100,6 +100,66 @@
AND fics.customer_id = #{customerId}
AND fics.month_id = #{monthId}
AND fics.index_code = #{indexCode}
AND fics.DATA_TYPE = #{dataType}
GROUP BY fics.agency_id
</select>
<insert id="batchInsertAgencyScoreData" parameterType="map">
insert into fact_index_agency_score
(
ID,
CUSTOMER_ID,
AGENCY_ID,
PARENT_AGENCY_ID,
YEAR_ID,
QUARTER_ID,
MONTH_ID,
DATA_TYPE,
IS_TOTAL,
SCORE,
INDEX_CODE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{item.agencyId},
#{item.parentAgencyId},
#{item.yearId},
#{item.quarterId},
#{item.monthId},
#{item.dataType},
#{item.isTotal},
#{item.score},
#{item.indexCode},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<select id="selectListAgencyId" resultType="String">
SELECT
AGENCY_ID agencyId
FROM
fact_index_agency_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY AGENCY_ID
</select>
</mapper>

61
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml

@ -43,4 +43,65 @@
GROUP BY fidc.agency_id
</select>
<insert id="batchInsertDeptScoreData" parameterType="map">
insert into fact_index_dept_score
(
ID,
CUSTOMER_ID,
DEPT_ID,
AGENCY_ID,
QUARTER_ID,
YEAR_ID,
MONTH_ID,
IS_TOTAL,
SCORE,
INDEX_CODE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{item.deptId},
#{item.agencyId},
#{item.quarterId},
#{item.yearId},
#{item.monthId},
#{item.isTotal},
#{item.score},
#{item.indexCode},
#{item.delFlag},
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<select id="selectListDeptId" resultType="String">
SELECT
DEPT_ID deptId
FROM
fact_index_dept_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY DEPT_ID
</select>
<delete id="deleteByDeptIdAndMonthId" parameterType="map">
delete from fact_index_dept_score where CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
and DEPT_ID=#{deptId}
</delete>
</mapper>

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml

@ -101,7 +101,7 @@
MAX(m.TRANSFERED_COUNT) as TRANSFERED_COUNT_MAX,
MIN(m.CLOSED_PROJECT_COUNT) as CLOSED_PROJECT_COUNT_MIN,
MAX(m.CLOSED_PROJECT_COUNT) as CLOSED_PROJECT_COUNT_MAX,
MIN(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MIN_MAX,
MIN(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MIN,
MAX(m.RESP_PROJECT_RATIO) as RESP_PROJECT_RATIO_MAX,
MIN(m.HANDLE_PROJECT_RATIO) as HANDLE_PROJECT_RATIO_MIN,
MAX(m.HANDLE_PROJECT_RATIO) as HANDLE_PROJECT_RATIO_MAX,

55
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml

@ -102,4 +102,59 @@
AND MONTH_ID = #{monthId}
ORDER BY AGENCY_ID
</select>
<insert id="batchInsertCommunityScoreData" parameterType="map">
insert into fact_index_community_score
(
ID,
CUSTOMER_ID,
AGENCY_ID,
PARENT_AGENCY_ID,
YEAR_ID,
QUARTER_ID,
MONTH_ID,
IS_TOTAL,
SCORE,
INDEX_CODE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{item.agencyId},
#{item.parentAgencyId},
#{item.yearId},
#{item.quarterId},
#{item.monthId},
#{item.isTotal},
#{item.score},
#{item.indexCode},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<select id="selectListCommunityId" resultType="String">
SELECT
AGENCY_ID agencyId
FROM
fact_index_community_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY AGENCY_ID
</select>
</mapper>

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

@ -43,4 +43,61 @@
AND MONTH_ID = #{monthId}
ORDER BY GRID_ID
</select>
<insert id="batchInsertGridScoreData" parameterType="map">
insert into fact_index_grid_score
(
ID,
CUSTOMER_ID,
GRID_ID,
AGENCY_ID,
ALL_PARENT_IDS,
QUARTER_ID,
YEAR_ID,
MONTH_ID,
IS_TOTAL,
SCORE,
INDEX_CODE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
#{item.gridId},
#{item.agencyId},
#{item.allParentIds},
#{item.quarterId},
#{item.yearId},
#{item.monthId},
#{item.isTotal},
#{item.score},
#{item.indexCode},
#{item.delFlag},
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<select id="selectListGridId" resultType="String">
SELECT
GRID_ID gridId
FROM
fact_index_grid_score
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND MONTH_ID = #{monthId}
ORDER BY GRID_ID
</select>
</mapper>

11
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailDao.xml

@ -6,19 +6,10 @@
<select id="getDetailListByParentCode" resultType="com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity">
select
ID,CUSTOMER_ID, INDEX_GROUP_ID, INDEX_ID, INDEX_CODE, WEIGHT, THRESHOLD, ALL_PARENT_INDEX_CODE
ID,CUSTOMER_ID, INDEX_GROUP_ID, INDEX_ID, INDEX_CODE, WEIGHT, THRESHOLD, ALL_PARENT_INDEX_CODE, CORRELATION
FROM index_group_detail
WHERE
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and STATUS = 'enable' and DEL_FLAG = '0'
and ALL_PARENT_INDEX_CODE = #{indexCode,jdbcType=VARCHAR}
</select>
<select id="getDetailListLikeParentCode" resultType="com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity">
select
ID, CUSTOMER_ID, INDEX_GROUP_ID, INDEX_ID, INDEX_CODE, WEIGHT, THRESHOLD, ALL_PARENT_INDEX_CODE
FROM index_group_detail
WHERE
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and STATUS = 'enable' and DEL_FLAG = '0'
and ALL_PARENT_INDEX_CODE like concat(#{parentIndexCode,jdbcType=VARCHAR},'%')
</select>
</mapper>

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/IndexGroupDetailTemplateDao.xml

@ -7,7 +7,7 @@
delete from index_group_detail_template
</delete>
<select id="selectAll" resultType="com.epmet.entity.evaluationindex.screen.IndexGroupDetailTemplateEntity">
select ID, INDEX_GROUP_ID, INDEX_ID, INDEX_CODE, WEIGHT, THRESHOLD, ALL_PARENT_INDEX_CODE
select ID, INDEX_GROUP_ID, INDEX_ID, INDEX_CODE, WEIGHT, THRESHOLD, ALL_PARENT_INDEX_CODE, CORRELATION
from index_group_detail_template
where STATUS = 'enable' and DEL_FLAG = '0'
</select>

24
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml

@ -60,14 +60,34 @@
</foreach>
</insert>
<select id="selectParentAgencyInfo" parameterType="map" resultType="String">
<select id="selectListMismatcAgencyInfo" parameterType="map" resultType="com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity">
SELECT
AGENCY_ID agencyId,
AGENCY_NAME agencyName,
PID pid,
PIDS pids,
`LEVEL` `level`
FROM
screen_customer_agency
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID =#{customerId}
<if test="agencyIds != null and agencyIds!= ''">
AND AGENCY_ID NOT IN
<foreach item="item" collection="agencyIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="selectListAgencyInfo" parameterType="map" resultType="com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity">
SELECT
AGENCY_ID agencyId,
AGENCY_NAME agencyName
FROM
screen_customer_agency
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID =#{customerId}
AND AGENCY_ID = #{agencyId}
</select>
</mapper>

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml

@ -64,8 +64,28 @@
AND m.CUSTOMER_ID =#{customerId}
AND m.DEPT_ID =#{deptId}
</select>
<select id="selectParentDeptInfo" parameterType="map" resultType="com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity">
<select id="selectListMismatchDeptInfo" parameterType="map" resultType="com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity">
SELECT
DEPT_ID deptId,
DEPT_NAME deptName,
PARENT_AGENCY_ID parentAgencyId
FROM
screen_customer_dept
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID =#{customerId}
<if test="deptIds != null and deptIds!= ''">
AND DEPT_ID NOT IN
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="selectListDeptInfo" parameterType="map" resultType="com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity">
SELECT
DEPT_ID deptId,
PARENT_AGENCY_ID parentAgencyId,
DEPT_NAME deptName
FROM
@ -73,6 +93,5 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID =#{customerId}
AND DEPT_ID = #{deptId}
</select>
</mapper>

23
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml

@ -106,8 +106,28 @@
AND m.GRID_ID = #{gridId}
</select>
<select id="selectParentGridInfo" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
<select id="selectListMismatchGridInfo" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
SELECT
GRID_ID gridId,
GRID_NAME gridName,
PARENT_AGENCY_ID parentAgencyId,
ALL_PARENT_IDS allParentIds
FROM
screen_customer_grid
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID =#{customerId}
<if test="gridIds != null and gridIds!= ''">
AND GRID_ID NOT IN
<foreach item="item" collection="gridIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="selectListGridInfo" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
SELECT
GRID_ID gridId,
GRID_NAME gridName,
PARENT_AGENCY_ID parentAgencyId
FROM
@ -115,6 +135,5 @@
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID =#{customerId}
AND GRID_ID = #{gridId}
</select>
</mapper>

19
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml

@ -59,4 +59,23 @@
</foreach>
</insert>
<select id="selectListIndexDataMonthlyByYear" parameterType="map" resultType="com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO">
SELECT
YEAR_ID yearId,
MONTH_ID monthId,
ORG_TYPE orgType,
ORG_ID orgId,
PARENT_ID parentId,
ORG_NAME orgName,
SUM(INDEX_TOTAL) / #{month} as indexTotal,
SUM(PARTY_DEV_ABLITY) / #{month} as partyDevAblity,
SUM(SERVICE_ABLITY) / #{month} as serviceAblity,
SUM(GOVERN_ABLITY) / #{month} as governAblity
FROM screen_index_data_monthly
WHERE DEL_FLAG = '0'
AND YEAR_ID = #{yearId}
AND CUSTOMER_ID = #{customerId}
GROUP BY ORG_ID
</select>
</mapper>

2
epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-ext-server:
container_name: epmet-ext-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.6
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.7
ports:
- "8113:8113"
network_mode: host # 使用现有网络

2
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-third-server:
container_name: epmet-third-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.131
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.132
ports:
- "8110:8110"
network_mode: host # 使用现有网络

4
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -203,8 +203,8 @@
<spring.redis.password>123456</spring.redis.password>
<!-- nacos -->
<nacos.register-enabled>true</nacos.register-enabled>
<nacos.server-addr>122.152.200.70:8848</nacos.server-addr>
<nacos.discovery.namespace>fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b</nacos.discovery.namespace>
<nacos.server-addr>192.168.1.130:8848</nacos.server-addr>
<nacos.discovery.namespace>6ceab336-d004-4acf-89c6-e121d06f4988</nacos.discovery.namespace>
<nacos.config.namespace></nacos.config.namespace>
<nacos.config.group></nacos.config.group>
<nacos.config-enabled>false</nacos.config-enabled>

2
epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-project-server:
container_name: gov-project-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.40
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.43
ports:
- "8102:8102"
network_mode: host # 使用现有网络

21
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java

@ -5,6 +5,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 查询客户定制功能列表-接口入参
@ -25,6 +26,11 @@ public class FunctionDetailFromDTO implements Serializable {
*/
@NotBlank(message = "客户Id不能为空", groups = {AddUserShowGroup.class})
private String customerId;
/**
* 网格ID
*/
@NotBlank(message = "网格Id不能为空", groups = {AddUserShowGroup.class})
private String gridId;
/**
* resi居民端work工作端
@ -32,4 +38,19 @@ public class FunctionDetailFromDTO implements Serializable {
@NotBlank(message = "所属端不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class})
private String clientType;
/**
* token中userId
*/
private String userId;
/**
* 所属端居民端resi 工作端gov
*/
private String fromApp;
/**
* 用户角色key集合
*/
private List<String> roleKeyList;
}

9
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java

@ -18,6 +18,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -105,7 +106,9 @@ public class CustomerFunctionDetailController {
@PostMapping("resifunctiondetaillist")
public Result<List<FunctionDetailResultDTO>> resiFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserShowGroup.class);
return new Result<List<FunctionDetailResultDTO>>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO));
formDTO.setUserId(tokenDto.getUserId());
formDTO.setFromApp(AppClientConstant.APP_RESI);
return new Result<List<FunctionDetailResultDTO>>().ok(customerFunctionDetailService.resiFunctionDetail(formDTO));
}
/**
@ -118,7 +121,9 @@ public class CustomerFunctionDetailController {
public Result<List<FunctionDetailResultDTO>> workFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserInternalGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<FunctionDetailResultDTO>>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO));
formDTO.setUserId(tokenDto.getUserId());
formDTO.setFromApp(AppClientConstant.APP_GOV);
return new Result<List<FunctionDetailResultDTO>>().ok(customerFunctionDetailService.workFunctionDetail(formDTO));
}
/**

12
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionRoleDao.java

@ -20,6 +20,8 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerFunctionRoleDTO;
import com.epmet.dto.form.CustomerFunctionRoleListFormDTO;
import com.epmet.dto.form.FunctionDetailFromDTO;
import com.epmet.dto.form.SaveCustomerFunctionRoleFormDTO;
import com.epmet.dto.result.CustomerFunctionRoleListResultDTO;
import com.epmet.entity.CustomerFunctionRoleEntity;
import org.apache.ibatis.annotations.Mapper;
@ -40,7 +42,7 @@ public interface CustomerFunctionRoleDao extends BaseDao<CustomerFunctionRoleEnt
* @author sun
* @Description 根据客户Id删除客户功能角色信息
*/
void delByCustomerId(@Param("customerId") String customerId);
void delByCustomerId(SaveCustomerFunctionRoleFormDTO formDTO);
/**
* @param formDTO
@ -49,4 +51,12 @@ public interface CustomerFunctionRoleDao extends BaseDao<CustomerFunctionRoleEnt
* @Description 查询客户定制功能角色列表
*/
List<CustomerFunctionRoleListResultDTO> selectCustomerFunctionRoleList(CustomerFunctionRoleListFormDTO formDTO);
/**
* @param formDTO
* @return
* @author sun
* @Description 根据用户拥有的角色查询客户的定制功能
*/
List<String> selectFunctionList(FunctionDetailFromDTO formDTO);
}

12
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java

@ -102,9 +102,17 @@ public interface CustomerFunctionDetailService extends BaseService<CustomerFunct
* @param formDTO
* @return
* @Author sun
* @Description 根据所属端和客户Id查询客户定制功能列表
* @Description 居民端-根据所属端和客户Id查询客户定制功能列表
**/
List<FunctionDetailResultDTO> resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO);
List<FunctionDetailResultDTO> resiFunctionDetail(FunctionDetailFromDTO formDTO);
/**
* @param formDTO
* @return
* @Author sun
* @Description 工作端-根据所属端和客户Id查询客户定制功能列表
**/
List<FunctionDetailResultDTO> workFunctionDetail(FunctionDetailFromDTO formDTO);
/**
* 修改客户定制功能上下架

113
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java

@ -20,6 +20,7 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -28,10 +29,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.CustomerFunctionDao;
import com.epmet.dao.CustomerFunctionDetailDao;
import com.epmet.dao.FunctionCustomizedDao;
import com.epmet.dao.FunctionShoppingHistoryDao;
import com.epmet.dao.*;
import com.epmet.dto.CustomerFunctionDetailDTO;
import com.epmet.dto.FunctionCustomizedDTO;
import com.epmet.dto.FunctionShoppingHistoryDTO;
@ -40,6 +38,7 @@ import com.epmet.dto.result.*;
import com.epmet.entity.CustomerFunctionDetailEntity;
import com.epmet.entity.CustomerFunctionEntity;
import com.epmet.entity.FunctionShoppingHistoryEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.CustomerFunctionDetailRedis;
import com.epmet.service.CustomerFunctionDetailService;
import com.epmet.service.FunctionShoppingHistoryService;
@ -49,6 +48,7 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import rx.internal.util.LinkedArrayList;
import java.util.*;
import java.util.stream.Collectors;
@ -73,6 +73,10 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl<CustomerF
private CustomerFunctionDao customerFunctionDao;
@Autowired
private FunctionShoppingHistoryDao functionShoppingHistoryDao;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private CustomerFunctionRoleDao customerFunctionRoleDao;
@Override
public PageData<CustomerFunctionDetailDTO> page(Map<String, Object> params) {
@ -126,6 +130,58 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl<CustomerF
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 根据所属端和客户Id查询客户定制功能列表
**/
@Override
public List<FunctionDetailResultDTO> resiFunctionDetail(FunctionDetailFromDTO formDTO) {
List<FunctionDetailResultDTO> restltList = new LinkedList<>();
//1.根据客户Id和所属端查询客户定制功能列表数据
logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType()));
List<FunctionDetailResultDTO> list = baseDao.selectFunctionDetailList(formDTO);
if (null != list && list.size() > NumConstant.ZERO) {
//1-1.设置自定义json数据(暂时为空)
try {
String join = String.join(",", new ArrayList<>());
String customerParameter = java.net.URLEncoder.encode(join, "utf-8");
list.forEach(l -> {
l.setCustomerParameter(customerParameter);
});
} catch (Exception e) {
logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败");
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage());
}
//2.调用user服务,获取用户角色信息
GetRoleKeyListFormDTO dto = new GetRoleKeyListFormDTO();
dto.setUserId(formDTO.getUserId());
dto.setGridId(formDTO.getGridId());
dto.setFromApp(AppClientConstant.APP_RESI);
Result<List<String>> result = epmetUserOpenFeignClient.getUserRoleKeyList(dto);
if (!result.success()) {
throw new RenException(result.getCode());
}
formDTO.setRoleKeyList(result.getData());
//3.根据用户拥有的角色查询客户的定制功能
List<String> listFunctionIds = customerFunctionRoleDao.selectFunctionList(formDTO);
//4.封装结果数据
listFunctionIds.forEach(id -> {
list.forEach(l -> {
if (id.equals(l.getFunctionId())) {
restltList.add(l);
}
});
});
}
return restltList;
}
/**
* @param formDTO
* @return
@ -133,21 +189,48 @@ public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl<CustomerF
* @Description 根据所属端和客户Id查询客户定制功能列表
**/
@Override
public List<FunctionDetailResultDTO> resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO) {
//根据客户Id和所属端查询客户定制功能列表数据
public List<FunctionDetailResultDTO> workFunctionDetail(FunctionDetailFromDTO formDTO) {
List<FunctionDetailResultDTO> restltList = new LinkedList<>();
//1.根据客户Id和所属端查询客户定制功能列表数据
logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType()));
List<FunctionDetailResultDTO> list = baseDao.selectFunctionDetailList(formDTO);
try {
String join = String.join(",", new ArrayList<>());
String customerParameter = java.net.URLEncoder.encode(join, "utf-8");
list.forEach(l->{
l.setCustomerParameter(customerParameter);
if (null != list && list.size() > NumConstant.ZERO) {
//1-1.设置自定义json数据(暂时为空)
try {
String join = String.join(",", new ArrayList<>());
String customerParameter = java.net.URLEncoder.encode(join, "utf-8");
list.forEach(l->{
l.setCustomerParameter(customerParameter);
});
} catch (Exception e) {
logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败");
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage());
}
//2.调用user服务,获取用户角色信息
GetRoleKeyListFormDTO dto = new GetRoleKeyListFormDTO();
dto.setUserId(formDTO.getUserId());
dto.setFromApp(AppClientConstant.APP_GOV);
Result<List<String>> result = epmetUserOpenFeignClient.getUserRoleKeyList(dto);
if (!result.success()) {
throw new RenException(result.getCode());
}
formDTO.setRoleKeyList(result.getData());
//3.根据用户拥有的角色查询客户的定制功能
List<String> listFunctionIds = customerFunctionRoleDao.selectFunctionList(formDTO);
//4.封装结果数据
listFunctionIds.forEach(id -> {
list.forEach(l -> {
if (id.equals(l.getFunctionId())) {
restltList.add(l);
}
});
});
} catch (Exception e) {
logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败");
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage());
}
return list;
return restltList;
}
@Override

4
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionRoleServiceImpl.java

@ -129,8 +129,8 @@ public class CustomerFunctionRoleServiceImpl extends BaseServiceImpl<CustomerFun
listEntity.add(entity);
});
//2.先按客户Id执行删除操作
baseDao.delByCustomerId(formDTO.getCustomerId());
//2.先按客户Id、功能Id执行删除操作
baseDao.delByCustomerId(formDTO);
//3.批量新增
if(!insertBatch(listEntity)){

15
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionRoleDao.xml

@ -15,10 +15,25 @@
AND function_id = #{functionId}
</select>
<select id="selectFunctionList" resultType="java.lang.String">
SELECT
DISTINCT
FUNCTION_ID
FROM customer_function_role
WHERE del_flag = '0'
AND customer_id = #{customerId}
AND from_app = #{fromApp}
<foreach collection="roleKeyList" item="roleKey" index="index" open="AND ( " separator=" OR " close=")">
role_key = #{roleKey}
</foreach>
</select>
<delete id="delByCustomerId">
DELETE
FROM customer_function_role
WHERE customer_id = #{customerId}
AND function_id = #{functionId}
</delete>
</mapper>

2
epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-mine-server:
container_name: resi-mine-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.39
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.40
ports:
- "8094:8094"
network_mode: host # 使用现有网络

28
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetRoleKeyListFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 获取用户拥有的角色key集合-接口入参
* @Author sun
*/
@Data
public class GetRoleKeyListFormDTO implements Serializable{
private static final long serialVersionUID = -7994579456530273809L;
/**
* 用户Id
* */
private String userId;
/**
* 网格Id
* */
private String gridId;
/**
* 所属端居民端resi 工作端gov
* */
private String fromApp;
}

7
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -306,4 +306,11 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping("epmetuser/staffrole/changeroleorg")
Result changeRoleOrg(@RequestBody StaffRoleDTO formDTO);
/**
* @Author sun
* @Description 居民端-查询用户角色key列表
**/
@PostMapping("epmetuser/role/getuserrolekeylist")
Result<List<String>> getUserRoleKeyList(@RequestBody GetRoleKeyListFormDTO dto);
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -205,4 +205,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result changeRoleOrg(StaffRoleDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "changeRoleOrg", formDTO);
}
@Override
public Result<List<String>> getUserRoleKeyList(GetRoleKeyListFormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleKeyList", dto);
}
}

2
epmet-user/epmet-user-server/deploy/docker-compose-prod.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-prod
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.122
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.124
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

14
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java

@ -17,7 +17,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -26,6 +28,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.RoleDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.excel.RoleExcel;
import com.epmet.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
@ -91,4 +94,15 @@ public class RoleController {
ExcelUtils.exportExcelToTarget(response, null, list, RoleExcel.class);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 居民端-查询用户角色key列表
**/
@PostMapping("getuserrolekeylist")
public Result<List<String>> getUserRoleKeyList(@RequestBody GetRoleKeyListFormDTO formDTO) {
return new Result<List<String>>().ok(roleService.getUserRoleKeyList(formDTO));
}
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java

@ -23,6 +23,7 @@ import com.epmet.commons.mybatis.entity.DataScope;
import com.epmet.dto.StaffRoleDTO;
import com.epmet.dto.form.CommonUserFormDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.dto.result.CustomerStaffRoleListResultDTO;
import com.epmet.dto.result.CustomerStaffRoleResultDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
@ -122,4 +123,12 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
* @return void
*/
void updateStaffRoleOrgId(StaffRoleDTO dto);
/**
* @param formDTO
* @return
* @Author sun
* @Description 工作端-查询用户角色key列表
**/
List<String> selectStaffRoleKeyList(GetRoleKeyListFormDTO formDTO);
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.dto.form.UserRoleFormDTO;
import com.epmet.dto.result.UserRoleResultDTO;
import com.epmet.entity.UserRoleEntity;
@ -63,4 +64,12 @@ public interface UserRoleDao extends BaseDao<UserRoleEntity> {
* @Date 14:24 2020-07-23
**/
List<UserRoleResultDTO> getUserRoleInfoByUserId(@Param("userId") String userId);
/**
* @param formDTO
* @return
* @Author sun
* @Description 居民端-查询用户角色key列表
**/
List<String> selectUserRoleKeyList(GetRoleKeyListFormDTO formDTO);
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java

@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.RoleDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.entity.RoleEntity;
import java.util.List;
@ -99,4 +100,12 @@ public interface RoleService extends BaseService<RoleEntity> {
* @return RoleDTO
*/
RoleDTO getRoleByKey(RoleDTO role);
/**
* @param formDTO
* @return
* @Author sun
* @Description 居民端-查询用户角色key列表
**/
List<String> getUserRoleKeyList(GetRoleKeyListFormDTO formDTO);
}

26
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java

@ -20,11 +20,15 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.RoleDao;
import com.epmet.dao.StaffRoleDao;
import com.epmet.dao.UserRoleDao;
import com.epmet.dto.RoleDTO;
import com.epmet.dto.form.GetRoleKeyListFormDTO;
import com.epmet.entity.RoleEntity;
import com.epmet.redis.RoleRedis;
import com.epmet.service.RoleService;
@ -33,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -48,6 +53,10 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleDao, RoleEntity> implem
@Autowired
private RoleRedis roleRedis;
@Autowired
private UserRoleDao userRoleDao;
@Autowired
private StaffRoleDao staffRoleDao;
@Override
public PageData<RoleDTO> page(Map<String, Object> params) {
@ -106,4 +115,21 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleDao, RoleEntity> implem
RoleEntity entity = baseDao.selectRoleByKey(ConvertUtils.sourceToTarget(role, RoleEntity.class));
return ConvertUtils.sourceToTarget(entity, RoleDTO.class);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 居民端-查询用户角色key列表
**/
@Override
public List<String> getUserRoleKeyList(GetRoleKeyListFormDTO formDTO) {
List<String> list = new ArrayList<>();
if(AppClientConstant.APP_RESI.equals(formDTO.getFromApp())){
list = userRoleDao.selectUserRoleKeyList(formDTO);
}else if(AppClientConstant.APP_GOV.equals(formDTO.getFromApp())){
list = staffRoleDao.selectStaffRoleKeyList(formDTO);
}
return list;
}
}

12
epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml

@ -181,4 +181,16 @@
and sr.ROLE_ID = #{roleId}
and sr.DEL_FLAG='0'
</select>
<select id="selectStaffRoleKeyList" resultType="java.lang.String">
SELECT
gsr.role_key
FROM
staff_role sr
INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id
WHERE
sr.del_flag = '0'
AND gsr.del_flag = '0'
AND sr.staff_id = #{userId}
</select>
</mapper>

12
epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml

@ -88,4 +88,16 @@
ur.USER_ID = #{userId}
</where>
</select>
<select id="selectUserRoleKeyList" resultType="java.lang.String">
SELECT
DISTINCT
er.role_key
FROM user_role ur
JOIN epmet_role er ON ur.role_id = er.id
WHERE er.del_flag = '0'
AND ur.del_flag = '0'
AND ur.user_id = #{userId}
AND ( ur.grid_id = #{gridId} OR ur.grid_id = 'all' )
</select>
</mapper>

Loading…
Cancel
Save