|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
|---|
|  |  |  | import com.doumee.api.BaseController; | 
|---|
|  |  |  | import com.doumee.config.Jwt.JwtTokenUtil; | 
|---|
|  |  |  | 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.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.service.business.BookingsService; | 
|---|
|  |  |  | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParam; | 
|---|
|  |  |  | import io.swagger.annotations.ApiImplicitParams; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import org.apache.shiro.SecurityUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @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) { | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | public ApiResponse<List<MonthDataResponse>> monthDay(@RequestParam String yearMonth | 
|---|
|  |  |  | ,@RequestParam(required = false) Integer queryType) { | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(null); | 
|---|
|  |  |  | 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()); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("我的会议列表") | 
|---|
|  |  |  | @PostMapping("/myMeetingPage") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<IPage<MeetingListResponse>> myMeetingPage(@RequestBody PageWrap<MeetingPageRequest> pageWrap) { | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(null); | 
|---|
|  |  |  | pageWrap.getModel().setUserId(user.getId()); | 
|---|
|  |  |  | IPage<MeetingListResponse> page = bookingsService.getMyMeetingPage(pageWrap); | 
|---|
|  |  |  | return ApiResponse.success("查询成功",page); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("会议详情") | 
|---|
|  |  |  | @GetMapping("/meetingDetail") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | //            @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)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //    @ApiOperation("会议详情") | 
|---|
|  |  |  | //    @GetMapping("/meetingDetail") | 
|---|
|  |  |  | //    @ApiImplicitParams({ | 
|---|
|  |  |  | //            @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "会议主键", required = true), | 
|---|
|  |  |  | //    }) | 
|---|
|  |  |  | //    public ApiResponse<MeetingDetailResponse> meetingDetail(@RequestParam Integer id) { | 
|---|
|  |  |  | //        return ApiResponse.success("查询成功", bookingsService.getMeetingDetail(id)); | 
|---|
|  |  |  | //    } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取会议开门二维码") | 
|---|
|  |  |  | @GetMapping("/getQrCode") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "会议主键", required = true), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<String> getQrCode(@RequestParam Integer id) { | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(null); | 
|---|
|  |  |  | return ApiResponse.success("查询成功", bookingsService.getQrCode(id,user.getId())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("获取会议开门二维码-图片流") | 
|---|
|  |  |  | @GetMapping("/getQrCodeImg") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | //            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "会议主键", required = true), | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "query", dataType = "String", name = "token", value = "用户token值", required = true), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public void getQrCodeImg(@RequestParam Integer id,@RequestParam String token, HttpServletResponse response) throws  Exception { | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(null); | 
|---|
|  |  |  | response.setHeader("Cache-Control", "no-store, no-cache"); | 
|---|
|  |  |  | response.setContentType("image/jpeg"); | 
|---|
|  |  |  | String content =bookingsService.getQrCode(id,user.getId()); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("会议预约") | 
|---|
|  |  |  | @PostMapping("/reservationMeeting") | 
|---|
|  |  |  | @ApiImplicitParams({ | 
|---|
|  |  |  | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public ApiResponse<Integer> reservationMeeting(@RequestBody BookingsRequest bookingsRequest) { | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(null); | 
|---|
|  |  |  | bookingsRequest.setCreator(user.getId()); | 
|---|
|  |  |  | bookingsRequest.setEditor(user.getId()); | 
|---|
|  |  |  | 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) { | 
|---|
|  |  |  | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); | 
|---|
|  |  |  | bookingsService.reservationCancel(id,user.getId()); | 
|---|
|  |  |  | @PostMapping("/reservationCancel") | 
|---|
|  |  |  | public ApiResponse reservationCancel(@RequestBody BusinessOverDTO businessOverDTO) { | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(null); | 
|---|
|  |  |  | businessOverDTO.setUserId(user.getId()); | 
|---|
|  |  |  | bookingsService.reservationCancel(businessOverDTO); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("提前结束会议") | 
|---|
|  |  |  | @PostMapping("/reservationOver") | 
|---|
|  |  |  | public ApiResponse reservationOver(@RequestBody BusinessOverDTO businessOverDTO) { | 
|---|
|  |  |  | LoginUserInfo user = getLoginUser(null); | 
|---|
|  |  |  | businessOverDTO.setUserId(user.getId()); | 
|---|
|  |  |  | bookingsService.reservationOver(businessOverDTO); | 
|---|
|  |  |  | return ApiResponse.success("操作成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|