Browse Source

Merge branch 'dev_event_category'

dev
zhaoqifeng 3 years ago
parent
commit
d56f14a1a4
  1. 14
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
  2. 5
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java
  3. 5
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/OrgProjectListFormDTO.java
  4. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgProjectListResultDTO.java
  5. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java
  6. 7
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/OrgProjectListExcel.java
  7. 17
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  8. 18
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml
  9. 17
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

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

@ -61,15 +61,19 @@
<select id="selectCategoryList" resultType="com.epmet.dto.IssueProjectCategoryDictDTO">
SELECT
*
a.*,
b.CATEGORY_NAME as parentCategoryName
FROM
issue_project_category_dict
issue_project_category_dict a
LEFT JOIN issue_project_category_dict b ON a.PID = b.ID
AND b.del_flag = '0'
AND b.customer_id = #{customerId}
WHERE
del_flag = '0'
AND customer_id = #{customerId}
a.del_flag = '0'
AND a.customer_id = #{customerId}
<if test="cstegoryIdList != null and cstegoryIdList.size() > 0">
<foreach collection="cstegoryIdList" item="id" open="AND( " separator=" OR " index="index" close=")">
id = #{id}
a.id = #{id}
</foreach>
</if>
ORDER BY

5
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java

@ -84,5 +84,10 @@ public class IcEventListFormDTO implements Serializable {
* 操作类型 0:取消标记 1:标记
*/
private String type;
/**
* 事件分类 一类二类Id集合
*/
private List<String> firstIdList;
private List<String> secondIdList;
}

5
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/OrgProjectListFormDTO.java

@ -3,7 +3,6 @@ package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
@ -46,6 +45,10 @@ public class OrgProjectListFormDTO extends PageFormDTO implements Serializable {
* 事件状态 处理中 pending已结案 closed
*/
private String status;
/**
* 解决状态 已解决 resolved无需解决 unresolved
*/
private String closedStatus;
/**
* 起始上报时间 精确到秒
*/

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgProjectListResultDTO.java

@ -98,6 +98,8 @@ public class OrgProjectListResultDTO implements Serializable {
*/
private String status;
private String statusValue;
private String closedStatus;
private String closedStatusValue;
/**
* 是否需要自己处理 true:需要 false:不需要
*/

4
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/IcEventExcel.java

@ -20,6 +20,10 @@ public class IcEventExcel {
@ColumnWidth(20)
private String gridName;
@ExcelProperty(value = "事件分类")
@ColumnWidth(25)
private String categoryName;
@ExcelProperty(value = "事件内容")
@ColumnWidth(25)
private String eventContent;

7
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/OrgProjectListExcel.java

@ -1,12 +1,9 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.util.List;
/**
* 事件管理表
*
@ -122,5 +119,9 @@ public class OrgProjectListExcel {
@ColumnWidth(20)
private String status;
@ExcelProperty(value = "解决状态")
@ColumnWidth(20)
private String closedStatus;
}

17
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -125,6 +125,15 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode());
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>();
//查询分类信息
IssueProjectCategoryDictListFormDTO dictFormDto = new IssueProjectCategoryDictListFormDTO();
dictFormDto.setCustomerId(formDTO.getCustomerId());
Result<List<IssueProjectCategoryDictDTO>> categoryRes = govIssueOpenFeignClient.getCategoryList(dictFormDto);
if (!categoryRes.success() || org.springframework.util.CollectionUtils.isEmpty(categoryRes.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取项目分类名称异常");
}
Map<String, IssueProjectCategoryDictDTO> categoryMap = categoryRes.getData().stream().collect(Collectors.toMap(IssueProjectCategoryDictDTO::getId, o -> o, (o1, o2) -> o1));
//封装数据
for (IcEventListResultDTO dto : list) {
if (gridInfoMap.containsKey(dto.getGridId())) {
@ -133,6 +142,14 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
if (StringUtils.isNotBlank(dto.getSourceType())) {
dto.setSourceTypeName(statusMap.get(dto.getSourceType()));
}
if (categoryMap.containsKey(dto.getCategoryId())) {
IssueProjectCategoryDictDTO category = categoryMap.get(dto.getCategoryId());
if (StringUtils.isNotBlank(category.getParentCategoryName())) {
dto.setCategoryName(category.getParentCategoryName().concat(StrConstant.HYPHEN).concat(category.getCategoryName()));
} else {
dto.setCategoryName(category.getCategoryName());
}
}
//每个事件对应的图片数据
if(!CollectionUtils.isEmpty(dto.getAttachmentList())){
List<String> imageList = new ArrayList<>();

18
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

@ -218,6 +218,24 @@
<if test="status != null and status != '' ">
AND ie.`status` = #{status}
</if>
<if test="(firstIdList != null and firstIdList.size() > 0) and (secondIdList == null or secondIdList.size() == 0)"><!-- 一类查询条件 -->
<foreach collection="firstIdList" item="firstId" open="AND iec.CATEGORY_PIDS IN (" separator="," close=")">
#{firstId}
</foreach>
</if>
<if test="(secondIdList != null and secondIdList.size() > 0) and (firstIdList == null or firstIdList.size() == 0)"><!-- 二类查询条件 -->
<foreach collection="secondIdList" item="secondId" open="AND iec.CATEGORY_ID IN (" separator="," close=")">
#{secondId}
</foreach>
</if>
<if test="(secondIdList != null and secondIdList.size() > 0) and (firstIdList != null and firstIdList.size() > 0)"><!-- 二类查询条件 -->
<foreach collection="firstIdList" item="firstId" open="AND (iec.CATEGORY_PIDS IN (" separator="," close=")">
#{firstId}
</foreach>
<foreach collection="secondIdList" item="secondId" open="OR iec.CATEGORY_ID IN (" separator="," close="))">
#{secondId}
</foreach>
</if>
order by ie.created_time desc, ie.latest_operated_time desc
</select>

17
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

@ -655,6 +655,8 @@
p.back_ground,
( CASE WHEN p.`STATUS` = 'pending' THEN '处理中' WHEN p.`STATUS` = 'closed' THEN '已结案' ELSE '' END ) AS status,
p.`status` AS statusValue,
( CASE WHEN p.CLOSED_STATUS = 'resolved' THEN '已解决' WHEN p.CLOSED_STATUS = 'unresolved' THEN '无需解决' ELSE '' END ) AS closedStatus,
p.CLOSED_STATUS AS closedStatusValue,
pc.category_pids,
pc.category_id,
pp.public_reply,
@ -671,16 +673,24 @@
group by project_id
ORDER BY created_time desc
)pc ON p.id = pc.project_id
<if test="firstIdList != null and firstIdList.size() > 0"><!-- 一类查询条件 -->
<if test="(firstIdList != null and firstIdList.size() > 0) and (secondIdList == null or secondIdList.size() == 0)"><!-- 一类查询条件 -->
<foreach collection="firstIdList" item="firstId" open="AND pc.category_pids IN (" separator="," close=")">
#{firstId}
</foreach>
</if>
<if test="secondIdList != null and secondIdList.size() > 0"><!-- 二类查询条件 -->
<if test="(secondIdList != null and secondIdList.size() > 0) and (firstIdList == null or firstIdList.size() == 0)"><!-- 二类查询条件 -->
<foreach collection="secondIdList" item="secondId" open="AND pc.category_id IN (" separator="," close=")">
#{secondId}
</foreach>
</if>
<if test="(secondIdList != null and secondIdList.size() > 0) and (firstIdList != null and firstIdList.size() > 0)"><!-- 二类查询条件 -->
<foreach collection="firstIdList" item="firstId" open="AND (pc.CATEGORY_PIDS IN (" separator="," close=")">
#{firstId}
</foreach>
<foreach collection="secondIdList" item="secondId" open="OR pc.CATEGORY_ID IN (" separator="," close="))">
#{secondId}
</foreach>
</if>
LEFT JOIN project_process pp ON p.id = pp.project_id AND pp.operation = 'close'
INNER JOIN project_process ppc ON p.id = ppc.project_id AND ppc.operation = 'created'
<if test="staffName != null and staffName != ''"><!-- 上报人姓名对应查询条件,上报人就是对应的创建节点的人 -->
@ -722,6 +732,9 @@
<if test="null != endTime and endTime != '' ">
AND p.created_time <![CDATA[ <= ]]> #{endTime}
</if>
<if test="closedStatus != null and closedStatus != ''">
AND p.CLOSED_STATUS = #{closedStatus}
</if>
</select>
<select id="getIndexExplainTreeByPid" resultType="com.epmet.dto.form.FileDTO"><!-- 项目创建节点的图片附件 -->
SELECT

Loading…
Cancel
Save