Merge remote-tracking branch 'origin/master'
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | 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.core.utils.DateUtil; |
| | | import com.doumee.core.utils.QrCodeUtils; |
| | | 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.Api; |
| | | 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.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2024/4/29 9:42 |
| | | */ |
| | | @Api(tags = "ä¼è®®å®¤é¢å®ä¿¡æ¯è¡¨") |
| | | @RestController |
| | | @RequestMapping("/business/meeting") |
| | | public class MeetingController 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) { |
| | | 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); |
| | | for (String str:dataList) { |
| | | MonthDataResponse monthDataResponse = new MonthDataResponse(); |
| | | monthDataResponse.setWeekMsg(DateUtil.getWeek(DateUtil.StringToDate(str,"yyyy-MM-dd")).getChineseName()); |
| | | monthDataResponse.setMonthDate(str); |
| | | monthDataResponse.setMeetingNum(bookings.stream() |
| | | .filter(b-> DateUtil.dateToString(b.getStartTime(),"yyyy-MM-dd").equals(str)).collect(Collectors.toList()).size()); |
| | | monthDataResponseList.add(monthDataResponse); |
| | | } |
| | | return ApiResponse.success("æ¥è¯¢æå",monthDataResponseList); |
| | | } |
| | | |
| | | @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(); |
| | | 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("/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(); |
| | | 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(); |
| | | response.setHeader("Cache-Control", "no-store, no-cache"); |
| | | response.setContentType("image/jpeg"); |
| | | String content =bookingsService.getQrCode(id,user.getId()); |
| | | QrCodeUtils.encode(content,null, response.getOutputStream(), true); |
| | | } |
| | | |
| | | |
| | | @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(); |
| | | 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()); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.Jwt.JwtTokenUtil; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.QrCodeUtils; |
| | | import com.doumee.dao.business.model.RoomTime; |
| | | import com.doumee.dao.business.model.Rooms; |
| | | import com.doumee.dao.web.request.RoomTimeRequest; |
| | | import com.doumee.dao.web.request.RoomsRequest; |
| | | import com.doumee.dao.web.response.RoomsResponse; |
| | | import com.doumee.service.business.RoomTimeService; |
| | | import com.doumee.service.business.RoomsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Autowired |
| | | private RoomsService roomsService; |
| | | |
| | | @Autowired |
| | | private RoomTimeService roomTimeService; |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | |
| | | return ApiResponse.success(roomsService.findList(rooms)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("è·åä¼è®®å®¤å¼é¨äºç»´ç ") |
| | | @GetMapping("/getQrCode") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "ä¼è®®å®¤ä¸»é®", required = true), |
| | | }) |
| | | public ApiResponse<String> getQrCode(@RequestParam Integer id) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | return ApiResponse.success("æ¥è¯¢æå", roomsService.getQrCode(id,user.getId())); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("è·åä¼è®®å®¤å¼é¨äºç»´ç -å¾çæµ") |
| | | @GetMapping("/getQrCodeImg") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "ä¼è®®å®¤ä¸»é®", required = true) |
| | | }) |
| | | public void getQrCodeImg(@RequestParam Integer id,@RequestParam String token, HttpServletResponse response) throws Exception { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | response.setHeader("Cache-Control", "no-store, no-cache"); |
| | | response.setContentType("image/jpeg"); |
| | | String content =roomsService.getQrCode(id,user.getId()); |
| | | QrCodeUtils.encode(content,null, response.getOutputStream(), true); |
| | | } |
| | | |
| | | @ApiOperation("ä¼è®®å®¤å表") |
| | | @GetMapping("/roomsList") |
| | | public ApiResponse<List<RoomsResponse>> roomsList() { |
| | | return ApiResponse.success("æ¥è¯¢æå",roomsService.getRoomsList()); |
| | | } |
| | | |
| | | @ApiOperation("ä¼è®®å®¤æ¶é´å¼æ¾å表") |
| | | @PostMapping("/getRoomUseTime") |
| | | public ApiResponse<List<RoomTime>> getRoomUseTime(@RequestBody RoomTimeRequest roomTimeRequest) { |
| | | return ApiResponse.success("æ¥è¯¢æå",roomTimeService.getRoomUseTime(roomTimeRequest)); |
| | | } |
| | | |
| | | @ApiOperation("æçä¼è®®å®¤å表") |
| | | @PostMapping("/myRoomsPage") |
| | | public ApiResponse<IPage<RoomsResponse>> myRoomsPage(@RequestBody PageWrap<RoomsRequest> pageWrap) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | pageWrap.getModel().setUserId(user.getId()); |
| | | IPage<RoomsResponse> page = roomsService.getRoomsPage(pageWrap); |
| | | return ApiResponse.success("æ¥è¯¢æå",page); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("ä¼è®®å®¤è¯¦æ
") |
| | | @GetMapping("/getRoomDetail") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "roomId", value = "ä¼è®®å®¤ä¸»é®", required = true), |
| | | }) |
| | | public ApiResponse<RoomsResponse> getRoomDetail(@RequestParam Integer roomId) { |
| | | return ApiResponse.success("æ¥è¯¢æå",roomsService.getRoomDetail(roomId)); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.cloud; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.BookingTime; |
| | | import com.doumee.service.business.BookingTimeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/05/04 18:18 |
| | | */ |
| | | @Api(tags = "ä¼è®®å®¤é¢çº¦æ¶é´æ®µå
³è表") |
| | | @RestController |
| | | @RequestMapping("/cloudService/bookingTime") |
| | | public class CloudBookingTimeController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BookingTimeService bookingTimeService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:bookingtime:create") |
| | | public ApiResponse create(@RequestBody BookingTime bookingTime) { |
| | | return ApiResponse.success(bookingTimeService.create(bookingTime)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:bookingtime:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | bookingTimeService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:bookingtime:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | bookingTimeService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:bookingtime:update") |
| | | public ApiResponse updateById(@RequestBody BookingTime bookingTime) { |
| | | bookingTimeService.updateById(bookingTime); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:bookingtime:query") |
| | | public ApiResponse<PageData<BookingTime>> findPage (@RequestBody PageWrap<BookingTime> pageWrap) { |
| | | return ApiResponse.success(bookingTimeService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:bookingtime:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<BookingTime> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(BookingTime.class).export(bookingTimeService.findPage(pageWrap).getRecords(), "ä¼è®®å®¤é¢çº¦æ¶é´æ®µå
³è表", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:bookingtime:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(bookingTimeService.findById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("æ ¹æ®ç§å®¤æ¥ææ¥è¯¢ææçæ¶é´æ®µ") |
| | | @PostMapping("/findList") |
| | | @CloudRequiredPermission("business:roomtime:query") |
| | | public ApiResponse<List<BookingTime>> findPage (@RequestBody BookingTime pageWrap) { |
| | | return ApiResponse.success(bookingTimeService.findList(pageWrap)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.cloud; |
| | | |
| | | 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.core.utils.DateUtil; |
| | | import com.doumee.core.utils.QrCodeUtils; |
| | | 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.Api; |
| | | 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.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2024/4/29 9:42 |
| | | */ |
| | | @Api(tags = "ä¼è®®å®¤é¢å®ä¿¡æ¯è¡¨") |
| | | @RestController |
| | | @RequestMapping("/cloudService/meeting") |
| | | public class CloudMeetingController 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) { |
| | | 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); |
| | | for (String str:dataList) { |
| | | MonthDataResponse monthDataResponse = new MonthDataResponse(); |
| | | monthDataResponse.setWeekMsg(DateUtil.getWeek(DateUtil.StringToDate(str,"yyyy-MM-dd")).getChineseName()); |
| | | monthDataResponse.setMonthDate(str); |
| | | monthDataResponse.setMeetingNum(bookings.stream() |
| | | .filter(b-> DateUtil.dateToString(b.getStartTime(),"yyyy-MM-dd").equals(str)).collect(Collectors.toList()).size()); |
| | | monthDataResponseList.add(monthDataResponse); |
| | | } |
| | | return ApiResponse.success("æ¥è¯¢æå",monthDataResponseList); |
| | | } |
| | | |
| | | @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(); |
| | | 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("/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(); |
| | | 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(); |
| | | response.setHeader("Cache-Control", "no-store, no-cache"); |
| | | response.setContentType("image/jpeg"); |
| | | String content =bookingsService.getQrCode(id,user.getId()); |
| | | QrCodeUtils.encode(content,null, response.getOutputStream(), true); |
| | | } |
| | | |
| | | |
| | | @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(); |
| | | 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()); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.cloud; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.system.model.Multifile; |
| | | import com.doumee.service.system.MultifileService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/05/04 18:18 |
| | | */ |
| | | @Api(tags = "éä»¶ä¸ä¼ ä¿¡æ¯è¡¨") |
| | | @RestController |
| | | @RequestMapping("/cloudService/multifile") |
| | | public class CloudMultifileController extends BaseController { |
| | | |
| | | @Autowired |
| | | private MultifileService multifileService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:multifile:create") |
| | | public ApiResponse create(@RequestBody Multifile multifile) { |
| | | return ApiResponse.success(multifileService.create(multifile)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:multifile:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | multifileService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:multifile:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | multifileService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:multifile:update") |
| | | public ApiResponse updateById(@RequestBody Multifile multifile) { |
| | | multifileService.updateById(multifile); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:multifile:query") |
| | | public ApiResponse<PageData<Multifile>> findPage (@RequestBody PageWrap<Multifile> pageWrap) { |
| | | return ApiResponse.success(multifileService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:multifile:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Multifile> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(Multifile.class).export(multifileService.findPage(pageWrap).getRecords(), "éä»¶ä¸ä¼ ä¿¡æ¯è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:multifile:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(multifileService.findById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.cloud; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.ProjectRel; |
| | | import com.doumee.service.business.ProjectRelService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/05/04 18:18 |
| | | */ |
| | | @Api(tags = "æå¡é¡¹ç®å
³è表") |
| | | @RestController |
| | | @RequestMapping("/cloudService/projectRel") |
| | | public class CloudProjectRelController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ProjectRelService projectRelService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:projectrel:create") |
| | | public ApiResponse create(@RequestBody ProjectRel projectRel) { |
| | | return ApiResponse.success(projectRelService.create(projectRel)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:projectrel:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | projectRelService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:projectrel:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | projectRelService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:projectrel:update") |
| | | public ApiResponse updateById(@RequestBody ProjectRel projectRel) { |
| | | projectRelService.updateById(projectRel); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:projectrel:query") |
| | | public ApiResponse<PageData<ProjectRel>> findPage (@RequestBody PageWrap<ProjectRel> pageWrap) { |
| | | return ApiResponse.success(projectRelService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:projectrel:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<ProjectRel> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(ProjectRel.class).export(projectRelService.findPage(pageWrap).getRecords(), "æå¡é¡¹ç®å
³è表", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:projectrel:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(projectRelService.findById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.cloud; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Projects; |
| | | import com.doumee.dao.web.response.ProjectsResponse; |
| | | import com.doumee.service.business.ProjectsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/05/04 18:18 |
| | | */ |
| | | @Api(tags = "æå¡é¡¹ç®ä¿¡æ¯è¡¨") |
| | | @RestController |
| | | @RequestMapping("/cloudService/projects") |
| | | public class CloudProjectsController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ProjectsService projectsService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:projects:create") |
| | | public ApiResponse create(@RequestBody Projects projects) { |
| | | projects.setCreator(getLoginUser().getId()); |
| | | projects.setEditor(getLoginUser().getId()); |
| | | return ApiResponse.success(projectsService.create(projects)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:projects:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | projectsService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:projects:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | projectsService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:projects:update") |
| | | public ApiResponse updateById(@RequestBody Projects projects) { |
| | | projectsService.updateById(projects); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:projects:query") |
| | | public ApiResponse<PageData<Projects>> findPage (@RequestBody PageWrap<Projects> pageWrap) { |
| | | return ApiResponse.success(projectsService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:projects:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Projects> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(Projects.class).export(projectsService.findPage(pageWrap).getRecords(), "æå¡é¡¹ç®ä¿¡æ¯è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:projects:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(projectsService.findById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("ä¼è®®å
³èç项ç®") |
| | | @PostMapping("/findListByObjId") |
| | | @CloudRequiredPermission("business:projects:query") |
| | | public ApiResponse<List<ProjectsResponse>> findListByObjId (@RequestParam Integer objId, @RequestParam Integer objType) { |
| | | return ApiResponse.success(projectsService.getProjectsList(objId,objType)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.cloud; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.RoomRecord; |
| | | import com.doumee.service.business.RoomRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/05/05 18:25 |
| | | */ |
| | | @Api(tags = "ä¼è®®å®¤å¼é¨è®°å½è¡¨") |
| | | @RestController |
| | | @RequestMapping("/cloudService/roomRecord") |
| | | public class CloudRoomRecordController extends BaseController { |
| | | |
| | | @Autowired |
| | | private RoomRecordService roomRecordService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:roomrecord:create") |
| | | public ApiResponse create(@RequestBody RoomRecord roomRecord) { |
| | | return ApiResponse.success(roomRecordService.create(roomRecord)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:roomrecord:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | roomRecordService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:roomrecord:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | roomRecordService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:roomrecord:update") |
| | | public ApiResponse updateById(@RequestBody RoomRecord roomRecord) { |
| | | roomRecordService.updateById(roomRecord); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:roomrecord:query") |
| | | public ApiResponse<PageData<RoomRecord>> findPage (@RequestBody PageWrap<RoomRecord> pageWrap) { |
| | | return ApiResponse.success(roomRecordService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:roomrecord:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<RoomRecord> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(RoomRecord.class).exportWithFirstAndEnd(roomRecordService.findPage(pageWrap).getRecords(), "ä¼è®®å®¤å¼é¨è®°å½_"+System.currentTimeMillis(),"ä¼è®®å®¤å¼é¨è®°å½è¡¨", "ä¼è®®å®¤å¼é¨è®°å½è¡¨",null,response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:roomrecord:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(roomRecordService.findById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.cloud; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.RoomTime; |
| | | import com.doumee.service.business.RoomTimeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/05/04 18:18 |
| | | */ |
| | | @Api(tags = "ä¼è®®å®¤é¢çº¦æ¶é´æ®µä¿¡æ¯è¡¨") |
| | | @RestController |
| | | @RequestMapping("/cloudService/roomTime") |
| | | public class CloudRoomTimeController extends BaseController { |
| | | |
| | | @Autowired |
| | | private RoomTimeService roomTimeService; |
| | | |
| | | |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:roomtime:create") |
| | | public ApiResponse create(@RequestBody RoomTime roomTime) { |
| | | return ApiResponse.success(roomTimeService.create(roomTime)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:roomtime:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | roomTimeService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:roomtime:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | roomTimeService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:roomtime:update") |
| | | public ApiResponse updateById(@RequestBody RoomTime roomTime) { |
| | | roomTimeService.updateById(roomTime); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:roomtime:query") |
| | | public ApiResponse<PageData<RoomTime>> findPage (@RequestBody PageWrap<RoomTime> pageWrap) { |
| | | return ApiResponse.success(roomTimeService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:roomtime:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<RoomTime> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(RoomTime.class).export(roomTimeService.findPage(pageWrap).getRecords(), "ä¼è®®å®¤é¢çº¦æ¶é´æ®µä¿¡æ¯è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:roomtime:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(roomTimeService.findById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("æ ¹æ®ç§å®¤æ¥ææ¥è¯¢ææçæ¶é´æ®µ") |
| | | @PostMapping("/findList") |
| | | @CloudRequiredPermission("business:roomtime:query") |
| | | public ApiResponse<List<RoomTime>> findPage (@RequestBody RoomTime pageWrap) { |
| | | return ApiResponse.success(roomTimeService.findList(pageWrap)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.cloud; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.QrCodeUtils; |
| | | import com.doumee.dao.business.model.RoomTime; |
| | | import com.doumee.dao.business.model.Rooms; |
| | | import com.doumee.dao.web.request.RoomTimeRequest; |
| | | import com.doumee.dao.web.request.RoomsRequest; |
| | | import com.doumee.dao.web.response.RoomsResponse; |
| | | import com.doumee.service.business.RoomTimeService; |
| | | import com.doumee.service.business.RoomsService; |
| | | import io.swagger.annotations.Api; |
| | | 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.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/05/04 18:18 |
| | | */ |
| | | @Api(tags = "ä¼è®®å®¤ä¿¡æ¯è¡¨") |
| | | @RestController |
| | | @RequestMapping("/cloudService/rooms") |
| | | public class CloudRoomsController extends BaseController { |
| | | |
| | | @Autowired |
| | | private RoomsService roomsService; |
| | | |
| | | @Autowired |
| | | private RoomTimeService roomTimeService; |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:rooms:create") |
| | | public ApiResponse create(@RequestBody Rooms rooms) { |
| | | return ApiResponse.success(roomsService.create(rooms)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:rooms:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | roomsService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:rooms:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | roomsService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:rooms:update") |
| | | public ApiResponse updateById(@RequestBody Rooms rooms) { |
| | | roomsService.updateById(rooms); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("ä¿®æ¹ç¶æ") |
| | | @PostMapping("/updateStatusById") |
| | | @CloudRequiredPermission("business:rooms:update") |
| | | public ApiResponse updateStatusById(@RequestBody Rooms rooms) { |
| | | roomsService.updateStatusById(rooms); |
| | | return ApiResponse.success(null); |
| | | } |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:rooms:query") |
| | | public ApiResponse<PageData<Rooms>> findPage (@RequestBody PageWrap<Rooms> pageWrap) { |
| | | return ApiResponse.success(roomsService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢æ¯å¦åå¨é¢çº¦è®°å½") |
| | | @GetMapping("/recordisExist") |
| | | @CloudRequiredPermission("business:rooms:query") |
| | | public ApiResponse<JSONObject> recordisExist (Integer id) { |
| | | JSONObject jsonObject=new JSONObject(); |
| | | Integer res=roomsService.recordisExist(id); |
| | | if(Constants.equalsInteger(res,Constants.ONE)){ |
| | | jsonObject.put("code","1"); |
| | | jsonObject.put("msg","false"); |
| | | }else{ |
| | | jsonObject.put("code","0"); |
| | | jsonObject.put("msg","sucess"); |
| | | } |
| | | return ApiResponse.success(jsonObject); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:rooms:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Rooms> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(Rooms.class).export(roomsService.findPage(pageWrap).getRecords(), "ä¼è®®å®¤ä¿¡æ¯è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:rooms:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(roomsService.findById(id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("æ¥è¯¢ææçä¼è®®å®¤è®°å½æ°æ®") |
| | | @PostMapping("/findList") |
| | | @CloudRequiredPermission("business:rooms:query") |
| | | public ApiResponse<List<Rooms>> findList (@RequestBody Rooms rooms) { |
| | | return ApiResponse.success(roomsService.findList(rooms)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("è·åä¼è®®å®¤å¼é¨äºç»´ç ") |
| | | @GetMapping("/getQrCode") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "ä¼è®®å®¤ä¸»é®", required = true), |
| | | }) |
| | | public ApiResponse<String> getQrCode(@RequestParam Integer id) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | return ApiResponse.success("æ¥è¯¢æå", roomsService.getQrCode(id,user.getId())); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("è·åä¼è®®å®¤å¼é¨äºç»´ç -å¾çæµ") |
| | | @GetMapping("/getQrCodeImg") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "ä¼è®®å®¤ä¸»é®", required = true) |
| | | }) |
| | | public void getQrCodeImg(@RequestParam Integer id,@RequestParam String token, HttpServletResponse response) throws Exception { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | response.setHeader("Cache-Control", "no-store, no-cache"); |
| | | response.setContentType("image/jpeg"); |
| | | String content =roomsService.getQrCode(id,user.getId()); |
| | | QrCodeUtils.encode(content,null, response.getOutputStream(), true); |
| | | } |
| | | |
| | | @ApiOperation("ä¼è®®å®¤å表") |
| | | @GetMapping("/roomsList") |
| | | public ApiResponse<List<RoomsResponse>> roomsList() { |
| | | return ApiResponse.success("æ¥è¯¢æå",roomsService.getRoomsList()); |
| | | } |
| | | |
| | | @ApiOperation("ä¼è®®å®¤æ¶é´å¼æ¾å表") |
| | | @PostMapping("/getRoomUseTime") |
| | | public ApiResponse<List<RoomTime>> getRoomUseTime(@RequestBody RoomTimeRequest roomTimeRequest) { |
| | | return ApiResponse.success("æ¥è¯¢æå",roomTimeService.getRoomUseTime(roomTimeRequest)); |
| | | } |
| | | |
| | | @ApiOperation("æçä¼è®®å®¤å表") |
| | | @PostMapping("/myRoomsPage") |
| | | public ApiResponse<IPage<RoomsResponse>> myRoomsPage(@RequestBody PageWrap<RoomsRequest> pageWrap) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | pageWrap.getModel().setUserId(user.getId()); |
| | | IPage<RoomsResponse> page = roomsService.getRoomsPage(pageWrap); |
| | | return ApiResponse.success("æ¥è¯¢æå",page); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("ä¼è®®å®¤è¯¦æ
") |
| | | @GetMapping("/getRoomDetail") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "roomId", value = "ä¼è®®å®¤ä¸»é®", required = true), |
| | | }) |
| | | public ApiResponse<RoomsResponse> getRoomDetail(@RequestParam Integer roomId) { |
| | | return ApiResponse.success("æ¥è¯¢æå",roomsService.getRoomDetail(roomId)); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.cloud; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.UserRel; |
| | | import com.doumee.service.business.UserRelService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/05/04 18:18 |
| | | */ |
| | | @Api(tags = "ä¼è®®å®¤ç®¡çåååä¼äººåå
³è表") |
| | | @RestController |
| | | @RequestMapping("/cloudService/userRel") |
| | | public class CloudUserRelController extends BaseController { |
| | | |
| | | @Autowired |
| | | private UserRelService userRelService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @CloudRequiredPermission("business:userrel:create") |
| | | public ApiResponse create(@RequestBody UserRel userRel) { |
| | | return ApiResponse.success(userRelService.create(userRel)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @CloudRequiredPermission("business:userrel:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | userRelService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @CloudRequiredPermission("business:userrel:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | userRelService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:userrel:update") |
| | | public ApiResponse updateById(@RequestBody UserRel userRel) { |
| | | userRelService.updateById(userRel); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:userrel:query") |
| | | public ApiResponse<PageData<UserRel>> findPage (@RequestBody PageWrap<UserRel> pageWrap) { |
| | | return ApiResponse.success(userRelService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:userrel:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<UserRel> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(UserRel.class).export(userRelService.findPage(pageWrap).getRecords(), "ä¼è®®å®¤ç®¡çåååä¼äººåå
³è表", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:userrel:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(userRelService.findById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.cloud; |
| | | |
| | | import cn.hutool.core.io.IoUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.admin.request.InDeviceEntranceParam; |
| | | import com.doumee.dao.admin.response.DevWgDataResponseParam; |
| | | import com.doumee.dao.admin.response.DevWgResponseParam; |
| | | import com.doumee.dao.admin.response.DevWgYtjResponseParam; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.BookingsService; |
| | | import com.doumee.service.business.DevicesService; |
| | | import com.doumee.service.system.SystemUserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * å¾®å
äºç»´ç 请æ±å
¥å£ |
| | | * |
| | | * @author lishuai |
| | | * @email |
| | | * @date 2022-12-12 14:30:50 |
| | | */ |
| | | @Api(tags = "å¾®å
äºç»´ç 请æ±å
¥å£æ¥å£",value = "") |
| | | @RestController |
| | | @RequestMapping("/cloudService/wgListener") |
| | | @Slf4j |
| | | public class CloudWgListenerController { |
| | | @Autowired |
| | | private SystemUserService systemUserService; |
| | | @Autowired |
| | | private BookingsService bookingsService; |
| | | @Autowired |
| | | private DevicesService devicesService; |
| | | @ApiOperation(value="å¾®å
äºç»´ç è¿åºæ ¸éå
¥å£") |
| | | @PostMapping("/qrcodeIn") |
| | | public void qrcodeIn(HttpServletRequest request, HttpServletResponse response) throws Exception{ |
| | | // å
¥å£è°ç¨è¿åjson |
| | | response.setDateHeader("Expires", 0); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | DevWgResponseParam json = reqJSONObject( request); |
| | | log.info("æå°jsonæ°æ®================="+json); |
| | | if(null == json) { |
| | | ApiResponse.outputCode(response,"-1"); |
| | | return; |
| | | } |
| | | try { |
| | | if(StringUtils.equals("hello",json.getVgdecoderesult())){ |
| | | //妿æ¯å¿è·³è®¾ç½® |
| | | devicesService.doHeartDeal(json.getDevicenumber()); |
| | | log.info("å¿è·³æå================="+json.getDevicenumber()); |
| | | ApiResponse.outputCode(response,"-1"); |
| | | }else{ |
| | | bookingsService.openRoomDoor(json); |
| | | log.info("æ«ç æå================="); |
| | | ApiResponse.outputCode(response,"0000"); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | log.info("æ«ç å¼å¸¸================="+e.getMessage()); |
| | | ApiResponse.outputCode(response,"-1"); |
| | | } |
| | | } |
| | | @ApiOperation(value="å¾®å
ä¸ä½æºäºç»´ç è¿åºæ ¸éå
¥å£") |
| | | @PostMapping("/qrcodeInYtj") |
| | | public void qrcodeInNew(HttpServletRequest request, HttpServletResponse response) throws Exception{ |
| | | // å
¥å£è°ç¨è¿åjson |
| | | response.setDateHeader("Expires", 0); |
| | | response.setHeader("Content-Type", "text/html;charset=UTF-8"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | DevWgResponseParam json = reqJSONObjectYtj( request); |
| | | log.info("æå°jsonæ°æ®================="+json); |
| | | if(null == json) { |
| | | ApiResponse.outputCode(response,"-1"); |
| | | return; |
| | | } |
| | | try { |
| | | if(StringUtils.equals("hello",json.getVgdecoderesult())){ |
| | | //妿æ¯å¿è·³è®¾ç½® |
| | | devicesService.doHeartDeal(json.getDevicenumber()); |
| | | log.info("å¿è·³æå================="+json.getDevicenumber()); |
| | | ApiResponse.outputCode(response,-1,"å¿è·³å¤±è´¥"); |
| | | }else{ |
| | | bookingsService.openRoomDoor(json); |
| | | log.info("æ«ç æå================="); |
| | | ApiResponse.outputCode(response,0,"è®¤è¯æå"); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | log.info("æ«ç å¼å¸¸================="+e.getMessage()); |
| | | ApiResponse.outputCode(response,-1,e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | private DevWgResponseParam reqJSONObjectYtj(HttpServletRequest request) throws Exception{ |
| | | //"type":2,"data":"8tiDkHTlGJdmxP4yAkO7mPR2odwwPgtW","time":1692772938,"deviceSn":"C238180003" |
| | | String input = IoUtil.read(request.getInputStream(), "utf-8"); |
| | | log.info("ä¸ä½æºè¯»å¤´è®¾å¤è¿åçäºç»´ç ä¿¡æ¯==========="+input); |
| | | DevWgYtjResponseParam param1 = JSONObject.toJavaObject(JSONObject.parseObject(input), DevWgYtjResponseParam.class); |
| | | DevWgResponseParam param = new DevWgResponseParam(); |
| | | param.setVgdecoderesult(param1.getData()); |
| | | param.setDevicenumber(param1.getDeviceSn()); |
| | | log.info("ä¸ä½æºå¯¹è±¡æ°æ®================="+param); |
| | | //å¯¹è±¡ä¼ json |
| | | return param; |
| | | } |
| | | |
| | | @ApiOperation(value="å¾®å
äºç»´ç åºåºæ ¸éåºå£") |
| | | @PostMapping("/qrcodeOut") |
| | | public void qrcodeOut( HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | // åºå£è°ç¨è¿åjson |
| | | DevWgResponseParam json = reqJSONObject( request); |
| | | log.info("æå°jsonæ°æ®=================="+json); |
| | | if(null == json) { |
| | | return; |
| | | } |
| | | ApiResponse.outputCode(response,"0000"); |
| | | } |
| | | |
| | | /** |
| | | * å¾®å
äºç»´ç è¯»å¤´é¸æºè¯·æ±ï¼è°ç¨è¿åºåºæ¥å£jsonå°è£
|
| | | */ |
| | | private DevWgResponseParam reqJSONObject( HttpServletRequest request) throws Exception{ |
| | | String input = IoUtil.read(request.getInputStream(), "utf-8"); |
| | | log.info("读头设å¤è¿åçäºç»´ç ä¿¡æ¯==========="+input); |
| | | String[] split = input.split("&&"); |
| | | DevWgResponseParam param = new DevWgResponseParam(); |
| | | int indexOne = split[0].indexOf("="); |
| | | int indexTwo = split[1].indexOf("="); |
| | | param.setVgdecoderesult(split[0].substring(indexOne+1)); |
| | | param.setDevicenumber(split[1].substring(indexTwo+1)); |
| | | log.info("å¯¹è±¡æ°æ®================="+param); |
| | | //å¯¹è±¡ä¼ json |
| | | // JSONObject json = getJSONObject(param); |
| | | return param; |
| | | } |
| | | |
| | | @ApiOperation(value="äºä»¶çå¬æç±»åå¤ç---å¾®å
ä¸ä½æºè¿åº") |
| | | @PostMapping("/taskTwo") |
| | | public void taskTwo( HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | // å
¥å£è°ç¨è¿åjson |
| | | JSONObject jsonObject = reqMachineJSONObject( request); |
| | | log.info("åæ°================"+jsonObject); |
| | | if(null == jsonObject) { |
| | | return; |
| | | } |
| | | ApiResponse.outputCode(response,0,"success"); |
| | | } |
| | | |
| | | @ApiOperation(value="äºä»¶çå¬æç±»åå¤ç---å¾®å
ä¸ä½æºåºåº") |
| | | @PostMapping("/taskOutTwo") |
| | | public void taskOutTwo( HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | // å
¥å£è°ç¨è¿åjson |
| | | JSONObject jsonObject = reqMachineJSONObject( request); |
| | | log.info("åæ°================"+jsonObject); |
| | | if(null == jsonObject) { |
| | | return; |
| | | } |
| | | |
| | | ApiResponse.outputCode(response,0,"success"); |
| | | } |
| | | |
| | | /** |
| | | * å¾®å
ä¸ä½æºé¸æºè¯·æ±ï¼è°ç¨è¿åºåºæ¥å£jsonå°è£
|
| | | * @return |
| | | */ |
| | | private JSONObject reqMachineJSONObject( HttpServletRequest request) throws Exception { |
| | | |
| | | // å设ä¸å¡è®¤è¯æå |
| | | String input = IoUtil.read(request.getInputStream(), "utf-8"); |
| | | DevWgDataResponseParam responseParam = JSON.parseObject(input , DevWgDataResponseParam.class); |
| | | //å¯¹è±¡ä¼ json |
| | | InDeviceEntranceParam param = new InDeviceEntranceParam(); |
| | | if("1".equals(responseParam.getType())) { //äººè¸ |
| | | param.setFlag("2"); |
| | | param.setUserId(responseParam.getData()); |
| | | }else if("2".equals(responseParam.getType())) { //äºç»´ç |
| | | param.setFlag("1"); |
| | | param.setCode(responseParam.getData()); |
| | | }else if("3".equals(responseParam.getType())) { //å·å¡ |
| | | param.setFlag("3"); |
| | | // æ ¹æ®ä¼åå®ä½å¡å·å
³èæ¥è¯¢ï¼ä¼åå·¥å· |
| | | SystemUser memberDo = systemUserService.findById(1); |
| | | if(null != memberDo) { |
| | | param.setUserId( memberDo.getEmpNo()); |
| | | } |
| | | param.setCardNo(responseParam.getData()); |
| | | |
| | | } |
| | | param.setDeskId(responseParam.getDeviceSn()); |
| | | param.setInTime(DateUtil.getCurrDateTime()); |
| | | param.setOutTime(DateUtil.getCurrDateTime()); |
| | | JSONObject json =(JSONObject) JSONObject.toJSON(param); |
| | | return (JSONObject)JSONObject.toJSON(param); |
| | | } |
| | | } |
| | |
| | | @Select(" select a.id , b.`NAME` as roomName , a.`NAME` as meetingName ,date_format(a.START_TIME,'%Y-%m-%d') as meetingDate ," + |
| | | " CONCAT(date_format(a.START_TIME,'%H:%i') , ' ~ ',date_format(a.END_TIME,'%H:%i')) as meetingTime, c.REALNAME as bookingUser ," + |
| | | " CASE WHEN a.START_TIME > now() and a.`STATUS` = 0 THEN 1 WHEN a.END_TIME < now() or a.`STATUS` = 1 THEN 3 ELSE 2 END meetingStatus , b.IMGURL as imgUrl " + |
| | | " from bookings a inner join rooms b on a.ROOM_ID = b.ID " + |
| | | " from meeting_book a inner join meeting_rooms b on a.ROOM_ID = b.ID " + |
| | | " inner join system_user c on a.CREATOR = c.id " + |
| | | " ${ew.customSqlSegment} ") |
| | | IPage<MeetingListResponse> myMeetingPage(IPage<MeetingListResponse> page, @Param(Constants.WRAPPER) Wrapper wrapper); |
| | |
| | | " CONCAT(date_format(a.START_TIME,'%H:%i') , ' ~ ',date_format(a.END_TIME,'%H:%i')) as meetingTime, c.REALNAME as bookingUserName ," + |
| | | " CASE WHEN a.START_TIME > now() and a.`STATUS` = 0 THEN 1 WHEN a.END_TIME < now() or a.`STATUS` = 1 THEN 3 ELSE 2 END meetingStatus ," + |
| | | " a.CONTENT as meetingContent, c.MOBILE as bookingUserMobile , e.`NAME` as bookingUserDepartment , a.CREATOR as bookingUserId , a.remark " + |
| | | " from bookings a inner join rooms b on a.ROOM_ID = b.ID " + |
| | | " from meeting_book a inner join meeting_rooms b on a.ROOM_ID = b.ID " + |
| | | " inner join system_user c on a.CREATOR = c.id " + |
| | | " inner join system_department_user d on c.id = d.USER_ID " + |
| | | " INNER JOIN system_department e on d.DEPARTMENT_ID = e.ID " + |
| | |
| | | "b.ROOM_ID,\n" + |
| | | "r.NAME,\n" + |
| | | "SUM( CONVERT( (UNIX_TIMESTAMP(b.END_TIME) - UNIX_TIMESTAMP(b.START_TIME))/(60*60),DECIMAL(5,1))) c\n" + |
| | | "FROM bookings b\n" + |
| | | "LEFT JOIN rooms r ON r.ID = b.ROOM_ID \n" + |
| | | "FROM meeting_book b\n" + |
| | | "LEFT JOIN meeting_rooms r ON r.ID = b.ROOM_ID \n" + |
| | | "WHERE DATE_FORMAT(b.START_TIME,'%Y') = #{yearNum} AND b.STATUS = 0 \n" + |
| | | "GROUP BY b.ROOM_ID , DATE_FORMAT(b.START_TIME,'%m')\n" + |
| | | ") t) t1 GROUP BY t1.name") |
| | |
| | | "SUM(" + |
| | | "CONVERT( (UNIX_TIMESTAMP(b.END_TIME) - UNIX_TIMESTAMP(b.START_TIME))/(60*60), DECIMAL(5,1))) c\n" + |
| | | "FROM \n" + |
| | | "user_rel ur\n" + |
| | | "meeting_user_rel ur\n" + |
| | | "LEFT JOIN `SYSTEM_USER` su ON ur.USER_ID = su.id \n" + |
| | | "LEFT JOIN bookings b ON ur.OBJ_ID = b.id \n" + |
| | | "LEFT JOIN meeting_book b ON ur.OBJ_ID = b.id \n" + |
| | | "WHERE DATE_FORMAT(b.START_TIME,'%Y') = #{yearNum} AND b.STATUS = 0" + |
| | | "<if test='userId != null'>"+ |
| | | "and ur.USER_ID = #{userId}\n" + |
| | |
| | | public interface ProjectsMapper extends BaseMapper<Projects> { |
| | | |
| | | |
| | | @Select(" SELECT * FROM Projects " + |
| | | @Select(" SELECT * FROM meeting_projects " + |
| | | " ${ew.customSqlSegment} ") |
| | | List<ProjectsResponse> getProjectsList(@Param(Constants.WRAPPER) Wrapper wrapper); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | @Select(" SELECT * FROM rooms " + |
| | | @Select(" SELECT * FROM meeting_rooms " + |
| | | " ${ew.customSqlSegment} ") |
| | | List<RoomsResponse> getRoomsList(@Param(Constants.WRAPPER) Wrapper wrapper); |
| | | |
| | | |
| | | |
| | | @Select(" select * from rooms " + |
| | | @Select(" select * from meeting_rooms " + |
| | | " ${ew.customSqlSegment} ") |
| | | IPage<RoomsResponse> myRoomsPage(IPage<RoomsResponse> page, @Param(Constants.WRAPPER) Wrapper wrapper); |
| | | |
| | | |
| | | |
| | | @Select(" select * from rooms " + |
| | | @Select(" select * from meeting_rooms " + |
| | | " where id = #{id} ") |
| | | RoomsResponse myRoomsDetail(@Param("id") Integer id); |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Integer recordisExist(Integer roomsId) { |
| | | MPJLambdaWrapper<Bookings> queryBooke = new MPJLambdaWrapper<>(); |
| | | queryBooke.eq(Bookings::getIsdeleted, Constants.ZERO); |
| | |
| | | MonthDataResponse monthDataResponse = new MonthDataResponse(); |
| | | monthDataResponse.setWeekMsg(DateUtil.getWeek(DateUtil.StringToDate(str,"yyyy-MM-dd")).getChineseName()); |
| | | monthDataResponse.setMonthDate(str); |
| | | monthDataResponse.setMeetingNum(bookings.stream().filter(b-> DateUtil.dateToString(b.getStartTime(),"yyyy-MM-dd").equals(str)).collect(Collectors.toList()).size()); |
| | | monthDataResponse.setMeetingNum(bookings.stream() |
| | | .filter(b-> DateUtil.dateToString(b.getStartTime(),"yyyy-MM-dd").equals(str)).collect(Collectors.toList()).size()); |
| | | monthDataResponseList.add(monthDataResponse); |
| | | } |
| | | return ApiResponse.success("æ¥è¯¢æå",monthDataResponseList); |
| | |
| | | e.printStackTrace(); |
| | | |
| | | } |
| | | // OutputStream out = null; |
| | | // try{ |
| | | // response.setHeader("Cache-Control", "no-store, no-cache"); |
| | | // response.setContentType("image/jpeg"); |
| | | // InputStream inputStream = utilService.generateImgStream(bookingsId,userId); |
| | | // out = response.getOutputStream(); |
| | | // int len = 0; |
| | | // byte[] b = new byte[1024]; |
| | | // while ((len = inputStream.read(b)) != -1) { |
| | | // out.write(b, 0, len); |
| | | // } |
| | | // out.flush(); |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // }finally { |
| | | // try { |
| | | // if (out != null) { |
| | | // out.close(); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | password: nacos |
| | | discovery: |
| | | server-addr: http://175.27.187.84:8848 #é
ç½®Nacoså°å |
| | | namespace: dmvisit |
| | | namespace: dev_renkang |
| | | username: nacos |
| | | password: nacos |
| | | gateway: |