|
|
@@ -0,0 +1,95 @@
|
|
|
+package cn.iocoder.yudao.module.iscs.controller.admin.jobticketlockset;
|
|
|
+
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import jakarta.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 jakarta.validation.constraints.*;
|
|
|
+import jakarta.validation.*;
|
|
|
+import jakarta.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.iscs.controller.admin.jobticketlockset.vo.*;
|
|
|
+import cn.iocoder.yudao.module.iscs.dal.dataobject.jobticketlockset.JobTicketLocksetDO;
|
|
|
+import cn.iocoder.yudao.module.iscs.service.jobticketlockset.JobTicketLocksetService;
|
|
|
+
|
|
|
+@Tag(name = "管理后台 - 作业票锁具")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/iscs/job-ticket-lockset")
|
|
|
+@Validated
|
|
|
+public class JobTicketLocksetController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private JobTicketLocksetService jobTicketLocksetService;
|
|
|
+
|
|
|
+ @PostMapping("/insertJobTicketLockset")
|
|
|
+ @Operation(summary = "创建作业票锁具")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:job-ticket-lockset:create')")
|
|
|
+ public CommonResult<Long> insertJobTicketLockset(@Valid @RequestBody JobTicketLocksetSaveReqVO createReqVO) {
|
|
|
+ return success(jobTicketLocksetService.createJobTicketLockset(createReqVO));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping("/updateJobTicketLockset")
|
|
|
+ @Operation(summary = "更新作业票锁具")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:job-ticket-lockset:update')")
|
|
|
+ public CommonResult<Boolean> updateJobTicketLockset(@Valid @RequestBody JobTicketLocksetSaveReqVO updateReqVO) {
|
|
|
+ jobTicketLocksetService.updateJobTicketLockset(updateReqVO);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/deleteJobTicketLocksetList")
|
|
|
+ @Parameter(name = "ids", description = "编号", required = true)
|
|
|
+ @Operation(summary = "批量删除作业票锁具")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:job-ticket-lockset:delete')")
|
|
|
+ public CommonResult<Boolean> deleteJobTicketLocksetList(@RequestParam("ids") List<Long> ids) {
|
|
|
+ jobTicketLocksetService.deleteJobTicketLocksetListByIds(ids);
|
|
|
+ return success(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/selectJobTicketLocksetById")
|
|
|
+ @Operation(summary = "获得作业票锁具")
|
|
|
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:job-ticket-lockset:query')")
|
|
|
+ public CommonResult<JobTicketLocksetRespVO> selectJobTicketLocksetById(@RequestParam("id") Long id) {
|
|
|
+ JobTicketLocksetDO jobTicketLockset = jobTicketLocksetService.getJobTicketLockset(id);
|
|
|
+ return success(BeanUtils.toBean(jobTicketLockset, JobTicketLocksetRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/getJobTicketLocksetPage")
|
|
|
+ @Operation(summary = "获得作业票锁具分页")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:job-ticket-lockset:query')")
|
|
|
+ public CommonResult<PageResult<JobTicketLocksetRespVO>> getJobTicketLocksetPage(@Valid JobTicketLocksetPageReqVO pageReqVO) {
|
|
|
+ PageResult<JobTicketLocksetDO> pageResult = jobTicketLocksetService.getJobTicketLocksetPage(pageReqVO);
|
|
|
+ return success(BeanUtils.toBean(pageResult, JobTicketLocksetRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/exportJobTicketLocksetExcel")
|
|
|
+ @Operation(summary = "导出作业票锁具 Excel")
|
|
|
+ @PreAuthorize("@ss.hasPermission('iscs:job-ticket-lockset:export')")
|
|
|
+ @ApiAccessLog(operateType = EXPORT)
|
|
|
+ public void exportJobTicketLocksetExcel(@Valid JobTicketLocksetPageReqVO pageReqVO,
|
|
|
+ HttpServletResponse response) throws IOException {
|
|
|
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
+ List<JobTicketLocksetDO> list = jobTicketLocksetService.getJobTicketLocksetPage(pageReqVO).getList();
|
|
|
+ // 导出 Excel
|
|
|
+ ExcelUtils.write(response, "作业票锁具.xls", "数据", JobTicketLocksetRespVO.class,
|
|
|
+ BeanUtils.toBean(list, JobTicketLocksetRespVO.class));
|
|
|
+ }
|
|
|
+
|
|
|
+}
|