选煤厂生产管理平台后台代码
dongyukun
2024-12-11 3c46415ec95e8a542ab98ba686c4d9666c8776c1
提交 | 用户 | 时间
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.QualityMediumDTO;
8 import com.iailab.module.pms.coalquality.modules.detection.service.QualityMediumService;
9 import com.iailab.module.pms.coalquality.modules.detection.vo.MediumPageReqVO;
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 PanZhibao
20  * @Description
21  * @createTime 2023年02月07日 17:36:00
22  */
23 @Slf4j
24 @RestController
e16f4e 25 @RequestMapping("/xmcpms/quality/medium")
7e21bc 26 @Tag(name = "介质粉检测")
J 27 public class QualityMediumController {
28     @Autowired
29     private QualityMediumService qualityMediumService;
30
31     @GetMapping("page")
32     @Operation(summary = "分页")
33     public CommonResult<PageResult<QualityMediumDTO>> page(MediumPageReqVO mediumPageReqVO){
34         PageResult<QualityMediumDTO> page = qualityMediumService.page(mediumPageReqVO);
35
36         return success(page);
37     }
38
39     @GetMapping("{id}")
40     @Operation(summary = "信息")
41     public CommonResult<QualityMediumDTO> get(@PathVariable("id") String id){
42         QualityMediumDTO data = qualityMediumService.get(id);
43         return success(data);
44     }
45
46     @PostMapping
47     @Operation(summary = "保存")
48     public CommonResult<Boolean> save(@RequestBody QualityMediumDTO dto){
49 //        //效验数据
50 //        ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
51
52         qualityMediumService.save(dto);
53
54         return success(true);
55     }
56
57     @PutMapping
58     @Operation(summary = "修改")
59     public CommonResult<Boolean> update(@RequestBody QualityMediumDTO dto){
60 //        //效验数据
61 //        ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
62 //
63 //        if (qualityMediumService.cheack(dto) > 0) {
64 //            return new CommonResult().error("编号重复");
65 //        }
66
67         qualityMediumService.update(dto);
68
69         return success(true);
70     }
71
72     @DeleteMapping
73     @Operation(summary = "删除")
74     public CommonResult<Boolean> delete(@RequestBody String[] ids){
75         //效验数据
76         AssertUtils.isArrayEmpty(ids, "id");
77
78         qualityMediumService.delete(ids);
79
80         return success(true);
81     }
82
83 }