Browse Source

【项目分类分析】各分类项目数图表

dev_shibei_match
sunyuchao 4 years ago
parent
commit
d23401c039
  1. 93
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java
  2. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/CategoryProjectFormDTO.java
  3. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java
  4. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectCategoryTotalFormDTO.java
  5. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java
  6. 4
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java
  7. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java
  8. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java
  9. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java
  10. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java
  11. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java
  12. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java
  13. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java
  14. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java
  15. 31
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  16. 13
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml
  17. 12
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml

93
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java

@ -0,0 +1,93 @@
/**
* 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.dataaggre.dto.govissue;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 议题项目分类字典
*
* @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;
/**
* 颜色
*/
private String colour;
}

4
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/CategoryProjectFormDTO.java

@ -24,8 +24,8 @@ public class CategoryProjectFormDTO implements Serializable {
@NotBlank(message = "组织ID不能为空", groups = {Category.class})
private String dateId;
//一级分类Id
@NotBlank(message = "分类Id不能为空", groups = {Category.class})
private String categoryId;
@NotBlank(message = "分类Code不能为空", groups = {Category.class})
private String categoryCode;
//页码
@Min(1)
private Integer pageNo = 1;

4
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java

@ -25,8 +25,8 @@ public class ProjectAnalysisFormDTO implements Serializable {
@NotBlank(message = "话题或事件发起人Id不能为空", groups = {Analysis.class})
private String userId;
//一级分类Id集合
@NotNull(message = "分类Id集合不能为空", groups = {Analysis.class})
private List<String> categoryIdList;
@NotNull(message = "分类Code集合不能为空", groups = {Analysis.class})
private List<String> categoryCodeList;
public interface Analysis extends CustomerClientShowGroup {
}

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectCategoryTotalFormDTO.java

@ -24,6 +24,8 @@ public class ProjectCategoryTotalFormDTO implements Serializable {
@NotBlank(message = "日维度ID不能为空", groups = {Project.class})
private String dateId;
private String customerId;
public interface Project extends CustomerClientShowGroup {
}

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/CategoryProjectResultDTO.java

@ -27,7 +27,7 @@ public class CategoryProjectResultDTO implements Serializable {
//项目编码[目前没这个功能 默认为空]
private String projectCode = "";
//一级分类Id集合
private List<String> categoryIds;
private List<String> categoryCodes;
//一级分类名称集合
private List<String> categoryNames;
//来源:议题issue 项目立项:agency 事件:resi_event【控制电机查看时里边三个按钮的显示】

4
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java

@ -14,8 +14,8 @@ public class ProjectCategoryTotalResultDTO implements Serializable {
//组织Id
private String agencyId;
//一级分类Id
private String categoryId;
//一级分类Code
private String categoryCode;
//一级分类名称
private String categoryName;
//分类下项目总数

5
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java

@ -91,9 +91,10 @@ public class GovProjectController {
* @author sun
*/
@PostMapping("projectcategorylist")
public Result<ProjectCategoryTotalResultDTO> projectCategoryList(@RequestBody ProjectCategoryTotalFormDTO formDTO) {
public Result<List<ProjectCategoryTotalResultDTO>> projectCategoryList(@LoginUser TokenDto tokenDto, @RequestBody ProjectCategoryTotalFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ProjectCategoryTotalFormDTO.Project.class);
return new Result<ProjectCategoryTotalResultDTO>().ok(govProjectService.projectCategoryList(formDTO));
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<ProjectCategoryTotalResultDTO>>().ok(govProjectService.projectCategoryList(formDTO));
}
/**

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java

@ -21,6 +21,8 @@ import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -103,4 +105,10 @@ public interface EvaluationIndexDao {
*/
String selectAgencyNameByAgencyId(@Param("agencyId")String agencyId);
/**
* @Description 按dateId查询组织下一级分类项目总数统计
* @author sun
*/
List<ProjectCategoryTotalResultDTO> projectCategoryList(ProjectCategoryTotalFormDTO formDTO);
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java

@ -18,6 +18,7 @@
package com.epmet.dataaggre.dao.govissue;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO;
import com.epmet.dataaggre.dto.govissue.form.ClosedIssueListFormDTO;
import com.epmet.dataaggre.dto.govissue.form.ShiftProjectIssueListFormDTO;
import com.epmet.dataaggre.dto.govissue.form.VotingIssueListFormDTO;
@ -74,4 +75,10 @@ public interface IssueDao extends BaseDao<IssueEntity> {
Integer selectIssueCount(@Param("gridIds") List<String> gridIds,@Param("issueType")String issueType);
List<IssueInfoDTO> selectShiftProjectIssueList(@Param("customerId") String customerId, @Param("gridId") String gridId);
/**
* @Description 查询客户下分类信息
* @author sun
**/
List<IssueProjectCategoryDictDTO> getCategoryList(@Param("customerId") String customerId);
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java

@ -6,6 +6,8 @@ import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO;
import java.util.List;
@ -86,4 +88,9 @@ public interface EvaluationIndexService {
*/
ScreenAgencyOrGridListDTO getSubAgencyOrGridList(String agencyId);
/**
* @Description 按dateId查询组织下一级分类项目总数统计
* @author sun
*/
List<ProjectCategoryTotalResultDTO> projectCategoryList(ProjectCategoryTotalFormDTO formDTO);
}

11
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java

@ -11,6 +11,8 @@ import com.epmet.dataaggre.dto.evaluationindex.ScreenAgencyOrGridListDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govproject.form.ProjectCategoryTotalFormDTO;
import com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import com.epmet.dataaggre.service.opercrm.CustomerRelation;
import lombok.extern.slf4j.Slf4j;
@ -206,4 +208,13 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService {
return resultDTO;
}
/**
* @Description 按dateId查询组织下一级分类项目总数统计
* @author sun
*/
@Override
public List<ProjectCategoryTotalResultDTO> projectCategoryList(ProjectCategoryTotalFormDTO formDTO) {
return evaluationIndexDao.projectCategoryList(formDTO);
}
}

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java

@ -1,6 +1,7 @@
package com.epmet.dataaggre.service.govissue;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO;
import com.epmet.dataaggre.dto.govissue.form.AllIssueFormDTO;
import com.epmet.dataaggre.dto.govissue.form.ClosedIssueListFormDTO;
import com.epmet.dataaggre.dto.govissue.form.ShiftProjectIssueListFormDTO;
@ -45,4 +46,10 @@ public interface GovIssueService {
List<ClosedIssueListResultDTO> closedIssueList(ClosedIssueListFormDTO fromDTO);
List<IssueInfoDTO> selectShiftProjectIssueList(String customerId,String gridId,Integer pageNo,Integer pageSize);
/**
* @Description 查询客户下一级分类信息
* @author sun
**/
List<IssueProjectCategoryDictDTO> categoryList(String customerId);
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java

@ -8,6 +8,7 @@ import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.constant.IssueConstant;
import com.epmet.dataaggre.dao.govissue.IssueApplicationDao;
import com.epmet.dataaggre.dao.govissue.IssueDao;
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO;
import com.epmet.dataaggre.dto.govissue.form.AllIssueFormDTO;
import com.epmet.dataaggre.dto.govissue.form.ClosedIssueListFormDTO;
import com.epmet.dataaggre.dto.govissue.form.ShiftProjectIssueListFormDTO;
@ -323,4 +324,13 @@ public class GovIssueServiceImpl implements GovIssueService {
return issueDao.selectShiftProjectIssueList(customerId, gridId);
}
/**
* @Description 查询客户下一级分类信息
* @author sun
**/
@Override
public List<IssueProjectCategoryDictDTO> categoryList(String customerId) {
return issueDao.getCategoryList(customerId);
}
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java

@ -72,7 +72,7 @@ public interface GovProjectService {
* @Description 赋能平台项目分类分析各分类项目数图表
* @author sun
*/
ProjectCategoryTotalResultDTO projectCategoryList(ProjectCategoryTotalFormDTO formDTO);
List<ProjectCategoryTotalResultDTO> projectCategoryList(ProjectCategoryTotalFormDTO formDTO);
/**
* @Description 赋能平台项目处理分析分类下项目列表

31
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java

@ -12,6 +12,7 @@ import com.epmet.dataaggre.constant.ProjectConstant;
import com.epmet.dataaggre.dao.govproject.ProjectDao;
import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectMonthResultDTO;
import com.epmet.dataaggre.dto.datastats.result.FactAgencyProjectResultDTO;
import com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO;
import com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO;
import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO;
import com.epmet.dataaggre.dto.govproject.ProjectDTO;
@ -19,6 +20,7 @@ import com.epmet.dataaggre.dto.govproject.form.*;
import com.epmet.dataaggre.dto.govproject.result.*;
import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService;
import com.epmet.dataaggre.service.govissue.GovIssueService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.govproject.GovProjectService;
@ -56,6 +58,8 @@ public class GovProjectServiceImpl implements GovProjectService {
private ResiGroupService resiGroupService;
@Autowired
private DataStatsService dataStatsService;
@Autowired
private EvaluationIndexService evaluationIndexService;
/**
* @Description 查询项目信息
@ -334,11 +338,32 @@ public class GovProjectServiceImpl implements GovProjectService {
/**
* @Description 赋能平台项目分类分析各分类项目数图表
* @author sun
, * @author sun
*/
@Override
public ProjectCategoryTotalResultDTO projectCategoryList(ProjectCategoryTotalFormDTO formDTO) {
return null;
public List<ProjectCategoryTotalResultDTO> projectCategoryList(ProjectCategoryTotalFormDTO formDTO) {
List<ProjectCategoryTotalResultDTO> resultList = new ArrayList<>();
//1.查询客户下一级分类信息
List<IssueProjectCategoryDictDTO> categoryList = govIssueService.categoryList(formDTO.getCustomerId());
//2.按dateId查询组织下一级分类项目总数
List<ProjectCategoryTotalResultDTO> list = evaluationIndexService.projectCategoryList(formDTO);
//3.封装数据并返回
categoryList.forEach(ca -> {
ProjectCategoryTotalResultDTO dto = new ProjectCategoryTotalResultDTO();
dto.setAgencyId(formDTO.getAgencyId());
dto.setCategoryCode(ca.getCategoryCode());
dto.setCategoryName(ca.getCategoryName());
list.forEach(l -> {
if (ca.getCategoryCode().equals(l.getCategoryCode())) {
dto.setTotal(l.getTotal());
}
});
resultList.add(dto);
});
return resultList;
}
/**

13
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml

@ -182,4 +182,17 @@
AND DEL_FLAG = 0
</select>
<select id="projectCategoryList" resultType="com.epmet.dataaggre.dto.govproject.result.ProjectCategoryTotalResultDTO">
SELECT
org_id agencyId,
category_code categoryCode,
project_total total
FROM
screen_project_category_org_daily
WHERE
`level` = '1'
AND org_id = #{agencyId}
AND date_id = #{dateId}
</select>
</mapper>

12
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml

@ -124,4 +124,16 @@
</if>
order by i.SHIFTED_TIME desc
</select>
<select id="getCategoryList" resultType="com.epmet.dataaggre.dto.govissue.IssueProjectCategoryDictDTO">
SELECT
*
FROM issue_project_category_dict
WHERE del_flag = 0
AND customer_id = #{customerId}
AND category_type = '1'
AND is_disable = 'enable'
ORDER BY category_code
</select>
</mapper>
Loading…
Cancel
Save