fix 嘉宾上传文件

This commit is contained in:
lijiarao
2023-07-14 14:57:17 +08:00
parent 4dfeab2d34
commit 0c790723cc
10 changed files with 53 additions and 22 deletions
@@ -203,7 +203,7 @@ public class CommitteeMeetingController extends JeroController<PayMeeting, IPayM
@ApiOperation(value = "上传资料", notes = "上传资料")
@PostMapping(value = "/uploadFile")
public Result<?> uploadFile(@RequestBody UploadFileVO uploadFileVO) {
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.COMMITTEE_MEETING_INT, true);
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.COMMITTEE_MEETING_INT, false);
return Result.OK("上传资料成功!",strings);
}
@@ -190,7 +190,7 @@ public class CouncilMeetingController extends JeroController<PayMeeting, IPayMee
@ApiOperation(value = "上传资料", notes = "上传资料")
@PostMapping(value = "/uploadFile")
public Result<?> uploadFile(@RequestBody UploadFileVO uploadFileVO) {
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.COUNCIL_MEETING_INT, true);
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.COUNCIL_MEETING_INT, false);
return Result.OK("上传资料成功!",strings);
}
@@ -201,7 +201,7 @@ public class InternalMeetingController extends JeroController<PayMeeting, IPayMe
@ApiOperation(value = "上传资料", notes = "上传资料")
@PostMapping(value = "/uploadFile")
public Result<?> uploadFile(@RequestBody UploadFileVO uploadFileVO) {
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.INTERNATIONAL_MEETING_INT, true);
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.INTERNATIONAL_MEETING_INT, false);
return Result.OK("上传资料成功!",strings);
}
@@ -201,7 +201,7 @@ public class OtherMeetingController extends JeroController<PayMeeting, IPayMeeti
@ApiOperation(value = "上传资料", notes = "上传资料")
@PostMapping(value = "/uploadFile")
public Result<?> uploadFile(@RequestBody UploadFileVO uploadFileVO) {
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.OTHER_MEETING_INT, true);
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.OTHER_MEETING_INT, false);
return Result.OK("上传资料成功!",strings);
}
@@ -27,6 +27,7 @@ import com.jero.data.service.IPayCaseCouncilSubitemService;
import com.jero.meeting.common.MeetingCommon;
import com.jero.meeting.common.MeetingSubitemCommon;
import com.jero.meeting.entity.*;
import com.jero.meeting.mapper.PayMeetingGuestsFileMapper;
import com.jero.meeting.service.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -101,6 +102,8 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
private IPayMeetingContactsService meetingContactsService;
@Resource
private IPayMeetingStandardService payMeetingStandardService;
@Resource
private PayMeetingGuestsFileMapper meetingGuestsFileMapper;
/**
* 分页列表查询
@@ -464,7 +467,7 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
@PostMapping(value = "/uploadFile")
@Transactional
public Result<?> uploadFile(@RequestBody UploadFileVO uploadFileVO) {
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.INTERNATIONAL_MEETING_INT, true);
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.INTERNATIONAL_MEETING_INT, false);
return Result.OK("上传资料成功!",strings);
}
@@ -270,7 +270,7 @@ public class StandardsMeetingController extends JeroController<PayMeeting, IPayM
@ApiOperation(value = "上传资料", notes = "上传资料")
@PostMapping(value = "/uploadFile")
public Result<?> uploadFile(@RequestBody UploadFileVO uploadFileVO) {
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.STANDARD_MEETING_INT, true);
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.STANDARD_MEETING_INT, false);
return Result.OK("上传资料成功!",strings);
}
@@ -208,7 +208,7 @@ public class WorkGroupMeetingController extends JeroController<PayMeeting, IPayM
@ApiOperation(value = "上传资料", notes = "上传资料")
@PostMapping(value = "/uploadFile")
public Result<?> uploadFile(@RequestBody UploadFileVO uploadFileVO) {
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.WORKING_GROUP_MEETING_INT, true);
List<String> strings = payMeetingService.uploadFileSendMsg(uploadFileVO, MeetingCommon.WORKING_GROUP_MEETING_INT, false);
return Result.OK("上传资料成功!",strings);
}
@@ -73,7 +73,7 @@ public interface IPayMeetingService extends IService<PayMeeting> {
IPage<PayMeeting> queryMeetingSummary(MeetingSummary meetingSummary, Integer pageNo, Integer pageSize, HttpServletRequest req);
List<String> uploadFileSendMsg(UploadFileVO uploadFileVO, Integer meetingCommon, Boolean saveFileFlag);
List<String> uploadFileSendMsg(UploadFileVO uploadFileVO, Integer meetingCommon, Boolean isGuestsUpload);
/**
* 上传会议纪要
@@ -1,5 +1,6 @@
package com.jero.meeting.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@@ -59,6 +60,7 @@ import com.jero.project.service.IPayWorkingGroupSubItemService;
import com.jero.standards.xuanguan.stablecrosstraining.entity.StableCrossTraining;
import com.jero.standards.xuanguan.stablecrosstraining.service.IStableCrossTrainingService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.Strings;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.util.CollectionUtils;
import org.jetbrains.annotations.NotNull;
@@ -1010,12 +1012,12 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
if (StringUtils.isNotBlank(meetingData)) {
meetingDataList.addAll(Arrays.asList(meetingData.split(",")));
}
LambdaQueryWrapper<PayMeetingGuestsFile> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(PayMeetingGuestsFile::getMeetingId,meetingId);
List<PayMeetingGuestsFile> payMeetingGuestsFiles = meetingGuestsFileMapper.selectList(wrapper1);
List<String> collect = payMeetingGuestsFiles.stream().map(PayMeetingGuestsFile::getFileId).collect(Collectors.toList());
meetingDataList.addAll(collect);
meeting.setMeetingData(String.join(",",meetingDataList));
//LambdaQueryWrapper<PayMeetingGuestsFile> wrapper1 = new LambdaQueryWrapper<>();
//wrapper1.eq(PayMeetingGuestsFile::getMeetingId,meetingId);
//List<PayMeetingGuestsFile> payMeetingGuestsFiles = meetingGuestsFileMapper.selectList(wrapper1);
//List<String> collect = payMeetingGuestsFiles.stream().map(PayMeetingGuestsFile::getFileId).collect(Collectors.toList());
//meetingDataList.addAll(collect);
//meeting.setMeetingData(String.join(",",meetingDataList));
}
return pageList;
}
@@ -1105,7 +1107,7 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
@Override
@Transactional
public List<String> uploadFileSendMsg(UploadFileVO uploadFileVO, Integer meetingCommon, Boolean saveFileFlag) {
public List<String> uploadFileSendMsg(UploadFileVO uploadFileVO, Integer meetingCommon, Boolean isGuestsUpload) {
List<String> listMsg = new ArrayList<>();
String id = uploadFileVO.getId();
LambdaQueryWrapper<PayMeeting> payMeetingLambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -1119,13 +1121,26 @@ public class PayMeetingServiceImpl extends ServiceImpl<PayMeetingMapper, PayMeet
}
meetingCommon = payMeeting.getMeetingType();
String fileIds = uploadFileVO.getFileIds();
if (saveFileFlag){
LambdaUpdateWrapper<PayMeeting> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(PayMeeting::getId, id);
wrapper.set(PayMeeting::getMeetingData, fileIds);
update(wrapper);
}
List<String> meetingFileIdList = Arrays.asList(fileIds.split(","));
if (isGuestsUpload){
String meetingData = payMeeting.getMeetingData();
if (StringUtils.isNotBlank(meetingData)) {
List<String> oldMeetingDataList = Arrays.asList(meetingData.split(","));
oldMeetingDataList.addAll(meetingFileIdList);
meetingFileIdList = oldMeetingDataList;
fileIds = String.join(",", meetingFileIdList);
}
}
//删除嘉宾文件
LambdaQueryWrapper<PayMeetingGuestsFile> deleteWrapper = new LambdaQueryWrapper<>();
deleteWrapper.eq(PayMeetingGuestsFile::getMeetingId,id);
deleteWrapper.notIn(PayMeetingGuestsFile::getFileId,meetingFileIdList);
meetingGuestsFileMapper.delete(deleteWrapper);
LambdaUpdateWrapper<PayMeeting> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(PayMeeting::getId, id);
wrapper.set(PayMeeting::getMeetingData, fileIds);
update(wrapper);
//如果过滤后为空则不发邮件
if (meetingFileIdList.isEmpty()) {
return listMsg;
@@ -80,6 +80,7 @@ import com.jero.temporary.service.IPayContactsManagementTemporaryService;
import com.jero.util.ObjRecordUtil;
import com.jero.util.module.ObjRecordUtilModule;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.Strings;
import org.apache.shiro.SecurityUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.BeanUtils;
@@ -1815,7 +1816,7 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
uploadFileVO.setFileIds(fileIds);
meetingService.uploadFileSendMsg(uploadFileVO, null,false);
meetingService.uploadFileSendMsg(uploadFileVO, null,true);
}
@Override
@@ -1843,6 +1844,18 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
wrapper.eq(PayMeetingGuestsFile::getContactsId,sysUserId);
wrapper.in(PayMeetingGuestsFile::getFileId,fileIdList);
meetingGuestsFileMapper.delete(wrapper);
PayMeeting meeting = meetingService.getById(meetingId);
String meetingData = meeting.getMeetingData();
List<String> meetingDataList = new ArrayList<>();
if (StringUtils.isNotBlank(meetingData)){
meetingDataList = Arrays.asList(meetingData.split(","));
meetingDataList.removeAll(fileIdList);
}
LambdaUpdateWrapper<PayMeeting> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(PayMeeting::getId, meetingId);
updateWrapper.set(PayMeeting::getMeetingData, String.join(",",meetingDataList));
meetingService.update(updateWrapper);
}
}