|  |  |  | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.core.utils.DateUtil; | 
|---|
|  |  |  | import com.doumee.core.utils.QrCodeUtils; | 
|---|
|  |  |  | import com.doumee.dao.admin.request.BusinessOverDTO; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Bookings; | 
|---|
|  |  |  | import com.doumee.dao.web.request.BookingsRequest; | 
|---|
|  |  |  | import com.doumee.dao.web.request.MeetingPageRequest; | 
|---|
|  |  |  | import com.doumee.dao.web.response.MeetingDetailResponse; | 
|---|
|  |  |  | import com.doumee.dao.web.response.MeetingListResponse; | 
|---|
|  |  |  | import com.doumee.dao.web.response.MonthDataResponse; | 
|---|
|  |  |  | import com.doumee.dao.web.response.RoomDetailResponse; | 
|---|
|  |  |  | import com.doumee.service.business.BookingsService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParam; | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "String", name = "yearMonth", value = "年月  yyyy-MM", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<List<MonthDataResponse>> monthDay(@RequestParam String yearMonth) { | 
|---|
|  |  |  | public ApiResponse<List<MonthDataResponse>> monthDay(@RequestParam String yearMonth, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | List<String> dataList = DateUtil.getDayByMonth(yearMonth); | 
|---|
|  |  |  | List<MonthDataResponse> monthDataResponseList = new ArrayList<>(); | 
|---|
|  |  |  | 
|---|
|  |  |  | //            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "会议主键", required = true), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<MeetingDetailResponse> meetingDetail(@RequestParam Integer id) { | 
|---|
|  |  |  | return ApiResponse.success("查询成功", bookingsService.getMeetingDetail(id)); | 
|---|
|  |  |  | public ApiResponse<MeetingDetailResponse> meetingDetail( @RequestHeader(Constants.HEADER_USER_TOKEN) String token,@RequestParam Integer id) { | 
|---|
|  |  |  | return ApiResponse.success("查询成功", bookingsService.getMeetingDetail(id,getLoginUser(token).getId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取会议开门二维码") | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<String> getQrCode(@RequestParam Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(token); | 
|---|
|  |  |  | //        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | return ApiResponse.success("查询成功", bookingsService.getQrCode(id,user.getId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public void getQrCodeImg(@RequestParam Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token, HttpServletResponse response) throws  Exception { | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(token); | 
|---|
|  |  |  | //        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | response.setHeader("Cache-Control", "no-store, no-cache"); | 
|---|
|  |  |  | response.setContentType("image/jpeg"); | 
|---|
|  |  |  | String content =bookingsService.getQrCode(id,user.getId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<Integer> reservationMeeting(@RequestBody BookingsRequest bookingsRequest,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(token); | 
|---|
|  |  |  | //        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | bookingsRequest.setCreator(user.getId()); | 
|---|
|  |  |  | bookingsRequest.setEditor(user.getId()); | 
|---|
|  |  |  | bookingsRequest.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success("操作成功",bookingsService.reservationMeeting(bookingsRequest)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("取消会议预约") | 
|---|
|  |  |  | @GetMapping("/reservationCancel") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "会议主键", required = true), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse reservationCancel(@RequestParam Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | //        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | @PostMapping("/reservationCancel") | 
|---|
|  |  |  | public ApiResponse reservationCancel(@RequestBody BusinessOverDTO businessOverDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(token); | 
|---|
|  |  |  | bookingsService.reservationCancel(id,user.getId()); | 
|---|
|  |  |  | businessOverDTO.setUserId(user.getId()); | 
|---|
|  |  |  | bookingsService.reservationCancel(businessOverDTO); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("提前开始会议") | 
|---|
|  |  |  | @PostMapping("/startEarly") | 
|---|
|  |  |  | public ApiResponse startEarly(@RequestBody BusinessOverDTO businessOverDTO,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(token); | 
|---|
|  |  |  | businessOverDTO.setUserId(user.getId()); | 
|---|
|  |  |  | businessOverDTO.setStartType(Constants.ZERO); | 
|---|
|  |  |  | bookingsService.startEarly(businessOverDTO); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("开始会议") | 
|---|
|  |  |  | @PostMapping("/start") | 
|---|
|  |  |  | public ApiResponse start(@RequestBody BusinessOverDTO businessOverDTO,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(token); | 
|---|
|  |  |  | businessOverDTO.setUserId(user.getId()); | 
|---|
|  |  |  | businessOverDTO.setStartType(Constants.ONE); | 
|---|
|  |  |  | bookingsService.start(businessOverDTO); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("提前结束会议") | 
|---|
|  |  |  | @PostMapping("/reservationOver") | 
|---|
|  |  |  | public ApiResponse reservationOver(@RequestBody BusinessOverDTO businessOverDTO,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(token); | 
|---|
|  |  |  | businessOverDTO.setUserId(user.getId()); | 
|---|
|  |  |  | bookingsService.reservationOver(businessOverDTO); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|