| | |
| | | package com.doumee.cloud.web; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.Jwt.JwtTokenUtil; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.QrCodeUtils; |
| | | import com.doumee.dao.business.model.Bookings; |
| | |
| | | @Api(tags = "2、预定会议业务") |
| | | @Trace(exclude = true) |
| | | @RestController |
| | | @RequestMapping("/web/meeting") |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/web/meeting") |
| | | @Slf4j |
| | | public class MeetingApi extends ApiController{ |
| | | public class MeetingApi extends BaseController { |
| | | |
| | | @Autowired |
| | | private BookingsService bookingsService; |
| | |
| | | @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) |
| | | }) |
| | | 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 = getLoginUser(token); |
| | | List<String> dataList = DateUtil.getDayByMonth(yearMonth); |
| | | List<MonthDataResponse> monthDataResponseList = new ArrayList<>(); |
| | | List<Bookings> bookings = bookingsService.getMyBookings(getMemberId(),yearMonth); |
| | | List<Bookings> bookings = bookingsService.getMyBookings(user.getId(),yearMonth); |
| | | 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) { |
| | | pageWrap.getModel().setUserId(getMemberId()); |
| | | public ApiResponse<IPage<MeetingListResponse>> myMeetingPage(@RequestBody PageWrap<MeetingPageRequest> pageWrap |
| | | ,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo user = getLoginUser(token); |
| | | 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) { |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("获取会议开门二维码") |
| | | /* @ApiOperation("获取会议开门二维码") |
| | | @GetMapping("/getQrCode") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | |
| | | response.setContentType("image/jpeg"); |
| | | String content =bookingsService.getQrCode(id,memberId); |
| | | QrCodeUtils.encode(content,null, response.getOutputStream(), true); |
| | | } |
| | | }*/ |
| | | |
| | | /* |
| | | @LoginRequired |
| | |
| | | |
| | | @ApiOperation("会议预约") |
| | | @PostMapping("/reservationMeeting") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | }) |
| | | public ApiResponse<Integer> reservationMeeting(@RequestBody BookingsRequest bookingsRequest) { |
| | | bookingsRequest.setCreator(getMemberId()); |
| | | bookingsRequest.setEditor(getMemberId()); |
| | | public ApiResponse<Integer> reservationMeeting(@RequestBody BookingsRequest bookingsRequest ,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo user = getLoginUser(token); |
| | | 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) { |
| | | bookingsService.reservationCancel(id,getMemberId()); |
| | | public ApiResponse reservationCancel(@RequestParam Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo user = getLoginUser(token); |
| | | bookingsService.reservationCancel(id,user.getId()); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |