Browse Source

话题语音

master
zhaoqifeng 5 years ago
parent
commit
eb863ab503
  1. 8
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateTopicFormDTO.java
  2. 24
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/FileDTO.java
  3. 36
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java

8
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateTopicFormDTO.java

@ -62,17 +62,17 @@ public class CreateTopicFormDTO implements Serializable {
/**
* 图片附件
*/
private List<String> imageList;
private List<FileDTO> imageList;
/**
* 文件附件
*/
private List<String> docList;
private List<FileDTO> docList;
/**
* 语音附件
*/
private List<String> voiceList;
private List<FileDTO> voiceList;
/**
* 视频附件
*/
private List<String> videoList;
private List<FileDTO> videoList;
}

24
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/FileDTO.java

@ -0,0 +1,24 @@
package com.epmet.resi.group.dto.topic.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/12/24 14:09
*/
@NoArgsConstructor
@Data
public class FileDTO implements Serializable {
private static final long serialVersionUID = -3930520724652521552L;
private String name;
private String url;
private String type;
private String format;
private Integer size;
private Integer duration;
}

36
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java

@ -279,18 +279,18 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
if(CollectionUtils.isNotEmpty(formDTO.getImageList())){
TopicDraftAttachmentDTO attachment = new TopicDraftAttachmentDTO();
int sort = 0;
for(String url : formDTO.getImageList()){
attachment.setAttachmentUrl(url);
for(FileDTO file : formDTO.getImageList()){
attachment.setAttachmentUrl(file.getUrl());
attachment.setTopicDraftId(topic.getId());
attachment.setCreatedBy(tokenDto.getUserId());
attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase());
attachment.setAttachmentFormat(file.getUrl().substring(file.getUrl().lastIndexOf(".") + NumConstant.ONE).toLowerCase());
attachment.setSort(sort++);
attachment.setAttachmentType("image");
topicDraftAttachmentService.save(attachment);
ImgTaskDTO task = new ImgTaskDTO();
task.setDataId(attachment.getId());
task.setUrl(url);
task.setUrl(file.getUrl());
imageDTOList.add(task);
}
}
@ -298,18 +298,18 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
if(CollectionUtils.isNotEmpty(formDTO.getVideoList())){
TopicDraftAttachmentDTO attachment = new TopicDraftAttachmentDTO();
int sort = 0;
for(String url : formDTO.getVideoList()){
attachment.setAttachmentUrl(url);
for(FileDTO file : formDTO.getVideoList()){
attachment.setAttachmentUrl(file.getUrl());
attachment.setTopicDraftId(topic.getId());
attachment.setCreatedBy(tokenDto.getUserId());
attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase());
attachment.setAttachmentFormat(file.getUrl().substring(file.getUrl().lastIndexOf(".") + NumConstant.ONE).toLowerCase());
attachment.setSort(sort++);
attachment.setAttachmentType("voice");
topicDraftAttachmentService.save(attachment);
VoiceTaskDTO task = new VoiceTaskDTO();
task.setDataId(attachment.getId());
task.setUrl(url);
task.setUrl(file.getUrl());
voiceDTOList.add(task);
}
}
@ -671,17 +671,31 @@ public class TopicDraftServiceImpl extends BaseServiceImpl<TopicDraftDao, TopicD
if(CollectionUtils.isNotEmpty(formDTO.getImageList())){
ResiTopicAttachmentEntity attachment = new ResiTopicAttachmentEntity();
int sort = 0;
for(String url : formDTO.getImageList()){
attachment.setAttachmentUrl(url);
for(FileDTO file : formDTO.getImageList()){
attachment.setAttachmentUrl(file.getUrl());
attachment.setTopicId(topic.getId());
attachment.setCreatedBy(tokenDto.getUserId());
attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase());
attachment.setAttachmentFormat(file.getUrl().substring(file.getUrl().lastIndexOf(".") + NumConstant.ONE).toLowerCase());
attachment.setSort(sort++);
attachment.setAttachmentType("image");
resiTopicAttachmentDao.insertOne(attachment);
}
}
if(CollectionUtils.isNotEmpty(formDTO.getVoiceList())){
ResiTopicAttachmentEntity attachment = new ResiTopicAttachmentEntity();
int sort = 0;
for(FileDTO file : formDTO.getVoiceList()){
attachment.setAttachmentUrl(file.getUrl());
attachment.setTopicId(topic.getId());
attachment.setCreatedBy(tokenDto.getUserId());
attachment.setAttachmentFormat(file.getUrl().substring(file.getUrl().lastIndexOf(".") + NumConstant.ONE).toLowerCase());
attachment.setSort(sort++);
attachment.setAttachmentType("voice");
resiTopicAttachmentDao.insertOne(attachment);
}
}
//3.话题操作记录
ResiTopicOperationEntity operation = new ResiTopicOperationEntity();
operation.setTopicId(topic.getId());

Loading…
Cancel
Save