Browse Source

事件管理_详情

master
sunyuchao 3 years ago
parent
commit
f468a66ce9
  1. 11
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java
  2. 20
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java
  3. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  4. 7
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java
  5. 59
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  6. 50
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

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

@ -1,7 +1,10 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
@ -12,6 +15,14 @@ import java.io.Serializable;
public class IcEventListFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
public interface Detail extends CustomerClientShowGroup {
}
/**
* 事件ID
*/
@NotBlank(message = "事件ID不能为空", groups = Detail.class)
private String icEventId;
/**
* 所属网格
*/

20
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java

@ -1,9 +1,11 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@ -18,7 +20,7 @@ public class IcEventListResultDTO implements Serializable {
/**
* 事件Id
*/
private String eventId;
private String icEventId;
/**
* 网格ID
*/
@ -39,10 +41,23 @@ public class IcEventListResultDTO implements Serializable {
* 音频[url集合]
*/
private List<String> voiceList;
/**
* 分类Id
*/
private String categoryId;
/**
* 分类名称(医疗-二类名)
*/
private String categoryName;
/**
* 上报渠道[字典表]
*/
private String sourceType;
/**
* 发生时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date happenTime;
/**
* 上报渠道
*/
@ -70,7 +85,8 @@ public class IcEventListResultDTO implements Serializable {
/**
* 上报时间
*/
private String createdTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdTime;
/**
* 状态处理中processing已办结closed_case
*/

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java

@ -206,6 +206,16 @@ public class IcEventController {
return new Result();
}
/**
* @Author sun
* @Description 事件管理-评价
**/
@PostMapping("detail")
public Result<IcEventListResultDTO> detail(@RequestBody IcEventListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.Detail.class);
return new Result<IcEventListResultDTO>().ok(icEventService.detail(formDTO));
}
}

7
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java

@ -125,4 +125,11 @@ public interface IcEventService extends BaseService<IcEventEntity> {
* @Description 事件管理-评价
**/
void comment(IcEventReplyFormDTO formDTO);
/**
* @Author sun
* @Description 事件管理-评价
**/
IcEventListResultDTO detail(IcEventListFormDTO formDTO);
}

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

@ -102,7 +102,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
List<AllGridsByUserIdResultDTO> gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>();
Map<String, String> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2));
//与户主关系字典表数据
//事件管理字典表数据
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<>();
@ -690,5 +690,62 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
baseDao.updateById(entity);
}
/**
* @Author sun
* @Description 事件管理-评价
**/
@Override
public IcEventListResultDTO detail(IcEventListFormDTO formDTO) {
IcEventListResultDTO resultDTO = new IcEventListResultDTO();
//1.获取事件基本信息
List<IcEventListResultDTO> list = baseDao.icEventList(formDTO);
if (!CollectionUtils.isEmpty(list)) {
resultDTO = list.get(0);
//查询网格名称(组织-网格)
List<String> gridIds = list.stream().map(IcEventListResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
Result<List<AllGridsByUserIdResultDTO>> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds);
List<AllGridsByUserIdResultDTO> gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>();
Map<String, String> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2));
//事件管理字典表数据
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<>();
//封装数据
if (gridInfoMap.containsKey(resultDTO.getGridId())) {
resultDTO.setGridName(gridInfoMap.get(resultDTO.getGridId()));
}
if (StringUtils.isNotBlank(resultDTO.getSourceType())) {
resultDTO.setSourceTypeName(statusMap.get(resultDTO.getSourceType()));
}
//每个事件对应的图片数据
List<String> imageList = new ArrayList<>();
List<String> voiceList = new ArrayList<>();
resultDTO.getAttachmentList().forEach(file -> {
if ("image".equals(file.getType())) {
imageList.add(file.getUrl());
} else if ("voice".equals(file.getType())) {
voiceList.add(file.getUrl());
}
});
resultDTO.setImageList(imageList);
resultDTO.setVoiceList(voiceList);
//分类信息
if(StringUtils.isNotBlank(resultDTO.getCategoryId())){
List<String> categoryList = new ArrayList<>();
categoryList.add(resultDTO.getCategoryId());
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList);
for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){
if (ca.getId().equals(resultDTO.getCategoryId())) {
resultDTO.setCategoryName(ca.getParentCategoryName()+"-"+ca.getCategoryName());
}
}
}
}
return resultDTO;
}
}

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

@ -3,27 +3,6 @@
<mapper namespace="com.epmet.dao.IcEventDao">
<resultMap id="icEventMap" type="com.epmet.dto.result.IcEventListResultDTO">
<id property="eventId" column="id"/>
<result property="gridId" column="grid_id"/>
<result property="sourceType" column="source_type" />
<result property="address" column="address" />
<result property="name" column="name" />
<result property="mobile" column="mobile" />
<result property="satisfaction" column="satisfaction" />
<result property="satisfactionName" column="satisfaction" />
<result property="createdTime" column="created_time" />
<result property="status" column="status" />
<result property="createdUserId" column="created_by" />
<collection property="attachmentList" ofType="com.epmet.dto.result.IcEventListResultDTO$Attachment">
<result column="icEventAttachmentId"/><!-- 附件表ID,如果附件url和type一样会被去重 加上id就可以了 -->
<result column="url" property="url"/>
<result column="type" property="type"/>
<result column="duration" property="duration"/>
</collection>
</resultMap>
<select id="getProcessStatusRatio" resultType="java.util.Map">
select STATUS status, count(1) eventCount
from ic_event e
@ -90,9 +69,29 @@
</select>
<resultMap id="icEventMap" type="com.epmet.dto.result.IcEventListResultDTO">
<id property="icEventId" column="id"/>
<result property="gridId" column="grid_id"/>
<result property="sourceType" column="source_type" />
<result property="address" column="address" />
<result property="name" column="name" />
<result property="mobile" column="mobile" />
<result property="satisfaction" column="satisfaction" />
<result property="satisfactionName" column="satisfaction" />
<result property="createdTime" column="created_time" />
<result property="status" column="status" />
<result property="createdUserId" column="created_by" />
<result property="categoryId" column="CATEGORY_ID" />
<collection property="attachmentList" ofType="com.epmet.dto.result.IcEventListResultDTO$Attachment">
<result column="icEventAttachmentId"/><!-- 附件表ID,如果附件url和type一样会被去重 加上id就可以了 -->
<result column="url" property="url"/>
<result column="type" property="type"/>
<result column="duration" property="duration"/>
</collection>
</resultMap>
<select id="icEventList" parameterType="map" resultMap="icEventMap">
SELECT
ie.id eventId,
ie.id icEventId,
ie.grid_id gridId,
ie.event_content eventContent,
ie.source_type sourceType,
@ -108,12 +107,17 @@
rea.id AS iceventattachmentid,
rea.attachment_url AS url,
rea.attachment_type AS type,
rea.duration AS duration
rea.duration AS duration,
iec.category_id AS categoryId
FROM
ic_event ie
LEFT JOIN ic_event_attachment rea ON(ie.id = rea.ic_event_id AND rea.del_flag = '0')
LEFT JOIN ic_event_category iec ON(ie.id = iec.ic_event_id AND iec.del_flag = '0')
WHERE
ie.del_flag = '0'
<if test="icEventId != null and icEventId != '' ">
AND ie.id = #{icEventId}
</if>
<if test="gridId != null and gridId != '' ">
AND ie.grid_id = #{gridId}
</if>

Loading…
Cancel
Save