| | |
| | | s.setSysList(userrelList); |
| | | //会议室管理员 |
| | | MPJLambdaWrapper<UserRel> param = new MPJLambdaWrapper<>(); |
| | | urquery.selectAll(UserRel.class); |
| | | urquery.eq(UserRel::getObjType, MeetConstants.ZERO); |
| | | urquery.eq(UserRel::getIsdeleted, MeetConstants.ZERO); |
| | | urquery.eq(UserRel::getObjId, s.getRoomId()); |
| | | List<UserRel> adminList = userRelJoinMapper.selectJoinList(UserRel.class, urquery); |
| | | param.selectAll(UserRel.class); |
| | | param.eq(UserRel::getObjType, MeetConstants.ZERO); |
| | | param.eq(UserRel::getIsdeleted, MeetConstants.ZERO); |
| | | param.eq(UserRel::getObjId, s.getRoomId()); |
| | | List<UserRel> adminList = userRelJoinMapper.selectJoinList(UserRel.class, param); |
| | | s.setAdminList(adminList); |
| | | |
| | | //查询是否有权限 |
| | |
| | | if(Constants.equalsInteger(userInfo.getId(),s.getCreator()) ){ |
| | | return 1; |
| | | } |
| | | if(adminList!=null){ |
| | | if(adminList!=null && userInfo!=null){ |
| | | for(UserRel u : adminList){ |
| | | if(Constants.equalsInteger(userInfo.getId(),u.getUserId()) ){ |
| | | return 1; |
| | |
| | | if (Objects.isNull(bookings)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "未查询到预约记录"); |
| | | } |
| | | if (!bookings.getCreator().equals(businessOverDTO.getUserId())) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "非你的预约记录,无法进行取消"); |
| | | |
| | | // LoginUserInfo user =(LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | //会议室管理员 |
| | | MPJLambdaWrapper<UserRel> param = new MPJLambdaWrapper<>(); |
| | | param.selectAll(UserRel.class); |
| | | param.eq(UserRel::getObjType, MeetConstants.ZERO); |
| | | param.eq(UserRel::getIsdeleted, MeetConstants.ZERO); |
| | | param.eq(UserRel::getObjId, bookings.getRoomId()); |
| | | List<UserRel> adminList = userRelJoinMapper.selectJoinList(UserRel.class, param); |
| | | Integer hasRole =getHasRoleByParam(bookings,businessOverDTO.getLoginUser(),adminList); |
| | | |
| | | // if (!bookings.getCreator().equals(businessOverDTO.getUserId())) { |
| | | if (!Constants.equalsInteger(hasRole,Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "对不起,只有会议室管理员和申请人才能进行该操作哦!"); |
| | | } |
| | | if (Objects.nonNull(bookings.getStartTimeReal()) && System.currentTimeMillis() > bookings.getStartTimeReal().getTime()) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "会议已开始,无法进行取消"); |
| | |
| | | for (Rooms rooms:roomList) { |
| | | //查询当前会议室是否存在进行中的会议 |
| | | if(bookingsMapper.selectCount(new QueryWrapper<Bookings>().lambda().eq(Bookings::getIsdeleted,Constants.ZERO) |
| | | .eq(Bookings::getStatus,Constants.ZERO).isNotNull(Bookings::getStartTimeReal) |
| | | .eq(Bookings::getStatus,Constants.ZERO).eq(Bookings::getRoomId,rooms.getId()).isNotNull(Bookings::getStartTimeReal). |
| | | apply(" DATE_FORMAT(NOW(), '%Y-%m-%d') = DATE_FORMAT(START_TIME, '%Y-%m-%d') ") |
| | | )<=Constants.ZERO){ |
| | | //根据会议室获取可以开启的会议记录(第一条记录) |
| | | Bookings bookings = bookingsMapper.selectOne(new QueryWrapper<Bookings>().lambda() |
| | | .eq(Bookings::getIsdeleted,Constants.ZERO) |
| | | .eq(Bookings::getStatus,Constants.ZERO) |
| | | .eq(Bookings::getRoomId,rooms.getId()) |
| | | .apply(" now() > START_TIME and now < END_TIME ") |
| | | .apply(" now() > START_TIME and now() < END_TIME ") |
| | | .isNull(Bookings::getStartTimeReal) |
| | | .orderByAsc(Bookings::getStartTime) |
| | | .last(" limit 1 ") |
| | | ); |
| | | bookings.setStartTimeReal(new Date()); |
| | | bookings.setEditDate(new Date()); |
| | | bookingsMapper.updateById(bookings); |
| | | if(Objects.nonNull(bookings)){ |
| | | bookings.setStartTimeReal(new Date()); |
| | | bookings.setEditDate(bookings.getStartTimeReal()); |
| | | bookingsMapper.updateById(bookings); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | .eq(Bookings::getIsdeleted, MeetConstants.ZERO) |
| | | .eq(Bookings::getStatus, MeetConstants.ZERO) |
| | | .eq(Rooms::getId, rooms.getId()) |
| | | .apply("to_days(t.start_time) = to_days(now()) and t.end_time > now()")//子查询当天的 |
| | | .apply(" ( " + |
| | | " to_days(t.start_time) = to_days(now()) " + |
| | | " and ( t.START_TIME_REAL is not null or ( t.end_time > now() and t.START_TIME_REAL is null ) ) " + |
| | | " ) ")//子查询当天的 |
| | | .orderByAsc(Bookings::getStartTime); |
| | | Integer minute =getNearStartMinut(); |
| | | List<Bookings> meetingList =bookingsMapper.selectJoinList(Bookings.class,queryWrapper); |
| | |
| | | .selectAs(SystemUser::getMobile,UserRel::getUserPhone) |
| | | .selectAs(SystemUser::getOpenid,UserRel::getOpenid) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,UserRel::getUserId) |
| | | .eq(UserRel::getObjType, MeetConstants.ONE) |
| | | // .eq(UserRel::getObjType, MeetConstants.ONE) |
| | | .eq(UserRel::getObjId, bookings.getId()) |
| | | .eq(UserRel::getIsdeleted, MeetConstants.ZERO) |
| | | .isNotNull(SystemUser::getOpenid) |