选煤厂生产管理平台后台代码
dongyukun
2024-12-11 3c46415ec95e8a542ab98ba686c4d9666c8776c1
提交 | 用户 | 时间
7e21bc 1 package com.iailab.module.pms.coalquality.modules.wash.controller.admin;
J 2
3 import com.iailab.framework.common.annotation.AutoDict;
4 import com.iailab.framework.common.pojo.CommonResult;
5 import com.iailab.framework.common.pojo.PageResult;
6 import com.iailab.iems.common.utils.Result;
7 import com.iailab.iems.common.validator.AssertUtils;
8 import com.iailab.iems.common.validator.ValidatorUtils;
9 import com.iailab.iems.common.validator.group.AddGroup;
10 import com.iailab.iems.common.validator.group.DefaultGroup;
11 import com.iailab.iems.common.validator.group.UpdateGroup;
12 import com.iailab.module.pms.coalquality.modules.wash.dto.QualityWashTargetDTO;
13 import com.iailab.module.pms.coalquality.modules.wash.service.QualityWashTargetService;
14 import com.iailab.module.pms.coalquality.modules.wash.vo.WashTargetPageReqVO;
15 import io.swagger.v3.oas.annotations.Operation;
16 import io.swagger.v3.oas.annotations.tags.Tag;
17 import org.springframework.beans.factory.annotation.Autowired;
18 import org.springframework.web.bind.annotation.*;
19
20 import static com.iailab.framework.common.pojo.CommonResult.success;
21
22 /**
23  * @author PanZhibao
24  * @Description
25  * @createTime 2023年12月12日 13:34:00
26  */
27 @RestController
e16f4e 28 @RequestMapping("/xmcpms/coal-quality/wash/target")
7e21bc 29 @Tag(name = "入洗原煤指标")
J 30 public class QualityWashTargetController {
31     @Autowired
32     private QualityWashTargetService qualityWashTargetService;
33
34     @GetMapping("/page")
35     @AutoDict
36     public CommonResult<PageResult<QualityWashTargetDTO>> page(WashTargetPageReqVO washTargetPageReqVO) {
37         PageResult<QualityWashTargetDTO> page = qualityWashTargetService.page(washTargetPageReqVO);
38
39         return success(page);
40     }
41
42     @GetMapping("/get")
43     @Operation(summary = "信息")
44     public Result<QualityWashTargetDTO> get(String id) {
45         QualityWashTargetDTO data = qualityWashTargetService.get(id);
46         return new Result<QualityWashTargetDTO>().ok(data);
47     }
48
49     @PostMapping
50     @Operation(summary = "保存")
51     public CommonResult<Boolean> save(@RequestBody QualityWashTargetDTO dto) {
52         //效验数据
53         ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
54
55         qualityWashTargetService.save(dto);
56
57         return success(true);
58     }
59
60     @PutMapping
61     @Operation(summary = "修改")
62     public CommonResult<Boolean> update(@RequestBody QualityWashTargetDTO dto) {
63         //效验数据
64         ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
65
66         qualityWashTargetService.update(dto);
67
68         return success(true);
69     }
70
71     @DeleteMapping
72     @Operation(summary = "删除")
73     public CommonResult<Boolean> delete(@RequestBody String[] ids) {
74         //效验数据
75         AssertUtils.isArrayEmpty(ids, "id");
76
77         qualityWashTargetService.delete(ids);
78
79         return success(true);
80     }
81 }