选煤厂生产管理平台后台代码
dongyukun
2024-12-11 e16f4e463a6a090798c189a78a4a8f08295d31a6
提交 | 用户 | 时间
7e21bc 1 package com.iailab.module.pms.coalquality.modules.detection.controller.admin;
J 2
3
4 import com.iailab.framework.common.pojo.CommonResult;
5 import com.iailab.framework.common.pojo.PageResult;
6 import com.iailab.iems.common.validator.AssertUtils;
7 import com.iailab.module.pms.coalquality.modules.detection.dto.QualityQuickDTO;
8 import com.iailab.module.pms.coalquality.modules.detection.service.QualityQuickService;
9 import com.iailab.module.pms.coalquality.modules.detection.vo.QuickPageReqVO;
10 import io.swagger.v3.oas.annotations.Operation;
11 import io.swagger.v3.oas.annotations.tags.Tag;
12 import lombok.extern.slf4j.Slf4j;
13 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.web.bind.annotation.*;
15
16 import static com.iailab.framework.common.pojo.CommonResult.success;
17
18 /**
19  * @author DongYukun
20  * @Description
21  * @createTime 2023年12月27日 9:53:00
22  */
23 @Slf4j
24 @RestController
e16f4e 25 @RequestMapping("/xmcpms/quality/quick")
7e21bc 26 @Tag(name = "生产快检")
J 27 public class QualityQuickController {
28     @Autowired
29     private QualityQuickService qualityQuickService;
30
31     @GetMapping("page")
32     @Operation(summary = "分页")
33     public CommonResult<PageResult<QualityQuickDTO>> page(QuickPageReqVO quickPageReqVO){
34         PageResult<QualityQuickDTO> page = qualityQuickService.page(quickPageReqVO);
35
36         return success(page);
37     }
38
39     @GetMapping("{id}")
40     @Operation(summary = "信息")
41     public CommonResult<QualityQuickDTO> get(@PathVariable("id") String id){
42         QualityQuickDTO data = qualityQuickService.get(id);
43         return success(data);
44     }
45
46     @PostMapping
47     @Operation(summary = "保存")
48     public CommonResult<Boolean> save(@RequestBody QualityQuickDTO dto){
49
50         qualityQuickService.save(dto);
51
52         return success(true);
53     }
54
55     @PutMapping
56     @Operation(summary = "修改")
57     public CommonResult<Boolean> update(@RequestBody QualityQuickDTO dto){
58
59         qualityQuickService.update(dto);
60
61         return success(true);
62     }
63
64     @DeleteMapping
65     @Operation(summary = "删除")
66     public CommonResult<Boolean> delete(@RequestBody String[] ids){
67         //效验数据
68         AssertUtils.isArrayEmpty(ids, "id");
69
70         qualityQuickService.delete(ids);
71
72         return success(true);
73     }
74 }