提交 | 用户 | 时间
|
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.module.pms.coalquality.modules.detection.dto.QualityMediumDTO; |
|
7 |
import com.iailab.module.pms.coalquality.modules.detection.service.QualityMediumService; |
|
8 |
import com.iailab.module.pms.coalquality.modules.detection.vo.MediumPageReqVO; |
|
9 |
import io.swagger.v3.oas.annotations.Operation; |
|
10 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
11 |
import lombok.extern.slf4j.Slf4j; |
|
12 |
import org.springframework.beans.factory.annotation.Autowired; |
|
13 |
import org.springframework.web.bind.annotation.*; |
|
14 |
|
|
15 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
|
16 |
|
|
17 |
/** |
|
18 |
* @author PanZhibao |
|
19 |
* @Description |
|
20 |
* @createTime 2023年02月07日 17:36:00 |
|
21 |
*/ |
|
22 |
@Slf4j |
|
23 |
@RestController |
8d3ff6
|
24 |
@RequestMapping("/coal-quality/quality/medium") |
7e21bc
|
25 |
@Tag(name = "介质粉检测") |
J |
26 |
public class QualityMediumController { |
|
27 |
@Autowired |
|
28 |
private QualityMediumService qualityMediumService; |
|
29 |
|
|
30 |
@GetMapping("page") |
|
31 |
@Operation(summary = "分页") |
|
32 |
public CommonResult<PageResult<QualityMediumDTO>> page(MediumPageReqVO mediumPageReqVO){ |
|
33 |
PageResult<QualityMediumDTO> page = qualityMediumService.page(mediumPageReqVO); |
|
34 |
|
|
35 |
return success(page); |
|
36 |
} |
|
37 |
|
8d3ff6
|
38 |
@GetMapping("/get") |
7e21bc
|
39 |
@Operation(summary = "信息") |
8d3ff6
|
40 |
public CommonResult<QualityMediumDTO> get(String id){ |
7e21bc
|
41 |
QualityMediumDTO data = qualityMediumService.get(id); |
J |
42 |
return success(data); |
|
43 |
} |
|
44 |
|
8d3ff6
|
45 |
@PostMapping("/create") |
7e21bc
|
46 |
@Operation(summary = "保存") |
8d3ff6
|
47 |
public CommonResult<Boolean> create(@RequestBody QualityMediumDTO dto){ |
7e21bc
|
48 |
// //效验数据 |
J |
49 |
// ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
50 |
|
|
51 |
qualityMediumService.save(dto); |
|
52 |
|
|
53 |
return success(true); |
|
54 |
} |
|
55 |
|
8d3ff6
|
56 |
@PutMapping("/update") |
7e21bc
|
57 |
@Operation(summary = "修改") |
J |
58 |
public CommonResult<Boolean> update(@RequestBody QualityMediumDTO dto){ |
|
59 |
// //效验数据 |
|
60 |
// ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
61 |
// |
|
62 |
// if (qualityMediumService.cheack(dto) > 0) { |
|
63 |
// return new CommonResult().error("编号重复"); |
|
64 |
// } |
|
65 |
|
|
66 |
qualityMediumService.update(dto); |
|
67 |
|
|
68 |
return success(true); |
|
69 |
} |
|
70 |
|
8d3ff6
|
71 |
@DeleteMapping("/delete") |
7e21bc
|
72 |
@Operation(summary = "删除") |
J |
73 |
public CommonResult<Boolean> delete(@RequestBody String[] ids){ |
|
74 |
|
|
75 |
qualityMediumService.delete(ids); |
|
76 |
|
|
77 |
return success(true); |
|
78 |
} |
|
79 |
|
|
80 |
} |