Browse Source

Merge branch 'dev_issue_category' into dev_temp

# Conflicts:
#	epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
#	epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
#	epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java
#	epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java
#	epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
master
zhangyongzhangyong 5 years ago
parent
commit
745a59bb94
  1. 41
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java
  2. 41
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java
  3. 43
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/CustomerCategoryDTO.java
  4. 41
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java
  5. 6
      epmet-module/data-report/data-report-server/pom.xml
  6. 14
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
  7. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
  8. 54
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  9. 40
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml
  10. 27
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/CategoryDictDataFormDTO.java
  11. 43
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java
  12. 43
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java
  13. 72
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CategoryDictFormDTO.java
  14. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java
  15. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java
  16. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java
  17. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java
  18. 63
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerProjectCategoryDictDao.java
  19. 63
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectCategoryDailyEntity.java
  20. 49
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java
  21. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java
  22. 83
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java
  23. 95
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/CustomerProjectCategoryDictEntity.java
  24. 37
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java
  25. 36
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java
  26. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java
  27. 31
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java
  28. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java
  29. 38
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java
  30. 51
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java
  31. 58
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java
  32. 114
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java
  33. 8
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml
  34. 23
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml
  35. 25
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml
  36. 44
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/IssueProjectCategoryDictDao.xml
  37. 95
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerProjectCategoryDictDao.xml
  38. 8
      epmet-module/gov-issue/gov-issue-client/pom.xml
  39. 16
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
  40. 10
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
  41. 8
      epmet-module/gov-issue/gov-issue-server/pom.xml
  42. 41
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java
  43. 16
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java
  44. 28
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java
  45. 27
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java
  46. 19
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
  47. 11
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java
  48. 5
      epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java
  49. 17
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java
  50. 11
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java
  51. 10
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java
  52. 4
      epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java
  53. 10
      epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml

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>

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

@ -137,4 +137,18 @@ public class ProjectController {
public Result<List<ProjectNextAgencyResultDTO>> myNextAgency(@LoginUser TokenDto tokenDto){
return new Result<List<ProjectNextAgencyResultDTO>>().ok(projectService.getMyNextAgency(tokenDto));
}
/**
* 002项目分类字典查询
* 查询当前客户的父客户下项目分类字典
*
* @param tokenDto
* @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(@LoginUser TokenDto tokenDto) {
return new Result<List<ProjectCategoryDictResultDTO>>().ok(projectService.getCategoryDict(tokenDto));
}
}

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 tokenDto
* @return java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO>
* @Author zhangyong
* @Date 14:26 2021-03-22
**/
List<ProjectCategoryDictResultDTO> getCategoryDict(TokenDto tokenDto);
}

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(TokenDto tokenDto) {
List<ProjectCategoryDictResultDTO> result = new ArrayList<>();
Result<String> parentCustomerId = operCrmOpenFeignClient.getExternalAndParentCustomerId(tokenDto.getCustomerId());
if (!parentCustomerId.success() && null == parentCustomerId.getData()) {
logger.warn(String.format("调用%s服务查询外部客户的 父级客户ID 失败,入参%s", ServiceConstant.OPER_CRM_SERVER,
JSON.toJSONString(tokenDto.getCustomerId())));
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(tokenDto.getCustomerId())));
} 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>

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;
}

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;
/**
* 删除标识

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

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

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();
}

25
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,19 @@ 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 CategoryDictDataFormDTO formDTO) {
customerProjectCategoryDictService.uploadCategoryDict(customerId, formDTO);
return new Result();
}
}

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

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

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.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.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);
}

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;
}

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

@ -0,0 +1,37 @@
/**
* 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);
}

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

@ -0,0 +1,36 @@
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.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);
}
}

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();
}

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

@ -0,0 +1,31 @@
/**
* 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.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity;
/**
* 项目所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-19
*/
public interface FactOriginProjectCategoryDailyService extends BaseService<FactOriginProjectCategoryDailyEntity> {
//todo 将epmet_gov_project库中的项目分类信息(project_category)同步到统计库epmet_data_statistical
}

7
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,8 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
} catch (Exception e) {
log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
//todo 新增项目分类抽取 shaowen
// originProjectCategoryDailyService.xxxx();
} else {
try {
for (int i = 0; i < finalDaysBetween.size(); i++) {
@ -219,6 +222,8 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService {
} catch (Exception e) {
log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e);
}
//todo 新增项目分类抽取 shaowen
// originProjectCategoryDailyService.xxxx();
}
});
}

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

@ -0,0 +1,38 @@
/**
* 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.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.extract.FactOriginProjectCategoryDailyDao;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService;
import org.springframework.stereotype.Service;
/**
* 项目所属分类表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-19
*/
@Service
@DataSource(DataSourceConstant.STATS)
public class FactOriginProjectCategoryDailyServiceImpl extends BaseServiceImpl<FactOriginProjectCategoryDailyDao, FactOriginProjectCategoryDailyEntity> implements FactOriginProjectCategoryDailyService {
}

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<>();
}
}

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.CategoryDictDataFormDTO;
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 customerId
* @param formDTO
* @return void
* @Author zhangyong
* @Date 16:03 2021-03-22
**/
void uploadCategoryDict(String customerId, CategoryDictDataFormDTO formDTO);
}

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

@ -0,0 +1,114 @@
/**
* 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.CategoryDictDataFormDTO;
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.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.collections4.CollectionUtils;
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());
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)
@Override
@Transactional(rollbackFor = Exception.class)
public void uploadCategoryDict(String customerId, CategoryDictDataFormDTO formDTO) {
if (formDTO.getIsFirst()) {
int deleteNum;
do {
deleteNum = baseDao.deleteCustomerProjectCategoryDict(customerId);
} while (deleteNum > NumConstant.ZERO);
}
if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
baseDao.batchInsertCustomerProjectCategoryDict(formDTO.getDataList(), customerId);
}
}
}

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

@ -0,0 +1,8 @@
<?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">
</mapper>

23
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}

25
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}

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

@ -0,0 +1,44 @@
<?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>
</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>

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>

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

@ -2,13 +2,12 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IssueApplicationDTO;
import com.epmet.dto.IssueDTO;
import com.epmet.dto.IssueSuggestionDTO;
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;
@ -275,4 +274,15 @@ public interface GovIssueOpenFeignClient {
@PostMapping(value = "/gov/issue/manage/votingissuedetail")
Result<GovIssueDetailResultDTO> votingissuedetail(@RequestBody IssueDetailFormDTO issueDetail);
/**
* 获取客户 分类字典 信息
*
* @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);
}

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

@ -3,13 +3,12 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IssueApplicationDTO;
import com.epmet.dto.IssueDTO;
import com.epmet.dto.IssueSuggestionDTO;
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;
@ -242,4 +241,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient
public Result<GovIssueDetailResultDTO> votingissuedetail(IssueDetailFormDTO issueDetail) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "votingissuedetail", issueDetail);
}
@Override
public Result<List<ProjectCategoryDictResultDTO>> getCustomerCategoryDict(CustomerCategoryDTO customerCategoryDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getCustomerCategoryDict", customerCategoryDTO);
}
}

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

@ -96,6 +96,12 @@
<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>
<build>
@ -270,4 +276,4 @@
</profile>
</profiles>
</project>
</project>

41
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java

@ -34,6 +34,8 @@ import com.epmet.dto.form.ProjectSaveCategoryFormDTO;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.dto.result.ProjectIssueCategoryResultDTO;
import com.epmet.excel.IssueProjectCategoryDictExcel;
import com.epmet.project.dto.CustomerCategoryDTO;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import com.epmet.service.IssueProjectCategoryDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -144,4 +146,41 @@ public class IssueProjectCategoryDictController {
return new Result<ProjectIssueCategoryResultDTO>().ok(issueProjectCategoryDictService.getProjectAndCategoryInfo(formDTO));
}
}
/**
* @param formDTO
* @return
* @Description 分类启用与禁用
* @Author sun
**/
@PostMapping("isdisablecategory")
public Result<ProjectIssueCategoryResultDTO> isDisableCategory(@RequestBody ProjectSaveCategoryFormDTO formDTO) {
return new Result<ProjectIssueCategoryResultDTO>().ok(issueProjectCategoryDictService.isDisableCategory(formDTO));
}
/**
* @param formDTO
* @return
* @Description 分类删除
* @Author sun
**/
@PostMapping("delcategory")
public Result<ProjectIssueCategoryResultDTO> delCategory(@RequestBody ProjectSaveCategoryFormDTO formDTO) {
return new Result<ProjectIssueCategoryResultDTO>().ok(issueProjectCategoryDictService.delCategory(formDTO));
}
/**
* 获取客户 分类字典 信息
*
* @param dto
* pid = 0 查询一级分类
* pid != 0 查询二级分类
* @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("getcustomercategorydict")
public Result<List<ProjectCategoryDictResultDTO>> getCustomerCategoryDict(@RequestBody CustomerCategoryDTO dto){
return new Result<List<ProjectCategoryDictResultDTO>>().ok(issueProjectCategoryDictService.listCategoryDict(dto.getCustomerId(),
dto.getPid()));
}
}

16
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java

@ -22,6 +22,7 @@ import com.epmet.dto.IssueProjectCategoryDictDTO;
import com.epmet.dto.form.IssueProjectCategoryDictListFormDTO;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.entity.IssueProjectCategoryDictEntity;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -73,4 +74,17 @@ public interface IssueProjectCategoryDictDao extends BaseDao<IssueProjectCategor
* @date 2020.12.10 13:37
*/
IssueProjectCategoryDictEntity selectSingleByCustomerIdAndCategoryNameAndCategoryType(@Param("customerId")String customerId,@Param("categoryName")String categoryName,@Param("categoryType")String categoryType);
}
/**
* 获取客户 分类字典 信息
*
* @param customerId
* @param pid pid = 0 查询一级分类
* pid != 0 查询二级分类
*
* @return java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO>
* @Author zhangyong
* @Date 14:10 2021-03-22
**/
List<ProjectCategoryDictResultDTO> selectListCategoryDict(@Param("customerId") String customerId, @Param("pid") String pid);
}

28
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java

@ -26,6 +26,7 @@ import com.epmet.dto.form.ProjectSaveCategoryFormDTO;
import com.epmet.dto.result.CustomerCategoryListResultDTO;
import com.epmet.dto.result.ProjectIssueCategoryResultDTO;
import com.epmet.entity.IssueProjectCategoryDictEntity;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import java.util.List;
import java.util.Map;
@ -130,4 +131,29 @@ public interface IssueProjectCategoryDictService extends BaseService<IssueProjec
* @Author sun
**/
ProjectIssueCategoryResultDTO getProjectAndCategoryInfo(ProjectSaveCategoryFormDTO formDTO);
}
/**
* @Description 分类启用与禁用
* @Author sun
**/
ProjectIssueCategoryResultDTO isDisableCategory(ProjectSaveCategoryFormDTO formDTO);
/**
* @Description 分类删除
* @Author sun
**/
ProjectIssueCategoryResultDTO delCategory(ProjectSaveCategoryFormDTO formDTO);
/**
* 获取客户 分类字典 信息
*
* @param customerId
* @param pid pid = 0 查询一级分类
* pid != 0 查询二级分类
*
* @return java.util.List<com.epmet.project.dto.result.ProjectCategoryDictResultDTO>
* @Author zhangyong
* @Date 14:10 2021-03-22
**/
List<ProjectCategoryDictResultDTO> listCategoryDict(String customerId, String pid);
}

27
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java

@ -38,6 +38,7 @@ import com.epmet.dto.result.ProjectIssueCategoryResultDTO;
import com.epmet.dto.result.ProjectIssueDTOResultDTO;
import com.epmet.entity.IssueProjectCategoryDictEntity;
import com.epmet.entity.IssueProjectTagDictEntity;
import com.epmet.project.dto.result.ProjectCategoryDictResultDTO;
import com.epmet.redis.IssueProjectCategoryDictRedis;
import com.epmet.service.IssueProjectCategoryDictService;
import com.epmet.service.IssueProjectTagDictService;
@ -201,4 +202,28 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
issueProjectTagDictService.insertBatch(tagList);
}
}
}
/**
* @Description 分类启用与禁用
* @Author sun
**/
@Override
public ProjectIssueCategoryResultDTO isDisableCategory(ProjectSaveCategoryFormDTO formDTO) {
return null;
}
/**
* @Description 分类删除
* @Author sun
**/
@Override
public ProjectIssueCategoryResultDTO delCategory(ProjectSaveCategoryFormDTO formDTO) {
return null;
}
@Override
public List<ProjectCategoryDictResultDTO> listCategoryDict(String customerId, String pid) {
return baseDao.selectListCategoryDict(customerId, pid);
}
}

19
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

@ -96,4 +96,21 @@
</choose>
LIMIT 1
</select>
</mapper>
<select id="selectListCategoryDict" resultType="com.epmet.project.dto.result.ProjectCategoryDictResultDTO">
SELECT
CATEGORY_CODE categoryCode,
CATEGORY_NAME categoryName,
PID,
ID
FROM issue_project_category_dict d
WHERE d.CUSTOMER_ID = #{customerId}
AND d.DEL_FLAG ='0' AND d.IS_DISABLE = 'enable'
<if test="pid != null and pid == 0">
AND d.PID = '0'
</if>
<if test="pid != null and pid != 0">
AND d.PID != '0'
</if>
</select>
</mapper>

11
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java

@ -131,4 +131,15 @@ public interface OperCrmOpenFeignClient {
*/
@PostMapping("list-apiservice-by-customerid")
Result<List<ThirdplatApiserviceResultDTO>> listApiServiceByCustomerId(@RequestBody ApiServiceFormDTO form);
/**
* 获取外部客户的父级 客户id
*
* @param customerId
* @return com.epmet.commons.tools.utils.Result<java.lang.String>
* @Author zhangyong
* @Date 14:57 2021-03-22
**/
@GetMapping("/oper/crm/customer/getexternalandparentcustomerid/{customerId}")
Result<String> getExternalAndParentCustomerId(@PathVariable("customerId") String customerId);
}

5
epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java

@ -100,4 +100,9 @@ public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient {
public Result<List<ThirdplatApiserviceResultDTO>> listApiServiceByCustomerId(ApiServiceFormDTO form) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "listApiServiceByCustomerId", form);
}
@Override
public Result<String> getExternalAndParentCustomerId(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getExternalAndParentCustomerId", customerId);
}
}

17
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java

@ -389,4 +389,21 @@ public class CustomerController {
String customerId = form.getCustomerId();
return new Result<List<ThirdplatApiserviceResultDTO>>().ok(customerThirdplatApiServiceService.listByCustomerId(customerId));
}
/**
* 获取外部客户的父级 客户id
*
* @param customerId
* @return com.epmet.commons.tools.utils.Result<java.lang.String>
* @Author zhangyong
* @Date 14:57 2021-03-22
**/
@GetMapping("getexternalandparentcustomerid/{customerId}")
public Result<String> getExternalAndParentCustomerId(@PathVariable("customerId") String customerId){
if(StringUtils.isNotBlank(customerId)){
String resultDTO = customerService.getExternalAndParentCustomerId(customerId);
return new Result<String>().ok(resultDTO);
}
return new Result<>();
}
}

11
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java

@ -48,7 +48,7 @@ public interface CustomerDao extends BaseDao<CustomerEntity> {
* @param customerIdList
* @Author yinzuomei
* @Description 根据客户id查询客户信息
* @Date 2020/4/24 9:21
* @Date 2020/4/24 9:21
**/
List<CustomerDTO> selectListByIds(@Param("customerIdList") List<String> customerIdList);
@ -98,4 +98,13 @@ public interface CustomerDao extends BaseDao<CustomerEntity> {
*/
List<CustomerListResultDTO> selectAllCustomerList(@Param("customerName") String customerName);
/**
* 获取外部客户的父级 客户id
*
* @param customerId
* @return java.lang.String
* @Author zhangyong
* @Date 14:57 2021-03-22
**/
String getExternalAndParentCustomerId(@Param("customerId") String customerId);
}

10
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java

@ -226,4 +226,14 @@ public interface CustomerService extends BaseService<CustomerEntity> {
* @Date 2021/2/3 12:52
**/
CustomerRelationInfoResultDTO queryCustomerInfoByCustomerId(String customerId);
/**
* 获取外部客户的父级 客户id
*
* @param customerId
* @return java.lang.String
* @Author zhangyong
* @Date 14:57 2021-03-22
**/
String getExternalAndParentCustomerId(String customerId);
}

4
epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java

@ -785,4 +785,8 @@ public class CustomerServiceImpl extends BaseServiceImpl<CustomerDao, CustomerEn
return resultDTO;
}
@Override
public String getExternalAndParentCustomerId(String customerId) {
return baseDao.getExternalAndParentCustomerId(customerId);
}
}

10
epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml

@ -120,4 +120,14 @@
AND customer_name LIKE concat('%', trim(#{customerName}), '%')
</if>
</select>
<select id="getExternalAndParentCustomerId" resultType="String">
SELECT
CR.PARENT_CUSTOMER_ID AS rootCustomerId
FROM customer_relation cr
WHERE cr.DEL_FLAG = '0'
AND cr.CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
AND cr.PARENT_CUSTOMER_ID != '0'
AND cr.CUSTOMER_TYPE = 'external'
</select>
</mapper>

Loading…
Cancel
Save