|
|
@@ -0,0 +1,96 @@
|
|
|
+package cn.iocoder.yudao.module.bpm.controller.admin.oa.stamp;
|
|
|
+
|
|
|
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.stamp.vo.OaStampPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.stamp.vo.OaStampRespVO;
|
|
|
+import cn.iocoder.yudao.module.bpm.controller.admin.oa.stamp.vo.OaStampSaveReqVO;
|
|
|
+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.oa.stamp.OaStampDO;
|
|
|
+import cn.iocoder.yudao.module.bpm.service.oa.stamp.OaStampService;
|
|
|
+
|
|
|
+@Tag(name = "管理后台 - 用印流程信息")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/bpm/oa-stamp")
|
|
|
+@Validated
|
|
|
+public class OaStampController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private OaStampService oaStampService;
|
|
|
+
|
|
|
+ @PostMapping("/create")
|
|
|
+ @Operation(summary = "创建用印流程信息")
|
|
|
+ @PreAuthorize("@ss.hasPermission('bpm:oa-stamp:create')")
|
|
|
+ public CommonResult<Long> createOaStamp(@Valid @RequestBody OaStampSaveReqVO createReqVO) {
|
|
|
+ return success(oaStampService.createOaStamp(createReqVO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/update")
|
|
|
+ @Operation(summary = "更新用印流程信息")
|
|
|
+ @PreAuthorize("@ss.hasPermission('bpm:oa-stamp:update')")
|
|
|
+ public CommonResult<Boolean> updateOaStamp(@Valid @RequestBody OaStampSaveReqVO updateReqVO) {
|
|
|
+ oaStampService.updateOaStamp(updateReqVO);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/delete")
|
|
|
+ @Operation(summary = "删除用印流程信息")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true)
|
|
|
+ @PreAuthorize("@ss.hasPermission('bpm:oa-stamp:delete')")
|
|
|
+ public CommonResult<Boolean> deleteOaStamp(@RequestParam("id") Long id) {
|
|
|
+ oaStampService.deleteOaStamp(id);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/get")
|
|
|
+ @Operation(summary = "获得用印流程信息")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
+ @PreAuthorize("@ss.hasPermission('bpm:oa-stamp:query')")
|
|
|
+ public CommonResult<OaStampRespVO> getOaStamp(@RequestParam("id") Long id) {
|
|
|
+ OaStampDO oaStamp = oaStampService.getOaStamp(id);
|
|
|
+ return success(BeanUtils.toBean(oaStamp, OaStampRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/page")
|
|
|
+ @Operation(summary = "获得用印流程信息分页")
|
|
|
+ @PreAuthorize("@ss.hasPermission('bpm:oa-stamp:query')")
|
|
|
+ public CommonResult<PageResult<OaStampRespVO>> getOaStampPage(@Valid OaStampPageReqVO pageReqVO) {
|
|
|
+ PageResult<OaStampDO> pageResult = oaStampService.getOaStampPage(pageReqVO);
|
|
|
+ return success(BeanUtils.toBean(pageResult, OaStampRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/export-excel")
|
|
|
+ @Operation(summary = "导出用印流程信息 Excel")
|
|
|
+ @PreAuthorize("@ss.hasPermission('bpm:oa-stamp:export')")
|
|
|
+ @ApiAccessLog(operateType = EXPORT)
|
|
|
+ public void exportOaStampExcel(@Valid OaStampPageReqVO pageReqVO,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ List<OaStampDO> list = oaStampService.getOaStampPage(pageReqVO).getList();
|
|
|
+ // 导出 Excel
|
|
|
+ ExcelUtils.write(response, "用印流程信息.xls", "数据", OaStampRespVO.class,
|
|
|
+ BeanUtils.toBean(list, OaStampRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|