Browse Source

最新直报返参附件类型分为图片和语音

master
sunyuchao 4 years ago
parent
commit
ab8e163a9d
  1. 22
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java
  2. 24
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.java
  3. 28
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
  4. 15
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml
  5. 13
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml

22
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.result; package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -31,4 +32,25 @@ public class NewEventsResultDTO implements Serializable {
private List<String> eventImgs; private List<String> eventImgs;
private String eventId; private String eventId;
/**
* 语音附件url集合
*/
private List<String> voiceList;
/**
* 事件附件
*/
@JsonIgnore
private List<EventDetailResultDTO.Attachment> attachmentList;
@Data
public static class Attachment {
/**
* url
*/
private String url;
/**
* 附件类型
*/
private String type;
}
} }

24
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UserMentionResultDTO.java

@ -1,6 +1,7 @@
package com.epmet.dto.result; package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -58,4 +59,27 @@ public class UserMentionResultDTO implements Serializable {
*/ */
private String replyButtonFlag; private String replyButtonFlag;
/**
* 语音附件url集合
*/
private List<String> voiceList;
/**
* 事件附件
*/
@JsonIgnore
private List<EventDetailResultDTO.Attachment> attachmentList;
@Data
public static class Attachment {
/**
* url
*/
private String url;
/**
* 附件类型
*/
private String type;
}
} }

28
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

@ -627,6 +627,19 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
formDTO.getPageSize()).doSelectPageInfo(() -> resiEventMentionDao.selectMentionList(formDTO.getUserId(), formDTO.getPageSize()).doSelectPageInfo(() -> resiEventMentionDao.selectMentionList(formDTO.getUserId(),
formDTO.getReadFlag())); formDTO.getReadFlag()));
result.getList().forEach(dto->{ result.getList().forEach(dto->{
//附件按类型分组【图片、语音】
List<String> imgList = new ArrayList<>();
List<String> voiceList = new ArrayList<>();
dto.getAttachmentList().forEach(file -> {
if ("image".equals(file.getType())) {
imgList.add(file.getUrl());
} else if ("voice".equals(file.getType())) {
voiceList.add(file.getUrl());
}
});
dto.setImgList(imgList);
dto.setVoiceList(voiceList);
if(dto.getShiftProject()||dto.getStatus().equals(EventConstant.EVENT_STATUS_CLOSED_CASE)){ if(dto.getShiftProject()||dto.getStatus().equals(EventConstant.EVENT_STATUS_CLOSED_CASE)){
// 立项和办结了不能回复哈。 // 立项和办结了不能回复哈。
dto.setReplyButtonFlag("false"); dto.setReplyButtonFlag("false");
@ -652,6 +665,21 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
List<String> orgIds = listResult.getData(); List<String> orgIds = listResult.getData();
if (!CollectionUtils.isEmpty(orgIds)){ if (!CollectionUtils.isEmpty(orgIds)){
List<NewEventsResultDTO> result = baseDao.newEvents(orgIds); List<NewEventsResultDTO> result = baseDao.newEvents(orgIds);
//附件按类型分组【图片、语音】
result.forEach(re->{
List<String> eventImgs = new ArrayList<>();
List<String> voiceList = new ArrayList<>();
re.getAttachmentList().forEach(file->{
if ("image".equals(file.getType())) {
eventImgs.add(file.getUrl());
} else if ("voice".equals(file.getType())) {
voiceList.add(file.getUrl());
}
});
re.setEventImgs(eventImgs);
re.setVoiceList(voiceList);
});
return result; return result;
} }
return new ArrayList<>(); return new ArrayList<>();

15
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml

@ -31,7 +31,7 @@
(CASE WHEN re.SHIFT_PROJECT = 1 THEN TRUE ELSE FALSE END) AS isProject, (CASE WHEN re.SHIFT_PROJECT = 1 THEN TRUE ELSE FALSE END) AS isProject,
(CASE WHEN ro.RED_DOT = 1 THEN TRUE ELSE FALSE END) AS redDot (CASE WHEN ro.RED_DOT = 1 THEN TRUE ELSE FALSE END) AS redDot
FROM resi_event_report_org ro FROM resi_event_report_org ro
INNER JOIN resi_event re ON (ro.RESI_EVENT_ID = re.ID AND re.DEL_FLAG = '0') INNER JOIN resi_event re ON (ro.RESI_EVENT_ID = re.ID AND re.DEL_FLAG = '0' AND re.audit_status = 'auto_passed')
AND ro.DEL_FLAG = '0' AND ro.DEL_FLAG = '0'
and ro.ORG_ID = #{orgId} and ro.ORG_ID = #{orgId}
<if test='eventType == "undisposed" '> <if test='eventType == "undisposed" '>
@ -185,18 +185,23 @@
<result property="eventContent" column="eventContent"/> <result property="eventContent" column="eventContent"/>
<result property="eventTime" column="eventTime"/> <result property="eventTime" column="eventTime"/>
<result property="eventId" column="eventId"/> <result property="eventId" column="eventId"/>
<collection property="eventImgs" ofType="java.lang.String"> <collection property="attachmentList" ofType="com.epmet.dto.result.NewEventsResultDTO$Attachment">
<result column="img"/> <result column="url" property="url"/>
<result column="type" property="type"/>
</collection> </collection>
<!--<collection property="eventImgs" ofType="java.lang.String">
<result column="img"/>
</collection>-->
</resultMap> </resultMap>
<select id="newEvents" resultMap="newEventsMap"> <select id="newEvents" resultMap="newEventsMap">
SELECT SELECT
IFNULL(re.EVENT_CONTENT,'') AS eventContent, IFNULL(re.EVENT_CONTENT,'') AS eventContent,
DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i') AS eventTime, DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i') AS eventTime,
ea.ATTACHMENT_URL AS img, ea.attachment_url AS url,
ea.attachment_type AS type,
re.id as eventId re.id as eventId
FROM resi_event_report_org ro FROM resi_event_report_org ro
LEFT JOIN resi_event re ON (re.ID = ro.RESI_EVENT_ID AND re.DEL_FLAG = '0') LEFT JOIN resi_event re ON (re.ID = ro.RESI_EVENT_ID AND re.DEL_FLAG = '0' AND re.audit_status = 'auto_passed')
LEFT JOIN resi_event_attachment ea ON (ea.RESI_EVENT_ID = ro.RESI_EVENT_ID AND ea.DEL_FLAG = '0' AND LEFT JOIN resi_event_attachment ea ON (ea.RESI_EVENT_ID = ro.RESI_EVENT_ID AND ea.DEL_FLAG = '0' AND
ea.ATTACHMENT_TYPE = 'image' AND ea.SORT IN (3,1,2)) ea.ATTACHMENT_TYPE = 'image' AND ea.SORT IN (3,1,2))
WHERE ro.DEL_FLAG = '0' WHERE ro.DEL_FLAG = '0'

13
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml

@ -10,11 +10,15 @@
<result property="status" column="STATUS" /> <result property="status" column="STATUS" />
<result property="shiftProject" column="SHIFT_PROJECT" /> <result property="shiftProject" column="SHIFT_PROJECT" />
<result property="showTime" column="LATEST_OPERATED_TIME" /> <result property="showTime" column="LATEST_OPERATED_TIME" />
<collection property="imgList" ofType="java.lang.String"> <collection property="attachmentList" ofType="com.epmet.dto.result.UserMentionResultDTO$Attachment">
<result column="url" property="url"/>
<result column="type" property="type"/>
</collection>
<!--<collection property="imgList" ofType="java.lang.String">
<constructor> <constructor>
<arg column="img_url"/> <arg column="img_url"/>
</constructor> </constructor>
</collection> </collection>-->
</resultMap> </resultMap>
<select id="selectMentionList" parameterType="map" resultMap="UserMentionResultDTOMap"> <select id="selectMentionList" parameterType="map" resultMap="UserMentionResultDTOMap">
@ -29,11 +33,12 @@
re.`STATUS`, re.`STATUS`,
re.SHIFT_PROJECT, re.SHIFT_PROJECT,
re.LATEST_OPERATED_TIME, re.LATEST_OPERATED_TIME,
rea.ATTACHMENT_URL as img_url rea.attachment_url AS url,
rea.attachment_type AS type
FROM FROM
resi_event_mention rem resi_event_mention rem
LEFT JOIN resi_event re LEFT JOIN resi_event re
ON ( rem.RESI_EVENT_ID = re.id ) ON ( rem.RESI_EVENT_ID = re.id AND re.audit_status = 'auto_passed')
LEFT JOIN resi_event_attachment rea LEFT JOIN resi_event_attachment rea
ON ( re.id = rea.RESI_EVENT_ID ON ( re.id = rea.RESI_EVENT_ID
AND rea.DEL_FLAG = '0' AND rea.DEL_FLAG = '0'

Loading…
Cancel
Save