| | |
| | | |
| | | 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; |
| | | import com.ruoyi.shop.domain.pojo.task.AgencyTaskRecord; |
| | | import com.ruoyi.shop.domain.pojo.task.TaskFile; |
| | | import com.ruoyi.shop.domain.vo.MerAgencyTaskRecordPageVo; |
| | | import com.ruoyi.shop.domain.vo.MerMemberTaskRecordPageVo; |
| | | import com.ruoyi.shop.domain.vo.MgtAgencyTaskRecordPageVo; |
| | | import com.ruoyi.shop.domain.vo.MgtMemberFollowPageVo; |
| | | import com.ruoyi.shop.domain.vo.StaffAgencyTaskRecordPageVo; |
| | | import com.ruoyi.shop.mapper.task.AgencyTaskRecordMapper; |
| | | import com.ruoyi.shop.service.task.AgencyTaskRecordService; |
| | | import com.ruoyi.shop.service.task.TaskFileService; |
| | | import com.ruoyi.shop.util.FileConvertUtils; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.api.service.RemoteUserService; |
| | | 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; |
| | | |
| | | /** |
| | |
| | | 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); |
| | |
| | | |
| | | /** |
| | | * 平台分页获取代理商跟进任务 |
| | | * @param page |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MgtAgencyTaskRecordPageVo> pageMgtAgencyFollow(Page page, MgtShopTaskPageDto mgtShopTaskPageDto){ |
| | | List<MgtAgencyTaskRecordPageVo> mgtAgencyTaskRecordPageVoList = agencyTaskRecordMapper.pageMgtAgencyFollow(page, mgtShopTaskPageDto); |
| | | public List<MgtAgencyTaskRecordPageVo> pageMgtAgencyFollow(MgtShopTaskPageDto mgtShopTaskPageDto){ |
| | | List<MgtAgencyTaskRecordPageVo> mgtAgencyTaskRecordPageVoList = agencyTaskRecordMapper.pageMgtAgencyFollow(mgtShopTaskPageDto); |
| | | 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){ |
| | |
| | | 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); |
| | |
| | | } |
| | | return mgtAgencyTaskRecordPageVoList; |
| | | } |
| | | |
| | | /** |
| | | * @description 员工端分页获取经销商跟进任务记录列表 |
| | | * @author jqs |
| | | * @date 2023/7/14 19:24 |
| | | * @param page |
| | | * @param staffAgencyPageDto |
| | | * @return List<StaffAgencyTaskRecordPageVo> |
| | | */ |
| | | @Override |
| | | public List<StaffAgencyTaskRecordPageVo> pageStaffAgencyTaskRecord(Page page, StaffAgencyPageDto staffAgencyPageDto){ |
| | | List<StaffAgencyTaskRecordPageVo> agencyTaskRecordPageVoList = agencyTaskRecordMapper.pageStaffAgencyTaskRecord(page, staffAgencyPageDto); |
| | | if(agencyTaskRecordPageVoList!=null&&!agencyTaskRecordPageVoList.isEmpty()){ |
| | | Long followId; |
| | | List<TaskFile> taskFileList; |
| | | List<FileDto> picture = new ArrayList<>(); |
| | | List<FileDto> video = new ArrayList<>(); |
| | | List<FileDto> audio = new ArrayList<>(); |
| | | Long userId; |
| | | SysUser sysUser; |
| | | for(StaffAgencyTaskRecordPageVo staffAgencyTaskRecordPageVo : agencyTaskRecordPageVoList){ |
| | | //获取任务用户信息 |
| | | userId = staffAgencyTaskRecordPageVo.getUserId(); |
| | | sysUser = remoteUserService.getSysUser(userId).getData(); |
| | | staffAgencyTaskRecordPageVo.setUserName(sysUser.getNickName()); |
| | | staffAgencyTaskRecordPageVo.setUserPicture(sysUser.getAvatar()); |
| | | //获取任务详情文件 |
| | | followId = staffAgencyTaskRecordPageVo.getFollowId(); |
| | | taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1); |
| | | if(taskFileList!=null&&!taskFileList.isEmpty()){ |
| | | 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(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(taskFile -> { |
| | | FileDto fileDto = new FileDto(); |
| | | fileDto.setFileName(taskFile.getFileName()); |
| | | fileDto.setFileUrl(taskFile.getFileUrl()); |
| | | return fileDto; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | staffAgencyTaskRecordPageVo.setPicture(picture); |
| | | staffAgencyTaskRecordPageVo.setVideo(video); |
| | | staffAgencyTaskRecordPageVo.setAudio(audio); |
| | | } |
| | | } |
| | | |
| | | return agencyTaskRecordPageVoList; |
| | | } |
| | | |
| | | |
| | | } |