Browse Source

Merge remote-tracking branch 'remotes/origin/dev_issue_category' into dev

# Conflicts:
#	epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
master
jianjun 4 years ago
parent
commit
e95d3a210d
  1. 4
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
  2. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 34
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java
  4. 5
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectCategoryDTO.java
  5. 41
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java
  6. 41
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java
  7. 43
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/CustomerCategoryDTO.java
  8. 41
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java
  9. 6
      epmet-module/data-report/data-report-server/pom.xml
  10. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
  11. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
  12. 54
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  13. 40
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml
  14. 10
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java
  15. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java
  16. 27
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/CategoryDictDataFormDTO.java
  17. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java
  18. 43
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java
  19. 43
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java
  20. 61
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CategoryDictFormDTO.java
  21. 56
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CategoryProjectResultDTO.java
  22. 53
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  23. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java
  24. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java
  25. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java
  26. 46
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java
  27. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  28. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.java
  29. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java
  30. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java
  31. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
  32. 63
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerProjectCategoryDictDao.java
  33. 63
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectCategoryDailyEntity.java
  34. 49
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java
  35. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java
  36. 83
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java
  37. 95
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/CustomerProjectCategoryDictEntity.java
  38. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java
  39. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java
  40. 42
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java
  41. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java
  42. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java
  43. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java
  44. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java
  45. 50
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java
  46. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java
  47. 122
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java
  48. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  49. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  50. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridDailyService.java
  51. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java
  52. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  53. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java
  54. 257
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java
  55. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java
  56. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java
  57. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  58. 58
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java
  59. 119
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java
  60. 47
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.10__add_project_category_analysis.sql
  61. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml
  62. 65
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml
  63. 13
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml
  64. 53
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml
  65. 78
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml
  66. 51
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/IssueProjectCategoryDictDao.xml
  67. 36
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml
  68. 14
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
  69. 95
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerProjectCategoryDictDao.xml
  70. 12
      epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据对接.txt
  71. 8
      epmet-module/gov-issue/gov-issue-client/pom.xml
  72. 101
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCategoryDTO.java
  73. 116
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java
  74. 106
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectTagDictDTO.java
  75. 96
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueTagsDTO.java
  76. 24
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AddTagFormDTO.java
  77. 16
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CategoryTagInitFormDTO.java
  78. 47
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/FirstCategoryFormDTO.java
  79. 21
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java
  80. 34
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueSaveCategoryFormDTO.java
  81. 26
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueTagFormDTO.java
  82. 72
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueTagsFormDTO.java
  83. 28
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueTagsSaveFormDTO.java
  84. 27
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SaveIssueCategoryFormDTO.java
  85. 21
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SecondCategoryFormDTO.java
  86. 10
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectFormDTO.java
  87. 28
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/TagDifferentSetFormDTO.java
  88. 17
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/TagListFormDTO.java
  89. 23
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AddTagResultDTO.java
  90. 48
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/CustomerCategoryResultDTO.java
  91. 27
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagListResultDTO.java
  92. 45
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagResultDTO.java
  93. 21
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectTagsResultDTO.java
  94. 18
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/TagListResultDTO.java
  95. 38
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
  96. 30
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
  97. 32
      epmet-module/gov-issue/gov-issue-server/pom.xml
  98. 16
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/GovIssueRedisKeys.java
  99. 138
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java
  100. 16
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java

4
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java

@ -17,5 +17,9 @@ public interface ConsomerGroupConstants {
* 初始化客户组织机构信息分组
*/
String INIT_CUSTOMER_ORG_ROLES_GROUP = "init_customer_org_roles_group";
/**
* 客户初始化议题项目分类标签数据
*/
String ISSUE_PROJECT_CATEGORY_TAG = "issue_project_category_tag";
}

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -131,6 +131,7 @@ public enum EpmetErrorCode {
CUSTOMER_VALIDATE_ERROR(8805, "内部数据校验异常"),
CATEGORY_IS_NULL(8806, "请设置分类"),
//公众号 865..开头的码
PUBLIC_NOT_EXISTS(8651,"手机号未注册,请先完成信息注册"),
SELECT_CUSTOMER_ERROR(8652,"未查询到注册客户信息"),
@ -145,7 +146,10 @@ public enum EpmetErrorCode {
TOPIC_SHIFTED_TO_ISSUE_UNDER_AUDITING(9004,"当前话题正在转议题审核"),
TOPIC_ALREADY_SHIFTED_TO_ISSUE(9005,"该话题已被转为议题,请勿重复操作"),
TOPIC_IS_HIDDEN(9006,"该话题已被屏蔽,请先解除屏蔽"),
TOPIC_IS_CLOSED(9008,"该话题已关闭,无法转为议题");
TOPIC_IS_CLOSED(9008,"该话题已关闭,无法转为议题"),
CUSTOMER_CATEGORY(9101,"分类已使用,不允许删除"),
CATEGORY_NAME(9102,"分类名称已存在,不允许重复");
private int code;
private String msg;

34
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java

@ -357,6 +357,18 @@ public class RedisUtils {
return typedTuples;
}
public <T> Set<T> zReverseRange(String key, long start, long end, Class<T> clazz) {
Set<Object> objects = redisTemplate.opsForZSet().reverseRange(key, start, end);
if(CollectionUtils.isEmpty(objects)) return null;
return objects.stream().map(o->{
try {
T target = clazz.newInstance();
BeanUtils.copyProperties(o, target);
return target;
}catch (Exception e){throw new RenException("convert error");}
}).collect(Collectors.toSet());
}
/**
* @Description 标签使用数量缓存更新
* @param key
@ -368,6 +380,28 @@ public class RedisUtils {
return redisTemplate.opsForZSet().incrementScore(key, value, delta);
}
/**
* @Description 获取某个Zset的score
* @Param key
* @Param o
* @author zxc
* @date 2020/12/9 下午3:07
*/
public Double getScore(String key, Object o){
return redisTemplate.opsForZSet().score(key,o);
}
/**
* @Description zset添加
* @Param key
* @Param o
* @author zxc
* @date 2020/12/9 下午3:18
*/
public void zSetAdd(String key, Object o){
redisTemplate.opsForZSet().add(key,o,NumConstant.ZERO);
}
/**
* @Description 判断key是否存在
* @param key

5
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectCategoryDTO.java

@ -64,6 +64,11 @@ public class ProjectCategoryDTO implements Serializable {
*/
private String categoryPids;
/**
* 分类编码分类编码+customer_id唯一
*/
private String categoryCode;
/**
* 删除标识 0未删除1已删除
*/

41
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java

@ -17,11 +17,10 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
/**
* 项目(事件)分类按网格_按天统计
@ -67,7 +66,7 @@ public class ScreenProjectCategoryGridDailyDTO implements Serializable {
/**
* e世通中的项目类别编码
*/
private String epmetCategoryCode;
private String categoryCode;
/**
* 该分类下所有项目总数
@ -75,39 +74,9 @@ public class ScreenProjectCategoryGridDailyDTO implements Serializable {
private Integer projectTotal;
/**
* 该分类下正在处理中的项目总数
*/
private Integer pendingTotal;
/**
* 该分类下已结案的项目总数
*/
private Integer closedTotal;
/**
* 该分类下已结案无需解决的项目总数
*/
private Integer unResolvedTotal;
/**
* 该分类下已结案已解决的项目总数
*/
private Integer resolvedTotal;
/**
* 该分类下项目结案率
*/
private BigDecimal closedRatio;
/**
* 该分类下已结案项目解决率
*/
private BigDecimal resolvedRatio;
/**
* 该分类下已结案项目未解决率
* 分类等级12....
*/
private BigDecimal unResolvedRatio;
private Integer level;
/**
* 删除标识

41
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java

@ -17,11 +17,10 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
/**
* 项目(事件)分类按组织_按天统计
@ -72,7 +71,7 @@ public class ScreenProjectCategoryOrgDailyDTO implements Serializable {
/**
* e世通中的项目类别编码
*/
private String epmetCategoryCode;
private String categoryCode;
/**
* 该分类下所有项目总数
@ -80,39 +79,9 @@ public class ScreenProjectCategoryOrgDailyDTO implements Serializable {
private Integer projectTotal;
/**
* 该分类下正在处理中的项目总数
*/
private Integer pendingTotal;
/**
* 该分类下已结案的项目总数
*/
private Integer closedTotal;
/**
* 该分类下已结案无需解决的项目总数
*/
private Integer unResolvedTotal;
/**
* 该分类下已结案已解决的项目总数
*/
private Integer resolvedTotal;
/**
* 该分类下项目结案率
*/
private BigDecimal closedRatio;
/**
* 该分类下已结案项目解决率
*/
private BigDecimal resolvedRatio;
/**
* 该分类下已结案项目未解决率
* 分类等级12....
*/
private BigDecimal unResolvedRatio;
private Integer level;
/**
* 删除标识

43
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/CustomerCategoryDTO.java

@ -0,0 +1,43 @@
/**
* 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;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class CustomerCategoryDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 父id
* pid = 0 查询一级分类
* pid != 0 查询二级分类
*/
private String pid;
/**
* 客户Id
*/
private String customerId;
}

41
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java

@ -0,0 +1,41 @@
package com.epmet.project.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zhangyong
* @Description 002项目分类字典查询
**/
@Data
public class ProjectCategoryDictResultDTO implements Serializable {
private static final long serialVersionUID = 8529179932504931368L;
/**
* 一级分类编码
*/
private String categoryCode;
/**
* 一级分类名称
*/
private String categoryName;
/**
* 二级分类列表
*/
private List<ProjectCategoryDictResultDTO> children;
/**
* 主键
**/
private String id;
/**
* 上级分类ID 顶级此列存储0
**/
private String pid;
}

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

@ -94,6 +94,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-issue-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

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

@ -16,10 +16,7 @@ import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
import com.epmet.project.dto.result.*;
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;
@ -129,4 +126,18 @@ public class ProjectController {
public Result<List<ProjectNextAgencyResultDTO>> myNextAgency(@LoginUser TokenDto tokenDto){
return new Result<List<ProjectNextAgencyResultDTO>>().ok(projectService.getMyNextAgency(tokenDto));
}
/**
* 002项目分类字典查询
* 查询当前客户的父客户下项目分类字典
*
* @param customerId
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO>>
* @Author zhangyong
* @Date 10:41 2021-03-22
**/
@PostMapping("categorydict")
public Result<List<ProjectCategoryDictResultDTO>> categoryDict(@RequestHeader("CustomerId") String customerId) {
return new Result<List<ProjectCategoryDictResultDTO>>().ok(projectService.getCategoryDict(customerId));
}
}

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

@ -70,4 +70,14 @@ public interface ProjectService {
* @date 2020.10.19 16:38
**/
List<ProjectNextAgencyResultDTO> getMyNextAgency(TokenDto tokenDto);
/**
* 002项目分类字典查询
*
* @param customerId
* @return java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO>
* @Author zhangyong
* @Date 14:26 2021-03-22
**/
List<ProjectCategoryDictResultDTO> getCategoryDict(String customerId);
}

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

@ -3,6 +3,7 @@ package com.epmet.datareport.service.project.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -18,20 +19,21 @@ import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.form.SubAgencyFormDTO;
import com.epmet.dto.result.*;
import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.GovProjectOpenFeignClient;
import com.epmet.feign.*;
import com.epmet.project.constant.ProjectConstant;
import com.epmet.project.dto.CustomerCategoryDTO;
import com.epmet.project.dto.FactAgencyProjectDailyDTO;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
import com.epmet.project.dto.result.ProjectDetailResultDTO;
import com.epmet.project.dto.result.*;
import com.epmet.project.dto.result.ProjectDetailResultDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -50,7 +52,7 @@ import java.util.List;
@Slf4j
@Service
public class ProjectServiceImpl implements ProjectService {
private Logger logger = LogManager.getLogger(getClass());
@Autowired
private ProjectDao projectDao;
@Autowired
@ -64,6 +66,11 @@ public class ProjectServiceImpl implements ProjectService {
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private ResiGroupOpenFeignClient resiGroupOpenFeignClient;
@Autowired
private GovIssueOpenFeignClient govIssueOpenFeignClient;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
/**
* @Author sun
* @Description 数据-项目-获取汇总数据
@ -350,4 +357,41 @@ public class ProjectServiceImpl implements ProjectService {
return result;
}
@Override
public List<ProjectCategoryDictResultDTO> getCategoryDict(String customerId) {
List<ProjectCategoryDictResultDTO> result = new ArrayList<>();
Result<String> parentCustomerId = operCrmOpenFeignClient.getExternalAndParentCustomerId(customerId);
if (!parentCustomerId.success() && null == parentCustomerId.getData()) {
logger.warn(String.format("调用%s服务查询外部客户的 父级客户ID 失败,入参%s", ServiceConstant.OPER_CRM_SERVER,
JSON.toJSONString(customerId)));
return result;
}
CustomerCategoryDTO argDto = new CustomerCategoryDTO();
argDto.setCustomerId(parentCustomerId.getData());
argDto.setPid(NumConstant.ZERO_STR);
// 获取客户一级分类
Result<List<ProjectCategoryDictResultDTO>> parentCategoryDict = govIssueOpenFeignClient.getCustomerCategoryDict(argDto);
if (!parentCategoryDict.success()) {
logger.warn(String.format("调用%s服务查询当前客户的父客户下,项目分类字典失败,入参%s", ServiceConstant.GOV_ISSUE_SERVER,
JSON.toJSONString(customerId)));
} else {
result = parentCategoryDict.getData();
// 获取客户二级分类
argDto.setPid(NumConstant.TWO_STR);
Result<List<ProjectCategoryDictResultDTO>> childrenCategoryDict = govIssueOpenFeignClient.getCustomerCategoryDict(argDto);
for (ProjectCategoryDictResultDTO p : result) {
List<ProjectCategoryDictResultDTO> children = new ArrayList<>();
for (ProjectCategoryDictResultDTO c : childrenCategoryDict.getData()) {
if (p.getId().equals(c.getPid())) {
ProjectCategoryDictResultDTO dto = new ProjectCategoryDictResultDTO();
dto.setCategoryCode(c.getCategoryCode());
dto.setCategoryName(c.getCategoryName());
children.add(dto);
}
}
p.setChildren(children);
}
}
return result;
}
}

40
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml

@ -5,24 +5,26 @@
<select id="selectCategoryAnalysis" resultType="com.epmet.dto.result.screen.CategoryAnalysisResultDTO">
SELECT EPMET_CATEGORY_NAME AS categoryName,
PROJECT_TOTAL AS projectTotal
FROM screen_project_category_org_daily
WHERE DEL_FLAG = '0'
AND ORG_ID = #{agencyId}
AND DATE_ID = (
select
date_id
from
screen_project_category_org_daily
where
del_flag = '0'
and ORG_ID = #{agencyId}
order by
date_id desc,
created_time desc
limit 1
)
ORDER BY EPMET_CATEGORY_CODE
SELECT D.CATEGORY_NAME AS categoryName,
M.PROJECT_TOTAL AS projectTotal
FROM screen_project_category_org_daily m
left join customer_project_category_dict d
on(m.CATEGORY_CODE=D.CATEGORY_CODE AND D.DEL_FLAG='0')
WHERE M.DEL_FLAG = '0'
AND M.ORG_ID = #{agencyId}
AND M.DATE_ID = (
select
date_id
from
screen_project_category_org_daily
where
del_flag = '0'
and ORG_ID = #{agencyId}
order by
date_id desc,
created_time desc
limit 1
)
ORDER BY M.CATEGORY_CODE ASC
</select>
</mapper>

10
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java

@ -53,6 +53,11 @@ public class IssueProjectCategoryDictDTO implements Serializable {
*/
private String pids;
/**
* 上级分类编码
*/
private String parentCategoryCode;
/**
* 分类编码分类编码+customer_id唯一
*/
@ -73,6 +78,11 @@ public class IssueProjectCategoryDictDTO implements Serializable {
*/
private Integer sort;
/**
* 是否禁用(enable:启用 disable:禁用)
*/
private String isDisable;
/**
* 删除标识 0未删除1已删除
*/

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java

@ -64,6 +64,11 @@ public class ProjectCategoryDTO implements Serializable {
*/
private String categoryPids;
/**
* 分类编码分类编码+customer_id唯一
*/
private String categoryCode;
/**
* 删除标识 0未删除1已删除
*/

27
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/CategoryDictDataFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.screen;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.dto.screen.form.CategoryDictFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 项目分类字典上报
* @Auther: zhangyong
* @Date: 2021-03-22
*/
@Data
public class CategoryDictDataFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 当isFirst=true时直接根据 customerId 删除原有数据再批量insert
*/
private Boolean isFirst;
private List<CategoryDictFormDTO> dataList;
}

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java

@ -112,5 +112,7 @@ public class ScreenCustomerGridDTO implements Serializable {
* 所有上级ID用英文逗号分开
*/
private String allParentIds;
private String pid;
private String pids;
}

43
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java

@ -17,11 +17,10 @@
package com.epmet.dto.screen;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
/**
* 项目(事件)分类按网格_按天统计
@ -67,9 +66,7 @@ public class ScreenProjectCategoryGridDailyDTO implements Serializable {
/**
* e世通中的项目类别编码
*/
private String epmetCategoryCode;
private String epmetCategoryName;
private String categoryCode;
/**
* 该分类下所有项目总数
@ -77,39 +74,9 @@ public class ScreenProjectCategoryGridDailyDTO implements Serializable {
private Integer projectTotal;
/**
* 该分类下正在处理中的项目总数
*/
private Integer pendingTotal;
/**
* 该分类下已结案的项目总数
*/
private Integer closedTotal;
/**
* 该分类下已结案无需解决的项目总数
*/
private Integer unResolvedTotal;
/**
* 该分类下已结案已解决的项目总数
*/
private Integer resolvedTotal;
/**
* 该分类下项目结案率
*/
private BigDecimal closedRatio;
/**
* 该分类下已结案项目解决率
*/
private BigDecimal resolvedRatio;
/**
* 该分类下已结案项目未解决率
* 分类等级12....
*/
private BigDecimal unResolvedRatio;
private Integer level;
/**
* 删除标识

43
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java

@ -17,11 +17,10 @@
package com.epmet.dto.screen;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
/**
* 项目(事件)分类按组织_按天统计
@ -72,9 +71,7 @@ public class ScreenProjectCategoryOrgDailyDTO implements Serializable {
/**
* e世通中的项目类别编码
*/
private String epmetCategoryCode;
private String epmetCategoryName;
private String categoryCode;
/**
* 该分类下所有项目总数
@ -82,39 +79,9 @@ public class ScreenProjectCategoryOrgDailyDTO implements Serializable {
private Integer projectTotal;
/**
* 该分类下正在处理中的项目总数
*/
private Integer pendingTotal;
/**
* 该分类下已结案的项目总数
*/
private Integer closedTotal;
/**
* 该分类下已结案无需解决的项目总数
*/
private Integer unResolvedTotal;
/**
* 该分类下已结案已解决的项目总数
*/
private Integer resolvedTotal;
/**
* 该分类下项目结案率
*/
private BigDecimal closedRatio;
/**
* 该分类下已结案项目解决率
*/
private BigDecimal resolvedRatio;
/**
* 该分类下已结案项目未解决率
* 分类等级12....
*/
private BigDecimal unResolvedRatio;
private Integer level;
/**
* 删除标识

61
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CategoryDictFormDTO.java

@ -0,0 +1,61 @@
package com.epmet.dto.screen.form;
import lombok.Data;
import java.io.Serializable;
/**
* 项目分类字典上报
* @Auther: zhangyong
* @Date: 2021-03-22
*/
@Data
public class CategoryDictFormDTO implements Serializable {
private static final long serialVersionUID = 1245827825857891963L;
/**
* 客户内自己的分类编码
*/
private String categoryCode;
/**
* 客户内自己的分类名称
*/
private String categoryName;
/**
* 父类分类编码如果是一级分类此列赋值为0
*/
private String parentCategoryCode;
/**
* 分类等级12....
*/
private Integer level;
/**
* 排序
*/
private Integer sort;
/**
* 当前分类对应产品内的分类编码如果对应不上此列传空
*/
private String epmetCategoryCode;
/**
* 原始创建时间yyyy-MM-dd HH:mm:ss
*/
private String originCreatedTime;
/**
* 原始更新时间yyyy-MM-dd HH:mm:ss
*/
private String orginUpdatedTime;
/**
* 分类字典表主键
*/
private String categoryId;
}

56
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/CategoryProjectResultDTO.java

@ -0,0 +1,56 @@
package com.epmet.dto.screen.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/3/23 下午2:38
* @DESC
*/
@Data
public class CategoryProjectResultDTO implements Serializable {
private static final long serialVersionUID = -5774330825880917524L;
private String pid;
private String pids;
/**
* 组织ID
*/
private String orgId;
/**
* 客户ID
*/
private String customerId;
/**
* 分类码
*/
private String categoryCode;
/**
* 项目总数
*/
private Integer projectTotal;
/**
* 分类级别
*/
private Integer level;
/**
* 日期ID
*/
private String dateId;
/**
* 组织级别
*/
private String orgType;
private Boolean status = false;
}

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

@ -2,6 +2,7 @@ package com.epmet.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.DateUtils;
import com.epmet.commons.tools.utils.Result;
@ -34,13 +35,11 @@ import com.epmet.entity.stats.DimDateEntity;
import com.epmet.entity.stats.DimMonthEntity;
import com.epmet.service.StatsDemoService;
import com.epmet.service.evaluationindex.extract.dataToIndex.*;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.evaluationindex.screen.ScreenProjectGridDailyService;
import com.epmet.service.evaluationindex.screen.ScreenProjectOrgDailyService;
import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityGridMonthlyService;
import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService;
import com.epmet.service.evaluationindex.screen.*;
import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import lombok.extern.slf4j.Slf4j;
@ -49,6 +48,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.concurrent.ExecutionException;
@ -103,6 +103,13 @@ public class DemoController {
private GovernRankDataExtractService governRankDataExtractService;
@Autowired
private OrgRankExtractService orgRankExtractService;
@Autowired
private ScreenProjectSettleService screenProjectSettleService;
@Autowired
private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService;
@Autowired
private FactOriginProjectCategoryDailyService originProjectCategoryDailyService;
@GetMapping("testAlarm")
public void testAlarm() {
//for (int i = 0; i < 20; i++) {
@ -815,8 +822,6 @@ public class DemoController {
return new Result();
}*/
@Autowired
private ScreenProjectSettleService screenProjectSettleService;
@PostMapping("project-test")
public Result project(@RequestBody ScreenCentralZoneDataFormDTO param){
screenProjectSettleService.extractScreenData(param);
@ -828,4 +833,40 @@ public class DemoController {
System.out.println(monthId);
}
}
/**
* @return com.epmet.commons.tools.utils.Result
* @param customerId
* @author yinzuomei
* @description 产品内部计算网格内按分类统计项目数量
* @Date 2021/3/23 10:52
**/
@PostMapping("extractProjectCategoryData")
public Result extractProjectCategoryData(@RequestParam("customerId") String customerId){
String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", "");
projectCategoryGridDailyService.extractProjectCategoryData(customerId,dateId);
return new Result();
}
/**
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @description 将epmet_gov_project库中的项目分类信息project_category同步到统计库epmet_data_statistical
* @Date 2021/3/23 10:52
**/
@PostMapping("extractProjectCategory")
public Result extractProjectCategory(@RequestBody ExtractOriginFormDTO formDTO){
originProjectCategoryDailyService.extractProjectCategory(formDTO);
return new Result();
}
@Autowired
private ScreenProjectCategoryOrgDailyService screenProjectCategoryOrgDailyService;
@PostMapping("orgdaily")
public Result orgDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId){
screenProjectCategoryOrgDailyService.extractProjectCategoryOrgData(customerId,dateId);
return new Result();
}
}

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

@ -1,7 +1,6 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.AgencySubDeptTreeDto;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
@ -105,6 +104,13 @@ public class DimController {
} catch (Exception e) {
logger.error("初始化按周维度失败:", e);
}
//项目分类字典维度 初始化 每天晚上凌晨10分执行
try {
statsDimService.customerInitProjectCategory();
logger.info("初始化项目分类成功");
} catch (Exception e) {
logger.error("初始化项目分类失败:", e);
}
return new Result();
}

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

@ -3,16 +3,15 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.screen.*;
import com.epmet.dto.screen.form.CategoryDictFormDTO;
import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO;
import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.service.evaluationindex.screen.*;
import com.epmet.service.stats.CustomerProjectCategoryDictService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @Description 事件/项目采集接口入口
@ -41,7 +40,8 @@ public class ScreenProjectDataCollController {
private ScreenProjectDataService projectDataService;
@Autowired
private ScreenProjectProcessService projectProcessService;
@Autowired
private CustomerProjectCategoryDictService customerProjectCategoryDictService;
/**
* @author wangc
* @description 事件/项目分析网格内月度数量统计
@ -152,4 +152,21 @@ public class ScreenProjectDataCollController {
return new Result();
}
/**
* 项目分类字典上报
* 目标表epmet_evaluation_index库的customer_project_category_dict
*
* @param customerId
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 16:03 2021-03-22
**/
@PostMapping("uploadcategorydict")
public Result uploadcategorydict(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO<CategoryDictFormDTO> formDTO) {
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class);
customerProjectCategoryDictService.uploadCategoryDict(formDTO);
return new Result();
}
}

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java

@ -43,4 +43,12 @@ public interface CustomerRelationDao extends BaseDao<CustomerRelationEntity> {
CustomerSubInfoDTO selectCustomerSubInfo(@Param("customerId")String customerId);
List<CustomerRelationEntity> selectListByPids(String customerId);
/**
* @Description 查询子级客户
* @Param customerId
* @author zxc
* @date 2021/3/23 上午10:21
*/
List<CustomerRelationEntity> selectSubCustomer(@Param("customerId") String customerId);
}

46
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java

@ -0,0 +1,46 @@
/**
* 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.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity;
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 2021-03-19
*/
@Mapper
public interface FactOriginProjectCategoryDailyDao extends BaseDao<FactOriginProjectCategoryDailyEntity> {
void deleteOldData(@Param("customerId") String customerId,@Param("dateId") String dateId);
/**
* @param customerId
* @author yinzuomei
* @description 计算当前客户下各个网格内各项目分类下项目数量
* @Date 2021/3/23 9:58
**/
List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(@Param("customerId") String customerId);
}

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

@ -194,4 +194,13 @@ public interface ScreenCustomerGridDao extends BaseDao<ScreenCustomerGridEntity>
* @date 2021/1/28 下午3:18
*/
List<ScreenProjectGridDailyDTO> selectGridInfoByCustomerId(@Param("customerId") String customerId);
/**
* @Description 查询直属网格信息
* @Param customerId
* @Param level
* @author zxc
* @date 2021/3/23 下午4:03
*/
List<ScreenCustomerGridDTO> selectBelongGridInfo(@Param("customerId") String customerId,@Param("level") String level);
}

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

@ -18,10 +18,13 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.result.CategoryProjectResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目(事件)分类按网格_按天统计
*
@ -39,4 +42,13 @@ public interface ScreenProjectCategoryGridDailyDao extends BaseDao<ScreenProject
* @return int
*/
int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 查询分类信息
* @Param customerId
* @Param dateId
* @author zxc
* @date 2021/3/23 下午2:49
*/
List<CategoryProjectResultDTO> selectCategoryInfo(@Param("customerId") String customerId,@Param("dateId") String dateId,@Param("level")String level,@Param("gridIds")List<String> gridIds);
}

26
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java

@ -18,10 +18,14 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.result.CategoryProjectResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity;
import com.sun.org.apache.xpath.internal.operations.Bool;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目(事件)分类按组织_按天统计
*
@ -39,4 +43,26 @@ public interface ScreenProjectCategoryOrgDailyDao extends BaseDao<ScreenProjectC
* @return int
*/
int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId);
/**
* @Description 查询组织分类信息
* @Param customerId
* @Param dateId
* @Param level 组织级别
* @author zxc
* @date 2021/3/23 下午3:22
*/
List<CategoryProjectResultDTO> selectOrgCategoryInfo(@Param("customerId") String customerId, @Param("dateId") String dateId,@Param("level")String level);
/**
* @Description 查询组织分类信息多客户
* @Param customerId
* @Param dateId
* @Param level
* @Param existsStatus 父客户是否存在
* @author zxc
* @date 2021/3/24 下午2:48
*/
List<CategoryProjectResultDTO> selectOrgCategoryMoreCustomerInfo(@Param("customerIds")List<String> customerIds, @Param("dateId") String dateId,
@Param("level")String level, @Param("customerId")String customerId, @Param("existsStatus")Boolean existsStatus);
}

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java

@ -0,0 +1,41 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao.issue;
import com.epmet.entity.issue.IssueProjectCategoryDictEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
/**
* 议题项目分类字典
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Mapper
public interface IssueProjectCategoryDictDao {
List<IssueProjectCategoryDictEntity> listInsertCategoies(@Param("start") Date start, @Param("end") Date end);
List<IssueProjectCategoryDictEntity> listByUpdatedTime(@Param("start") Date start, @Param("end") Date end);
IssueProjectCategoryDictEntity getById(@Param("customerId")String customerId, @Param("id")String id);;
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java

@ -133,4 +133,6 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
* @date 2021.03.08 23:44
*/
List<ProjectCategoryDTO> selectProjectCategory(@Param("list")List<String> list);
}
List<com.epmet.dto.ProjectCategoryDTO> getProjectCategoryData(@Param("customerId") String customerId, @Param("dateId") String dateId);
}

63
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerProjectCategoryDictDao.java

@ -0,0 +1,63 @@
/**
* 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.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screen.form.CategoryDictFormDTO;
import com.epmet.entity.stats.CustomerProjectCategoryDictEntity;
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 2021-03-19
*/
@Mapper
public interface CustomerProjectCategoryDictDao extends BaseDao<CustomerProjectCategoryDictEntity> {
CustomerProjectCategoryDictEntity getLatestProjectCategory();
CustomerProjectCategoryDictEntity getLatestUpdatedEntity();
CustomerProjectCategoryDictEntity selectByCustomerIdAndId(@Param("customerId") String customerId, @Param("categoryId") String categoryId);
/**
* 当isFirst=true时直接根据 customerId 删除原有数据再批量insert
*
* @param customerId
* @return java.lang.Integer
* @Author zhangyong
* @Date 16:12 2021-03-22
**/
Integer deleteCustomerProjectCategoryDict(@Param("customerId") String customerId);
/**
* 批量insert
*
* @param list
* @param customerId
* @return void
* @Author zhangyong
* @Date 16:13 2021-03-22
**/
void batchInsertCustomerProjectCategoryDict(@Param("list") List<CategoryDictFormDTO> list, @Param("customerId")String customerId);
}

63
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectCategoryDailyEntity.java

@ -0,0 +1,63 @@
/**
* 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.extract;
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 2021-03-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_origin_project_category_daily")
public class FactOriginProjectCategoryDailyEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 项目id
*/
private String projectId;
/**
* 分类编码
*/
private String categoryCode;
/**
* 所属父类分类编码
*/
private String parentCategoryCode;
/**
* 分类等级12....产品目前只有2级分类
*/
private Integer level;
}

49
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java

@ -18,14 +18,10 @@
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;
import java.math.BigDecimal;
import java.util.Date;
/**
* 项目(事件)分类按网格_按天统计
*
@ -65,50 +61,17 @@ public class ScreenProjectCategoryGridDailyEntity extends BaseEpmetEntity {
private String pids;
/**
* e世通中的项目类别编码
* 项目类别编码
*/
private String epmetCategoryCode;
private String epmetCategoryName;
private String categoryCode;
/**
* 该分类下所有项目总数
*/
private Integer projectTotal;
/**
* 该分类下正在处理中的项目总数
*/
private Integer pendingTotal;
/**
* 该分类下已结案的项目总数
*/
private Integer closedTotal;
/**
* 该分类下已结案无需解决的项目总数
*/
private Integer unResolvedTotal;
/**
* 该分类下已结案已解决的项目总数
*/
private Integer resolvedTotal;
/**
* 该分类下项目结案率
*/
private BigDecimal closedRatio;
/**
* 该分类下已结案项目解决率
*/
private BigDecimal resolvedRatio;
/**
* 该分类下已结案项目未解决率
*/
private BigDecimal unResolvedRatio;
/**
* 分类等级12....
*/
private Integer level;
}

47
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java

@ -18,14 +18,10 @@
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;
import java.math.BigDecimal;
import java.util.Date;
/**
* 项目(事件)分类按组织_按天统计
*
@ -72,48 +68,15 @@ public class ScreenProjectCategoryOrgDailyEntity extends BaseEpmetEntity {
/**
* e世通中的项目类别编码
*/
private String epmetCategoryCode;
private String epmetCategoryName;
private String categoryCode;
/**
* 该分类下所有项目总数
*/
private Integer projectTotal;
/**
* 该分类下正在处理中的项目总数
*/
private Integer pendingTotal;
/**
* 该分类下已结案的项目总数
*/
private Integer closedTotal;
/**
* 该分类下已结案无需解决的项目总数
*/
private Integer unResolvedTotal;
/**
* 该分类下已结案已解决的项目总数
*/
private Integer resolvedTotal;
/**
* 该分类下项目结案率
*/
private BigDecimal closedRatio;
/**
* 该分类下已结案项目解决率
*/
private BigDecimal resolvedRatio;
/**
* 该分类下已结案项目未解决率
*/
private BigDecimal unResolvedRatio;
/**
* 分类等级12....
*/
private Integer level;
}

83
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java

@ -0,0 +1,83 @@
/**
* 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.issue;
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-12-08
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("issue_project_category_dict")
public class IssueProjectCategoryDictEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id, 产品默认default
*/
private String customerId;
/**
* 上级分类ID 顶级此列存储0
*/
private String pid;
/**
* 所有上级分类ID用逗号分开
*/
private String pids;
/**
* 上级分类编码
*/
private String parentCategoryCode;
/**
* 分类编码分类编码+customer_id唯一
*/
private String categoryCode;
/**
* 分类名称
*/
private String categoryName;
/**
* 分类类别1,2,3,4....
*/
private String categoryType;
/**
* 排序
*/
private Integer sort;
/**
* 是否禁用(enable:启用 disable:禁用)
*/
private String isDisable;
}

95
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/CustomerProjectCategoryDictEntity.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 客户项目分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-19
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("customer_project_category_dict")
public class CustomerProjectCategoryDictEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 外部客户external;内部客户internal
*/
private String customerType;
/**
* 客户自己的分类编码
*/
private String categoryCode;
/**
* 客户自己的分类名称
*/
private String categoryName;
/**
* 父类分类编码如果是一级分类此列赋值为0
*/
private String parentCategoryCode;
/**
* 分类等级12....产品只有2级分类
*/
private Integer level;
/**
* 排序
*/
private Integer sort;
/**
* 是否禁用(enable:启用 disable:禁用)
*/
private String isDisable;
/**
* 对应e世通中的分类编码没有此列为空
*/
private String epmetCategoryCode;
/**
* 创建时间
*/
private Date originCreatedTime;
/**
* 修改时间
*/
private Date originUpdatedTime;
private String categoryId;
}

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java

@ -0,0 +1,39 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.Issue;
import com.epmet.entity.issue.IssueProjectCategoryDictEntity;
import java.util.Date;
import java.util.List;
/**
* 议题项目分类字典
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
public interface IssueProjectCategoryDictService{
List<IssueProjectCategoryDictEntity> listInsertCategoies(Date start, Date end);
List<IssueProjectCategoryDictEntity> listByUpdatedTime(Date start, Date end);
IssueProjectCategoryDictEntity getById(String customerId,String id);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java

@ -176,7 +176,7 @@ public interface IssueService {
List<IssueVoteStatisticalResultDTO> selectIssueVoteStatis(String customerId, String monthId);
/**
* @Description 查找项目的分类名称 -相连
* @Description 查找项目的分类名称 -相连,分隔
* @param param
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc

42
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java

@ -0,0 +1,42 @@
package com.epmet.service.Issue.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.issue.IssueProjectCategoryDictDao;
import com.epmet.entity.issue.IssueProjectCategoryDictEntity;
import com.epmet.service.Issue.IssueProjectCategoryDictService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2021/3/19 15:29
*/
@Service
@DataSource(DataSourceConstant.GOV_ISSUE)
public class IssueProjectCategoryDictServiceImpl implements IssueProjectCategoryDictService {
@Autowired
private IssueProjectCategoryDictDao issueProjectCategoryDictDao;
@Override
public List<IssueProjectCategoryDictEntity> listInsertCategoies(Date start, Date end) {
return issueProjectCategoryDictDao.listInsertCategoies(start, end);
}
@Override
public List<IssueProjectCategoryDictEntity> listByUpdatedTime(Date start, Date end) {
return issueProjectCategoryDictDao.listByUpdatedTime(start, end);
}
@Override
public IssueProjectCategoryDictEntity getById(String customerId, String id) {
return issueProjectCategoryDictDao.getById(customerId,id);
}
}

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java

@ -2,6 +2,7 @@ package com.epmet.service.Issue.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.issue.StatsIssueDao;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
@ -146,14 +147,22 @@ public class IssueServiceImpl implements IssueService {
return statsIssueDao.selectIssueVoteStatis(customerId, dateId);
}
/**
* @Description 查找项目的分类名称 -相连,分隔
* @param param
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc
* @date 2021.03.09 00:23
*/
@Override
public Map<String, String> getIntegratedProjectCategory(Map<String, Set<String>> param,String customerId) {
Map<String, String> map = new HashMap<>();
param.forEach((projectId,categoryIds) -> {
//以下查询只适用于二级分类,如果分类层级变多了要修改此查询
List<IssueProjectCategoryDictDTO> categories = statsIssueDao.selectCategory(customerId, categoryIds);
if(!CollectionUtils.isEmpty(categories)){
StringBuilder str = new StringBuilder();
categories.forEach(category -> {str.append(category.getCategoryName()).append("-");});
categories.forEach(category -> {str.append(category.getCategoryName()).append(StrConstant.COMMA);});
map.put(projectId,str.substring(NumConstant.ZERO,str.length() - NumConstant.TWO));
}
});

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java

@ -10,4 +10,6 @@ public interface StatsDimService {
void initCustomerDim();
void initDepartmentDim();
void customerInitProjectCategory();
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java

@ -22,6 +22,8 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.indexcal.CustomerSubInfoDTO;
import com.epmet.entity.crm.CustomerRelationEntity;
import java.util.List;
/**
* 客户关系表(01.14 add)
*
@ -40,4 +42,12 @@ public interface CustomerRelationService extends BaseService<CustomerRelationEnt
CustomerSubInfoDTO getCustomerSubInfo(String customerId);
boolean haveSubCustomer(String customerId);
/**
* @Description 查询子级客户
* @Param customerId
* @author zxc
* @date 2021/3/23 上午10:21
*/
List<CustomerRelationEntity> selectSubCustomer(String customerId);
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java

@ -27,9 +27,11 @@ import com.epmet.entity.crm.CustomerRelationEntity;
import com.epmet.service.crm.CustomerRelationService;
import com.epmet.service.stats.DimCustomerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@ -70,4 +72,18 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl<CustomerRelatio
}
return true;
}
/**
* @Description 查询子级客户
* @Param customerId
* @author zxc
* @date 2021/3/23 上午10:21
*/
@Override
public List<CustomerRelationEntity> selectSubCustomer(String customerId) {
if (StringUtils.isEmpty(customerId)){
return new ArrayList<>();
}
return baseDao.selectSubCustomer(customerId);
}
}

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

@ -0,0 +1,50 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity;
import java.util.List;
/**
* 项目所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-19
*/
public interface FactOriginProjectCategoryDailyService extends BaseService<FactOriginProjectCategoryDailyEntity> {
/**
* @Description 将epmet_gov_project库中的项目分类信息project_category同步到统计库epmet_data_statistical
* @param paramNew
* @return void
* @Author liushaowen
* @Date 2021/3/22 15:28
*/
void extractProjectCategory(ExtractOriginFormDTO paramNew);
/**
* @param customerId
* @author yinzuomei
* @description 计算当前客户下各个网格内各项目分类下项目数量
* @Date 2021/3/23 9:56
**/
List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(String customerId);
}

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

@ -46,7 +46,8 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
private GroupExtractService groupExtractService;
@Autowired
private DimCustomerPartymemberService dimCustomerPartymemberService;
@Autowired
private FactOriginProjectCategoryDailyService originProjectCategoryDailyService;
@Override
public void extractAll(ExtractOriginFormDTO extractOriginFormDTO) {
@ -200,6 +201,11 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
} catch (Exception e) {
log.error("抽取【项目耗时数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
try {
originProjectCategoryDailyService.extractProjectCategory(paramNew);
} catch (Exception e) {
log.error("抽取【项目分类数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
} else {
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
@ -219,6 +225,16 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
} catch (Exception e) {
log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
String dateDimId = finalDaysBetween.get(i);
paramNew.setDateId(dateDimId);
originProjectCategoryDailyService.extractProjectCategory(paramNew);
}
} catch (Exception e) {
log.error("抽取【项目分类数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
}
});
}

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

@ -0,0 +1,122 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.evaluationindex.extract.todata.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectCategoryDailyDao;
import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity;
import com.epmet.entity.issue.IssueProjectCategoryDictEntity;
import com.epmet.service.Issue.IssueProjectCategoryDictService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService;
import com.epmet.service.project.ProjectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* 项目所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-19
*/
@Service
@DataSource(DataSourceConstant.STATS)
@Slf4j
public class FactOriginProjectCategoryDailyServiceImpl extends BaseServiceImpl<FactOriginProjectCategoryDailyDao, FactOriginProjectCategoryDailyEntity> implements FactOriginProjectCategoryDailyService {
@Autowired
private ProjectService projectService;
@Autowired
private IssueProjectCategoryDictService issueProjectCategoryDictService;
/**
* @param extractOriginFormDTO
* @return void
* @Description 将epmet_gov_project库中的项目分类信息project_category同步到统计库epmet_data_statistical
* @Author liushaowen
* @Date 2021/3/22 15:28
*/
@Override
public void extractProjectCategory(ExtractOriginFormDTO extractOriginFormDTO) {
String dateString = extractOriginFormDTO.getDateId();
String customerId = extractOriginFormDTO.getCustomerId();
List<FactOriginProjectCategoryDailyEntity> entities = new ArrayList<>();
Integer count = baseDao.selectCount(new QueryWrapper<FactOriginProjectCategoryDailyEntity>().eq("customer_id",customerId));
//如果count = 0 初始化该customer所有数据
if (NumConstant.ZERO == count){
dateString = null;
}
List<ProjectCategoryDTO> projectCategoryData = projectService.getProjectCategoryData(customerId, dateString);
if (!CollectionUtils.isEmpty(projectCategoryData)){
projectCategoryData.forEach(data->{
FactOriginProjectCategoryDailyEntity insertEntity = new FactOriginProjectCategoryDailyEntity();
IssueProjectCategoryDictEntity categoryDictEntity = issueProjectCategoryDictService.getById(customerId, data.getCategoryId());
if (categoryDictEntity == null){
log.warn("categoryDict not found : customerId:{},categoryId:{}",customerId,data.getCategoryId());
}
insertEntity.setProjectId(data.getProjectId());
insertEntity.setCategoryCode(categoryDictEntity.getCategoryCode());
insertEntity.setParentCategoryCode(categoryDictEntity.getParentCategoryCode());
insertEntity.setCustomerId(customerId);
insertEntity.setLevel(Integer.valueOf(categoryDictEntity.getCategoryType()));
insertEntity.setCreatedTime(data.getCreatedTime());
entities.add(insertEntity);
});
if (!CollectionUtils.isEmpty(entities)){
delAndInsert(customerId,dateString,entities);
}
}
}
/**
* @Description category表删除插入
* @param customerId
* @param dateId
* @param result
* @return void
* @Author liushaowen
* @Date 2021/3/22 17:01
*/
@Transactional(rollbackFor = Exception.class)
public void delAndInsert(String customerId,String dateId,List<FactOriginProjectCategoryDailyEntity> result){
baseDao.deleteOldData(customerId, dateId);
insertBatch(result);
}
/**
* @param customerId
* @author yinzuomei
* @description 计算当前客户下各个网格内各项目分类下项目数量
* @Date 2021/3/23 9:56
**/
@Override
public List<ScreenProjectCategoryGridDailyDTO> selectListProjectCategoryGridDailyDTO(String customerId) {
List<ScreenProjectCategoryGridDailyDTO> list=baseDao.selectListProjectCategoryGridDailyDTO(customerId);
return list;
}
}

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

@ -11,10 +11,7 @@ import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.IndexCalculateService;
import com.epmet.service.evaluationindex.screen.ScreenProjectGridDailyService;
import com.epmet.service.evaluationindex.screen.ScreenProjectOrgDailyService;
import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityGridMonthlyService;
import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService;
import com.epmet.service.evaluationindex.screen.*;
import com.epmet.service.stats.DimCustomerService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -68,6 +65,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
private ScreenProjectOrgDailyService screenProjectOrgDailyService;
@Autowired
private ScreenProjectSettleService screenProjectSettleService;
@Autowired
private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService;
/**
* @param extractOriginFormDTO
@ -198,12 +197,18 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
log.error("项目(事件)分析按组织_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e);
}
//项目分类打标签未上线,暂时屏蔽
/*try{
try{
//大屏项目数据抽取_按天抽取
screenProjectSettleService.extractScreenData(param);
}catch (Exception e){
log.error("大屏项目数据抽取_按天抽取_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e);
}*/
}
//按天统计:网格内各个分类下的项目总数
try{
projectCategoryGridDailyService.extractProjectCategoryData(customerId,dateId);
}catch(Exception e){
log.error("按天统计:网格内各个分类下的项目总数,customerId为:"+customerId+"dateId为:"+dateId, e);
}
log.info("===== extractDaily method end ======");
}

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

@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
@ -92,4 +93,13 @@ public interface ScreenCustomerGridService extends BaseService<ScreenCustomerGri
* @date 2020/10/21 2:33 下午
*/
Boolean initBizOrg(CustomerBizOrgFormDTO formDTO);
/**
* @Description 查询直属网格信息
* @Param customerId
* @Param level
* @author zxc
* @date 2021/3/23 下午4:02
*/
List<ScreenCustomerGridDTO> selectBelongGridInfo(String customerId,String level);
}

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridDailyService.java

@ -102,4 +102,14 @@ public interface ScreenProjectCategoryGridDailyService extends BaseService<Scree
* @return void
*/
void collect(ScreenCollFormDTO<ScreenProjectCategoryGridDailyDTO> param);
/**
* @return void
* @param customerId
* @param dateId
* @author yinzuomei
* @description 产品内部计算网格内按分类统计项目数量
* @Date 2021/3/22 16:46
**/
void extractProjectCategoryData(String customerId, String dateId);
}

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

@ -102,4 +102,13 @@ public interface ScreenProjectCategoryOrgDailyService extends BaseService<Screen
* @return void
*/
void collect(ScreenCollFormDTO<ScreenProjectCategoryOrgDailyDTO> param);
/**
* @Description 按组织计算分类统计项目数量
* @Param customerId
* @Param dateId
* @author zxc
* @date 2021/3/23 上午10:07
*/
void extractProjectCategoryOrgData(String customerId, String dateId);
}

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

@ -24,6 +24,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgSourceTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
@ -166,4 +167,16 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
public Boolean initBizOrg(CustomerBizOrgFormDTO formDTO) {
return null;
}
/**
* @Description 查询直属网格信息
* @Param customerId
* @Param level
* @author zxc
* @date 2021/3/23 下午4:03
*/
@Override
public List<ScreenCustomerGridDTO> selectBelongGridInfo(String customerId, String level) {
return baseDao.selectBelongGridInfo(customerId, level);
}
}

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

@ -30,8 +30,11 @@ import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryGridDailyDao;
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService;
import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryGridDailyService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@ -46,10 +49,12 @@ import java.util.Map;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Slf4j
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl<ScreenProjectCategoryGridDailyDao, ScreenProjectCategoryGridDailyEntity> implements ScreenProjectCategoryGridDailyService {
@Autowired
private FactOriginProjectCategoryDailyService factOriginProjectCategoryDailyService;
@Override
public PageData<ScreenProjectCategoryGridDailyDTO> page(Map<String, Object> params) {
@ -128,4 +133,22 @@ public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl<S
}
}
/**
* @param customerId
* @param dateId
* @return void
* @author yinzuomei
* @description 产品内部计算网格内按分类统计项目数量
* @Date 2021/3/22 16:46
**/
@Override
public void extractProjectCategoryData(String customerId, String dateId) {
List<ScreenProjectCategoryGridDailyDTO> listDTO= factOriginProjectCategoryDailyService.selectListProjectCategoryGridDailyDTO(customerId);
listDTO.forEach(dto->{
dto.setDateId(dateId);
});
boolean insertRes=insertBatch(ConvertUtils.sourceToTarget(listDTO, ScreenProjectCategoryGridDailyEntity.class));
log.info("insertRes is {}",insertRes);
}
}

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

@ -26,20 +26,34 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.ScreenConstant;
import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryGridDailyDao;
import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO;
import com.epmet.dto.screen.result.CategoryProjectResultDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.crm.CustomerRelationEntity;
import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity;
import com.epmet.service.crm.CustomerRelationService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryOrgDailyService;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 项目(事件)分类按组织_按天统计
@ -49,8 +63,17 @@ import java.util.Map;
*/
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
@Slf4j
public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<ScreenProjectCategoryOrgDailyDao, ScreenProjectCategoryOrgDailyEntity> implements ScreenProjectCategoryOrgDailyService {
@Autowired
private CustomerRelationService relationService;
@Autowired
private ScreenCustomerAgencyService agencyService;
@Autowired
private ScreenProjectCategoryGridDailyDao gridDailyDao;
@Autowired
private ScreenCustomerGridService gridService;
@Override
public PageData<ScreenProjectCategoryOrgDailyDTO> page(Map<String, Object> params) {
@ -131,4 +154,238 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl<Sc
}
}
/**
* @Description 按组织计算分类统计项目数量
* 查询sql以pid为orgIdpid的parentAgencyId为pid
* @Param customerId
* @Param dateId
* @author zxc
* @date 2021/3/23 上午10:07
*/
@Override
public void extractProjectCategoryOrgData(String customerId, String dateId) {
// 先查询有无子客户
List<CustomerRelationEntity> relationInfo = relationService.selectSubCustomer(customerId);
if (CollectionUtils.isEmpty(relationInfo)){
// 单客户
disposeOneCustomer(customerId, dateId);
}else {
// 多客户
/**
* 1.查自己客户分类标签统计
* 2.查询子级客户分类标签分为 epmet_category_code is null is not nullpid = '0'跟父客户对比同类标签项目数累加不同直接添加到父客户
* 加入直属网格
*/
disposeMoreCustomer(customerId,dateId,relationInfo);
}
}
/**
* @Description 单客户处理
* @Param customerId
* @Param dateId
* @author zxc
* @date 2021/3/23 上午10:40
*/
private void disposeOneCustomer(String customerId, String dateId){
List<CustomerAgencyInfoResultDTO> agencyIdList = agencyService.selectAllAgencyId(customerId);
if (!CollectionUtils.isEmpty(agencyIdList)){
// 根据组织级别分组
Map<String, List<CustomerAgencyInfoResultDTO>> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel));
if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){
// 社区级别
disposeOneCustomerSub(ScreenConstant.COMMUNITY,true,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.STREET)){
// 街道级别
disposeOneCustomerSub(ScreenConstant.STREET,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){
// 区级
disposeOneCustomerSub(ScreenConstant.DISTRICT,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.CITY)){
// 市级
disposeOneCustomerSub(ScreenConstant.CITY,false,customerId,dateId);
}
if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){
// 省级
disposeOneCustomerSub(ScreenConstant.PROVINCE,false,customerId,dateId);
}
}
}
/**
* @Description 单客户处理
* @Param level
* @Param isGrid
* @Param customerId
* @Param dateId
* @author zxc
* @date 2021/3/25 上午10:44
*/
public void disposeOneCustomerSub(String level, Boolean isGrid, String customerId, String dateId){
List<ScreenProjectCategoryOrgDailyEntity> result = new ArrayList<>();
if (isGrid){
// 是社区级别
List<CategoryProjectResultDTO> categoryInfos = gridDailyDao.selectCategoryInfo(customerId, dateId,null,null);
if (!CollectionUtils.isEmpty(categoryInfos)){
result = ConvertUtils.sourceToTarget(categoryInfos, ScreenProjectCategoryOrgDailyEntity.class);
}
}else {
List<CategoryProjectResultDTO> categoryProjectResultDTOS = baseDao.selectOrgCategoryInfo(customerId, dateId, level);
List<ScreenCustomerGridDTO> belongGridInfos = gridService.selectBelongGridInfo(customerId, level);
if (!CollectionUtils.isEmpty(belongGridInfos)){
// 存在直属网格
List<String> gridIds = belongGridInfos.stream().map(m -> m.getGridId()).collect(Collectors.toList());
List<CategoryProjectResultDTO> categoryProjectGrid = gridDailyDao.selectCategoryInfo(customerId, dateId, level, gridIds);
if (!CollectionUtils.isEmpty(categoryProjectGrid)){
categoryProjectResultDTOS.forEach(agency -> {
categoryProjectGrid.forEach(grid -> {
if (agency.getOrgId().equals(grid.getOrgId()) && agency.getCategoryCode().equals(grid.getCategoryCode())){
agency.setProjectTotal(agency.getProjectTotal() + grid.getProjectTotal());
grid.setStatus(true);
}
});
});
Map<Boolean, List<CategoryProjectResultDTO>> groupByStatus = categoryProjectGrid.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getStatus));
List<CategoryProjectResultDTO> categoryProjectResultDTOS1 = groupByStatus.get(false);
if (!CollectionUtils.isEmpty(categoryProjectResultDTOS1)) categoryProjectResultDTOS.addAll(categoryProjectResultDTOS1);
}
}
result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class);
}
deleteAndInsert(customerId,dateId,result);
}
/**
* @Description 多客户处理
* @Param customerId
* @Param dateId
* @Param relationInfo 子级客户信息
* @author zxc
* @date 2021/3/23 上午10:40
*/
private void disposeMoreCustomer(String customerId, String dateId,List<CustomerRelationEntity> relationInfo){
List<CustomerAgencyInfoResultDTO> agencyIdList = agencyService.selectAllAgencyId(customerId);
if (!CollectionUtils.isEmpty(agencyIdList)){
// 根据组织级别分组
Map<String, List<CustomerAgencyInfoResultDTO>> groupByLevel = agencyIdList.stream().collect(Collectors.groupingBy(CustomerAgencyInfoResultDTO::getLevel));
if (groupByLevel.containsKey(ScreenConstant.COMMUNITY)){
// 社区级别
disposeMoreCustomerSub(ScreenConstant.COMMUNITY,true,customerId,dateId,relationInfo);
}
if (groupByLevel.containsKey(ScreenConstant.STREET)){
// 街道级别
disposeMoreCustomerSub(ScreenConstant.STREET,false,customerId,dateId,relationInfo);
}
if (groupByLevel.containsKey(ScreenConstant.DISTRICT)){
// 区级
disposeMoreCustomerSub(ScreenConstant.DISTRICT,false,customerId,dateId,relationInfo);
}
if (groupByLevel.containsKey(ScreenConstant.CITY)){
// 市级
disposeMoreCustomerSub(ScreenConstant.CITY,false,customerId,dateId,relationInfo);
}
if (groupByLevel.containsKey(ScreenConstant.PROVINCE)){
// 省级
disposeMoreCustomerSub(ScreenConstant.PROVINCE,false,customerId,dateId,relationInfo);
}
}
}
/**
* @Description 多客户处理
* @Param level 级别
* @Param isGrid
* @Param customerId
* @Param dateId
* @Param relationInfo 子级客户信息
* @author zxc
* @date 2021/3/25 下午1:29
*/
private void disposeMoreCustomerSub(String level,Boolean isGrid,String customerId, String dateId, List<CustomerRelationEntity> relationInfo){
List<ScreenProjectCategoryOrgDailyEntity> result = new ArrayList<>();
if (isGrid){
// community级别走这
List<CategoryProjectResultDTO> categoryInfos = gridDailyDao.selectCategoryInfo(customerId, dateId,null,null);
if (!CollectionUtils.isEmpty(categoryInfos)){
result = ConvertUtils.sourceToTarget(categoryInfos, ScreenProjectCategoryOrgDailyEntity.class);
}
}else {
List<CategoryProjectResultDTO> categoryProjectResultDTOS = baseDao.selectOrgCategoryInfo(customerId, dateId, level);
List<ScreenCustomerGridDTO> belongGridInfos = gridService.selectBelongGridInfo(customerId, level);
if (!CollectionUtils.isEmpty(belongGridInfos)){
// 存在直属网格
List<String> gridIds = belongGridInfos.stream().map(m -> m.getGridId()).collect(Collectors.toList());
List<CategoryProjectResultDTO> categoryProjectGrid = gridDailyDao.selectCategoryInfo(customerId, dateId, level, gridIds);
if (!CollectionUtils.isEmpty(categoryProjectGrid)){
categoryProjectResultDTOS.forEach(agency -> {
categoryProjectGrid.forEach(grid -> {
if (agency.getOrgId().equals(grid.getOrgId()) && agency.getCategoryCode().equals(grid.getCategoryCode())){
agency.setProjectTotal(agency.getProjectTotal() + grid.getProjectTotal());
grid.setStatus(true);
}
});
});
Map<Boolean, List<CategoryProjectResultDTO>> groupByStatus = categoryProjectGrid.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getStatus));
List<CategoryProjectResultDTO> categoryProjectResultDTOS1 = groupByStatus.get(false);
categoryProjectResultDTOS.addAll(categoryProjectResultDTOS1);
}
}
result = ConvertUtils.sourceToTarget(categoryProjectResultDTOS,ScreenProjectCategoryOrgDailyEntity.class);
if (ScreenConstant.DISTRICT.equals(level)){
// 子级客户ID
List<String> customerIds = relationInfo.stream().map(m -> m.getCustomerId()).collect(Collectors.toList());
// 父客户存在的分类
List<CategoryProjectResultDTO> categoryProjectExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, true);
if (!CollectionUtils.isEmpty(categoryProjectExists)){
result.forEach(r -> {
categoryProjectExists.forEach(c -> {
if (r.getCategoryCode().equals(c.getCategoryCode())){
r.setProjectTotal(r.getProjectTotal() + c.getProjectTotal());
c.setStatus(true);
}
});
});
Map<Boolean, List<CategoryProjectResultDTO>> groupByStatus = categoryProjectExists.stream().collect(Collectors.groupingBy(CategoryProjectResultDTO::getStatus));
List<CategoryProjectResultDTO> categoryProjectFalse = groupByStatus.get(false);
if (!CollectionUtils.isEmpty(categoryProjectFalse)){
List<ScreenProjectCategoryOrgDailyEntity> f = ConvertUtils.sourceToTarget(categoryProjectFalse, ScreenProjectCategoryOrgDailyEntity.class);
result.addAll(f);
}
}
// 父客户不存在的分类
List<CategoryProjectResultDTO> categoryProjectNotExists = baseDao.selectOrgCategoryMoreCustomerInfo(customerIds, dateId, level, customerId, false);
if (!CollectionUtils.isEmpty(categoryProjectNotExists)){
List<ScreenProjectCategoryOrgDailyEntity> notExists = ConvertUtils.sourceToTarget(categoryProjectNotExists, ScreenProjectCategoryOrgDailyEntity.class);
result.addAll(notExists);
}
}
}
deleteAndInsert(customerId,dateId,result);
}
/**
* @Description 删除和新增
* @Param customerId
* @Param dateId
* @author zxc
* @date 2021/3/23 上午10:52
*/
@Transactional(rollbackFor = Exception.class)
public void deleteAndInsert(String customerId, String dateId, List<ScreenProjectCategoryOrgDailyEntity> needInsert){
if (CollectionUtils.isEmpty(needInsert)){
return;
}
Integer row = NumConstant.ZERO;
do {
row = baseDao.deleteByDateIdAndCustomerId(customerId, dateId);
}while (row > NumConstant.ZERO && row == NumConstant.ONE_THOUSAND);
List<List<ScreenProjectCategoryOrgDailyEntity>> partition = ListUtils.partition(needInsert, NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
insertBatch(p);
});
}
}

51
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java

@ -3,10 +3,12 @@ package com.epmet.service.impl;
import com.epmet.constant.RobotConstant;
import com.epmet.dto.org.result.CustomerAreaCodeResultDTO;
import com.epmet.entity.crm.CustomerEntity;
import com.epmet.entity.issue.IssueProjectCategoryDictEntity;
import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.entity.org.CustomerDepartmentEntity;
import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.entity.stats.*;
import com.epmet.service.Issue.IssueProjectCategoryDictService;
import com.epmet.service.StatsDimService;
import com.epmet.service.crm.CustomerService;
import com.epmet.service.org.CustomerAgencyService;
@ -52,6 +54,12 @@ public class StatsDimServiceImpl implements StatsDimService {
@Autowired
private DimDepartmentService dimDepartmentService;
@Autowired
private CustomerProjectCategoryDictService projectCategoryDictService;
@Autowired
private IssueProjectCategoryDictService issueProjectCategoryDictService;
@Override
public void initGridDim() {
List<DimGridEntity> newDimGrids = getNewDimGrids();
@ -264,4 +272,47 @@ public class StatsDimServiceImpl implements StatsDimService {
}
return new ArrayList<>();
}
/**
* @return void
* @author yinzuomei
* @description 初始化项目分类字典表
* @Date 2021/3/19 15:44
**/
@Override
public void customerInitProjectCategory() {
Date now = new Date();
List<IssueProjectCategoryDictEntity> insertCategoies = listInsertCategoies();
List<IssueProjectCategoryDictEntity> updateCategoies = listUpdateCategoies(now);
projectCategoryDictService.initProjectCategory(insertCategoies,updateCategoies);
}
/**
* @author yinzuomei
* @description 构造需要插入的分类字典
* @Date 2021/3/19 15:52
**/
private List<IssueProjectCategoryDictEntity> listInsertCategoies() {
CustomerProjectCategoryDictEntity lastInsertProjectCategory = projectCategoryDictService.getLatestProjectCategory();
Date now = new Date();
Date lastInitTime = null;
if (null != lastInsertProjectCategory) {
lastInitTime = lastInsertProjectCategory.getOriginCreatedTime();
}
return issueProjectCategoryDictService.listInsertCategoies(lastInitTime, now);
}
/**
* @param initTime
* @author yinzuomei
* @description
* @Date 2021/3/19 15:55
**/
private List<IssueProjectCategoryDictEntity> listUpdateCategoies(Date initTime) {
CustomerProjectCategoryDictEntity lastUpdated = projectCategoryDictService.getLatestUpdatedEntity();
if (lastUpdated != null) {
return issueProjectCategoryDictService.listByUpdatedTime(lastUpdated.getOriginUpdatedTime(), initTime);
}
return new ArrayList<>();
}
}

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java

@ -18,6 +18,7 @@
package com.epmet.service.project;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectGridDTO;
@ -141,4 +142,14 @@ public interface ProjectService extends BaseService<ProjectEntity> {
*/
Map<String,Set<String>> getProjectCategory(List<String> projectIds);
}
/**
* @Description 抽取project_category
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.ProjectCategoryDTO>
* @Author liushaowen
* @Date 2021/3/22 15:44
*/
List<ProjectCategoryDTO> getProjectCategoryData(String customerId, String dateId);
}

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java

@ -150,6 +150,18 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
return map;
}
/**
* @param customerId
* @param dateId
* @return java.util.List<com.epmet.dto.ProjectCategoryDTO>
* @Description 抽取project_category
* @Author liushaowen
* @Date 2021/3/22 15:44
*/
@Override
public List<com.epmet.dto.ProjectCategoryDTO> getProjectCategoryData(String customerId, String dateId) {
return baseDao.getProjectCategoryData(customerId,dateId);
}
}
}

58
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java

@ -0,0 +1,58 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.screen.form.CategoryDictFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.issue.IssueProjectCategoryDictEntity;
import com.epmet.entity.stats.CustomerProjectCategoryDictEntity;
import java.util.List;
/**
* 客户项目分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-19
*/
public interface CustomerProjectCategoryDictService extends BaseService<CustomerProjectCategoryDictEntity> {
void initProjectCategory(List<IssueProjectCategoryDictEntity> insertCategoies,
List<IssueProjectCategoryDictEntity> updateCategoies);
/**
* @author yinzuomei
* @description 获取内部客户最近一次初始记录
* @Date 2021/3/19 14:57
**/
CustomerProjectCategoryDictEntity getLatestProjectCategory();
CustomerProjectCategoryDictEntity getLatestUpdatedEntity();
/**
* 项目分类字典上报
* 目标表epmet_evaluation_index库的customer_project_category_dict
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 16:03 2021-03-22
**/
void uploadCategoryDict(ScreenCollFormDTO<CategoryDictFormDTO> formDTO);
}

119
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java

@ -0,0 +1,119 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.stats.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.stats.CustomerProjectCategoryDictDao;
import com.epmet.dto.screen.form.CategoryDictFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO;
import com.epmet.entity.issue.IssueProjectCategoryDictEntity;
import com.epmet.entity.stats.CustomerProjectCategoryDictEntity;
import com.epmet.service.stats.CustomerProjectCategoryDictService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 客户项目分类字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-19
*/
@Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX)
@Service
public class CustomerProjectCategoryDictServiceImpl extends BaseServiceImpl<CustomerProjectCategoryDictDao, CustomerProjectCategoryDictEntity> implements CustomerProjectCategoryDictService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX)
@Transactional(rollbackFor = Exception.class)
@Override
public void initProjectCategory(List<IssueProjectCategoryDictEntity> insertCategoies, List<IssueProjectCategoryDictEntity> updateCategoies) {
log.info(String.format("=============需要插入的条数=%s,更新的条数=%s",insertCategoies.size(),updateCategoies.size()));
insertCategoies.forEach(insertEntity -> {
CustomerProjectCategoryDictEntity entityInsert=new CustomerProjectCategoryDictEntity();
entityInsert.setCustomerId(insertEntity.getCustomerId());
entityInsert.setCustomerType("internal");
entityInsert.setCategoryCode(insertEntity.getCategoryCode());
entityInsert.setCategoryName(insertEntity.getCategoryName());
entityInsert.setParentCategoryCode(insertEntity.getParentCategoryCode());
entityInsert.setLevel(Integer.valueOf(insertEntity.getCategoryType()));
entityInsert.setSort(insertEntity.getSort());
entityInsert.setIsDisable(insertEntity.getIsDisable());
entityInsert.setOriginCreatedTime(insertEntity.getCreatedTime());
entityInsert.setOriginUpdatedTime(insertEntity.getUpdatedTime());
entityInsert.setCategoryId(insertEntity.getId());
baseDao.insert(entityInsert);
});
updateCategoies.forEach(updatedEntity -> {
CustomerProjectCategoryDictEntity entity=baseDao.selectByCustomerIdAndId(updatedEntity.getCustomerId(),updatedEntity.getId());
if (null != entity) {
entity.setCategoryCode(updatedEntity.getCategoryCode());
entity.setCategoryName(updatedEntity.getCategoryName());
entity.setParentCategoryCode(updatedEntity.getParentCategoryCode());
if (StringUtils.isNotBlank(updatedEntity.getCategoryType())) {
entity.setLevel(Integer.valueOf(updatedEntity.getCategoryType()));
}
entity.setSort(updatedEntity.getSort());
entity.setIsDisable(updatedEntity.getIsDisable());
entity.setOriginCreatedTime(updatedEntity.getCreatedTime());
entity.setOriginUpdatedTime(updatedEntity.getUpdatedTime());
baseDao.updateById(entity);
}
});
}
/**
* @author yinzuomei
* @description 获取内部客户最近一次初始记录
* @Date 2021/3/19 14:57
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX)
@Override
public CustomerProjectCategoryDictEntity getLatestProjectCategory() {
return baseDao.getLatestProjectCategory();
}
@DataSource(value = DataSourceConstant.EVALUATION_INDEX)
@Override
public CustomerProjectCategoryDictEntity getLatestUpdatedEntity() {
return baseDao.getLatestUpdatedEntity();
}
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
@Transactional(rollbackFor = Exception.class)
public void uploadCategoryDict(ScreenCollFormDTO<CategoryDictFormDTO> formDTO) {
if (formDTO.getIsFirst()) {
int deleteNum;
do {
deleteNum = baseDao.deleteCustomerProjectCategoryDict(formDTO.getCustomerId());
} while (deleteNum > NumConstant.ZERO);
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
baseDao.batchInsertCustomerProjectCategoryDict(formDTO.getDataList(), formDTO.getCustomerId());
}
}
}

47
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.10__add_project_category_analysis.sql

@ -0,0 +1,47 @@
-- epmet_data_statistical 库:
drop table if exists fact_origin_project_category_daily;
CREATE TABLE `fact_origin_project_category_daily` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`PROJECT_ID` varchar(64) NOT NULL COMMENT '项目id',
`CATEGORY_CODE` varchar(50) NOT NULL COMMENT '分类编码',
`PARENT_CATEGORY_CODE` varchar(50) NOT NULL COMMENT '所属父类分类编码',
`LEVEL` int(11) NOT NULL COMMENT '分类等级:1、2....;产品目前只有2级分类',
`DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目所属分类表';
-- epmet_data_statistical_display 、epmet_evaluation_index:
drop table if exists customer_project_category_dict;
CREATE TABLE `customer_project_category_dict` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`CUSTOMER_TYPE` varchar(20) NOT NULL COMMENT '外部客户:external;内部客户:internal',
`CATEGORY_CODE` varchar(64) NOT NULL COMMENT '客户自己的分类编码',
`CATEGORY_NAME` varchar(500) CHARACTER SET utf8 NOT NULL COMMENT '客户自己的分类名称',
`PARENT_CATEGORY_CODE` varchar(64) NOT NULL COMMENT '父类分类编码,如果是一级分类,此列赋值为0',
`LEVEL` int(11) NOT NULL COMMENT '分类等级:1、2....;产品只有2级分类',
`SORT` int(11) unsigned NOT NULL COMMENT '排序',
`IS_DISABLE` varchar(32) CHARACTER SET utf8 NOT NULL COMMENT '是否禁用(enable:启用 disable:禁用)',
`EPMET_CATEGORY_CODE` varchar(64) DEFAULT NULL COMMENT '对应e世通中的分类编码,没有此列为空',
`ORIGIN_CREATED_TIME` datetime DEFAULT NULL COMMENT '原始创建时间',
`ORIGIN_UPDATED_TIME` datetime DEFAULT NULL COMMENT '原始更新时间',
`CATEGORY_ID` varchar(64) NOT NULL COMMENT '分类字典表主键',
`DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE,
UNIQUE KEY `UN_KEY` (`CUSTOMER_ID`,`CATEGORY_CODE`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='客户项目分类字典表';
-- epmet_data_statistical_display 、epmet_evaluation_index:
alter table screen_project_category_org_daily add column `LEVEL` int(11) NOT NULL COMMENT '分类等级1、2....';
alter table screen_project_category_grid_daily add column `LEVEL` int(11) NOT NULL COMMENT '分类等级1、2....';

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml

@ -34,4 +34,9 @@
#{customerId},
'%')
</select>
<!-- 查询子级客户 -->
<select id="selectSubCustomer" resultType="com.epmet.entity.crm.CustomerRelationEntity">
SELECT * FROM customer_relation WHERE DEL_FLAG = 0 AND PARENT_CUSTOMER_ID = #{customerId}
</select>
</mapper>

65
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml

@ -0,0 +1,65 @@
<?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.extract.FactOriginProjectCategoryDailyDao">
<delete id="deleteOldData">
DELETE
FROM
fact_origin_project_category_daily
WHERE
CUSTOMER_ID = #{customerId}
<if test="dateId != null">
AND DATE_FORMAT(CREATED_TIME,'%Y%m%d') = #{dateId}
</if>
</delete>
<!-- 计算当前客户下,各个网格内,各项目分类下项目数量 -->
<!-- 先算出二级分类的 + 一级分类 -->
<select id="selectListProjectCategoryGridDailyDTO" parameterType="map" resultType="com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO">
SELECT
c.CUSTOMER_ID,
c.CATEGORY_CODE,
c.`LEVEL`,
p.GRID_ID,
p.AGENCY_ID AS PID,
P.PIDS,
count(1)as projectTotal
FROM
fact_origin_project_category_daily c
LEFT JOIN fact_origin_project_main_daily p ON ( c.PROJECT_Id = p.id and p.del_flag='0')
WHERE
c.DEL_FLAG = '0'
AND c.CUSTOMER_ID = #{customerId}
AND c.`LEVEL` = '2'
GROUP BY
c.CUSTOMER_ID,
c.CATEGORY_CODE,
c.`LEVEL`,
p.GRID_ID,
p.AGENCY_ID,
P.PIDS
union all
SELECT
c.CUSTOMER_ID,
left(c.CATEGORY_CODE, 4) as CATEGORY_CODE,
'1'as `LEVEL`,
p.GRID_ID,
p.AGENCY_ID AS PID,
P.PIDS,
count(distinct c.project_id)as projectTotal
FROM
fact_origin_project_category_daily c
LEFT JOIN fact_origin_project_main_daily p ON ( c.PROJECT_Id = p.id and p.del_flag='0')
WHERE
c.DEL_FLAG = '0'
AND c.CUSTOMER_ID = #{customerId}
GROUP BY
c.CUSTOMER_ID,
left(c.CATEGORY_CODE, 4),
c.`LEVEL`,
p.GRID_ID,
p.AGENCY_ID,
P.PIDS
</select>
</mapper>

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

@ -359,4 +359,17 @@
AND cg.CUSTOMER_ID = #{customerId}
</select>
<!-- 查询直属网格信息 -->
<select id="selectBelongGridInfo" resultType="com.epmet.dto.ScreenCustomerGridDTO">
SELECT
sca.AGENCY_ID AS PID,
sca.PIDS,
scg.*
FROM screen_customer_agency sca
LEFT JOIN screen_customer_grid scg ON scg.PARENT_AGENCY_ID = sca.AGENCY_ID
WHERE sca.`LEVEL` = #{level}
AND scg.DEL_FLAG = 0
AND scg.CUSTOMER_ID = #{customerId}
</select>
</mapper>

53
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml

@ -3,29 +3,6 @@
<mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryGridDailyDao">
<resultMap type="com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity" id="screenProjectCategoryGridDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="pid" column="PID"/>
<result property="pids" column="PIDS"/>
<result property="epmetCategoryCode" column="EPMET_CATEGORY_CODE"/>
<result property="projectTotal" column="PROJECT_TOTAL"/>
<result property="pendingTotal" column="PENDING_TOTAL"/>
<result property="closedTotal" column="CLOSED_TOTAL"/>
<result property="unResolvedTotal" column="UN_RESOLVED_TOTAL"/>
<result property="resolvedTotal" column="RESOLVED_TOTAL"/>
<result property="closedRatio" column="CLOSED_RATIO"/>
<result property="resolvedRatio" column="RESOLVED_RATIO"/>
<result property="unResolvedRatio" column="UN_RESOLVED_RATIO"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByDateIdAndCustomerId">
delete from screen_project_category_grid_daily
where customer_id = #{customerId}
@ -33,5 +10,35 @@
limit 1000
</delete>
<!-- 查询分类信息 -->
<select id="selectCategoryInfo" resultType="com.epmet.dto.screen.result.CategoryProjectResultDTO">
SELECT
sg.pid AS orgId,
sca.PID,
sca.pids,
sg.CUSTOMER_ID,
sg.CATEGORY_CODE,
SUM(sg.PROJECT_TOTAL) AS projectTotal,
sg.level,
sg.DATE_ID,
sca.`LEVEL` AS orgType
FROM screen_project_category_grid_daily sg
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = sg.PID
WHERE 1=1
AND sg.DEL_FLAG = '0'
<if test="null == level ">
AND sca.`LEVEL` = 'community'
</if>
<if test="null != level and '' != level">
AND sca.`LEVEL` = #{level}
<foreach collection="gridIds" item="gridId" separator=" OR ">
AND sg.GRID_ID = #{gridId}
</foreach>
</if>
AND sg.CUSTOMER_ID = #{customerId}
AND sg.DATE_ID = #{dateId}
GROUP BY sg.CATEGORY_CODE,sca.AGENCY_ID
</select>
</mapper>

78
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml

@ -2,31 +2,6 @@
<!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.ScreenProjectCategoryOrgDailyDao">
<resultMap type="com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity" id="screenProjectCategoryOrgDailyMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="orgId" column="ORG_ID"/>
<result property="orgType" column="ORG_TYPE"/>
<result property="pid" column="PID"/>
<result property="pids" column="PIDS"/>
<result property="epmetCategoryCode" column="EPMET_CATEGORY_CODE"/>
<result property="projectTotal" column="PROJECT_TOTAL"/>
<result property="pendingTotal" column="PENDING_TOTAL"/>
<result property="closedTotal" column="CLOSED_TOTAL"/>
<result property="unResolvedTotal" column="UN_RESOLVED_TOTAL"/>
<result property="resolvedTotal" column="RESOLVED_TOTAL"/>
<result property="closedRatio" column="CLOSED_RATIO"/>
<result property="resolvedRatio" column="RESOLVED_RATIO"/>
<result property="unResolvedRatio" column="UN_RESOLVED_RATIO"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<delete id="deleteByDateIdAndCustomerId">
delete from screen_project_category_org_daily
where customer_id = #{customerId}
@ -34,4 +9,57 @@
limit 1000
</delete>
<!-- 查询组织分类信息 -->
<select id="selectOrgCategoryInfo" resultType="com.epmet.dto.screen.result.CategoryProjectResultDTO">
SELECT
IF(sa.pid = '0', sa.ORG_ID,sa.pid) AS orgId,
IFNULL(sca.PID,'0') AS pid,
IFNULL(sca.PIDS,'0') AS pids,
sa.CUSTOMER_ID,
sa.CATEGORY_CODE,
SUM(sa.PROJECT_TOTAL) AS projectTotal,
sa.level,
sa.DATE_ID,
sca.`LEVEL` AS orgType
FROM screen_project_category_org_daily sa
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = sa.PID
WHERE sca.`LEVEL` = #{level}
AND sa.DEL_FLAG = '0'
AND sa.CUSTOMER_ID = #{customerId}
AND sa.DATE_ID = #{dateId}
GROUP BY sa.CATEGORY_CODE,sca.AGENCY_ID
</select>
<!-- 查询组织分类信息【多客户】 -->
<select id="selectOrgCategoryMoreCustomerInfo" resultType="com.epmet.dto.screen.result.CategoryProjectResultDTO">
SELECT
IF(od.pid = '0', od.ORG_ID,od.pid) AS orgId,
IFNULL(sca.PID,'0') AS pid,
IFNULL(sca.PIDS,'0') AS pids,
#{customerId} as customerId,
od.level,
od.CATEGORY_CODE,
SUM(od.PROJECT_TOTAL) AS projectTotal,
#{level} as orgType,
od.DATE_ID
FROM screen_project_category_org_daily od
LEFT JOIN customer_project_category_dict cd ON cd.CATEGORY_CODE = od.CATEGORY_CODE
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = od.PID
WHERE 1=1
AND od.DEL_FLAG = '0'
AND (
<foreach collection="customerIds" item="id" separator=" OR ">od.CUSTOMER_ID = #{id}
</foreach>
)
<if test="existsStatus == true">
AND cd.EPMET_CATEGORY_CODE IS NOT NULL
</if>
<if test="existsStatus == false">
AND cd.EPMET_CATEGORY_CODE IS NULL
</if>
AND od.pid = '0'
AND od.date_id = #{dateId}
GROUP BY od.CATEGORY_CODE,od.pid
</select>
</mapper>

51
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/IssueProjectCategoryDictDao.xml

@ -0,0 +1,51 @@
<?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.issue.IssueProjectCategoryDictDao">
<!-- 构造需要插入的分类字典数据 -->
<select id="listInsertCategoies" parameterType="map" resultType="com.epmet.entity.issue.IssueProjectCategoryDictEntity">
SELECT
*
FROM
issue_project_category_dict
<where>
DEL_FLAG = 0
and CUSTOMER_ID !='default'
<if test="start != null">
AND CREATED_TIME &gt; #{start}
</if>
<if test="end != null">
AND CREATED_TIME &lt; #{end}
</if>
</where>
ORDER BY CREATED_TIME ASC
</select>
<!-- 构造需要更新的分类字典数据 -->
<select id="listByUpdatedTime" parameterType="map" resultType="com.epmet.entity.issue.IssueProjectCategoryDictEntity">
SELECT
*
FROM
issue_project_category_dict
<where>
DEL_FLAG = 0
and CUSTOMER_ID !='default'
<if test="start != null">
AND UPDATED_TIME &gt; #{start}
</if>
<if test="end != null">
AND UPDATED_TIME &lt; #{end}
</if>
</where>
ORDER BY UPDATED_TIME ASC
</select>
<select id="getById" resultType="com.epmet.entity.issue.IssueProjectCategoryDictEntity">
select *
from issue_project_category_dict
where del_flag = '0'
and customer_id = #{customerId}
and id = #{id}
</select>
</mapper>

36
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml

@ -290,35 +290,15 @@
<select id="selectCategory" resultType="com.epmet.dto.issue.IssueProjectCategoryDictDTO">
SELECT
*
FROM (
SELECT
*
FROM issue_project_category_dict
WHERE DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
<foreach collection="ids" item="id" open="AND (" separator=" OR " close=")">
id = #{id}
</foreach>
UNION
SELECT
*
FROM issue_project_category_dict outter
WHERE outter.DEL_FLAG = '0'
AND outter.CUSTOMER_ID = 'default'
a.ID,
IF(a.CATEGORY_TYPE = '2',concat(b.CATEGORY_NAME,'-',a.CATEGORY_NAME),a.CATEGORY_NAME) as categoryName
FROM issue_project_category_dict a
LEFT JOIN issue_project_category_dict b on a.pid = b.id and a.customer_id = b.customer_id
WHERE a.DEL_FLAG = '0'
AND a.CUSTOMER_ID = #{customerId}
<foreach collection="ids" item="id" open="AND (" separator=" OR " close=")">
outter.id = #{id}
a.id = #{id}
</foreach>
AND NOT EXISTS (
SELECT * FROM issue_project_category_dict WHERE del_flag = '0' AND
customer_id = #{customerId} and id = outter.id
)
) temp
order by temp.category_type,temp.sort
order by a.category_type,a.sort
</select>
</mapper>

14
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

@ -105,7 +105,7 @@
and CUSTOMER_ID = #{customerId}
and PARAMETER_KEY ='detention_days'
</select>
<select id="selectProjectExceedParams" resultType="com.epmet.dto.project.result.ProjectExceedParamsResultDTO">
select
IF(customer_id = 'default' <![CDATA[&&]]> PARAMETER_KEY = 'detention_days',PARAMETER_VALUE,null) as defaultExceedLimit,
@ -135,4 +135,14 @@
project_id = #{id}
</foreach>
</select>
</mapper>
<select id="getProjectCategoryData" resultType="com.epmet.dto.ProjectCategoryDTO">
select * from
`project_category`
where del_flag = '0'
and customer_id = #{customerId}
<if test="dateId != null">
AND DATE_FORMAT(CREATED_TIME,'%Y%m%d')=#{dateId}
</if>
</select>
</mapper>

95
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerProjectCategoryDictDao.xml

@ -0,0 +1,95 @@
<?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.stats.CustomerProjectCategoryDictDao">
<select id="getLatestProjectCategory" resultType="com.epmet.entity.stats.CustomerProjectCategoryDictEntity">
SELECT
*
FROM
customer_project_category_dict m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_TYPE = 'internal'
ORDER BY
m.ORIGIN_CREATED_TIME DESC
LIMIT 1
</select>
<select id="getLatestUpdatedEntity" resultType="com.epmet.entity.stats.CustomerProjectCategoryDictEntity">
SELECT
*
FROM
customer_project_category_dict m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_TYPE = 'internal'
ORDER BY
m.ORIGIN_UPDATED_TIME DESC
LIMIT 1
</select>
<select id="selectByCustomerIdAndId" parameterType="map" resultType="com.epmet.entity.stats.CustomerProjectCategoryDictEntity">
SELECT
*
FROM
customer_project_category_dict m
WHERE
m.DEL_FLAG = '0'
and m.customer_id=#{customerId}
and m.CATEGORY_ID=#{categoryId}
</select>
<delete id="deleteCustomerProjectCategoryDict">
delete from customer_project_category_dict
where CUSTOMER_ID = #{customerId}
limit 1000;
</delete>
<insert id="batchInsertCustomerProjectCategoryDict" parameterType="map">
insert into customer_project_category_dict
(
ID,
CUSTOMER_ID,
CUSTOMER_TYPE,
CATEGORY_CODE,
CATEGORY_NAME,
PARENT_CATEGORY_CODE,
`LEVEL`,
SORT,
IS_DISABLE,
EPMET_CATEGORY_CODE,
ORIGIN_CREATED_TIME,
ORIGIN_UPDATED_TIME,
CATEGORY_ID,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{customerId},
'external',
#{item.categoryCode},
#{item.categoryName},
#{item.parentCategoryCode},
#{item.level},
#{item.sort},
'enable',
#{item.epmetCategoryCode},
#{item.originCreatedTime},
#{item.orginUpdatedTime},
#{item.categoryId},
0,
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
</mapper>

12
epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据对接.txt

@ -0,0 +1,12 @@
截止到2021-03-25数据对接外部客户:
1、市北党建
2、安宁e家
3、大美孔村街道
4、e锦水街道(没有自己的大屏)
5、微笑榆山街道(没有自己的大屏)
产品自己的客户上线的大屏:
1、城阳
2、临沂龙湾社区
3、平阴县
孔村、锦水、榆山这三个街道的数据上报时间要早于平阴县计算的时间,目前已经按天上报和按月上报的,让孔村、榆山、锦水调整到2点前推送了。

8
epmet-module/gov-issue/gov-issue-client/pom.xml

@ -29,5 +29,11 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>data-report-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
</project>

101
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCategoryDTO.java

@ -0,0 +1,101 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 议题所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Data
public class IssueCategoryDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 网格ID: 议题所属网格Id
*/
private String gridId;
/**
* 议题id
*/
private String issueId;
/**
* 分类id
*/
private String categoryId;
/**
* 分类对应的所有上级,英文逗号隔开
*/
private String categoryPids;
/**
* 分类编码分类编码+customer_id唯一
*/
private String categoryCode;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

116
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java

@ -0,0 +1,116 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 议题项目分类字典
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Data
public class IssueProjectCategoryDictDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id, 产品默认default
*/
private String customerId;
/**
* 上级分类ID 顶级此列存储0
*/
private String pid;
/**
* 所有上级分类ID用逗号分开
*/
private String pids;
/**
* 上级分类编码
*/
private String parentCategoryCode;
/**
* 分类编码分类编码+customer_id唯一
*/
private String categoryCode;
/**
* 分类名称
*/
private String categoryName;
/**
* 分类类别1,2,3,4....
*/
private String categoryType;
/**
* 排序
*/
private Integer sort;
/**
* 是否禁用(enable:启用 disable:禁用)
*/
private String isDisable;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

106
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectTagDictDTO.java

@ -0,0 +1,106 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 议题项目标签字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Data
public class IssueProjectTagDictDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 标签名称
*/
private String tagName;
/**
* 分类id, 用户自己添加的标签此列可为空
*/
private String categoryId;
/**
* 是否是默认标签(0: 1:)
*/
private String isDefault;
/**
* 议题对标签的引用次数
*/
private Integer issueUseCount;
/**
* 项目对标签的引用次数
*/
private Integer projectUseCount;
/**
* 是否禁用(enable:启用 disable:禁用)
*/
private String isDisable;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

96
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueTagsDTO.java

@ -0,0 +1,96 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 议题关联标签表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@Data
public class IssueTagsDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 议题所属网格id
*/
private String gridId;
/**
* 议题ID
*/
private String issueId;
/**
* 标签ID
*/
private String tagId;
/**
* 标签名称
*/
private String tagName;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

24
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AddTagFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.dto.form;
import com.google.gson.internal.$Gson$Types;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/12/9 下午3:25
*/
@Data
public class AddTagFormDTO implements Serializable {
private static final long serialVersionUID = -3245317956853388308L;
public interface AddTag{}
@NotBlank(message = "标签名称不能为空",groups = AddTag.class)
private String tagName;
private String customerId;
}

16
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CategoryTagInitFormDTO.java

@ -0,0 +1,16 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/12/10 10:00
*/
@Data
public class CategoryTagInitFormDTO implements Serializable {
private static final long serialVersionUID = -3420775041990761296L;
private String customerId;
}

47
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/FirstCategoryFormDTO.java

@ -0,0 +1,47 @@
package com.epmet.dto.form;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 一级分类 新增/修改
* @Auth zy
* @Date 2021-03-22 09:17
*/
@Data
public class FirstCategoryFormDTO implements Serializable {
private static final long serialVersionUID = 3188828578545996470L;
/**
* 客户Id
**/
@NotBlank(message = "customerId不能为空")
private String customerId;
/**
* 分类Id
* issue_project_category_dict 表主键只有执行修改操作时才会传入
**/
private String categoryId;
/**
* 分类名称
**/
@Length(max=20,message = "分类名称不能超过20个字")
@Length(min=2,message = "分类名称不能少于2个字")
private String categoryName;
/**
* 排序
**/
private Integer sort;
/**
* 操作类型(add:新增 edit:编辑)
**/
@NotBlank(message = "操作类型不能为空")
private String type;
}

21
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 获取议题的分类标签列表-接口入参
* @Author sun
*/
@Data
public class IssueCategoryTagListFormDTO implements Serializable {
private static final long serialVersionUID = 2599592072265715951L;
@NotBlank(message = "议题ID不能为空",groups = {ProjectCategoryTagListFormDTO.CategoryTag.class})
private String issueId;
public interface CategoryTag{}
}

34
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueSaveCategoryFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 议题保存/修改分类-接口入参
* @Author sun
*/
@Data
public class IssueSaveCategoryFormDTO implements Serializable {
private static final long serialVersionUID = 2599592072265715951L;
/**
* 议题Id
*/
@NotBlank(message = "议题ID不能为空",groups = {ProjectSaveCategoryFormDTO.SaveCategory.class})
private String issueId;
/**
* 议题分类集合
*/
private List<SaveIssueCategoryFormDTO> categoryList;
/**
* 客户Id
*/
private String customerId;
public interface SaveCategory{}
}

26
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueTagFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/12/10 上午9:31
*/
@Data
public class IssueTagFormDTO implements Serializable {
private static final long serialVersionUID = -8678756265520573631L;
private String id;
private String name;
private String categoryId;
private String tagId;
private String isDisable;
}

72
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueTagsFormDTO.java

@ -0,0 +1,72 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/12/10 上午9:31
*/
@Data
public class IssueTagsFormDTO implements Serializable {
private static final long serialVersionUID = -8678756265520570931L;
/**
* 主键ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 议题所属网格id
*/
private String gridId;
/**
* 议题ID
*/
private String issueId;
/**
* 标签ID
*/
private String tagId;
/**
* 标签名称
*/
private String name;
/**
* 删除标识 0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
public IssueTagsFormDTO() {
this.delFlag = 0;
this.revision = 0;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

28
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueTagsSaveFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/12/10 上午9:29
*/
@Data
public class IssueTagsSaveFormDTO implements Serializable {
private static final long serialVersionUID = 4122102633306198151L;
public interface IssueTagsSaveForm{}
@NotBlank(message = "议题ID不能为空",groups = {IssueTagsSaveForm.class})
private String issueId;
/**
* 标签集合 为空清除此议题标签
*/
private List<IssueTagFormDTO> tagList;
}

27
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SaveIssueCategoryFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 议题保存/修改分类-接口入参
*
* @Author sun
*/
@Data
public class SaveIssueCategoryFormDTO implements Serializable {
private static final long serialVersionUID = 2599592072265715951L;
/**
* 分类Id
*/
private String id;
/**
* 分类名称
*/
private String name;
}

21
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SecondCategoryFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 二级分类 新增/修改
* @ClassName CommonGridIdListFormDTO
* @Auth zy
* @Date 2021-03-22 09:17
*/
@Data
public class SecondCategoryFormDTO extends FirstCategoryFormDTO implements Serializable{
private static final long serialVersionUID = 3188828578545996470L;
/**
* 一级分类Id
**/
private String parentCategoryId;
}

10
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectFormDTO.java

@ -1,6 +1,8 @@
package com.epmet.dto.form;
import com.epmet.dto.IssueCategoryDTO;
import com.epmet.dto.IssueDTO;
import com.epmet.dto.IssueTagsDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@ -42,6 +44,14 @@ public class ShiftProjectFormDTO implements Serializable {
* 话题对象信息
*/
private ResiTopicDTO topicDTO ;
/**
* 议题分类
*/
private List<IssueCategoryDTO> categoryList;
/**
* 议题标签
*/
private List<IssueTagsDTO> tagList;
}

28
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/TagDifferentSetFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description 更新标签使用率入参DTO
* @ClassName TagDifferentSetFormDTO
* @Auth wangc
* @Date 2020-12-11 14:03
*/
@Data
public class TagDifferentSetFormDTO implements Serializable {
private static final long serialVersionUID = -5232943723252172322L;
private List<String> plus;
private List<String> minus;
@NotBlank(message = "客户Id不能为空")
private String customerId;
@NotBlank(message = "用户Id不能为空")
private String userId;
}

17
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/TagListFormDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/12/9 15:32
*/
@Data
public class TagListFormDTO implements Serializable {
private static final long serialVersionUID = -6448213704058150588L;
private List<String> categoryIdList;
}

23
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AddTagResultDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.result;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/12/9 下午5:09
*/
@Data
@AllArgsConstructor
public class AddTagResultDTO implements Serializable {
private static final long serialVersionUID = 4769136806332933579L;
private String tagId;
public AddTagResultDTO() {
this.tagId = "";
}
}

48
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/CustomerCategoryResultDTO.java

@ -0,0 +1,48 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 客户分类列表
*
* @Author ZY
* @DateTime 2021/03/23
*/
@Data
public class CustomerCategoryResultDTO implements Serializable {
private static final long serialVersionUID = 4769136806332933579L;
/**
* 分类Id
*/
private String categoryId;
/**
* 分类名称
*/
private String categoryName;
/**
* 排序
*/
private Integer sort;
/**
* 是否禁用(enable:启用 disable:禁用)
*/
private String isDisable;
/**
* 二级分类
*/
private List<CustomerCategoryResultDTO> children;
/**
* pid
*/
private String pid;
}

27
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagListResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Description 获取议题的分类标签列表-接口返参
* @Author sun
*/
@Data
public class IssueCategoryTagListResultDTO implements Serializable {
private static final long serialVersionUID = 5957826616179876849L;
/**
* 类别集合
*/
private List<IssueCategoryTagResultDTO> categoryList = new ArrayList<>();
/**
* 标签集合
*/
private List<IssueCategoryTagResultDTO> tagList = new ArrayList<>();
}

45
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueCategoryTagResultDTO.java

@ -0,0 +1,45 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Objects;
/**
* @Description 获取议题的分类标签列表-接口返参
* @Author sun
*/
@Data
public class IssueCategoryTagResultDTO implements Serializable {
private static final long serialVersionUID = 5957826616179876849L;
/**
* 分类或标签Id
*/
private String id;
/**
* 分类或标签名称
*/
private String name;
/**
* 是否禁用(enable:启用 disable:禁用)
*/
private String isDisable;
//equals计算时忽略isDisable属性
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
IssueCategoryTagResultDTO that = (IssueCategoryTagResultDTO) o;
return Objects.equals(id, that.id) &&
Objects.equals(name, that.name);
}
@Override
public int hashCode() {
return Objects.hash(id, name);
}
}

21
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProjectTagsResultDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/12/10 下午2:13
*/
@Data
public class IssueProjectTagsResultDTO implements Serializable {
private static final long serialVersionUID = -5035269596436047038L;
private String tagId;
private String tagName;
private String categoryId;
}

18
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/TagListResultDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/12/9 15:33
*/
@Data
public class TagListResultDTO implements Serializable {
private static final long serialVersionUID = -4247291364077634874L;
List<IssueCategoryTagResultDTO> defaulted;
List<IssueCategoryTagResultDTO> customized;
}

38
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java

@ -6,6 +6,8 @@ import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack;
import com.epmet.project.dto.CustomerCategoryDTO;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import com.epmet.resi.group.dto.group.form.AllIssueFormDTO;
import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO;
import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO;
@ -208,6 +210,31 @@ public interface GovIssueOpenFeignClient {
@PostMapping(value = "/gov/issue/issueapplication/queryuserpubauditingissues")
Result<List<UserPubAuditingIssueResDTO>> queryUserPubAuditingIssues(@RequestBody UserPubAuditingIssueFormDTO fomrDTO);
/**
* @description 调用issue库查询分类Id对应的分类名称按分类升序排列
* @author sun
**/
@PostMapping(value = "/gov/issue/issuecategory/projectcategorylist")
Result<List<ProjectCategoryTagResultDTO>> projectCategoryList(@RequestBody ProjectCategoryTagListFormDTO formDTO);
/**
* @description 查询项目所属客户和所属网格信息以及分类对应的分类信息
* @author sun
**/
@PostMapping(value = "/gov/issue/issueprojectcategorydict/getprojectandcategoryinfo")
Result<ProjectIssueCategoryResultDTO> getProjectAndCategoryInfo(ProjectSaveCategoryFormDTO formDTO);
/**
* @Description 更新标签热度 数据库/缓存
* @param param
* @return void
* @author wangc
* @date 2020.12.11 14:00
*/
@PostMapping("/gov/issue/issueprojecttagdict/updatecitations")
Result updateCitations(@RequestBody TagDifferentSetFormDTO param);
/**
* @Description 检查邀请关系如果确实存在邀请关系则返回邀请人Id
* 符合条件
@ -244,4 +271,15 @@ public interface GovIssueOpenFeignClient {
@PostMapping("/gov/issue/issue/detail")
Result<IssueResultDTO> queryIssueDetail(@RequestBody IssueDetailFormDTO formDTO);
/**
* 获取客户 分类字典 信息
*
* @param dto
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO>>
* @Author zhangyong
* @Date 14:10 2021-03-22
**/
@PostMapping(value = "/gov/issue/issueprojectcategorydict/getcustomercategorydict")
Result<List<ProjectCategoryDictResultDTO>> getCustomerCategoryDict(@RequestBody CustomerCategoryDTO dto);
}

30
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java

@ -7,6 +7,8 @@ import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.GovIssueOpenFeignClient;
import com.epmet.project.dto.CustomerCategoryDTO;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import com.epmet.resi.group.dto.group.form.AllIssueFormDTO;
import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO;
import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO;
@ -192,6 +194,29 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryUserPubAuditingIssues", fomrDTO);
}
/**
* @description 调用issue库查询分类Id对应的分类名称按分类升序排列
* @author sun
**/
@Override
public Result<List<ProjectCategoryTagResultDTO>> projectCategoryList(ProjectCategoryTagListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "projectCategoryList", formDTO);
}
/**
* @description 查询项目所属客户和所属网格信息以及分类对应的分类信息
* @author sun
**/
@Override
public Result<ProjectIssueCategoryResultDTO> getProjectAndCategoryInfo(ProjectSaveCategoryFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getProjectAndCategoryInfo", formDTO);
}
@Override
public Result updateCitations(TagDifferentSetFormDTO param) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "updateCitations", param);
}
@Override
public Result<String> checkInviteRelationship(SharableIssueAndInviteeFormDTO param) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "checkInviteRelationship", param);
@ -211,4 +236,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient
public Result<IssueResultDTO> queryIssueDetail(IssueDetailFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "detail", formDTO);
}
@Override
public Result<List<ProjectCategoryDictResultDTO>> getCustomerCategoryDict(CustomerCategoryDTO customerCategoryDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getCustomerCategoryDict", customerCategoryDTO);
}
}

32
epmet-module/gov-issue/gov-issue-server/pom.xml

@ -96,6 +96,24 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>data-report-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>oper-crm-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-rocketmq</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
@ -155,6 +173,9 @@
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.nameserver>192.168.1.130:9876;192.168.1.132:9876</rocketmq.nameserver>
</properties>
</profile>
<profile>
@ -192,6 +213,10 @@
<!--钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.nameserver>192.168.1.130:9876;192.168.1.132:9876</rocketmq.nameserver>
<rocketmq.producer.group>epmet_message</rocketmq.producer.group>
</properties>
</profile>
<profile>
@ -229,6 +254,8 @@
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19</dingTalk.robot.secret>
<rocketmq.nameserver>192.168.10.161:9876</rocketmq.nameserver>
</properties>
</profile>
<profile>
@ -266,8 +293,11 @@
</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1
</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.nameserver>192.168.11.187:9876;192.168.11.184:9876</rocketmq.nameserver>
</properties>
</profile>
</profiles>
</project>
</project>

16
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/GovIssueRedisKeys.java

@ -1,5 +1,9 @@
package com.epmet.constant;
import com.epmet.utils.ModuleConstants;
import java.util.Optional;
/**
* @Description gov-issue-server模块redis key
* @Author yinzuomei
@ -18,5 +22,17 @@ public class GovIssueRedisKeys {
public static String getWorkGrassrootsIssueRedDotKey(String gridId) {
return rootPrefix.concat(String.format("gov:wxmp:work:grassroots:issue:%s",gridId));
}
/**
* 议题项目标签key epmet:govern:customer:category:[customerId]:[categoryId]
*
* 自定义标签的categoryId统一为[customize]
* @param customerId
* @param categoryId
* @return
*/
public static String getGovernmentTagKey(String customerId,String categoryId){
return rootPrefix.concat("govern:customer:category:").concat(customerId).concat(":").concat(Optional.ofNullable(categoryId).orElse(ModuleConstants.ASTERISK));
}
}

138
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java

@ -0,0 +1,138 @@
/**
* 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.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IssueCategoryDTO;
import com.epmet.dto.form.IssueCategoryTagListFormDTO;
import com.epmet.dto.form.IssueSaveCategoryFormDTO;
import com.epmet.dto.form.ProjectCategoryTagListFormDTO;
import com.epmet.dto.result.IssueCategoryTagListResultDTO;
import com.epmet.dto.result.ProjectCategoryTagResultDTO;
import com.epmet.excel.IssueCategoryExcel;
import com.epmet.service.IssueCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 议题所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-08
*/
@RestController
@RequestMapping("issuecategory")
public class IssueCategoryController {
@Autowired
private IssueCategoryService issueCategoryService;
@GetMapping("page")
public Result<PageData<IssueCategoryDTO>> page(@RequestParam Map<String, Object> params) {
PageData<IssueCategoryDTO> page = issueCategoryService.page(params);
return new Result<PageData<IssueCategoryDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IssueCategoryDTO> get(@PathVariable("id") String id) {
IssueCategoryDTO data = issueCategoryService.get(id);
return new Result<IssueCategoryDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody IssueCategoryDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
issueCategoryService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody IssueCategoryDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
issueCategoryService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
issueCategoryService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IssueCategoryDTO> list = issueCategoryService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IssueCategoryExcel.class);
}
/**
* @param formDTO
* @return
* @Description 获取议题的分类标签列表
* @Author sun
**/
@PostMapping("categorytaglist")
public Result<IssueCategoryTagListResultDTO> categoryTagList(@RequestBody IssueCategoryTagListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IssueCategoryTagListFormDTO.CategoryTag.class);
return new Result<IssueCategoryTagListResultDTO>().ok(issueCategoryService.categoryTagList(formDTO));
}
/**
* @param formDTO
* @return
* @Description 查询分类Id集合对应的分类名称按分类升序排列
* @Author sun
**/
@PostMapping("projectcategorylist")
public Result<List<ProjectCategoryTagResultDTO>> projectCategoryList(@RequestBody ProjectCategoryTagListFormDTO formDTO) {
return new Result<List<ProjectCategoryTagResultDTO>>().ok(issueCategoryService.projectCategoryList(formDTO));
}
/**
* @param formDTO
* @return
* @Description 议题保存/修改分类
* @Author sun
**/
@PostMapping("save")
public Result saveCategory(@LoginUser TokenDto tokenDto, @RequestBody IssueSaveCategoryFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, IssueSaveCategoryFormDTO.SaveCategory.class);
issueCategoryService.saveCategory(formDTO);
return new Result();
}
}

16
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java

@ -168,6 +168,22 @@ public class IssueManageController {
return new Result();
}
/**
* 议题管理-议题转项目-增加分类标签功能
* @author zhaoqifeng
* @date 2020/12/9 9:58
* @param tokenDTO
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("shiftproject-v2")
public Result shiftProjectV2(@LoginUser TokenDto tokenDTO, @RequestBody ShiftProjectFormDTO formDTO) {
formDTO.setStaffId(tokenDTO.getUserId());
ValidatorUtils.validateEntity(formDTO);
issueService.shiftProjectV2(formDTO);
return new Result();
}
/**
* @Description 政府端查看议题进展 (已关闭单表查询转议题跨服务查询)
* @param issueId

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

Loading…
Cancel
Save