| | |
| | | import com.ruoyi.shop.service.task.MemberTaskRecordService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.shop.service.task.TaskFileService; |
| | | import com.ruoyi.shop.util.FileConvertUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.StringJoiner; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | if(merMemberTaskRecordPageVoList!=null&&!merMemberTaskRecordPageVoList.isEmpty()){ |
| | | Long followId; |
| | | List<TaskFile> taskFileList; |
| | | String picture; |
| | | String video; |
| | | String audio; |
| | | List<String> picture = new ArrayList<>(); |
| | | List<String> video = new ArrayList<>(); |
| | | List<String> audio = new ArrayList<>(); |
| | | for(MerMemberTaskRecordPageVo merMemberTaskRecordPageVo : merMemberTaskRecordPageVoList){ |
| | | followId = merMemberTaskRecordPageVo.getFollowId(); |
| | | taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1); |
| | | picture = convertFileListToString(taskFileList); |
| | | if(taskFileList!=null&&!taskFileList.isEmpty()){ |
| | | picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); |
| | | } |
| | | taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2); |
| | | video = convertFileListToString(taskFileList); |
| | | if(taskFileList!=null&&!taskFileList.isEmpty()){ |
| | | video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); |
| | | } |
| | | taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3); |
| | | audio = convertFileListToString(taskFileList); |
| | | if(taskFileList!=null&&!taskFileList.isEmpty()){ |
| | | audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); |
| | | } |
| | | merMemberTaskRecordPageVo.setPicture(picture); |
| | | merMemberTaskRecordPageVo.setVideo(video); |
| | | merMemberTaskRecordPageVo.setAudio(audio); |
| | |
| | | return merMemberTaskRecordPageVoList; |
| | | } |
| | | |
| | | private String convertFileListToString(List<TaskFile> taskFileList){ |
| | | StringJoiner sj = new StringJoiner(","); |
| | | if(taskFileList!=null&&!taskFileList.isEmpty()){ |
| | | for(TaskFile taskFile : taskFileList){ |
| | | sj.add(taskFile.getFileUrl()); |
| | | } |
| | | return sj.toString(); |
| | | }else{ |
| | | return null; |
| | | } |
| | | } |
| | | } |