|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
|---|
|  |  |  | import com.doumee.api.BaseController; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.LoginUserInfo; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "当月会议表", notes = "当月会议表") | 
|---|
|  |  |  | @GetMapping("/monthMeeting") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "String", name = "yearMonth", value = "年月  yyyy-MM", required = true) | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "String", name = "yearMonth", value = "年月  yyyy-MM", required = true), | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "String", name = "queryType", value = "查询类别:1=我参与的;2=我预约的;3管理员查看全部 ", required = true) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<List<MonthDataResponse>> monthDay(@RequestParam String yearMonth, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | public ApiResponse<List<MonthDataResponse>> monthDay(@RequestParam String yearMonth | 
|---|
|  |  |  | ,@RequestParam(required = false) Integer queryType | 
|---|
|  |  |  | ,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | List<String> dataList = DateUtil.getDayByMonth(yearMonth); | 
|---|
|  |  |  | List<MonthDataResponse> monthDataResponseList = new ArrayList<>(); | 
|---|
|  |  |  | List<Bookings> bookings = bookingsService.getMyBookings(user.getId(),yearMonth); | 
|---|
|  |  |  | List<Bookings> bookings = bookingsService.getMyBookings(user.getId(),yearMonth,queryType); | 
|---|
|  |  |  | for (String str:dataList) { | 
|---|
|  |  |  | MonthDataResponse  monthDataResponse = new MonthDataResponse(); | 
|---|
|  |  |  | monthDataResponse.setWeekMsg(DateUtil.getWeek(DateUtil.StringToDate(str,"yyyy-MM-dd")).getChineseName()); | 
|---|
|  |  |  | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "会议主键", required = true), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<MeetingDetailResponse> meetingDetail( @RequestHeader(Constants.HEADER_USER_TOKEN) String token,@RequestParam Integer id) { | 
|---|
|  |  |  | return ApiResponse.success("查询成功", bookingsService.getMeetingDetail(id)); | 
|---|
|  |  |  | return ApiResponse.success("查询成功", bookingsService.getMeetingDetail(id,getLoginUser(token).getId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取会议开门二维码") | 
|---|
|  |  |  | 
|---|
|  |  |  | 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()); | 
|---|
|  |  |  | businessOverDTO.setLoginUser(user); | 
|---|
|  |  |  | 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("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|