| | |
| | | //发送会议预约成功通知 |
| | | this.sendNotice(bookings, MeetConstants.TWO); |
| | | //发送微信订阅通知 |
| | | sendWxMessage.bookingsReservation(systemUserMapper.selectById(bookings.getCreator()), bookings, roomsMapper.selectById(bookings.getRoomId())); |
| | | // sendWxMessage.bookingsReservation(systemUserMapper.selectById(bookings.getCreator()), bookings, roomsMapper.selectById(bookings.getRoomId())); |
| | | |
| | | return bookings.getId(); |
| | | } |
| | |
| | | queryWrapper.leftJoin(Company.class,Company::getId,SystemUser::getCompanyId); |
| | | queryWrapper.orderByDesc(Bookings::getCreateDate); |
| | | queryWrapper.eq(Bookings::getIsdeleted, MeetConstants.ZERO); |
| | | |
| | | //数据权限开始--------------------start---------------- |
| | | LoginUserInfo userInfo =pageWrap.getModel().getLoginUserInfo(); |
| | | if(userInfo!=null && userInfo.getCompanyIdList()!=null){ |
| | | if( userInfo.getCompanyIdList().size() ==0){ |
| | | //只看自己 |
| | | queryWrapper.and(wrapper ->{ |
| | | wrapper.eq(Bookings::getCreator,userInfo.getId()) |
| | | .or().exists("select rel.id from meeting_user_rel rel where rel.OBJ_TYPE=0 and rel.obj_id=t.id and rel.isdeleted=0 and rel.user_id="+userInfo.getId()); |
| | | }); |
| | | queryWrapper.eq(Bookings::getCreator,userInfo.getId()); |
| | | }else{ |
| | | //权限范围内 |
| | | queryWrapper.and(wrapper ->{ |
| | | wrapper.in(SystemUser::getCompanyId ,userInfo.getCompanyIdList()) |
| | | .or().exists("select rel.id from meeting_user_rel rel where rel.OBJ_TYPE=0 and rel.obj_id=t.id and rel.isdeleted=0 and rel.user_id="+userInfo.getId()); |
| | | }); |
| | | } |
| | | } |
| | | //数据权限开始--------------------end---------------- |
| | | |
| | | queryWrapper.eq(pageWrap.getModel().getRoomId() != null, Bookings::getRoomId, pageWrap.getModel().getRoomId()); |
| | | queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getName()), Bookings::getName, pageWrap.getModel().getName()); |
| | |
| | | if (!bookings.getCreator().equals(businessOverDTO.getUserId())) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "非你的预约记录,无法进行取消"); |
| | | } |
| | | if (System.currentTimeMillis() > bookings.getStartTime().getTime()) { |
| | | if (Objects.nonNull(bookings.getStartTimeReal()) && System.currentTimeMillis() > bookings.getStartTimeReal().getTime()) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "会议已开始,无法进行取消"); |
| | | } |
| | | if(bookings.getStatus().equals(MeetConstants.ONE)){ |
| | |
| | | //取消会议 发送取消通知 |
| | | this.sendNotice(bookings, 3); |
| | | //发送微信订阅通知 |
| | | sendWxMessage.bookingsCancel(systemUserMapper.selectById(bookings.getCreator()), bookings, roomsMapper.selectById(bookings.getRoomId())); |
| | | // sendWxMessage.bookingsCancel(systemUserMapper.selectById(bookings.getCreator()), bookings, roomsMapper.selectById(bookings.getRoomId())); |
| | | } |
| | | |
| | | |
| | |
| | | if (!bookings.getCreator().equals(businessOverDTO.getUserId()) && userRelList <= 0) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "非你的预约记录,无法进行该操作"); |
| | | } |
| | | if (System.currentTimeMillis() < bookings.getStartTime().getTime()) { |
| | | if (System.currentTimeMillis() < bookings.getStartTimeReal().getTime()) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "会议未开始,无法进行结束,如需该操作请使用取消功能"); |
| | | } |
| | | if (System.currentTimeMillis() > bookings.getEndTime().getTime()) { |
| | |
| | | .eq(Bookings::getRoomId,bookings.getRoomId()) |
| | | .ne(Bookings::getId,bookings.getId()) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未开启会议,无法进行开始会议"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在未开启会议,无法开始会议"); |
| | | }; |
| | | |
| | | if(bookingsMapper.selectCount(new QueryWrapper<Bookings>() |
| | | .lambda() |
| | | .apply(" ( END_TIME > now() and START_TIME < now() ) or ( END_TIME > now() and START_TIME_REAL < now() ) ") |
| | | .apply(" ( ( END_TIME > now() and START_TIME < now() ) or ( END_TIME > now() and START_TIME_REAL < now() ) ) ") |
| | | .isNotNull(Bookings::getStartTimeReal) |
| | | .isNull(Bookings::getDoneDate) |
| | | .eq(Bookings::getStatus,Constants.ZERO) |
| | | .eq(Bookings::getRoomId,bookings.getRoomId()) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前开启时间与其他会议存在冲突,无法进行开始会议"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前开启时间与其他会议存在冲突,无法开始会议"); |
| | | }; |
| | | }else{ |
| | | if(bookings.getStartTime().getTime() > System.currentTimeMillis()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未到会议申请开始时间,无法进行开始"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未到会议申请开始时间,无法开始"); |
| | | } |
| | | } |
| | | bookings.setStartTimeReal(new Date()); |
| | |
| | | .eq("b.STATUS",MeetConstants.ZERO) |
| | | .eq("a.ISDELETED",MeetConstants.ZERO) |
| | | .eq("a.status",Constants.ZERO) |
| | | .ne("a.status",Constants.TWO) |
| | | .like("a.start_time",DateUtil.getCurrDate()) |
| | | .apply(" not exists ( select 1 from meeting_book mb where mb.END_TIME < now() and mb.id = a.id and START_TIME_REAL is null ) ") |
| | | .orderByAsc("a.start_time") |
| | | ); |
| | | this.dealMeetingStatus(meetingList); |