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/ShopTaskRecordServiceImpl.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/ShopTaskRecordServiceImpl.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/ShopTaskRecordServiceImpl.java index 2917a4c..c10086e 100644 --- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/ShopTaskRecordServiceImpl.java +++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/ShopTaskRecordServiceImpl.java @@ -2,6 +2,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.MgtShopTaskPageDto; import com.ruoyi.shop.domain.dto.StaffShopTaskPageDto; import com.ruoyi.shop.domain.pojo.task.ShopTaskRecord; @@ -50,9 +51,9 @@ if(mgtShopTaskRecordPageVoList!=null&&!mgtShopTaskRecordPageVoList.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(MgtShopTaskRecordPageVo mgtShopTaskRecordPageVo : mgtShopTaskRecordPageVoList){ @@ -65,15 +66,36 @@ followId = mgtShopTaskRecordPageVo.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()); } mgtShopTaskRecordPageVo.setPicture(picture); mgtShopTaskRecordPageVo.setVideo(video); @@ -97,9 +119,9 @@ if(myShopTaskRecordPageVoList!=null&&!myShopTaskRecordPageVoList.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(StaffMyShopTaskRecordPageVo staffMyShopTaskRecordPageVo : myShopTaskRecordPageVoList){ @@ -112,15 +134,36 @@ followId = staffMyShopTaskRecordPageVo.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()); } staffMyShopTaskRecordPageVo.setPicture(picture); staffMyShopTaskRecordPageVo.setVideo(video); @@ -144,9 +187,9 @@ if(myShopTaskRecordPageVoList!=null&&!myShopTaskRecordPageVoList.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(StaffMyShopTaskRecordPageVo staffMyShopTaskRecordPageVo : myShopTaskRecordPageVoList){ @@ -159,15 +202,36 @@ followId = staffMyShopTaskRecordPageVo.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()); } staffMyShopTaskRecordPageVo.setPicture(picture); staffMyShopTaskRecordPageVo.setVideo(video); -- Gitblit v1.7.1