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