提交 | 用户 | 时间
|
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.QualityDetectionDTO; |
|
7 |
import com.iailab.module.pms.coalquality.modules.detection.service.QualityDetectionService; |
|
8 |
import com.iailab.module.pms.coalquality.modules.detection.vo.DetectionPageReqVO; |
|
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 |
/** |
|
19 |
* 煤质检测 |
|
20 |
* |
|
21 |
* @author PanZhibao |
|
22 |
* @Description |
|
23 |
* @createTime 2023年02月07日 13:15:00 |
|
24 |
*/ |
|
25 |
@Slf4j |
|
26 |
@RestController |
8d3ff6
|
27 |
@RequestMapping("/coal-quality/quality/detection") |
7e21bc
|
28 |
@Tag(name = "煤质检测") |
J |
29 |
public class QualityDetectionController { |
|
30 |
@Autowired |
|
31 |
private QualityDetectionService qualityDetectionService; |
|
32 |
|
|
33 |
private String DICT_CODE = "mzzb"; |
|
34 |
|
|
35 |
@GetMapping("page") |
|
36 |
@Operation(summary = "分页") |
|
37 |
public CommonResult<PageResult<QualityDetectionDTO>> page(DetectionPageReqVO reqVO) { |
|
38 |
PageResult<QualityDetectionDTO> page = qualityDetectionService.page(reqVO); |
|
39 |
|
|
40 |
return success(page); |
|
41 |
} |
|
42 |
|
8d3ff6
|
43 |
@GetMapping("/get") |
7e21bc
|
44 |
@Operation(summary ="信息") |
8d3ff6
|
45 |
public CommonResult<QualityDetectionDTO> get(String id) { |
7e21bc
|
46 |
QualityDetectionDTO data = qualityDetectionService.get(id); |
J |
47 |
return success(data); |
|
48 |
} |
|
49 |
|
8d3ff6
|
50 |
@PostMapping("/create") |
7e21bc
|
51 |
@Operation(summary ="保存") |
8d3ff6
|
52 |
public CommonResult<Boolean> create(@RequestBody QualityDetectionDTO dto) { |
7e21bc
|
53 |
// if (qualityDetectionService.cheack(dto) > 0) { |
J |
54 |
// return new CommonResult().error("编号重复"); |
|
55 |
// } |
|
56 |
|
|
57 |
qualityDetectionService.save(dto); |
|
58 |
|
|
59 |
return success(true); |
|
60 |
} |
|
61 |
|
8d3ff6
|
62 |
@PutMapping("/update") |
7e21bc
|
63 |
@Operation(summary ="修改") |
J |
64 |
public CommonResult<Boolean> update(@RequestBody QualityDetectionDTO dto) { |
|
65 |
|
|
66 |
// if (qualityDetectionService.cheack(dto) > 0) { |
|
67 |
// return new CommonResult().error("编号重复"); |
|
68 |
// } |
|
69 |
qualityDetectionService.update(dto); |
|
70 |
|
|
71 |
return success(true); |
|
72 |
} |
|
73 |
|
8d3ff6
|
74 |
@DeleteMapping("/delete") |
7e21bc
|
75 |
@Operation(summary ="删除") |
J |
76 |
public CommonResult<Boolean> delete(@RequestBody String[] ids) { |
|
77 |
|
|
78 |
qualityDetectionService.delete(ids); |
|
79 |
|
|
80 |
return success(true); |
|
81 |
} |
|
82 |
} |