提交 | 用户 | 时间
|
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.QualityTailingDTO; |
|
8 |
import com.iailab.module.pms.coalquality.modules.detection.service.QualityTailingService; |
|
9 |
import com.iailab.module.pms.coalquality.modules.detection.vo.TailingPageReqVO; |
|
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:37:00 |
|
22 |
*/ |
|
23 |
@Slf4j |
|
24 |
@RestController |
e16f4e
|
25 |
@RequestMapping("/xmcpms/quality/tailing") |
7e21bc
|
26 |
@Tag(name = "尾矿检测") |
J |
27 |
public class QualityTailingController { |
|
28 |
@Autowired |
|
29 |
private QualityTailingService qualityTailingService; |
|
30 |
|
|
31 |
@GetMapping("page") |
|
32 |
@Operation(summary = "分页") |
|
33 |
public CommonResult<PageResult<QualityTailingDTO>> page(TailingPageReqVO tailingPageReqVO){ |
|
34 |
PageResult<QualityTailingDTO> page = qualityTailingService.page(tailingPageReqVO); |
|
35 |
|
|
36 |
return success(page); |
|
37 |
} |
|
38 |
|
|
39 |
@GetMapping("{id}") |
|
40 |
@Operation(summary ="信息") |
|
41 |
public CommonResult<QualityTailingDTO> get(@PathVariable("id") String id){ |
|
42 |
QualityTailingDTO data = qualityTailingService.get(id); |
|
43 |
return success(data); |
|
44 |
} |
|
45 |
|
|
46 |
@PostMapping |
|
47 |
@Operation(summary ="保存") |
|
48 |
public CommonResult<Boolean> save(@RequestBody QualityTailingDTO dto){ |
|
49 |
|
|
50 |
qualityTailingService.save(dto); |
|
51 |
|
|
52 |
return success(true); |
|
53 |
} |
|
54 |
|
|
55 |
@PutMapping |
|
56 |
@Operation(summary ="修改") |
|
57 |
public CommonResult<Boolean> update(@RequestBody QualityTailingDTO dto){ |
|
58 |
// |
|
59 |
// if (qualityTailingService.cheack(dto) > 0) { |
|
60 |
// return new CommonResult().error("编号重复"); |
|
61 |
// } |
|
62 |
|
|
63 |
qualityTailingService.update(dto); |
|
64 |
|
|
65 |
return success(true); |
|
66 |
} |
|
67 |
|
|
68 |
@DeleteMapping |
|
69 |
@Operation(summary ="删除") |
|
70 |
public CommonResult<Boolean> delete(@RequestBody String[] ids){ |
|
71 |
//效验数据 |
|
72 |
AssertUtils.isArrayEmpty(ids, "id"); |
|
73 |
|
|
74 |
qualityTailingService.delete(ids); |
|
75 |
|
|
76 |
return success(true); |
|
77 |
} |
|
78 |
|
|
79 |
} |