fix 成员能下载会议资料

This commit is contained in:
lijiarao
2021-12-24 13:54:07 +08:00
parent 6f232bdb1b
commit 51dba5ab70
@@ -21,8 +21,13 @@ import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.*;
import com.jero.company.service.IPayContactsManagementService;
import com.jero.data.entity.PayCaseCommittee;
import com.jero.data.entity.PayCaseCommitteeSubitem;
import com.jero.data.entity.PayCaseCouncilSubitem;
import com.jero.data.service.IPayCaseCommitteeService;
import com.jero.data.service.IPayCaseCommitteeSubitemService;
import com.jero.data.service.IPayCaseCouncilSubitemService;
import com.jero.meeting.common.MeetingCommon;
import com.jero.meeting.common.MeetingSubitemCommon;
import com.jero.meeting.entity.PayMeeting;
import com.jero.meeting.entity.PayMeetingHotelContacts;
import com.jero.meeting.entity.PayMeetingSituation;
@@ -39,7 +44,9 @@ import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.system.volid.group.UpdateGroup;
import com.jero.project.entity.PayWorkingGroup;
import com.jero.project.entity.PayWorkingGroupSubItem;
import com.jero.project.service.IPayWorkingGroupService;
import com.jero.project.service.IPayWorkingGroupSubItemService;
import com.jero.util.QrcodeUtil;
import io.swagger.annotations.ApiImplicitParam;
import lombok.extern.slf4j.Slf4j;
@@ -89,6 +96,12 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
@Resource
private IPayMeetingSituationService payMeetingSituationService;
@Resource
private IPayWorkingGroupSubItemService payWorkingGroupSubItemService;
@Resource
private IPayCaseCommitteeSubitemService payCaseCommitteeSubitemService;
@Resource
private IPayCaseCouncilSubitemService payCaseCouncilSubitemService;
@Resource
private Environment env;
@Resource
private SendMessageService sendMessageService;
@@ -462,6 +475,40 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
if(ObjectUtils.isEmpty(payMeeting)){
throw new JeroBootException("会议不存在..");
}
Integer meetingType = payMeeting.getMeetingType();
//如果是工作组会议或者分标委会议或理事会会议,判断是否为成员
boolean isSubItem = false;
if (meetingType.equals(MeetingCommon.WORKING_GROUP_MEETING_INT)) {
LambdaQueryWrapper<PayWorkingGroupSubItem> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PayWorkingGroupSubItem::getWorkingGroupId, payMeeting.getWorkingGroupId());
wrapper.and(i -> i.eq(PayWorkingGroupSubItem::getContactsIdOne, sysUserId)
.or()
.eq(PayWorkingGroupSubItem::getContactsIdTwo, sysUserId)
.or()
.eq(PayWorkingGroupSubItem::getContactsIdThree, sysUserId)
);
int count = payWorkingGroupSubItemService.count(wrapper);
if (count > 0) {
isSubItem = true;
}
} else if (meetingType.equals(MeetingCommon.COMMITTEE_MEETING_INT)) {
LambdaQueryWrapper<PayCaseCommitteeSubitem> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PayCaseCommitteeSubitem::getCommitteeId, payMeeting.getCaseCommitteeId());
wrapper.eq(PayCaseCommitteeSubitem::getContactsId, sysUserId);
int count = payCaseCommitteeSubitemService.count(wrapper);
if (count > 0) {
isSubItem = true;
}
} else if (meetingType.equals(MeetingCommon.COUNCIL_MEETING_INT)) {
LambdaQueryWrapper<PayCaseCouncilSubitem> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PayCaseCouncilSubitem::getCouncilId, payMeeting.getCouncilId());
wrapper.eq(PayCaseCouncilSubitem::getContactsId, sysUserId);
int count = payCaseCouncilSubitemService.count(wrapper);
if (count > 0) {
isSubItem = true;
}
}
String meetingMinute = payMeeting.getMeetingMinute();
String meetingData = payMeeting.getMeetingData();
List<String> fileList = new ArrayList<>();
@@ -475,8 +522,8 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
throw new JeroBootException("会议无此文件..");
}
BigDecimal meetingCosts = payMeeting.getMeetingCosts();
//免费会议
if (!"0.00".equals(meetingCosts.toString())){
//免费会议并且非成员
if (!"0.00".equals(meetingCosts.toString()) && !isSubItem){
QueryWrapper<PayMeetingSituation> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("meeting_id", meetingId);
queryWrapper1.eq("company_contact_id", sysUserId);