From 30bc5274884e0f6d11580f9d3af9e71d7a320888 Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期四, 24 八月 2023 19:03:10 +0800
Subject: [PATCH] bug

---
 ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/AgencyTaskRecordServiceImpl.java |  100 +++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 82 insertions(+), 18 deletions(-)

diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/AgencyTaskRecordServiceImpl.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/AgencyTaskRecordServiceImpl.java
index 5379e85..69c25ae 100644
--- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/AgencyTaskRecordServiceImpl.java
+++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/AgencyTaskRecordServiceImpl.java
@@ -3,6 +3,7 @@
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.shop.domain.dto.FileDto;
 import com.ruoyi.shop.domain.dto.MerAgencyTaskPageDto;
 import com.ruoyi.shop.domain.dto.MgtShopTaskPageDto;
 import com.ruoyi.shop.domain.dto.StaffAgencyPageDto;
@@ -54,23 +55,44 @@
         if(merAgencyTaskRecordPageVoList!=null&&!merAgencyTaskRecordPageVoList.isEmpty()){
             Long followId;
             List<TaskFile> taskFileList;
-            List<String> picture = new ArrayList<>();
-            List<String> video = new ArrayList<>();
-            List<String> audio = new ArrayList<>();
+            List<FileDto> picture = new ArrayList<>();
+            List<FileDto> video = new ArrayList<>();
+            List<FileDto> audio = new ArrayList<>();
             //获取跟进详情文件
             for(MerAgencyTaskRecordPageVo merAgencyTaskRecordPageVo : merAgencyTaskRecordPageVoList){
                 followId = merAgencyTaskRecordPageVo.getFollowId();
                 taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1);
                 if(taskFileList!=null&&!taskFileList.isEmpty()){
-                    picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList());
+                    picture = taskFileList.stream()
+                            .map(taskFile -> {
+                                FileDto fileDto = new FileDto();
+                                fileDto.setFileName(taskFile.getFileName());
+                                fileDto.setFileUrl(taskFile.getFileUrl());
+                                return fileDto;
+                            })
+                            .collect(Collectors.toList());
                 }
                 taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2);
                 if(taskFileList!=null&&!taskFileList.isEmpty()){
-                    video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList());
+                    video = taskFileList.stream()
+                            .map(taskFile -> {
+                                FileDto fileDto = new FileDto();
+                                fileDto.setFileName(taskFile.getFileName());
+                                fileDto.setFileUrl(taskFile.getFileUrl());
+                                return fileDto;
+                            })
+                            .collect(Collectors.toList());
                 }
                 taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3);
                 if(taskFileList!=null&&!taskFileList.isEmpty()){
-                    audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList());
+                    audio = taskFileList.stream()
+                            .map(taskFile -> {
+                                FileDto fileDto = new FileDto();
+                                fileDto.setFileName(taskFile.getFileName());
+                                fileDto.setFileUrl(taskFile.getFileUrl());
+                                return fileDto;
+                            })
+                            .collect(Collectors.toList());
                 }
                 merAgencyTaskRecordPageVo.setPicture(picture);
                 merAgencyTaskRecordPageVo.setVideo(video);
@@ -91,9 +113,9 @@
         if(mgtAgencyTaskRecordPageVoList!=null&&!mgtAgencyTaskRecordPageVoList.isEmpty()){
             Long followId;
             List<TaskFile> taskFileList;
-            List<String> picture = new ArrayList<>();
-            List<String> video = new ArrayList<>();
-            List<String> audio = new ArrayList<>();
+            List<FileDto> picture = new ArrayList<>();
+            List<FileDto> video = new ArrayList<>();
+            List<FileDto> audio = new ArrayList<>();
             Long userId;
             SysUser sysUser;
             for(MgtAgencyTaskRecordPageVo mgtAgencyTaskRecordPageVo : mgtAgencyTaskRecordPageVoList){
@@ -106,15 +128,36 @@
                 followId = mgtAgencyTaskRecordPageVo.getFollowId();
                 taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1);
                 if(taskFileList!=null&&!taskFileList.isEmpty()){
-                    picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList());
+                    picture = taskFileList.stream()
+                            .map(taskFile -> {
+                                FileDto fileDto = new FileDto();
+                                fileDto.setFileName(taskFile.getFileName());
+                                fileDto.setFileUrl(taskFile.getFileUrl());
+                                return fileDto;
+                            })
+                            .collect(Collectors.toList());
                 }
                 taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2);
                 if(taskFileList!=null&&!taskFileList.isEmpty()){
-                    video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList());
+                    video = taskFileList.stream()
+                            .map(taskFile -> {
+                                FileDto fileDto = new FileDto();
+                                fileDto.setFileName(taskFile.getFileName());
+                                fileDto.setFileUrl(taskFile.getFileUrl());
+                                return fileDto;
+                            })
+                            .collect(Collectors.toList());
                 }
                 taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3);
                 if(taskFileList!=null&&!taskFileList.isEmpty()){
-                    audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList());
+                    audio = taskFileList.stream()
+                            .map(taskFile -> {
+                                FileDto fileDto = new FileDto();
+                                fileDto.setFileName(taskFile.getFileName());
+                                fileDto.setFileUrl(taskFile.getFileUrl());
+                                return fileDto;
+                            })
+                            .collect(Collectors.toList());
                 }
                 mgtAgencyTaskRecordPageVo.setPicture(picture);
                 mgtAgencyTaskRecordPageVo.setVideo(video);
@@ -138,9 +181,9 @@
         if(agencyTaskRecordPageVoList!=null&&!agencyTaskRecordPageVoList.isEmpty()){
             Long followId;
             List<TaskFile> taskFileList;
-            List<String> picture = new ArrayList<>();
-            List<String> video = new ArrayList<>();
-            List<String> audio = new ArrayList<>();
+            List<FileDto> picture = new ArrayList<>();
+            List<FileDto> video = new ArrayList<>();
+            List<FileDto> audio = new ArrayList<>();
             Long userId;
             SysUser sysUser;
             for(StaffAgencyTaskRecordPageVo staffAgencyTaskRecordPageVo : agencyTaskRecordPageVoList){
@@ -153,15 +196,36 @@
                 followId = staffAgencyTaskRecordPageVo.getFollowId();
                 taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1);
                 if(taskFileList!=null&&!taskFileList.isEmpty()){
-                    picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList());
+                    picture = taskFileList.stream()
+                            .map(taskFile -> {
+                                FileDto fileDto = new FileDto();
+                                fileDto.setFileName(taskFile.getFileName());
+                                fileDto.setFileUrl(taskFile.getFileUrl());
+                                return fileDto;
+                            })
+                            .collect(Collectors.toList());
                 }
                 taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2);
                 if(taskFileList!=null&&!taskFileList.isEmpty()){
-                    video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList());
+                    video = taskFileList.stream()
+                            .map(taskFile -> {
+                                FileDto fileDto = new FileDto();
+                                fileDto.setFileName(taskFile.getFileName());
+                                fileDto.setFileUrl(taskFile.getFileUrl());
+                                return fileDto;
+                            })
+                            .collect(Collectors.toList());
                 }
                 taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3);
                 if(taskFileList!=null&&!taskFileList.isEmpty()){
-                    audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList());
+                    audio = taskFileList.stream()
+                            .map(taskFile -> {
+                                FileDto fileDto = new FileDto();
+                                fileDto.setFileName(taskFile.getFileName());
+                                fileDto.setFileUrl(taskFile.getFileUrl());
+                                return fileDto;
+                            })
+                            .collect(Collectors.toList());
                 }
                 staffAgencyTaskRecordPageVo.setPicture(picture);
                 staffAgencyTaskRecordPageVo.setVideo(video);

--
Gitblit v1.7.1