Browse Source

事件详情语音附件加返参

master
sunyuchao 4 years ago
parent
commit
6d16cc034d
  1. 8
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java
  2. 5
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java
  3. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
  4. 3
      epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.18__alter.sql
  5. 2
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml

8
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.dto.EventProjectInfoDTO;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
@ -79,7 +80,7 @@ public class EventDetailResultDTO implements Serializable {
/**
* 语音附件url集合
*/
private List<String> voiceList;
private List<FileCommonDTO> voiceList;
/**
* 事件附件
*/
@ -127,5 +128,10 @@ public class EventDetailResultDTO implements Serializable {
* 附件类型
*/
private String type;
/**
* 附件类型
*/
private Integer duration;
}
}

5
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventAttachmentEntity.java

@ -89,4 +89,9 @@ public class ResiEventAttachmentEntity extends BaseEpmetEntity {
*/
private String reason;
/**
* 语音或视频时长
* */
private Integer duration;
}

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

@ -216,12 +216,15 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
}
//附件按类型分组【图片、语音】
List<String> eventImgs = new ArrayList<>();
List<String> voiceList = new ArrayList<>();
List<FileCommonDTO> voiceList = new ArrayList<>();
dto.getAttachmentList().forEach(file->{
if("image".equals(file.getType())){
eventImgs.add(file.getUrl());
}else if("voice".equals(file.getType())){
voiceList.add(file.getUrl());
FileCommonDTO fl = new FileCommonDTO();
fl.setUrl(file.getUrl());
fl.setDuration(file.getDuration());
voiceList.add(fl);
}
});
dto.setEventImgs(eventImgs);
@ -350,6 +353,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
entity.setAttachmentUrl(file.getUrl());
entity.setSort(sort);
entity.setStatus(TopicConstant.AUDITING);
entity.setDuration(file.getDuration());
sort++;
resiEventAttachmentDao.insert(entity);

3
epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.18__alter.sql

@ -0,0 +1,3 @@
ALTER TABLE `resi_event_attachment`
ADD COLUMN `DURATION` int(11) NULL DEFAULT NULL COMMENT '语音或视频时长,秒' AFTER `REASON`;

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

@ -134,6 +134,7 @@
<result column="resiEventAttachmentId"/><!-- 附件表ID,如果附件url和type一样会被去重 加上id就可以了 -->
<result column="url" property="url"/>
<result column="type" property="type"/>
<result column="duration" property="duration"/>
</collection>
<collection property="eventPerson" ofType="java.lang.String">
<result column="person"/>
@ -155,6 +156,7 @@
ea.id AS resiEventAttachmentId,
ea.ATTACHMENT_URL AS url,
ea.ATTACHMENT_TYPE AS type,
ea.duration AS duration,
IF(ISNULL(em.USER_SHOW_NAME),NULL,concat('人大代表-',em.USER_SHOW_NAME)) AS person,
re.GRID_ID AS gridId,
re.CREATED_BY AS eventUserId,

Loading…
Cancel
Save