|
@@ -0,0 +1,93 @@
|
|
|
+package cn.iocoder.yudao.module.bpm.controller.admin.meeting.room;
|
|
|
+
|
|
|
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
+import cn.iocoder.yudao.module.bpm.controller.admin.meeting.room.vo.OaMeetingRoomPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.bpm.controller.admin.meeting.room.vo.OaMeetingRoomRespVO;
|
|
|
+import cn.iocoder.yudao.module.bpm.controller.admin.meeting.room.vo.OaMeetingRoomSaveReqVO;
|
|
|
+import cn.iocoder.yudao.module.bpm.dal.dataobject.meeting.room.OaMeetingRoomDO;
|
|
|
+import cn.iocoder.yudao.module.bpm.service.meeting.room.OaMeetingRoomService;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.Parameter;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
|
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
+
|
|
|
+@Tag(name = "管理后台 - 会议室信息管理")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/bpm/oa-meeting-room")
|
|
|
+@Validated
|
|
|
+public class OaMeetingRoomController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private OaMeetingRoomService oaMeetingRoomService;
|
|
|
+
|
|
|
+ @PostMapping("/create")
|
|
|
+ @Operation(summary = "创建会议室信息管理")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('bpm:oa-meeting-room:create')")
|
|
|
+ public CommonResult<Long> createOaMeetingRoom(@Valid @RequestBody OaMeetingRoomSaveReqVO createReqVO) {
|
|
|
+ return success(oaMeetingRoomService.createOaMeetingRoom(createReqVO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/update")
|
|
|
+ @Operation(summary = "更新会议室信息管理")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('bpm:oa-meeting-room:update')")
|
|
|
+ public CommonResult<Boolean> updateOaMeetingRoom(@Valid @RequestBody OaMeetingRoomSaveReqVO updateReqVO) {
|
|
|
+ oaMeetingRoomService.updateOaMeetingRoom(updateReqVO);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/delete")
|
|
|
+ @Operation(summary = "删除会议室信息管理")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true)
|
|
|
+ // @PreAuthorize("@ss.hasPermission('bpm:oa-meeting-room:delete')")
|
|
|
+ public CommonResult<Boolean> deleteOaMeetingRoom(@RequestParam("id") Long id) {
|
|
|
+ oaMeetingRoomService.deleteOaMeetingRoom(id);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/get")
|
|
|
+ @Operation(summary = "获得会议室信息管理")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('bpm:oa-meeting-room:query')")
|
|
|
+ public CommonResult<OaMeetingRoomRespVO> getOaMeetingRoom(@RequestParam("id") Long id) {
|
|
|
+ OaMeetingRoomDO oaMeetingRoom = oaMeetingRoomService.getOaMeetingRoom(id);
|
|
|
+ return success(BeanUtils.toBean(oaMeetingRoom, OaMeetingRoomRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/page")
|
|
|
+ @Operation(summary = "获得会议室信息管理分页")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('bpm:oa-meeting-room:query')")
|
|
|
+ public CommonResult<PageResult<OaMeetingRoomRespVO>> getOaMeetingRoomPage(@Valid OaMeetingRoomPageReqVO pageReqVO) {
|
|
|
+ PageResult<OaMeetingRoomDO> pageResult = oaMeetingRoomService.getOaMeetingRoomPage(pageReqVO);
|
|
|
+ return success(BeanUtils.toBean(pageResult, OaMeetingRoomRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/export-excel")
|
|
|
+ @Operation(summary = "导出会议室信息管理 Excel")
|
|
|
+ // @PreAuthorize("@ss.hasPermission('bpm:oa-meeting-room:export')")
|
|
|
+ @ApiAccessLog(operateType = EXPORT)
|
|
|
+ public void exportOaMeetingRoomExcel(@Valid OaMeetingRoomPageReqVO pageReqVO,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ List<OaMeetingRoomDO> list = oaMeetingRoomService.getOaMeetingRoomPage(pageReqVO).getList();
|
|
|
+ // 导出 Excel
|
|
|
+ ExcelUtils.write(response, "会议室信息管理.xls", "数据", OaMeetingRoomRespVO.class,
|
|
|
+ BeanUtils.toBean(list, OaMeetingRoomRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|