| | |
| | | |
| | | 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; |
| | | import com.ruoyi.shop.domain.pojo.task.TaskFile; |
| | | import com.ruoyi.shop.domain.vo.MgtShopTaskRecordPageVo; |
| | | import com.ruoyi.shop.domain.vo.StaffAgencyTaskRecordPageVo; |
| | | import com.ruoyi.shop.domain.vo.StaffMyShopTaskRecordPageVo; |
| | | import com.ruoyi.shop.mapper.task.ShopTaskRecordMapper; |
| | | import com.ruoyi.shop.service.task.ShopTaskRecordService; |
| | | import com.ruoyi.shop.service.task.TaskFileService; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysStaff; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.api.service.RemoteConfigService; |
| | | import com.ruoyi.system.api.service.RemoteUserService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private TaskFileService taskFileService; |
| | | |
| | | @Resource |
| | | private RemoteUserService remoteUserService; |
| | | private RemoteConfigService remoteConfigService; |
| | | |
| | | /** |
| | | * 平台分页获取平台跟进任务 |
| | |
| | | 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; |
| | | SysStaff sysStaff; |
| | | HashSet<Long> userIdSet = new HashSet<>(); |
| | | for(MgtShopTaskRecordPageVo mgtShopTaskRecordPageVo : mgtShopTaskRecordPageVoList){ |
| | | userIdSet.add(mgtShopTaskRecordPageVo.getUserId()); |
| | | } |
| | | List<Long> useIdList = new ArrayList<>(userIdSet); |
| | | List<SysStaff> sysStaffList = remoteConfigService.listSysStaffByIds(useIdList).getData(); |
| | | Map<Long,SysStaff> sysStaffMap = sysStaffList.stream() |
| | | .collect(Collectors.toMap(SysStaff::getUserId, Function.identity())); |
| | | for(MgtShopTaskRecordPageVo mgtShopTaskRecordPageVo : mgtShopTaskRecordPageVoList){ |
| | | //获取任务用户信息 |
| | | userId = mgtShopTaskRecordPageVo.getUserId(); |
| | | sysUser = remoteUserService.getSysUser(userId).getData(); |
| | | mgtShopTaskRecordPageVo.setUserName(sysUser.getNickName()); |
| | | mgtShopTaskRecordPageVo.setUserPicture(sysUser.getAvatar()); |
| | | sysStaff = sysStaffMap.get(userId); |
| | | if(sysStaff!=null){ |
| | | mgtShopTaskRecordPageVo.setUserName(sysStaff.getStaffName()); |
| | | mgtShopTaskRecordPageVo.setUserPicture(sysStaff.getStaffAvatar()); |
| | | mgtShopTaskRecordPageVo.setUserPosition(sysStaff.getStaffPost()); |
| | | } |
| | | //获取任务详情文件 |
| | | 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); |
| | |
| | | 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; |
| | | SysStaff sysStaff; |
| | | HashSet<Long> userIdSet = new HashSet<>(); |
| | | for(StaffMyShopTaskRecordPageVo staffMyShopTaskRecordPageVo : myShopTaskRecordPageVoList){ |
| | | userIdSet.add(staffMyShopTaskRecordPageVo.getUserId()); |
| | | } |
| | | List<Long> useIdList = new ArrayList<>(userIdSet); |
| | | List<SysStaff> sysStaffList = remoteConfigService.listSysStaffByIds(useIdList).getData(); |
| | | Map<Long,SysStaff> sysStaffMap = sysStaffList.stream() |
| | | .collect(Collectors.toMap(SysStaff::getUserId, Function.identity())); |
| | | for(StaffMyShopTaskRecordPageVo staffMyShopTaskRecordPageVo : myShopTaskRecordPageVoList){ |
| | | //获取任务用户信息 |
| | | userId = staffMyShopTaskRecordPageVo.getUserId(); |
| | | sysUser = remoteUserService.getSysUser(userId).getData(); |
| | | staffMyShopTaskRecordPageVo.setUserName(sysUser.getNickName()); |
| | | staffMyShopTaskRecordPageVo.setUserPicture(sysUser.getAvatar()); |
| | | sysStaff = sysStaffMap.get(userId); |
| | | if(sysStaff!=null){ |
| | | staffMyShopTaskRecordPageVo.setUserName(sysStaff.getStaffName()); |
| | | staffMyShopTaskRecordPageVo.setUserPicture(sysStaff.getStaffAvatar()); |
| | | staffMyShopTaskRecordPageVo.setUserPosition(sysStaff.getStaffPost()); |
| | | } |
| | | //获取任务详情文件 |
| | | 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); |
| | |
| | | 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; |
| | | SysStaff sysStaff; |
| | | HashSet<Long> userIdSet = new HashSet<>(); |
| | | for(StaffMyShopTaskRecordPageVo staffMyShopTaskRecordPageVo : myShopTaskRecordPageVoList){ |
| | | userIdSet.add(staffMyShopTaskRecordPageVo.getUserId()); |
| | | } |
| | | List<Long> useIdList = new ArrayList<>(userIdSet); |
| | | List<SysStaff> sysStaffList = remoteConfigService.listSysStaffByIds(useIdList).getData(); |
| | | Map<Long,SysStaff> sysStaffMap = sysStaffList.stream() |
| | | .collect(Collectors.toMap(SysStaff::getUserId, Function.identity())); |
| | | for(StaffMyShopTaskRecordPageVo staffMyShopTaskRecordPageVo : myShopTaskRecordPageVoList){ |
| | | //获取任务用户信息 |
| | | userId = staffMyShopTaskRecordPageVo.getUserId(); |
| | | sysUser = remoteUserService.getSysUser(userId).getData(); |
| | | staffMyShopTaskRecordPageVo.setUserName(sysUser.getNickName()); |
| | | staffMyShopTaskRecordPageVo.setUserPicture(sysUser.getAvatar()); |
| | | sysStaff = sysStaffMap.get(userId); |
| | | if(sysStaff!=null){ |
| | | staffMyShopTaskRecordPageVo.setUserName(sysStaff.getStaffName()); |
| | | staffMyShopTaskRecordPageVo.setUserPicture(sysStaff.getStaffAvatar()); |
| | | staffMyShopTaskRecordPageVo.setUserPosition(sysStaff.getStaffPost()); |
| | | } |
| | | //获取任务详情文件 |
| | | 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); |