Browse Source

Merge branches 'dev' and 'dev_wx_msg' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_wx_msg

 Conflicts:
	epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java
dev
sunyuchao 5 years ago
parent
commit
2440ebc200
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java
  2. 18
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java
  3. 23
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java
  4. 5
      epmet-module/data-report/data-report-client/pom.xml
  5. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java
  6. 31
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentByBizTypeFormDTO.java
  7. 37
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubSingleIndexRankFormDTO.java
  8. 22
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/TreeByTypeFormDTO.java
  9. 6
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java
  10. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java
  11. 28
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java
  12. 3
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java
  13. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java
  14. 61
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java
  15. 77
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectProcessResultDTO.java
  16. 5
      epmet-module/data-report/data-report-server/pom.xml
  17. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java
  18. 37
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/backdoor/BackDoorController.java
  19. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java
  20. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
  21. 21
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
  22. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java
  23. 18
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  24. 30
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  25. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java
  26. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  27. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java
  28. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java
  29. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java
  30. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/BackDoorService.java
  31. 50
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/impl/BackDoorServiceImpl.java
  32. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
  33. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java
  34. 14
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenDifficultyDataService.java
  35. 91
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  36. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  37. 31
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java
  38. 28
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java
  39. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
  40. 36
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  41. 20
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml
  42. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml
  43. 20
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml
  44. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml
  45. 20
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml
  46. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml
  47. 87
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  48. 14
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
  49. 25
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml
  50. 47
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  51. 26
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/CustomerBizOrgFormDTO.java
  52. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java
  53. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java
  54. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java
  55. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java
  56. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java
  57. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  58. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerBizOrgDao.java
  59. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java
  60. 52
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerBizOrgEntity.java
  61. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  62. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  63. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  64. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  65. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  66. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java
  67. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java
  68. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  69. 34
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java
  70. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java
  71. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java
  72. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml
  73. 39
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerBizOrgDao.xml
  74. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml
  75. 13
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/GetJwtAccessTokenFormDTO.java
  76. 32
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AppIdInfoResultDTO.java
  77. 16
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java
  78. 16
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java
  79. 12
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java
  80. 27
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java
  81. 9
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java
  82. 6
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java
  83. 28
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java
  84. 38
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java
  85. 14
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml
  86. 16
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimPartyMemberServiceImpl.java
  87. 27
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CustomerTemplateListFormDTO.java
  88. 30
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerTemplateListResultDTO.java
  89. 15
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PersonalTemplateController.java
  90. 9
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java
  91. 9
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java
  92. 12
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PersonalTemplateServiceImpl.java
  93. 43
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java
  94. 15
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml
  95. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  96. 1
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  97. 48
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessAndCurrentDeptResultDTO.java
  98. 6
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
  99. 8
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
  100. 12
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java

@ -11,6 +11,8 @@ public enum CommonOperateTypeEnum {
ADD("add", "添加"),
EDIT("edit", "编辑"),
DEL("del", "删除"),
DESC("DESC", "降序"),
ASC("ASC", "升序"),
;
private String code;

18
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java

@ -11,21 +11,23 @@ import org.springframework.core.env.Environment;
* @date 2020-07-03 11:14
**/
public enum EnvEnum {
LOCAL("local", "本地环境"),
DEV("dev", "开发环境"),
TEST("test", "体验环境"),
PROD("prod", "生产环境"),
UN_KNOWN("un_known", "未知"),
LOCAL("local", "本地环境","http://localhost:8080/api/"),
DEV("dev", "开发环境","http://192.168.1.130:8080/api/"),
TEST("test", "体验环境","https://epmet-dev.elinkservice.cn/api/"),
PROD("prod", "生产环境","https://epmet-cloud.elinkservice.cn/api/"),
UN_KNOWN("un_known", "未知","https://epmet-dev.elinkservice.cn/api/"),
;
private String code;
private String name;
private String url;
EnvEnum(String code, String name) {
EnvEnum(String code, String name, String url) {
this.code = code;
this.name = name;
this.url = url;
}
public static EnvEnum getEnum(String code) {
@ -59,4 +61,8 @@ public enum EnvEnum {
public String getName() {
return name;
}
public String getUrl(){
return url;
}
}

23
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java

@ -159,6 +159,29 @@ public class HttpClientManager {
}
public Result<String> sendPostByJSONAndHeader(String url, String jsonStrParam,Map<String,String> headerMap) {
try {
HttpPost httppost = new HttpPost(url);
httppost.setConfig(requestConfig);
httppost.addHeader("Content-Type", "application/json; charset=utf-8");
if (null != headerMap){
headerMap.forEach((k,v) -> {
httppost.addHeader(k,v);
});
}
if (StringUtils.isNotEmpty(jsonStrParam)) {
StringEntity se = new StringEntity(jsonStrParam, "utf-8");
httppost.setEntity(se);
}
return execute(httppost, false);
} catch (Exception e) {
log.error("send exception", e);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg());
}
}
/**
* 上传临时素材
* @author zhaoqifeng

5
epmet-module/data-report/data-report-client/pom.xml

@ -17,6 +17,11 @@
<artifactId>epmet-commons-tools</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-project-client</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java

@ -16,6 +16,8 @@ public interface ScreenConstant {
String COMMA = ",";
String COLON = ":";
String MONTH_ID = "month";
String YEAR_ID = "year";

31
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentByBizTypeFormDTO.java

@ -0,0 +1,31 @@
package com.epmet.evaluationindex.screen.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/10/22
*/
@Data
public class CompartmentByBizTypeFormDTO implements Serializable {
private static final long serialVersionUID = -3354778434424878413L;
public interface CompartmentByBizType extends CustomerClientShowGroup {}
/**
* 机关ID
*/
@NotBlank(message = "机关ID不能为空",groups = {CompartmentByBizType.class})
private String agencyId;
/**
* 业务类型
*/
@NotBlank(message = "bizType不能为空", groups = {CompartmentByBizType.class})
private String bizType;
}

37
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubSingleIndexRankFormDTO.java

@ -0,0 +1,37 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* desc:下级组织单项排行分数 form
*
* @DateTime 2020/8/20 9:54 上午
*/
@Data
public class SubSingleIndexRankFormDTO implements Serializable {
private static final long serialVersionUID = -2920561669035794486L;
@NotBlank(message = "客户ID不能为空")
private String customerId;
/**
* 机关ID
*/
@NotBlank(message = "机关ID不能为空")
private String agencyId;
@NotBlank(message = "指标code不能为空")
private String indexCode;
/**
* 默认查询前几名
*/
private Integer topNum;
private String monthId;
private String orgType;
private String sort;
}

22
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/TreeByTypeFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.evaluationindex.screen.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/10/22 10:52 上午
*/
@Data
public class TreeByTypeFormDTO implements Serializable {
private static final long serialVersionUID = -1438758394814978472L;
public interface TreeByType extends CustomerClientShowGroup{}
@NotBlank(message = "bizType不能为空",groups = TreeByType.class)
private String bizType;
}

6
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 按月查询各项指标数据--接口返参
@ -30,4 +31,9 @@ public class AblityListResultDTO implements Serializable {
*/
private String showType;
/**
* 指标对应的权重
*/
private BigDecimal weight;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java

@ -37,4 +37,9 @@ public class AgencyDistributionResultDTO implements Serializable {
* 组织agency; 网格grid ; 部门dept
*/
private String type;
public AgencyDistributionResultDTO() {
this.subAreaMarks = "";
this.subCenterMark = "";
}
}

28
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/10/26 3:36 下午
*/
@Data
@AllArgsConstructor
public class DepartmentNameListResultDTO implements Serializable {
private static final long serialVersionUID = -801407836277197080L;
/**
* 部门名
*/
private String departmentName;
/**
* 工作人员
*/
private List<String> staffList;
}

3
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java

@ -5,7 +5,8 @@ import lombok.Data;
import java.io.Serializable;
/**
* 同级对比各项数据查询--接口返参
* 同级对比(下级单项指数排行)各项数据查询--接口返参
*
* @Author sun
*/
@Data

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java

@ -20,4 +20,6 @@ public interface ProjectConstant {
*/
String TYPE_EXCEPTION = "必要参数为空或参数格式错误";
String PROCESS_FAILURE = "查询项目进展失败......";
}

61
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java

@ -0,0 +1,61 @@
package com.epmet.project.dto.result;
import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/10/23 10:13 上午
*/
@Data
public class ProjectDetailResultDTO implements Serializable {
private static final long serialVersionUID = 2450826789942547426L;
/** 事件 = 项目
* 事件标题
*/
private String eventTitle;
/**
* 事件内容
*/
private String eventContent;
/**
* 事件来源
*/
private String eventSource;
/**
* 事件图片集合
*/
private List<String> imgUrlList;
/**
* 项目进展
*/
private List<ProjectProcessResultDTO> processList;
/**
* 当前跟进部门
*/
private List<String> departmentNameList;
/**
* 当前跟进部门
*/
private List<DepartmentNameListResultDTO> departmentList;
public ProjectDetailResultDTO() {
this.eventTitle = "";
this.eventContent = "";
this.eventSource = "";
this.imgUrlList = new ArrayList<>();
this.processList = new ArrayList<>();
}
}

77
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectProcessResultDTO.java

@ -0,0 +1,77 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.project.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 项目跟踪-项目处理进展列表-接口返参
*
* @author sun
*/
@Data
public class ProjectProcessResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 项目Id
*/
private String projectId = "";
/**
* 项目处理进展Id
*/
private String processId = "";
/**
* 处理进展名称
*/
private String processName = "";
/**
* 处理进展时间
*/
private Long processTime;
/**
* 处理进展时间 字符串
*/
//@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//private String processTimeStr;
/**
* 处理部门
*/
private String departmentName = "";
/**
* 公开答复
*/
private String publicReply = "";
/**
* 内部备注
*/
private String internalRemark = "";
}

5
epmet-module/data-report/data-report-server/pom.xml

@ -29,6 +29,11 @@
<artifactId>epmet-user-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>common-service-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java

@ -61,4 +61,6 @@ public interface FactConstant {
* 评价指标类型-百分比
*/
String PERCENT = "percent";
String URL = "https://epmet-dev.elinkservice.cn/api/";
}

37
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/backdoor/BackDoorController.java

@ -0,0 +1,37 @@
package com.epmet.datareport.controller.backdoor;
import com.epmet.datareport.service.backdoor.BackDoorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @Author zxc
* @DateTime 2020/10/21 5:17 下午
*/
@RestController
@RequestMapping("backdoor")
public class BackDoorController {
@Autowired
private BackDoorService backDoorService;
/**
* desc: 重定向到target 方法适用于外部鉴权接口的查询 比如大屏的查询接口
*
* @param dataType
* @param appId
* @param target
* @param targetParam
* @return java.lang.String
* @author LiuJanJun
* @date 2020/10/23 1:44 下午
*/
@PostMapping("redirect/external")
public Object backDoor(@RequestHeader(value = "Data-Type", defaultValue = "real", required = false) String dataType,
@RequestHeader(value = "env", defaultValue = "test", required = false) String env,
@RequestHeader("AppId") String appId, @RequestHeader("target") String target,
@RequestBody(required = false) Object targetParam) {
return backDoorService.redirect(dataType, appId, target, targetParam,env);
}
}

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java

@ -1,7 +1,5 @@
package com.epmet.datareport.controller.fact;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.fact.FactIndexService;
@ -40,7 +38,7 @@ public class FactIndexController {
/**
* @param formDTO
* @Description 按月份查询各项能力分数
* @Description 按月份查询本级及下级分数
* @author sun
*/
@PostMapping("index/scorelist")

13
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java

@ -5,6 +5,7 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.module.project.service.ProjectService;
import com.epmet.project.constant.ProjectConstant;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
@ -78,4 +79,16 @@ public class ProjectController {
return new Result<List<ProjectIncrTrendResultDTO>>().ok(projectService.getProjectIncrTrend(tokenDto, formDTO));
}
/**
* @Description 项目详情
* @Param processListFormDTO
* @author zxc
* @date 2020/10/23 10:31 上午
*/
@PostMapping("projectdetail")
public Result<ProjectDetailResultDTO> projectDetail(@RequestBody ProcessListFormDTO processListFormDTO){
ValidatorUtils.validateEntity(processListFormDTO);
return new Result<ProjectDetailResultDTO>().ok(projectService.projectDetail(processListFormDTO));
}
}

21
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java

@ -3,7 +3,9 @@ package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
@ -33,6 +35,19 @@ public class AgencyController {
return new Result<TreeResultDTO>().ok(agencyService.tree(customerId));
}
/**
* @Description 智慧社区的tree
* @Param customerId
* @Param bizType
* @author zxc
* @date 2020/10/21 2:49 下午
*/
@PostMapping("treebytype")
public Result<TreeResultDTO> treeByType(@RequestHeader("CustomerId") String customerId,@RequestBody TreeByTypeFormDTO bizType){
ValidatorUtils.validateEntity(bizType, TreeByTypeFormDTO.TreeByType.class);
return new Result<TreeResultDTO>().ok(agencyService.treeByType(customerId,bizType));
}
/**
* @Description 2组织区域查询
* @param compartmentFormDTO
@ -45,4 +60,10 @@ public class AgencyController {
return new Result<CompartmentResultDTO>().ok(agencyService.compartment(compartmentFormDTO));
}
@PostMapping("compartmentbybiztype")
public Result<CompartmentResultDTO> compartmentByBizType(@RequestBody CompartmentByBizTypeFormDTO compartmentFormDTO){
ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentByBizTypeFormDTO.CompartmentByBizType.class);
return new Result<CompartmentResultDTO>().ok(agencyService.compartmentByBizType(compartmentFormDTO));
}
}

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java

@ -27,8 +27,8 @@ public class DistributionController {
private DistributionService distributionService;
/**
* @Description 1党支部
* @param formDTO
* @Description 1党支部分布 只显示 screen_customer_biz_org 表中存在的orgId的数据
* @author zxc
* @date 2020/8/18 10:59 上午
*/
@ -39,7 +39,7 @@ public class DistributionController {
}
/**
* @Description 2用户分布
* @Description 2用户分布 只显示 screen_customer_biz_org 表中存在的orgId的数据
* @param userFormDTO
* @author zxc
* @date 2020/8/18 11:10 上午
@ -51,7 +51,7 @@ public class DistributionController {
}
/**
* @Description 3党员分布
* @Description 3党员分布 只显示 screen_customer_biz_org 表中存在的orgId的数据
* @param parymemberFormDTO
* @author zxc
* @date 2020/8/18 11:20 上午

18
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java

@ -1,7 +1,5 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.eum.OrgTypeEnum;
@ -88,6 +86,22 @@ public class IndexController {
return new Result<List<AnNingSubAgencyIndexRankResultDTO>>().ok(indexService.getSubAgencyIndexRank(formDTO));
}
/**
* desc: 下级组织单项指数得分排行
*
* @param customerId
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.evaluationindex.screen.dto.result.PeerComparisonResultDTO>>
* @author LiuJanJun
* @date 2020/10/22 1:49 下午
*/
@PostMapping("subsingleindexrank")
public Result<List<PeerComparisonResultDTO>> getSubSingleIndexRank(@RequestHeader("CustomerId") String customerId, @RequestBody SubSingleIndexRankFormDTO formDTO) {
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return new Result<List<PeerComparisonResultDTO>>().ok(indexService.getSubSingleIndexRank(formDTO));
}
/**
* @param formDTO
* @Description 4获取该客户下所有网格指标排行

30
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -33,48 +33,56 @@ import java.util.List;
public interface ScreenCustomerAgencyDao {
/**
* @Description 查询客户根组织ID
* @param customerId
* @Description 查询客户根组织ID
* @author zxc
* @date 2020/8/18 2:44 下午
*/
TreeResultDTO selectRootAgencyId(@Param("customerId") String customerId);
TreeResultDTO selectRootAgencyIdByBizType(@Param("customerId") String customerId, @Param("bizType") String bizType);
/**
* @Description 查询下级机关的 名称和id
* @param subAgencyPids
* @Description 查询下级机关的 名称和id
* @author zxc
* @date 2020/8/18 4:48 下午
*/
List<TreeResultDTO> selectSubAgencyList(@Param("subAgencyPids") String subAgencyPids);
List<TreeResultDTO> selectSubAgencyListByBizType(@Param("subAgencyPids") String subAgencyPids);
/**
* @Description 查询当前机关的区域信息
* @param agencyId
* @Description 查询当前机关的区域信息
* @author zxc
* @date 2020/8/18 4:51 下午
*/
CompartmentResultDTO getAgencyAreaInfo(@Param("agencyId") String agencyId);
CompartmentResultDTO getAgencyAreaInfoByBizType(@Param("agencyId") String agencyId, @Param("bizType") String bizType);
/**
* @Description 查询子级区域分布信息机关级别
* @param agencyId
* @Description 查询子级区域分布信息机关级别
* @author zxc
* @date 2020/8/18 5:12 下午
*/
List<AgencyDistributionResultDTO> selectSubDistribution(@Param("agencyId") String agencyId);
List<AgencyDistributionResultDTO> selectSubDistributionByType(@Param("agencyId") String agencyId, @Param("bizType") String bizType);
/**
* @Description 查询子级用户分布机关级别
* @param parentId
* @Description 查询子级用户分布机关级别
* @author zxc
* @date 2020/8/19 9:33 上午
*/
List<UserDistributionResultDTO> selectUserDistributionAgency(@Param("parentId") String parentId);
/**
* @Description 查询子级党员分布机关级别
* @param parentId
* @Description 查询子级党员分布机关级别
* @author zxc
* @date 2020/8/19 10:30 上午
*/
@ -86,4 +94,14 @@ public interface ScreenCustomerAgencyDao {
* @author sun
*/
int selectRootAgency(@Param("agencyId") String agencyId);
/**
* desc: 根据orgId获取组织信息
*
* @param agencyId
* @return com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO
* @author LiuJanJun
* @date 2020/10/23 3:54 下午
*/
CompartmentResultDTO getAgencyInfoByAegncyId(@Param("agencyId") String agencyId);
}

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java

@ -18,6 +18,7 @@
package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.result.DifficultProjectResultDTO;
import com.epmet.project.dto.result.ProjectDetailResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -41,4 +42,6 @@ public interface ScreenDifficultyDataDao {
**/
List<DifficultProjectResultDTO> selectDifficulty(@Param("agencyId")String agencyId,@Param("type")String type);
ProjectDetailResultDTO projectDetail(@Param("eventId")String projectId);
}

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java

@ -95,4 +95,11 @@ public interface ScreenIndexDataMonthlyDao{
* @author sun
*/
List<IndexAdvanceBranchRankResultDTO> selectRankList(AdvancedBranchRankFormDTO formDTO);
/**
* @param formDTO
* @Description 下级单项指标得分排行
* @author sun
*/
List<PeerComparisonResultDTO> getSingleIndexRank(SubSingleIndexRankFormDTO formDTO);
}

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java

@ -39,22 +39,22 @@ public interface FactIndexAgencyScoreDao {
/**
* @param formDTO
* @Description 分别查询区县乡镇街道过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @Description 分别查询区县乡镇街道过去12个月党建能力治理能力服务能力每月各项乘以权重后的得分数据
* @author sun
*/
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectAblityIndex(AblityIndexFormDTO formDTO);
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectAgencyAblityWeightScoreIndex(AblityIndexFormDTO formDTO);
/**
* @param formDTO
* @Description 查询当前组织某一月份党建能力治理能力服务能力对应的总分本级分下级分
* @author sun
*/
List<ScoreListResultDTO> selectScoreList(ScoreListFormDTO formDTO);
List<ScoreListResultDTO> selectAgencyWeightScoreList(ScoreListFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查询区县乡镇街道过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectMonthScoreList(MonthScoreListFormDTO formDTO);
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectAgencyMonthWeightScoreList(MonthScoreListFormDTO formDTO);
}

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java

@ -42,19 +42,19 @@ public interface FactIndexCommunityScoreDao {
* @Description 分别查询社区过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectCommunityAblityIndex(AblityIndexFormDTO formDTO);
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectCommunityAblityWeightScore(AblityIndexFormDTO formDTO);
/**
* @param formDTO
* @Description 查询社区级组织某一月份党建能力治理能力服务能力对应的总分本级分下级分
* @author sun
*/
List<ScoreListResultDTO> selectCommunityScoreList(ScoreListFormDTO formDTO);
List<ScoreListResultDTO> selectCommunityWeightScoreList(ScoreListFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查询社区过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectCommunityMonthScoreList(MonthScoreListFormDTO formDTO);
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectCommunityMonthWeightScoreList(MonthScoreListFormDTO formDTO);
}

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java

@ -42,19 +42,19 @@ public interface FactIndexGridScoreDao {
* @Description 分别查网格过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectGridAblityIndex(AblityIndexFormDTO formDTO);
LinkedList<AblityIndexResultDTO.ScoreListResultDTO> selectGridAblityWeightScore(AblityIndexFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查网格某一月份党建能力治理能力服务能力对应的总分本级分下级分
* @author sun
*/
List<ScoreListResultDTO> selectGridScoreList(ScoreListFormDTO formDTO);
List<ScoreListResultDTO> selectGridWeightScoreList(ScoreListFormDTO formDTO);
/**
* @param formDTO
* @Description 分别查网格过去12个月党建能力治理能力服务能力每月总分本级得分下级得分数据
* @author sun
*/
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectGridMonthScoreList(MonthScoreListFormDTO formDTO);
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectGridMonthWeightScoreList(MonthScoreListFormDTO formDTO);
}

11
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/BackDoorService.java

@ -0,0 +1,11 @@
package com.epmet.datareport.service.backdoor;
/**
* @Author zxc
* @DateTime 2020/10/21 5:17 下午
*/
public interface BackDoorService {
Object redirect(String dataType, String appId, String target, Object o,String env);
}

50
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/impl/BackDoorServiceImpl.java

@ -0,0 +1,50 @@
package com.epmet.datareport.service.backdoor.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.datareport.constant.FactConstant;
import com.epmet.datareport.service.backdoor.BackDoorService;
import com.epmet.dto.result.AppIdInfoResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
* @Author zxc
* @DateTime 2020/10/21 5:17 下午
*/
@Service
@Slf4j
public class BackDoorServiceImpl implements BackDoorService {
@Autowired
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Override
public Object redirect(String dataType, String appId, String target, Object targetParam, String env) {
Result<AppIdInfoResultDTO> appIdInfoResultDTOResult = commonServiceOpenFeignClient.appIdInfo(appId);
if (!appIdInfoResultDTOResult.success()) {
throw new RenException("获取accessToken失败......");
}
AppIdInfoResultDTO data = appIdInfoResultDTOResult.getData();
String url = EnvEnum.getEnum(env).getUrl().concat(target);
Map<String, String> headerMap = new HashMap<>(16);
headerMap.put("AccessToken", data.getAccessToken());
headerMap.put("AppId", data.getAppId());
headerMap.put("AuthType", "jwt");
headerMap.put("Data-Type",dataType);
Result<String> stringResult = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(targetParam), headerMap);
log.info(JSON.toJSONString(stringResult));
if (!stringResult.success()){
throw new RenException("请求【"+url+"】失败......"+stringResult.error());
}
return JSON.parseObject(stringResult.getData());
}
}

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java

@ -1,6 +1,8 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
@ -20,6 +22,9 @@ public interface AgencyService {
*/
TreeResultDTO tree(String customerId);
TreeResultDTO treeByType(String customerId, TreeByTypeFormDTO bizType);
/**
* @Description 2组织区域查询
* @param compartmentFormDTO
@ -28,4 +33,6 @@ public interface AgencyService {
*/
CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO);
CompartmentResultDTO compartmentByBizType(CompartmentByBizTypeFormDTO compartmentFormDTO);
}

10
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java

@ -76,4 +76,14 @@ public interface IndexService {
* @author sun
*/
List<IndexAdvanceBranchRankResultDTO> advancedBranchRank(AdvancedBranchRankFormDTO formDTO);
/**
* desc:下级单项指数排行
*
* @param formDTO
* @return java.util.List<com.epmet.evaluationindex.screen.dto.result.PeerComparisonResultDTO>
* @author LiuJanJun
* @date 2020/10/22 10:58 上午
*/
List<PeerComparisonResultDTO> getSubSingleIndexRank(SubSingleIndexRankFormDTO formDTO);
}

14
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenDifficultyDataService.java

@ -0,0 +1,14 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.project.dto.result.ProjectDetailResultDTO;
/**
* @Author zxc
* @DateTime 2020/10/23 1:26 下午
*/
public interface ScreenDifficultyDataService {
ProjectDetailResultDTO projectDetail(ProcessListFormDTO processListFormDTO);
}

91
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

@ -8,7 +8,9 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
@ -66,6 +68,37 @@ public class AgencyServiceImpl implements AgencyService {
return rootAgency;
}
/**
* @Description 智慧社区的tree
* @Param customerId
* @Param bizType
* @author zxc
* @date 2020/10/21 2:49 下午
*/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
public TreeResultDTO treeByType(String customerId, TreeByTypeFormDTO bizType) {
TreeResultDTO rootAgency = null;
try {
rootAgency = screenCustomerAgencyDao.selectRootAgencyIdByBizType(customerId,bizType.getBizType());
if (null == rootAgency) {
return new TreeResultDTO();
}
} catch (TooManyResultsException e) {
throw new RenException("根组织结构数据有误");
}
List<Double> centerMark = this.getCenterMark(rootAgency.getCenterMarkA());
rootAgency.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark);
if (rootAgency.getLevel().equals(ScreenConstant.COMMUNITY)) {
List<TreeResultDTO> treeResultDTOS = screenCustomerGridDao.selectGridInfo(rootAgency.getValue());
rootAgency.setChildren(treeResultDTOS);
} else {
List<TreeResultDTO> departmentList = this.getDepartmentListByBiz(("".equals(rootAgency.getPids()) || rootAgency.getPids().equals(NumConstant.ZERO_STR)) ? rootAgency.getValue() : rootAgency.getPids().concat(",").concat(rootAgency.getValue()));
rootAgency.setChildren(departmentList);
}
return rootAgency;
}
/**
* @Description 处理centerMark
* @param centerMark
@ -105,7 +138,45 @@ public class AgencyServiceImpl implements AgencyService {
});
sub.setChildren(treeResultDTOS);
}else {
List<TreeResultDTO> subAgency = getDepartmentList(sub.getPids() + "," + sub.getValue());
List<TreeResultDTO> subAgency = new ArrayList<>();
if (sub.getPids().contains(ScreenConstant.COMMA)){
subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COMMA + sub.getValue());
}else {
subAgency = getDepartmentList(sub.getPids() + ScreenConstant.COLON + sub.getValue());
}
sub.setChildren(subAgency);
}
});
}
return subAgencyList;
}
/**
* @Description 智慧社区的tree
* @Param subAgencyPids
* @author zxc
* @date 2020/10/21 2:49 下午
*/
public List<TreeResultDTO> getDepartmentListByBiz(String subAgencyPids) {
List<TreeResultDTO> subAgencyList = screenCustomerAgencyDao.selectSubAgencyListByBizType(subAgencyPids);
if (subAgencyList.size() > NumConstant.ZERO) {
subAgencyList.forEach(sub -> {
List<Double> centerMark = this.getCenterMark(sub.getCenterMarkA());
sub.setCenterMark(centerMark.size() == NumConstant.ZERO ? new ArrayList<>() : centerMark);
if (sub.getLevel().equals(ScreenConstant.COMMUNITY)){
List<TreeResultDTO> treeResultDTOS = screenCustomerGridDao.selectGridInfo(sub.getValue());
treeResultDTOS.forEach(tree -> {
List<Double> centerMarkTree = this.getCenterMark(tree.getCenterMarkA());
tree.setCenterMark(centerMarkTree.size() == NumConstant.ZERO ? new ArrayList<>() : centerMarkTree);
});
sub.setChildren(treeResultDTOS);
}else {
List<TreeResultDTO> subAgency = new ArrayList<>();
if (sub.getPids().contains(ScreenConstant.COMMA)){
subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COMMA + sub.getValue());
}else {
subAgency = getDepartmentListByBiz(sub.getPids() + ScreenConstant.COLON + sub.getValue());
}
sub.setChildren(subAgency);
}
});
@ -136,4 +207,22 @@ public class AgencyServiceImpl implements AgencyService {
}
return agencyAreaInfo;
}
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public CompartmentResultDTO compartmentByBizType(CompartmentByBizTypeFormDTO compartmentFormDTO) {
CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfoByBizType(compartmentFormDTO.getAgencyId(),compartmentFormDTO.getBizType());
if (null == agencyAreaInfo){
return new CompartmentResultDTO();
}
if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){
// 当level为"community"时,查询screen_customer_grid表
List<AgencyDistributionResultDTO> agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId());
agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS);
}else {
List<AgencyDistributionResultDTO> agencyDistributionResultDTOS = screenCustomerAgencyDao.selectSubDistributionByType(compartmentFormDTO.getAgencyId(),compartmentFormDTO.getBizType());
agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS);
}
return agencyAreaInfo;
}
}

20
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java

@ -2,6 +2,7 @@ package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.CommonOperateTypeEnum;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao;
@ -11,18 +12,15 @@ import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.helper.DataUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.unit.DataUnit;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -328,4 +326,20 @@ public class IndexServiceImpl implements IndexService {
return list;
}
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public List<PeerComparisonResultDTO> getSubSingleIndexRank(SubSingleIndexRankFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getMonthId())) {
formDTO.setMonthId(DateUtils.getBeforeNMonth(1));
}
if (StringUtils.isBlank(formDTO.getSort())) {
formDTO.setSort(CommonOperateTypeEnum.DESC.getCode());
}
if (formDTO.getTopNum() == null) {
formDTO.setTopNum(NumConstant.FIVE);
}
List<PeerComparisonResultDTO> list = screenIndexDataMonthlyDao.getSingleIndexRank(formDTO);
return list;
}
}

31
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java

@ -0,0 +1,31 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenDifficultyDataDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenDifficultyDataService;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.project.dto.result.ProjectDetailResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Author zxc
* @DateTime 2020/10/23 1:26 下午
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenDifficultyDataServiceImpl implements ScreenDifficultyDataService {
@Autowired
private ScreenDifficultyDataDao screenDifficultyDataDao;
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public ProjectDetailResultDTO projectDetail(ProcessListFormDTO processListFormDTO) {
ProjectDetailResultDTO projectDetailResultDTO = screenDifficultyDataDao.projectDetail(processListFormDTO.getProjectId());
return projectDetailResultDTO;
}
}

28
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java

@ -70,7 +70,7 @@ public class FactIndexServiceImpl implements FactIndexService {
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//3.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId());
if (null == agency) {
//throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
return resultList;
@ -79,12 +79,12 @@ public class FactIndexServiceImpl implements FactIndexService {
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//4-1.查询过去12个月党建能力、治理能力、服务能力每月总分数据
list = factIndexAgencyScoreDao.selectAblityIndex(formDTO);
list = factIndexAgencyScoreDao.selectAgencyAblityWeightScoreIndex(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
//4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据
list = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO);
list = factIndexCommunityScoreDao.selectCommunityAblityWeightScore(formDTO);
} else {
//throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
return resultList;
@ -92,7 +92,7 @@ public class FactIndexServiceImpl implements FactIndexService {
//网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//5.查询网格过去12个月党建能力、治理能力、服务能力每月总分数据
list = factIndexGridScoreDao.selectGridAblityIndex(formDTO);
list = factIndexGridScoreDao.selectGridAblityWeightScore(formDTO);
} else {
throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
@ -172,7 +172,7 @@ public class FactIndexServiceImpl implements FactIndexService {
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//2.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId());
if (null == agency) {
//throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
return resultList;
@ -181,11 +181,11 @@ public class FactIndexServiceImpl implements FactIndexService {
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分
resultList = factIndexAgencyScoreDao.selectScoreList(formDTO);
resultList = factIndexAgencyScoreDao.selectAgencyWeightScoreList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
//3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分
resultList = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO);
resultList = factIndexCommunityScoreDao.selectCommunityWeightScoreList(formDTO);
} else {
//throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
return resultList;
@ -194,7 +194,7 @@ public class FactIndexServiceImpl implements FactIndexService {
//4.网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//4-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分
resultList = factIndexGridScoreDao.selectGridScoreList(formDTO);
resultList = factIndexGridScoreDao.selectGridWeightScoreList(formDTO);
} else {
throw new RenException(String.format("按月份查询各项能力分数,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
@ -220,7 +220,7 @@ public class FactIndexServiceImpl implements FactIndexService {
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//3.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId());
if (null == agency) {
//throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
return resultList;
@ -229,12 +229,12 @@ public class FactIndexServiceImpl implements FactIndexService {
//区县级、乡镇街道级
if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) {
//4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据
list = factIndexAgencyScoreDao.selectMonthScoreList(formDTO);
list = factIndexAgencyScoreDao.selectAgencyMonthWeightScoreList(formDTO);
//社区级
} else if ("community".equals(agency.getLevel())) {
//4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据
list = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO);
list = factIndexCommunityScoreDao.selectCommunityMonthWeightScoreList(formDTO);
} else {
//throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId()));
return resultList;
@ -242,7 +242,7 @@ public class FactIndexServiceImpl implements FactIndexService {
//网格层级数据
} else if (FactConstant.GRID.equals(formDTO.getOrgType())) {
//5.查询网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据
list = factIndexGridScoreDao.selectGridMonthScoreList(formDTO);
list = factIndexGridScoreDao.selectGridMonthWeightScoreList(formDTO);
} else {
throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType()));
}
@ -291,7 +291,7 @@ public class FactIndexServiceImpl implements FactIndexService {
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//2.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId());
if (null == agency) {
//throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId()));
return resultList;
@ -359,7 +359,7 @@ public class FactIndexServiceImpl implements FactIndexService {
//组织层级数据
if (FactConstant.AGENCY.equals(formDTO.getOrgType())) {
//3.根据组织Id查询组织信息
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId());
CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId());
if (null == agency) {
//throw new RenException(String.format("查询组织信息失败,组织Id:%s", formDTO.getOrgId()));
return resultList;

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java

@ -1,6 +1,7 @@
package com.epmet.module.project.service;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
import com.epmet.project.dto.result.*;
@ -41,4 +42,12 @@ public interface ProjectService {
* @Description 数据-项目-/月数据查询
**/
List<ProjectIncrTrendResultDTO> getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO);
/**
* @Description 项目详情
* @Param processListFormDTO
* @author zxc
* @date 2020/10/23 10:33 上午
*/
ProjectDetailResultDTO projectDetail( ProcessListFormDTO processListFormDTO);
}

36
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java

@ -3,11 +3,18 @@ package com.epmet.datareport.service.project.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.datareport.dao.project.ProjectDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenDifficultyDataService;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO;
import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovProjectOpenFeignClient;
import com.epmet.module.project.service.ProjectService;
import com.epmet.project.constant.ProjectConstant;
import com.epmet.project.dto.FactAgencyProjectDailyDTO;
@ -35,6 +42,10 @@ public class ProjectServiceImpl implements ProjectService {
private ProjectDao projectDao;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Autowired
private ScreenDifficultyDataService screenDifficultyDataService;
/**
* @Author sun
@ -168,6 +179,31 @@ public class ProjectServiceImpl implements ProjectService {
return resultList;
}
/**
* @Description 项目详情
* @Param processListFormDTO
* @author zxc
* @date 2020/10/23 10:33 上午
*/
@Override
public ProjectDetailResultDTO projectDetail(ProcessListFormDTO processListFormDTO) {
ProjectDetailResultDTO projectDetailResultDTO = screenDifficultyDataService.projectDetail(processListFormDTO);
if (null == projectDetailResultDTO) {
return new ProjectDetailResultDTO();
}
Result<ProcessAndCurrentDeptResultDTO> processList = govProjectOpenFeignClient.getProcessList(processListFormDTO);
if (!processList.success()) {
throw new RenException(ProjectConstant.PROCESS_FAILURE);
}
ProcessAndCurrentDeptResultDTO data = processList.getData();
List<ProjectProcessResultDTO> processResultDTOS = ConvertUtils.sourceToTarget(data.getProcessList(), ProjectProcessResultDTO.class);
projectDetailResultDTO.setProcessList(processResultDTOS);
List<DepartmentNameListResultDTO> departmentNameListResultDTOS = ConvertUtils.sourceToTarget(data.getDepartmentList(), DepartmentNameListResultDTO.class);
projectDetailResultDTO.setDepartmentList(departmentNameListResultDTOS);
projectDetailResultDTO.setDepartmentNameList(data.getDepartmentNameList());
return projectDetailResultDTO;
}
/**
* @author sun
* @Description 获取机关ID

20
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml

@ -3,10 +3,10 @@
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao">
<select id="selectAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
<select id="selectAgencyAblityWeightScoreIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal",
fact.index_code AS "indexCode"
FROM
fact_index_agency_score fact
@ -21,12 +21,12 @@
fact.month_id ASC
</select>
<select id="selectScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
<select id="selectAgencyWeightScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
SELECT
fact.index_code AS "indexCode",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore"
ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal",
ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore",
ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore"
FROM
fact_index_agency_score fact
INNER JOIN fact_index_agency_self_sub_score self ON fact.agency_id = self.agency_id
@ -41,12 +41,12 @@
AND fact.month_id = #{monthId}
</select>
<select id="selectMonthScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
<select id="selectAgencyMonthWeightScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore",
ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal",
ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore",
ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore",
fact.index_code AS "indexCode"
FROM
fact_index_agency_score fact

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml

@ -7,7 +7,8 @@
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
dict.index_name AS "name",
round(fact.WEIGHT,2) AS weight
FROM
fact_index_agency_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

20
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml

@ -3,10 +3,10 @@
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexCommunityScoreDao">
<select id="selectCommunityAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
<select id="selectCommunityAblityWeightScore" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal",
fact.index_code AS "indexCode"
FROM
fact_index_community_score fact
@ -21,12 +21,12 @@
fact.month_id ASC
</select>
<select id="selectCommunityScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
<select id="selectCommunityWeightScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
SELECT
fact.index_code AS "indexCode",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore"
ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal",
ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore",
ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore"
FROM
fact_index_community_score fact
INNER JOIN fact_index_community_self_sub_score self ON fact.agency_id = self.agency_id
@ -41,12 +41,12 @@
AND fact.month_id = #{monthId}
</select>
<select id="selectCommunityMonthScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
<select id="selectCommunityMonthWeightScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore",
ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal",
ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore",
ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore",
fact.index_code AS "indexCode"
FROM
fact_index_community_score fact

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml

@ -7,7 +7,8 @@
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
dict.index_name AS "name",
round(fact.WEIGHT,2) AS weight
FROM
fact_index_community_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

20
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml

@ -3,10 +3,10 @@
<mapper namespace="com.epmet.datareport.dao.fact.FactIndexGridScoreDao">
<select id="selectGridAblityIndex" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
<select id="selectGridAblityWeightScore" resultType="com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal",
fact.index_code AS "indexCode"
FROM
fact_index_grid_score fact
@ -21,12 +21,12 @@
fact.month_id ASC
</select>
<select id="selectGridScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
<select id="selectGridWeightScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO">
SELECT
fact.index_code AS "indexCode",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore"
ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal",
ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore",
ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore"
FROM
fact_index_grid_score fact
INNER JOIN fact_index_grid_self_sub_score self ON fact.grid_id = self.grid_id
@ -42,12 +42,12 @@
AND fact.month_id = #{monthId}
</select>
<select id="selectGridMonthScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
<select id="selectGridMonthWeightScoreList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO$ScoreListResultDTO">
SELECT
fact.month_id AS "monthId",
ROUND(fact.score, 1) AS "indexTotal",
ROUND(self.self_score, 1) AS "agencyScore",
ROUND(self.sub_score, 1) AS "subAgencyScore",
ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal",
ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore",
ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore",
fact.index_code AS "indexCode"
FROM
fact_index_grid_score fact

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml

@ -7,7 +7,8 @@
SELECT
fact.index_code AS "key",
IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value",
dict.index_name AS "name"
dict.index_name AS "name",
round(fact.WEIGHT,2) AS weight
FROM
fact_index_grid_sub_score fact
LEFT JOIN index_dict dict ON fact.index_code = dict.index_code

87
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -49,6 +49,7 @@
screen_customer_agency
WHERE
del_flag = 0
and is_display = 1
AND agency_id = #{agencyId}
</select>
@ -64,6 +65,7 @@
screen_customer_agency
WHERE
del_flag = 0
AND is_display = 1
AND pid = #{agencyId}
</select>
@ -78,7 +80,7 @@
sutd.org_type AS type
FROM
screen_user_total_data sutd
LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id
LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id AND sca.is_display = 1
WHERE
sutd.del_flag = '0'
AND sca.del_flag = 0
@ -96,7 +98,7 @@
sutd.org_type AS type
FROM
screen_user_total_data sutd
LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id
LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id AND sca.is_display = 1
WHERE
sutd.del_flag = '0'
AND sca.del_flag = 0
@ -114,4 +116,85 @@
AND agency_id = #{agencyId}
</select>
<select id="selectRootAgencyIdByBizType" resultType="com.epmet.evaluationindex.screen.dto.result.TreeResultDTO">
SELECT
ca.agency_name AS label,
cbo.ORG_ID AS value,
ca.pids AS pids,
IFNULL(ca.center_mark,'') AS centerMarkA,
ca.level AS level
FROM
screen_customer_agency ca
LEFT JOIN screen_customer_biz_org cbo ON cbo.ORG_ID = ca.AGENCY_ID
WHERE
ca.del_flag = 0
AND cbo.DEL_FLAG = 0
AND ca.pid = '0'
AND cbo.customer_id = #{customerId}
AND cbo.BIZ_TYPE = #{bizType}
</select>
<select id="selectSubAgencyListByBizType" resultType="com.epmet.evaluationindex.screen.dto.result.TreeResultDTO">
SELECT
cbo.ORG_ID AS value,
ca.agency_name AS label,
ca.pids AS pids,
IFNULL(ca.center_mark,'') AS centerMarkA,
ca.level AS level
FROM
screen_customer_biz_org cbo
LEFT JOIN screen_customer_agency ca ON ca.AGENCY_ID = cbo.ORG_ID
WHERE
ca.del_flag = '0'
AND cbo.DEL_FLAG = 0
AND cbo.biz_type = "community"
AND ca.pids = #{subAgencyPids}
ORDER BY
ca.created_time DESC
</select>
<select id="getAgencyAreaInfoByBizType" resultType="com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO">
SELECT
bo.ORG_ID AS agencyId,
sca.agency_name AS name,
IFNULL(sca.area_marks,'') AS areaMarks,
sca.level AS level
FROM
screen_customer_agency sca
LEFT JOIN screen_customer_biz_org bo ON bo.ORG_ID = sca.AGENCY_ID
WHERE
sca.del_flag = 0
AND bo.DEL_FLAG = 0
AND bo.ORG_ID = #{agencyId}
AND bo.BIZ_TYPE = #{bizType}
</select>
<select id="selectSubDistributionByType" resultType="com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO">
SELECT
ORG_ID AS subId,
sca.agency_name AS subName,
IFNULL(sca.area_marks,'') AS subAreaMarks,
IFNULL(sca.center_mark,'') AS subCenterMark,
'agency' AS type
FROM
screen_customer_agency sca
LEFT JOIN screen_customer_biz_org cbo ON cbo.ORG_ID = sca.AGENCY_ID
WHERE
sca.del_flag = 0
AND cbo.DEL_FLAG = 0
AND cbo.BIZ_TYPE = #{bizType}
AND sca.pid = #{agencyId}
</select>
<select id="getAgencyInfoByAegncyId" resultType="com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO">
SELECT
agency_id AS agencyId,
agency_name AS name,
level AS level
FROM
screen_customer_agency
WHERE
del_flag = 0
AND agency_id = #{agencyId}
</select>
</mapper>

14
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml

@ -21,14 +21,16 @@
<!-- 查询党支部信息 -->
<select id="selectBranch" resultType="com.epmet.evaluationindex.screen.dto.result.BranchResultDTO">
SELECT
grid_id AS gridId,
grid_name AS gridName,
party_mark AS partyMark
scg.grid_id AS gridId,
scg.grid_name AS gridName,
scg.party_mark AS partyMark
FROM
screen_customer_grid
screen_customer_grid scg
LEFT JOIN screen_customer_biz_org bo ON bo.ORG_ID = scg.PARENT_AGENCY_ID
WHERE
del_flag = 0
AND all_parent_ids LIKE concat('%', #{agencyId}, '%')
scg.del_flag = 0
AND bo.BIZ_TYPE = 'community'
AND scg.all_parent_ids LIKE concat('%', #{agencyId}, '%')
</select>
<!-- 查询子级用户分布【网格级别】 -->

25
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml

@ -30,4 +30,29 @@
DESC
</select>
<resultMap id="projectDetail" type="com.epmet.project.dto.result.ProjectDetailResultDTO">
<result property="eventContent" column="eventContent"/>
<result property="eventTitle" column="eventTitle"/>
<result property="eventSource" column="eventSource"/>
<collection property="imgUrlList" ofType="java.lang.String">
<result column="imgUrl"/>
<result column="id"/>
</collection>
</resultMap>
<!-- 项目详情 -->
<select id="projectDetail" resultMap="projectDetail">
SELECT
dd.event_title AS eventTitle,
dd.EVENT_CONTENT AS eventContent,
dd.EVENT_SOURCE AS eventSource,
did.EVENT_IMG_URL AS imgUrl,
did.id as id
FROM
screen_difficulty_data dd
LEFT JOIN screen_difficulty_img_data did ON did.EVENT_ID = dd.EVENT_ID
WHERE
dd.DEL_FLAG = '0'
AND dd.EVENT_ID = #{eventId}
</select>
</mapper>

47
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -205,4 +205,51 @@
LIMIT #{topNum}
</select>
<select id="getSingleIndexRank" resultType="com.epmet.evaluationindex.screen.dto.result.PeerComparisonResultDTO">
SELECT
ORG_ID,
ORG_NAME,
<choose>
<when test="indexCode == 'dangjiannengli'">
round(party_dev_ablity,1) as score
</when>
<when test="indexCode == 'zhilinengli'">
round(govern_ablity,1) as score
</when>
<when test="indexCode == 'fuwunengli'">
round(service_ablity,1) as score
</when>
</choose>
FROM
screen_index_data_monthly
WHERE
del_flag = '0'
<if test="customerId != null and customerId != ''">
AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
</if>
AND PARENT_ID = #{agencyId,jdbcType=VARCHAR}
AND MONTH_ID = #{monthId,jdbcType=VARCHAR}
<choose>
<when test="orgType != null and orgType != ''">
AND ORG_TYPE = #{orgType,jdbcType=VARCHAR}
</when>
<otherwise>
AND ORG_TYPE != 'department'
</otherwise>
</choose>
ORDER BY
<choose>
<when test="indexCode == 'dangjiannengli'">
party_dev_ablity
</when>
<when test="indexCode == 'zhilinengli'">
govern_ablity
</when>
<when test="indexCode == 'fuwunengli'">
service_ablity
</when>
</choose>
${sort}
LIMIT #{topNum}
</select>
</mapper>

26
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/CustomerBizOrgFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.indexcollect.form;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
/**
* 客户业务组织关系 入参
*/
@Data
public class CustomerBizOrgFormDTO implements Serializable {
/**
* 当为true时后台将删除本月数据
*/
@NotEmpty(message = "客户Id不能为空")
private String customerId;
/**
* 业务类型智慧社区 community
*/
@NotEmpty(message = "业务类型不能为空")
private String bizType;
}

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java

@ -68,4 +68,9 @@ public class CustomerAgencyFormDTO implements Serializable {
* 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增)
*/
private String dataEndTime;
/**
* 是否显示
*/
private String isDisplay;
}

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java

@ -48,6 +48,11 @@ public class DifficultyDataDetailFormDTO implements Serializable {
*/
private String eventSource;
/**
* 事件标题
*/
private String eventTitle;
/**
* 事件内容
*/

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java

@ -19,6 +19,9 @@ public class CustomerIdAndDateIdFormDTO implements Serializable {
private String customerId;
@NotBlank(message = "日期Id不能为空",groups = CustomerIdAndDateId.class)
private String dateId;
private String startDate;
private String endDate;
}

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java

@ -263,7 +263,6 @@ public class DimController {
*/
@PostMapping("statsparty")
public Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) {
ValidatorUtils.validateEntity(customerIdAndDateIdFormDTO, CustomerIdAndDateIdFormDTO.CustomerIdAndDateId.class);
return new Result().ok(partyMemberService.statsPartyMember(customerIdAndDateIdFormDTO));
}

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

@ -1,6 +1,7 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.dto.screencoll.form.*;
import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService;
import org.springframework.beans.factory.annotation.Autowired;
@ -261,4 +262,12 @@ public class ShiBeiScreenCollController {
shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, customerId);
return new Result();
}
/**
* 初始化客户业务组织类型
**/
@PostMapping("initbizorg")
public Result initBizOrg(@RequestBody CustomerBizOrgFormDTO formDTO) {
return new Result().ok(shiBeiScreenCollService.initBizOrg(formDTO));
}
}

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

@ -23,6 +23,7 @@ import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.extract.result.OrgNameResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.dto.screen.result.TreeResultDTO;
import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
@ -168,10 +169,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao<ScreenCustomerAgencyEnt
List<ScreenPartyBranchDataFormDTO> selectAllAgencyIdToOrganize(@Param("customerId") String customerId, @Param("monthId") String monthId);
/**
* @Description 查询org名称机关
* @param agencyIds
* @Description 查询org名称机关
* @author zxc
* @date 2020/9/24 1:27 下午
*/
List<OrgNameResultDTO> selectOrgNameAgency(@Param("agencyIds") List<String> agencyIds);
Boolean initBizOrg(CustomerBizOrgFormDTO formDTO);
}

40
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerBizOrgDao.java

@ -0,0 +1,40 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerBizOrgEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 组织机构信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-18
*/
@Mapper
public interface ScreenCustomerBizOrgDao extends BaseDao<ScreenCustomerBizOrgEntity> {
int deleteByBizType(CustomerBizOrgFormDTO formDTO);
int batchInsert(@Param("list") List<ScreenCustomerBizOrgEntity> list);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java

@ -100,4 +100,9 @@ public class ScreenCustomerAgencyEntity extends BaseEpmetEntity {
*/
private String dataEndTime;
/**
* desc: 是否显示 1显示 0不显示
*/
private String isDisplay;
}

52
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerBizOrgEntity.java

@ -0,0 +1,52 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.evaluationindex.screen;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 组织机构信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-21
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("screen_customer_biz_org")
public class ScreenCustomerBizOrgEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 组织id
*/
private String orgId;
/**
* 业务类型 community:智慧社区
*/
private String bizType;
}

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

@ -5,6 +5,8 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO;
@ -32,10 +34,10 @@ import com.epmet.service.project.ProjectService;
import com.epmet.service.topic.TopicService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.apache.commons.collections4.CollectionUtils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@ -88,7 +90,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> {
FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity();
entity.setId(process.getProjectId());
entity.setProjectStatus("closed");
entity.setProjectStatus(ProjectConstant.CLOSED);
entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD));
entity.setUpdatedTime(process.getUpdatedTime());
entity.setIsResolved(process.getIsResolved());
@ -194,10 +196,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}
}
final List<FactOriginProjectMainDailyEntity> mainList = list;
List<FactOriginProjectLogDailyEntity> logList = new ArrayList<>();
//节点发起人 部门流转退回结案
List<ProcessInfoDTO> processList = projectProcessService.getProcessListByCustomer(customerId, dateString);
if (!CollectionUtils.isEmpty(processList)) {
List<FactOriginProjectLogDailyEntity> logList = processList.stream().map(process -> {
logList = processList.stream().map(process -> {
//获取日期相关维度
DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime());
FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity();
@ -213,11 +216,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setIsActive(NumConstant.ONE);
entity.setPids(process.getPids());
if (StringUtils.isNotBlank(process.getDepartmentId())) {
entity.setOrgType("department");
entity.setOrgType(OrgTypeConstant.DEPARTMENT);
entity.setOrgId(process.getDepartmentId());
entity.setPid(process.getAgencyId());
}else if (StringUtils.isNotBlank(process.getGridId())) {
entity.setOrgType("grid");
entity.setOrgType(OrgTypeConstant.GRID);
entity.setOrgId(process.getGridId());
entity.setPid(process.getAgencyId());
}else{
@ -243,7 +246,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
return entity;
}).collect(Collectors.toList());
}
//节点发起人 响应
List<ProcessInfoDTO> responseList = projectProcessService.getResponseProcessList(customerId, dateString);
if (!CollectionUtils.isEmpty(responseList)) {
@ -263,11 +266,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setIsActive(NumConstant.ONE);
entity.setPids(process.getPids());
if (StringUtils.isNotBlank(process.getDepartmentId())) {
entity.setOrgType("department");
entity.setOrgType(OrgTypeConstant.DEPARTMENT);
entity.setOrgId(process.getDepartmentId());
entity.setPid(process.getAgencyId());
} else if (StringUtils.isNotBlank(process.getGridId())) {
entity.setOrgType("grid");
entity.setOrgType(OrgTypeConstant.GRID);
entity.setOrgId(process.getGridId());
entity.setPid(process.getAgencyId());
} else {
@ -318,7 +321,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setActionCode(process.getOperation());
entity.setIsActive(NumConstant.ONE);
entity.setOrgId(process.getGridId());
entity.setOrgType("grid");
entity.setOrgType(OrgTypeConstant.GRID);
entity.setPids(process.getPids());
entity.setPid(process.getPid());
return entity;
@ -343,11 +346,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setIsActive(NumConstant.ZERO);
entity.setPids(process.getPids());
if (StringUtils.isNotBlank(process.getDepartmentId())) {
entity.setOrgType("department");
entity.setOrgType(OrgTypeConstant.DEPARTMENT);
entity.setOrgId(process.getDepartmentId());
entity.setPid(process.getAgencyId());
}else if (StringUtils.isNotBlank(process.getGridId())) {
entity.setOrgType("grid");
entity.setOrgType(OrgTypeConstant.GRID);
entity.setOrgId(process.getGridId());
entity.setPid(process.getAgencyId());
}else{
@ -377,7 +380,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
factOriginProjectLogDailyService.deleteByDate(customerId, dateString);
factOriginProjectLogDailyService.insertBatch(logList);
}
}
}
/**
@ -405,11 +408,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
dest.setPid(original.getOrgId());
dest.setPids(original.getOrgIdPath());
}else if(StringUtils.isNotBlank(original.getGridId())) {
dest.setOrgType("grid");
dest.setOrgType(OrgTypeConstant.GRID);
dest.setPid(original.getOrgId());
dest.setPids(original.getOrgIdPath());
}else {
dest.setOrgType("agency");
dest.setOrgType(OrgTypeConstant.AGENCY);
dest.setPids("");
String[] array = original.getOrgIdPath().split(StrConstant.COLON);
if (array.length <= NumConstant.ZERO) {
@ -456,7 +459,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
*/
private Integer getDetentionDays(String id, Date startDate, Date endDate) {
int result;
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD);
List<WorkDayFormDTO> list = new ArrayList<>();
WorkDayFormDTO workDayFormDTO = new WorkDayFormDTO();

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

@ -197,7 +197,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false;
return true;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
@ -272,7 +272,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false;
return true;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
@ -344,7 +344,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false;
return true;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();

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

@ -194,7 +194,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<IndexGroupDetailEntity> indexDetailList = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
if (CollectionUtils.isEmpty(indexDetailList)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false;
return true;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
@ -271,7 +271,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false;
return true;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
@ -350,7 +350,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false;
return true;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();

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

@ -198,7 +198,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false;
return true;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
@ -273,7 +273,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false;
return true;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();
@ -345,7 +345,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (CollectionUtils.isEmpty(detailListByParentCode)) {
log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL);
return false;
return true;
}
List<IndexInputVO> indexInputVOS = new ArrayList<>();
Map<String, String> pid = new HashMap<>();

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java

@ -21,6 +21,7 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;
@ -75,10 +76,20 @@ public interface ScreenCustomerGridService extends BaseService<ScreenCustomerGri
List<PartyAbilityGridMonthlyFormDTO> selectAllGridInfoToParty(String customerId);
/**
* @Description 查询全部网格信息
* @param customerId
* @Description 查询全部网格信息
* @author zxc
* @date 2020/9/18 10:47 上午
*/
List<GovernAbilityGridMonthlyFormDTO> selectAllGridInfo(String customerId);
/**
* desc: 初始化客户的业务组织关系
*
* @param formDTO
* @return java.lang.Boolean
* @author LiuJanJun
* @date 2020/10/21 2:33 下午
*/
Boolean initBizOrg(CustomerBizOrgFormDTO formDTO);
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java

@ -1,8 +1,7 @@
package com.epmet.service.evaluationindex.screen;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.dto.screencoll.form.*;
import java.util.List;
/**
* 大屏数据采集api
*
@ -231,4 +230,14 @@ public interface ShiBeiScreenCollService {
* @Date 09:44 2020-08-25
**/
void insertPublicPartiTotalData(PublicPartiTotalDataListFormDTO formDTO, String customerId);
/**
* desc: 初始化客户业务组织关系表
*
* @param formDTO
* @return java.lang.Integer
* @author LiuJanJun
* @date 2020/10/21 2:38 下午
*/
Integer initBizOrg(CustomerBizOrgFormDTO formDTO);
}

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

@ -39,6 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
@ -131,6 +132,12 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
exists.setLevel(e.getLevel());
exists.setDataEndTime(dateEndTime);
exists.setAreaCode(e.getAreaCode());
//如果没有区划 则默认暂时不显示
if (StringUtils.isEmpty(e.getAreaCode())) {
exists.setIsDisplay(NumConstant.ZERO_STR);
} else {
exists.setIsDisplay(NumConstant.ONE_STR);
}
exists.setAllParentNames(e.getAllParentName());
updateAgency(exists);
}
@ -221,6 +228,12 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
cae.setAllParentNames(e.getAllParentName());
cae.setAreaCode(e.getAreaCode());
//cae.setAreaMarks(e);
//如果没有区划 则默认暂时不显示
if (StringUtils.isEmpty(e.getAreaCode())) {
cae.setIsDisplay(NumConstant.ZERO_STR);
} else {
cae.setIsDisplay(NumConstant.ONE_STR);
}
cae.setCustomerId(e.getCustomerId());
cae.setDataEndTime(dateEndTime);
cae.setLevel(e.getLevel());

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

@ -26,10 +26,10 @@ import com.epmet.constant.OrgSourceTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -150,8 +150,8 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
}
/**
* @Description 查询全部网格信息
* @param customerId
* @Description 查询全部网格信息
* @author zxc
* @date 2020/9/18 10:47 上午
*/
@ -159,4 +159,9 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
public List<GovernAbilityGridMonthlyFormDTO> selectAllGridInfo(String customerId) {
return screenCustomerGridDao.selectAllGridInfo(customerId);
}
@Override
public Boolean initBizOrg(CustomerBizOrgFormDTO formDTO) {
return null;
}
}

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

@ -17,17 +17,20 @@
package com.epmet.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.CompareConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.screen.*;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.dto.screencoll.form.*;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerBizOrgEntity;
import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService;
@ -40,7 +43,6 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
@ -81,6 +83,8 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
@Autowired
private ScreenCustomerAgencyDao screenCustomerAgencyDao;
@Autowired
private ScreenCustomerBizOrgDao screenCustomerBizOrgDao;
@Autowired
private ScreenUserTotalDataDao screenUserTotalDataDao;
@Autowired
private ScreenUserJoinDao screenUserJoinDao;
@ -396,8 +400,31 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
}
}
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
@Transactional(rollbackFor = Exception.class)
public Integer initBizOrg(CustomerBizOrgFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
List<ScreenCustomerAgencyEntity> entityList = screenCustomerAgencyDao.selectListAgencyInfo(formDTO.getCustomerId());
List<ScreenCustomerBizOrgEntity> list = new ArrayList<>();
if (CollectionUtils.isEmpty(entityList)) {
return 0;
}
entityList.forEach(o -> {
ScreenCustomerBizOrgEntity entity = new ScreenCustomerBizOrgEntity();
entity.setCustomerId(o.getCustomerId());
entity.setOrgId(o.getAgencyId());
entity.setBizType(formDTO.getBizType());
list.add(entity);
});
screenCustomerBizOrgDao.deleteByBizType(formDTO);
return screenCustomerBizOrgDao.batchInsert(list);
}
/**
* 获取当前日期的前一个月的日期
*
* @param
* @return java.lang.String[]
* @Author zhangyong
@ -411,7 +438,8 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + NumConstant.ONE;
date[NumConstant.ZERO] = String.valueOf(year);
date[NumConstant.ONE] = String.valueOf(month);;
date[NumConstant.ONE] = String.valueOf(month);
;
if (NumConstant.TEN >= month) {
date[NumConstant.ONE] = NumConstant.ZERO_STR + month;
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java

@ -41,6 +41,7 @@ import com.epmet.service.partymember.PartyMemberService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.service.stats.DimGridService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@ -49,10 +50,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -134,13 +132,29 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustom
*/
@Override
public Boolean statsPartyMember(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) {
List<String> allCustomerId = dimCustomerService.getAllCustomerId();
if (CollectionUtils.isEmpty(allCustomerId)){
String customerIdOne = customerIdAndDateIdFormDTO.getCustomerId();
List<String> customerIds = new ArrayList<>();
List<String> dateIds = new ArrayList<>();
if (StringUtils.isNotBlank(customerIdOne)){
customerIds.add(customerIdOne);
}else {
customerIds = dimCustomerService.getAllCustomerId();
}
if (CollectionUtils.isEmpty(customerIds)){
throw new RenException(StatsConstant.CUSTOMER_INFO_NULL);
}
allCustomerId.forEach(customerId -> {
String dateId = customerIdAndDateIdFormDTO.getDateId();
if ((StringUtils.isBlank(customerIdAndDateIdFormDTO.getStartDate()) && StringUtils.isBlank(customerIdAndDateIdFormDTO.getEndDate()))){
if (StringUtils.isNotBlank(customerIdAndDateIdFormDTO.getDateId())){
dateIds.add(customerIdAndDateIdFormDTO.getDateId());
}else {
dateIds.add(DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1)));
}
}else {
dateIds = DateUtils.getDaysBetween(customerIdAndDateIdFormDTO.getStartDate(), customerIdAndDateIdFormDTO.getEndDate());
}
List<String> finalDateIds = dateIds;
customerIds.forEach(customerId -> {
finalDateIds.forEach(dateId -> {
List<DimCustomerPartyMemberFormDTO> partyMemberList = partyMemberService.selectPartyMemberInfo(customerId, dateId);
if (CollectionUtils.isEmpty(partyMemberList)){
log.warn(String.format(StatsConstant.PARTY_INFO_LIST,customerId));
@ -161,6 +175,7 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustom
});
delAndInsertParty(partyMemberList,customerId,dateId);
});
});
return true;
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

@ -66,6 +66,13 @@ public class BatchScoreCalculator {
BigDecimal minScoreValue = idx.getScoreCalculator().getMinScore();
BigDecimal maxScoreValue = idx.getScoreCalculator().getMaxScore();
//1.如果是分数值(平均值)不需要归一 则 直接value*权重
//2.否则 先判断 样本值是否相等 是:反正切函数 否:归一算法
if (idx.isScore()) {
vo.setSampleValue(new BigDecimal(vo.getSampleValue().toString()).compareTo(NumConstant.ZERO_DECIMAL) == NumConstant.ZERO ? ScoreConstants.MIN_SCORE : new BigDecimal(vo.getSampleValue().toString()));
normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold);
} else {
if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) {
//*((max-min)/ (Math.PI/2))+min
//Math.atan(new Double(vo.getSampleValue().toString()))*
@ -77,11 +84,6 @@ public class BatchScoreCalculator {
if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) {
normalizeValue = maxScoreValue.subtract(normalizeValue);
}
}else {
//如果不需要归一 则 直接value*权重
if (idx.isScore()) {
vo.setSampleValue(new BigDecimal(vo.getSampleValue().toString()).compareTo(NumConstant.ZERO_DECIMAL) == NumConstant.ZERO ? ScoreConstants.MIN_SCORE : new BigDecimal(vo.getSampleValue().toString()));
normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold);
} else {
normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold));
}

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

@ -24,6 +24,7 @@
PARTY_MARK,
`LEVEL`,
AREA_CODE,
IS_DISPLAY,
DEL_FLAG,
REVISION,
CREATED_BY,
@ -46,6 +47,7 @@
#{item.partyMark},
#{item.level},
#{item.areaCode},
ifnull(#{item.isDisplay},'1'),
0,
0,
'APP_USER',
@ -80,6 +82,7 @@
<select id="selectListAgencyInfo" parameterType="map" resultType="com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity">
SELECT
CUSTOMER_ID,
AGENCY_ID agencyId,
AGENCY_NAME agencyName,
PIDS pids

39
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerBizOrgDao.xml

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenCustomerBizOrgDao">
<delete id="deleteByBizType">
delete from screen_customer_biz_org
where CUSTOMER_ID = #{customerId}
and BIZ_TYPE = #{bizType,jdbcType=VARCHAR}
</delete>
<insert id="batchInsert">
insert into screen_customer_biz_org
(
ID,
CUSTOMER_ID,
ORG_ID,
BIZ_TYPE,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.customerId},
#{item.orgId},
#{item.bizType},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
</mapper>

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

@ -18,6 +18,7 @@
PARENT_ID,
ORG_NAME,
EVENT_ID,
EVENT_TITLE,
EVENT_IMG_URL,
EVENT_SOURCE,
EVENT_CONTENT,
@ -47,6 +48,7 @@
#{item.parentId},
#{item.orgName},
#{item.eventId},
#{item.eventTitle},
#{item.eventImgUrl},
#{item.eventSource},
#{item.eventContent},

13
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/GetJwtAccessTokenFormDTO.java

@ -0,0 +1,13 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class GetJwtAccessTokenFormDTO {
@NotBlank(message = "AppId不能为空")
private String appId;
}

32
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AppIdInfoResultDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/10/21 5:30 下午
*/
@Data
public class AppIdInfoResultDTO implements Serializable {
private static final long serialVersionUID = 4556971930323763712L;
/**
* 应用ID
*/
private String appId;
/**
* 客户ID
*/
private String customerId;
/**
* 密钥
*/
private String secret;
private String accessToken;
}

16
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java

@ -0,0 +1,16 @@
package com.epmet.dto.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GetJwtAccessTokenResultDTO {
private String customerId;
private String token;
private Long ts;
}

16
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java

@ -3,7 +3,9 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.ExternalAppAuthFormDTO;
import com.epmet.dto.form.GetJwtAccessTokenFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
import com.epmet.dto.result.AppIdInfoResultDTO;
import com.epmet.dto.result.ExternalAppAuthResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import com.epmet.feign.fallback.EpmetCommonServiceOpenFeignClientFallback;
@ -20,7 +22,7 @@ import java.util.List;
* @date 2020/6/4 10:28
*/
@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class)
//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://localhost:8103")
//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "localhost:8103")
public interface EpmetCommonServiceOpenFeignClient {
/**
* @param formDTO
@ -53,4 +55,16 @@ public interface EpmetCommonServiceOpenFeignClient {
*/
@PostMapping("/commonservice/externalapp/get-secret")
Result getSecret(@RequestBody String appId);
/**
* @Description 获取AccessToken
* @return Result
* @author wxz
* @date 2020.10.22 10:19
*/
@PostMapping("/commonservice/externalapp/get-jwt-accesstoken")
Result getAccessToken(@RequestBody GetJwtAccessTokenFormDTO form);
@PostMapping("/commonservice/externalapp/appidinfo")
Result<AppIdInfoResultDTO> appIdInfo(@RequestBody String appId);
}

12
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java

@ -4,7 +4,9 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.ExternalAppAuthFormDTO;
import com.epmet.dto.form.GetJwtAccessTokenFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
import com.epmet.dto.result.AppIdInfoResultDTO;
import com.epmet.dto.result.ExternalAppAuthResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -39,4 +41,14 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer
public Result getSecret(String appId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getSecret", appId);
}
@Override
public Result<AppIdInfoResultDTO> appIdInfo(String appId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "appIdInfo", appId);
}
@Override
public Result getAccessToken(GetJwtAccessTokenFormDTO form) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getAccessToken", form);
}
}

27
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java

@ -8,8 +8,11 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.ExternalAppAuthFormDTO;
import com.epmet.dto.form.ExternalAppFormDTO;
import com.epmet.dto.form.GetJwtAccessTokenFormDTO;
import com.epmet.dto.result.AppIdInfoResultDTO;
import com.epmet.dto.result.ExternalAppAuthResultDTO;
import com.epmet.dto.result.ExternalAppResultDTO;
import com.epmet.dto.result.GetJwtAccessTokenResultDTO;
import com.epmet.service.ExternalAppAuthService;
import com.epmet.service.ExternalAppSecretService;
import com.epmet.service.ExternalAppService;
@ -17,10 +20,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -146,4 +146,23 @@ public class ExternalAppController {
return new Result().ok(secret);
}
/**
* @Description 获取AccessToken
* @return Result
* @author wxz
* @date 2020.10.22 10:19
*/
@PostMapping("get-jwt-accesstoken")
public Result getAccessToken(@RequestBody GetJwtAccessTokenFormDTO form) {
ValidatorUtils.validateEntity(form);
String appId = form.getAppId();
GetJwtAccessTokenResultDTO jwtAccessToken = externalAppService.getJwtAccessToken(appId);
return new Result().ok(jwtAccessToken);
}
@PostMapping("appidinfo")
public Result<AppIdInfoResultDTO> appIdInfo(@RequestBody String appId){
return new Result<AppIdInfoResultDTO>().ok(externalAppService.appIdInfo(appId));
}
}

9
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.AppIdInfoResultDTO;
import com.epmet.dto.result.ExternalAppResultDTO;
import com.epmet.entity.ExternalAppEntity;
import org.apache.ibatis.annotations.Mapper;
@ -41,4 +42,12 @@ public interface ExternalAppDao extends BaseDao<ExternalAppEntity> {
List<ExternalAppResultDTO> list(@Param("customerId") String customerId);
List<String> getCustomerIds();
/**
* @Description 根据appId查询客户ID和密钥
* @Param appId
* @author zxc
* @date 2020/10/21 5:50 下午
*/
AppIdInfoResultDTO appIdInfo(@Param("appId")String appId);
}

6
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java

@ -18,7 +18,9 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.result.AppIdInfoResultDTO;
import com.epmet.dto.result.ExternalAppResultDTO;
import com.epmet.dto.result.GetJwtAccessTokenResultDTO;
import java.util.List;
@ -38,4 +40,8 @@ public interface ExternalAppService {
List<String> getCustomerIds();
String resetSecret(String appId);
GetJwtAccessTokenResultDTO getJwtAccessToken(String appId);
AppIdInfoResultDTO appIdInfo(String appId);
}

28
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java

@ -27,12 +27,15 @@ import com.epmet.dao.ExternalAppDao;
import com.epmet.dao.ExternalAppSecretDao;
import com.epmet.dao.ExternalCustomerDao;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.result.AppIdInfoResultDTO;
import com.epmet.dto.result.ExternalAppResultDTO;
import com.epmet.dto.result.GetJwtAccessTokenResultDTO;
import com.epmet.entity.ExternalAppEntity;
import com.epmet.entity.ExternalAppSecretEntity;
import com.epmet.enu.CustomerTypeEnum;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.service.ExternalAppService;
import com.epmet.utils.externalapp.ExtAppJwtTokenUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
@ -41,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
@ -70,6 +74,9 @@ public class ExternalAppServiceImpl implements ExternalAppService {
@Autowired
private RedisUtils redisUtils;
@Autowired
private ExtAppJwtTokenUtils tokenUtils;
@Transactional
@Override
public ExternalAppResultDTO add(String appName, String customerId, String customerType) {
@ -197,4 +204,25 @@ public class ExternalAppServiceImpl implements ExternalAppService {
return null;
}
@Override
public GetJwtAccessTokenResultDTO getJwtAccessToken(String appId) {
ExternalAppEntity externalAppEntity = externalAppDao.selectById(appId);
String customerId = externalAppEntity.getCustomerId();
String secret = externalAppSecretDao.getSecretByAppId(appId);
long ts = System.currentTimeMillis();
String token = tokenUtils.genToken(secret, appId, customerId, ts);
return new GetJwtAccessTokenResultDTO(customerId, token, ts);
}
@Override
public AppIdInfoResultDTO appIdInfo(String appId) {
AppIdInfoResultDTO appIdInfoResultDTO = externalAppDao.appIdInfo(appId);
if (null == appIdInfoResultDTO){
throw new RenException("没查到对应appId【"+appId+"】的信息");
}
String accessToken = tokenUtils.genToken(appIdInfoResultDTO.getSecret(), appId, appIdInfoResultDTO.getCustomerId(), System.currentTimeMillis());
appIdInfoResultDTO.setAccessToken(accessToken);
return appIdInfoResultDTO;
}
}

38
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java

@ -49,7 +49,7 @@ public class ExtAppJwtTokenUtils {
}
}
public String createToken(Map<String, Object> map, String secret) {
private String createToken(Map<String, Object> map, String secret) {
return Jwts.builder()
.setHeaderParam("typ", "JWT")
.setClaims(map)
@ -59,21 +59,7 @@ public class ExtAppJwtTokenUtils {
.compact();
}
// /**
// * token是否过期
// *
// * @return true:过期
// */
// public boolean isTokenExpired(Date expiration) {
// return expiration.before(new Date());
// }
public static void main(String[] args) {
genToken();
// getClaim();
}
public static void genToken() {
public static void genTestToken() {
HashMap<String, Object> claim = new HashMap<>();
//市北
//String secret = "612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970";
@ -89,21 +75,23 @@ public class ExtAppJwtTokenUtils {
String appId = "f358d63a89f3670c197c62ca4c3a0366";
String customrId = "45687aa479955f9d06204d415238f7cc";
claim.put("customerId", customrId);
claim.put("appId", appId);
long ts = System.currentTimeMillis() + 1000 * 60 * 1;
System.out.println("时间戳:" + ts);
String token = new ExtAppJwtTokenUtils().genToken(secret, appId, customrId, ts);
System.out.println(token);
}
public String genToken(String secret, String appId, String customrId, Long ts) {
HashMap<String, Object> claim = new HashMap<>();
claim.put("customerId", customrId);
claim.put("appId", appId);
claim.put("ts", ts);
String abc = new ExtAppJwtTokenUtils().createToken(claim, secret);
System.out.println(abc);
return createToken(claim, secret);
}
public static void getClaim() {
String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHBJZCI6IjEiLCJjdXN0b21lcklkIjoiYzEiLCJpYXQiOjE1OTc3NDI2NTB9.09Vop0Nobg3LENAJoAZaCUKtgAjADAK48BS11ky3YdAp6h-cXYtGeqUxbgvE_4F6239rc7UE2fjxtEvMuWEJuA";
Claims claimByToken = new ExtAppJwtTokenUtils().getClaimByToken(token, "4a762660254c57996343f8ee42fbc0a6");
System.out.println(claimByToken);
public static void main(String[] args) {
genTestToken();
}
}

14
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml

@ -66,5 +66,19 @@
SELECT CUSTOMER_ID FROM external_app WHERE DEL_FLAG = 0
</select>
<!-- 根据appId查询客户ID和密钥 -->
<select id="appIdInfo" resultType="com.epmet.dto.result.AppIdInfoResultDTO">
SELECT
ea.ID AS appId,
ea.CUSTOMER_ID,
eas.SECRET
FROM external_app ea
LEFT JOIN external_app_secret eas ON eas.APP_ID = ea.id
WHERE
ea.DEL_FLAG = 0
AND eas.DEL_FLAG = 0
AND ea.ID = #{appId}
</select>
</mapper>

16
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimPartyMemberServiceImpl.java

@ -1,7 +1,6 @@
package com.epmet.service.impl;
import com.alibaba.druid.util.StringUtils;
import com.epmet.commons.tools.constant.NumConstant;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
@ -23,15 +22,8 @@ public class DimPartyMemberServiceImpl implements DimPartyMemberService {
@Override
public Result getPartyInfo(String dateId) {
CustomerIdAndDateIdFormDTO c = new CustomerIdAndDateIdFormDTO();
if (!StringUtils.isEmpty(dateId)) {
c.setDateId(dateId);
}else {
String now = LocalDate.now().minusDays(NumConstant.ONE).toString();
String concat = now.substring(NumConstant.ZERO, NumConstant.FOUR).concat(now.substring(NumConstant.FIVE, NumConstant.SEVEN)).concat(now.substring(NumConstant.EIGHT, NumConstant.TEN));
c.setDateId(concat);
}
return statsFeignClient.getPartyInfo(c);
public Result getPartyInfo(String form) {
CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO = JSON.parseObject(form, CustomerIdAndDateIdFormDTO.class);
return statsFeignClient.getPartyInfo(customerIdAndDateIdFormDTO);
}
}

27
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CustomerTemplateListFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 获取客户小程序模板列表-接口入参
* @Author sun
*/
@Data
public class CustomerTemplateListFormDTO implements Serializable {
/**
* 客户Id
*/
@NotBlank(message="客户Id不能为空", groups = {AddUserInternalGroup.class})
private String customerId;
/**
* 微信公共模板库模板Id
*/
@NotBlank(message="公共模板Id不能为空", groups = {AddUserInternalGroup.class})
private String publicId;
public interface AddUserInternalGroup {}
}

30
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerTemplateListResultDTO.java

@ -0,0 +1,30 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 获取客户小程序模板列表-接口返参
* @Author sun
*/
@Data
public class CustomerTemplateListResultDTO implements Serializable {
private static final long serialVersionUID = 6856602932571839314L;
/**
* 模板Id
*/
private String templateId;
/**
* 模板类型站内信提醒
*/
private String templateType;
/**
* 所属端居民端resi 工作端work
*/
private String clientType;
}

15
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PersonalTemplateController.java

@ -1,7 +1,10 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CustomerTemplateListFormDTO;
import com.epmet.dto.form.GetTemplateListFormDTO;
import com.epmet.dto.result.CustomerTemplateListResultDTO;
import com.epmet.dto.result.GetTemplateListResultDTO;
import com.epmet.service.PersonalTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
@ -30,8 +33,20 @@ public class PersonalTemplateController {
*/
@PostMapping("templatelist")
public Result<List<GetTemplateListResultDTO>> templateList(@RequestBody GetTemplateListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GetTemplateListFormDTO.AddUserInternalGroup.class);
return new Result<List<GetTemplateListResultDTO>>().ok(personalTemplateService.templateList(formDTO));
}
/**
* @return
* @Description 获取客户两个端站内信模板Id
* @author sun
*/
@PostMapping("customertemplatelist")
public Result<List<CustomerTemplateListResultDTO>> customerTemplateList(@RequestBody CustomerTemplateListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, CustomerTemplateListFormDTO.AddUserInternalGroup.class);
return new Result<List<CustomerTemplateListResultDTO>>().ok(personalTemplateService.customerTemplateList(formDTO));
}
}

9
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java

@ -19,8 +19,10 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.PersonalTemplateDTO;
import com.epmet.dto.form.CustomerTemplateListFormDTO;
import com.epmet.dto.form.GetTemplateListFormDTO;
import com.epmet.dto.result.CustomerTempResultDTO;
import com.epmet.dto.result.CustomerTemplateListResultDTO;
import com.epmet.dto.result.GetTemplateListResultDTO;
import com.epmet.dto.result.TemplateDTO;
import com.epmet.entity.PersonalTemplateEntity;
@ -85,4 +87,11 @@ public interface PersonalTemplateDao extends BaseDao<PersonalTemplateEntity> {
* @author sun
*/
List<GetTemplateListResultDTO> selectTemplateList(GetTemplateListFormDTO formDTO);
/**
* @return
* @Description 获取客户两个端站内信模板Id
* @author sun
*/
List<CustomerTemplateListResultDTO> selectCustomerTemplateList(CustomerTemplateListFormDTO formDTO);
}

9
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java

@ -20,7 +20,9 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.PersonalTemplateDTO;
import com.epmet.dto.form.CustomerTemplateListFormDTO;
import com.epmet.dto.form.GetTemplateListFormDTO;
import com.epmet.dto.result.CustomerTemplateListResultDTO;
import com.epmet.dto.result.GetTemplateListResultDTO;
import com.epmet.dto.result.TemplateDTO;
import com.epmet.entity.PersonalTemplateEntity;
@ -132,4 +134,11 @@ public interface PersonalTemplateService extends BaseService<PersonalTemplateEnt
* @author sun
*/
List<GetTemplateListResultDTO> templateList(GetTemplateListFormDTO formDTO);
/**
* @return
* @Description 获取客户两个端站内信模板Id
* @author sun
*/
List<CustomerTemplateListResultDTO> customerTemplateList(CustomerTemplateListFormDTO formDTO);
}

12
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PersonalTemplateServiceImpl.java

@ -25,7 +25,9 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.PersonalTemplateDao;
import com.epmet.dto.PersonalTemplateDTO;
import com.epmet.dto.form.CustomerTemplateListFormDTO;
import com.epmet.dto.form.GetTemplateListFormDTO;
import com.epmet.dto.result.CustomerTemplateListResultDTO;
import com.epmet.dto.result.GetTemplateListResultDTO;
import com.epmet.dto.result.TemplateDTO;
import com.epmet.entity.PersonalTemplateEntity;
@ -129,4 +131,14 @@ public class PersonalTemplateServiceImpl extends BaseServiceImpl<PersonalTemplat
return baseDao.selectTemplateList(formDTO);
}
/**
* @return
* @Description 获取客户两个端站内信模板Id
* @author sun
*/
@Override
public List<CustomerTemplateListResultDTO> customerTemplateList(CustomerTemplateListFormDTO formDTO) {
return baseDao.selectCustomerTemplateList(formDTO);
}
}

43
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java

@ -476,6 +476,17 @@ public enum WxMaErrorMsgEnum {
CODE_85012(85012, "无效的审核 id"),
CODE_87006(87006, "小游戏不能提交"),
CODE_86007(86007, "小程序禁止提交"),
CODE_85051(85012, "version_desc或者preview_info超限"),
CODE_85092(85092, "preview_info格式错误"),
CODE_85093(85093, "preview_info 视频或者图片个数超限"),
CODE_85094(85094, "需提供审核机制说明信息"),
CODE_86009(86009, "服务商新增小程序代码提审能力被限制"),
CODE_86010(86010, "服务商迭代小程序代码提审能力被限制"),
CODE_9400001(9400001, "该开发小程序已开通小程序直播权限,不支持发布版本。如需发版,请解绑开发小程序后再操作"),
CODE_9402202(9402202, "请勿频繁提交,待上一次操作完成后再提交"),
CODE_87013(87013, "撤回次数达到上限(每天一次,每个月 10 次)"),
CODE_85019(85019, "没有审核版本"),
@ -539,6 +550,38 @@ public enum WxMaErrorMsgEnum {
CODE_200020(200020, "关键词列表 kidList 参数错误"),
CODE_200021(200021, "场景描述 sceneDesc 参数错误"),
CODE_20002(20002, "商品id不存在"),
CODE_1003(1003, "POST参数非法"),
CODE_40005(40005, "上传素材文件格式不对"),
CODE_40006(40006, "上传素材文件大小超出限制"),
CODE_40008(40008, "不合法的消息类型"),
CODE_40010(40010, "不合法的语音文件大小"),
CODE_40011(40011, "不合法的视频文件大小"),
CODE_40012(40012, "不合法的缩略图文件大小"),
CODE_40015(40015, "不合法的菜单类型"),
CODE_40016(40016, "不合法的按钮个数"),
CODE_40017(40017, "不合法的按钮类型"),
CODE_40018(40018, "不合法的按钮名字长度"),
CODE_40019(40019, "不合法的按钮 KEY 长度"),
CODE_40020(40020, "不合法的按钮 URL 长度"),
CODE_40021(40021, "不合法的菜单版本号"),
CODE_40022(40022, "不合法的子菜单级数"),
CODE_40023(40023, "不合法的子菜单按钮个数"),
CODE_40024(40024, "不合法的子菜单按钮类型"),
CODE_40025(40025, "不合法的子菜单按钮名字长度"),
CODE_40026(40026, "不合法的子菜单按钮 KEY 长度"),
CODE_40027(40027, "不合法的子菜单按钮 URL 长度"),
CODE_40028(40028, "不合法的自定义菜单使用用户"),
CODE_40030(40030, "不合法的 refresh_token"),
CODE_40031(40031, "不合法的 openid 列表"),
CODE_40032(40032, "不合法的 openid 列表长度"),
CODE_40033(40033, "不合法的请求字符,不能包含 \\uxxxx 格式的字符"),
CODE_40034(40034, "无效的模板大小"),
CODE_40035(40035, "不合法的参数"),
CODE_40036(40036, "不合法的 template_id 长度"),
CODE_40038(40038, "不合法的请求格式"),
;
private int code;

15
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml

@ -89,4 +89,19 @@
ORDER BY CREATED_TIME DESC
</select>
<select id="selectCustomerTemplateList" resultType="com.epmet.dto.result.CustomerTemplateListResultDTO">
SELECT
pt.title AS "templateType",
pt.pri_tmpl_id AS "templateId",
cm.client AS "clientType"
FROM
personal_template pt
LEFT JOIN customer_mp cm ON pt.app_id = cm.app_id
WHERE
pt.del_flag = '0'
AND cm.del_flag = '0'
AND pt.customer_id = #{customerId}
AND pt.tid = #{publicId}
</select>
</mapper>

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -237,11 +237,21 @@ public class AgencyServiceImpl implements AgencyService {
@Override
public Result<SubAgencyResultDTO> subAgencyList(SubAgencyFormDTO formDTO) {
SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO();
//1:根据当前机关Id查询直属下一级机关列表
//1:根据当前机关Id查询直属下一级机关列表,只返回前十条
List<SubListResultDTO> agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId());
subAgencyResultDTO.setAgencyList(null == agencyList ? new ArrayList<SubListResultDTO>() : agencyList);
//2:统计下一级机关数
if (null == agencyList || agencyList.size() < NumConstant.ONE) {
subAgencyResultDTO.setAgencyList(new ArrayList<SubListResultDTO>());
subAgencyResultDTO.setSubAgencyCount(NumConstant.ZERO);
} else {
subAgencyResultDTO.setSubAgencyCount(agencyList.size());
if (agencyList.size() > NumConstant.TEN) {
List<SubListResultDTO> newList = agencyList.subList(NumConstant.ZERO, NumConstant.TEN);
subAgencyResultDTO.setAgencyList(newList);
} else {
subAgencyResultDTO.setAgencyList(agencyList);
}
}
return new Result<SubAgencyResultDTO>().ok(subAgencyResultDTO);
}

1
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -67,7 +67,6 @@
WHERE del_flag = '0'
AND pid = #{pId}
ORDER BY created_time DESC
LIMIT 10
</select>
<select id="selectAgencyList" resultType="com.epmet.dto.result.AgencyListResultDTO">

48
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessAndCurrentDeptResultDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/10/26 9:36 上午
*/
@Data
public class ProcessAndCurrentDeptResultDTO implements Serializable {
private static final long serialVersionUID = 2977695657920536933L;
private List<ProcesslistResultDTO> processList;
/**
* 当前跟进部门
*/
private List<String> departmentNameList;
/**
* 当前跟进部门
*/
private List<ProjectDetailResultDTO.DepartmentNameListBean> departmentList;
@NoArgsConstructor
@Data
public static class DepartmentNameListBean {
/**
* 部门名
*/
private String departmentName;
/**
* 工作人员
*/
private List<String> staffList;
}
public ProcessAndCurrentDeptResultDTO() {
this.processList = new ArrayList<>();
this.departmentNameList = new ArrayList<>();
this.departmentList = new ArrayList<>();
}
}

6
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java

@ -1,8 +1,11 @@
package com.epmet.feign;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.form.ProjectListFromDTO;
import com.epmet.dto.result.PendProjectListResultDTO;
import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO;
import com.epmet.dto.result.ProcesslistResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import com.epmet.commons.tools.constant.ServiceConstant;
@ -29,4 +32,7 @@ public interface GovProjectOpenFeignClient {
*/
@PostMapping("gov/project/project/pendprojectlist")
Result<List<PendProjectListResultDTO>> getPendProjectList(@RequestBody ProjectListFromDTO fromDTO);
@PostMapping("gov/project/trace/processlistnotrule")
Result<ProcessAndCurrentDeptResultDTO> getProcessList(@RequestBody ProcessListFormDTO fromDTO);
}

8
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java

@ -3,8 +3,11 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.form.ProjectListFromDTO;
import com.epmet.dto.result.PendProjectListResultDTO;
import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO;
import com.epmet.dto.result.ProcesslistResultDTO;
import com.epmet.feign.GovProjectOpenFeignClient;
import org.springframework.stereotype.Component;
@ -22,4 +25,9 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli
public Result<List<PendProjectListResultDTO>> getPendProjectList(ProjectListFromDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getPendProjectList", fromDTO);
}
@Override
public Result<ProcessAndCurrentDeptResultDTO> getProcessList(ProcessListFormDTO fromDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getProcessList", fromDTO);
}
}

12
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java

@ -179,6 +179,18 @@ public class ProjectTraceController {
return new Result<List<ProcesslistResultDTO>>().ok(projectProcessService.progressList(formDTO));
}
/**
* @param formDTO
* @return
* @Author zxc
* @Description 项目跟踪-项目处理进展列表
**/
@PostMapping("processlistnotrule")
public Result<ProcessAndCurrentDeptResultDTO> processListNotRule(@RequestBody ProcessListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<ProcessAndCurrentDeptResultDTO>().ok(projectProcessService.progressAndCurrentDept(formDTO));
}
/**
* @param formDTO
* @return

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save