|  |  |  | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.model.YwContractRoom; | 
|---|
|  |  |  | import com.doumee.dao.business.model.YwRoom; | 
|---|
|  |  |  | import com.doumee.dao.business.vo.YwFloorStatusDataVO; | 
|---|
|  |  |  | import com.doumee.dao.business.vo.YwRoomContractDataVO; | 
|---|
|  |  |  | import com.doumee.service.business.YwRoomService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/create") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywroom:create") | 
|---|
|  |  |  | public ApiResponse create(@RequestBody YwRoom ywRoom,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | ywRoom.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(ywRoomService.create(ywRoom)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @GetMapping("/delete/{id}") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywroom:delete") | 
|---|
|  |  |  | public ApiResponse deleteById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | ywRoomService.deleteById(id); | 
|---|
|  |  |  | ywRoomService.deleteById(id,this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | for (String id : idArray) { | 
|---|
|  |  |  | idList.add(Integer.valueOf(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ywRoomService.deleteByIdInBatch(idList); | 
|---|
|  |  |  | ywRoomService.deleteByIdInBatch(idList,this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/updateById") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywroom:update") | 
|---|
|  |  |  | public ApiResponse updateById(@RequestBody YwRoom ywRoom,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | ywRoom.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | ywRoomService.updateById(ywRoom); | 
|---|
|  |  |  | return ApiResponse.success(null); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("查询列表") | 
|---|
|  |  |  | @PostMapping("/list") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywroom:query") | 
|---|
|  |  |  | public ApiResponse<List<YwRoom>> findList (@RequestBody  YwRoom pageWrap, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | pageWrap.setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(ywRoomService.findList(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @ApiOperation("分页查询") | 
|---|
|  |  |  | @PostMapping("/page") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywroom:query") | 
|---|
|  |  |  | public ApiResponse<PageData<YwRoom>> findPage (@RequestBody PageWrap<YwRoom> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | pageWrap.getModel().setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | return ApiResponse.success(ywRoomService.findPage(pageWrap)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | @PostMapping("/exportExcel") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywroom:exportExcel") | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<YwRoom> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | pageWrap.getModel().setLoginUserInfo(this.getLoginUser(token)); | 
|---|
|  |  |  | ExcelExporter.build(YwRoom.class).export(ywRoomService.findPage(pageWrap).getRecords(), "运维房源信息表", response); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | return ApiResponse.success(ywRoomService.findById(id)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("查询房间态势数据") | 
|---|
|  |  |  | @PostMapping("/getRoomStatusList") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywroom:query") | 
|---|
|  |  |  | public ApiResponse<List<YwFloorStatusDataVO>> getRoomStatusList (@RequestBody  YwRoom model, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | return ApiResponse.success(ywRoomService.getRoomStatusList(model)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation("查询房间租赁信息") | 
|---|
|  |  |  | @PostMapping("/getRoomContract") | 
|---|
|  |  |  | @CloudRequiredPermission("business:ywroom:query") | 
|---|
|  |  |  | public ApiResponse<YwRoomContractDataVO> getRoomContract (@RequestBody  YwRoom model, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | return ApiResponse.success(ywRoomService.getRoomContract(model)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|