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