提交 | 用户 | 时间
|
532d0b
|
1 |
package com.iailab.module.pms.production.wash.controller.admin; |
D |
2 |
|
|
3 |
import com.iailab.framework.common.pojo.CommonResult; |
|
4 |
import com.iailab.framework.common.pojo.PageResult; |
|
5 |
import com.iailab.framework.common.util.object.BeanUtils; |
|
6 |
import com.iailab.module.pms.production.wash.vo.WashPlanPageReqVO; |
|
7 |
import com.iailab.module.pms.production.wash.entity.WashPlanEntity; |
|
8 |
import com.iailab.module.pms.production.wash.service.WashPlanService; |
|
9 |
import io.swagger.v3.oas.annotations.Operation; |
|
10 |
import io.swagger.v3.oas.annotations.Parameter; |
|
11 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
12 |
import org.springframework.web.bind.annotation.*; |
|
13 |
|
|
14 |
import javax.annotation.Resource; |
|
15 |
import javax.validation.Valid; |
|
16 |
|
|
17 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
|
18 |
|
|
19 |
@Tag(name = "洗选计划") |
|
20 |
@RestController |
e16f4e
|
21 |
@RequestMapping("/xmcpms/prod/wash/washPlan") |
532d0b
|
22 |
public class WashPlanController { |
D |
23 |
|
|
24 |
@Resource |
|
25 |
private WashPlanService washPlanService; |
|
26 |
|
|
27 |
@PostMapping("/create") |
|
28 |
@Operation(summary = "新增") |
|
29 |
public CommonResult<String> createWashPlan(@Valid @RequestBody WashPlanEntity createEntity) { |
|
30 |
return success(washPlanService.create(createEntity)); |
|
31 |
} |
|
32 |
|
|
33 |
@PutMapping("/update") |
|
34 |
@Operation(summary = "更新") |
|
35 |
public CommonResult<Boolean> updateWashPlan(@Valid @RequestBody WashPlanEntity updateEntity) { |
|
36 |
washPlanService.update(updateEntity); |
|
37 |
return success(true); |
|
38 |
} |
|
39 |
|
|
40 |
@DeleteMapping("/delete") |
|
41 |
@Operation(summary = "删除") |
|
42 |
@Parameter(name = "id", description = "ID", required = true, example = "1024") |
|
43 |
public CommonResult<Boolean> deleteWashPlan(@RequestParam("id") String id) { |
|
44 |
washPlanService.delete(id); |
|
45 |
return success(true); |
|
46 |
} |
|
47 |
|
|
48 |
@GetMapping("/get") |
|
49 |
@Operation(summary = "详情") |
|
50 |
@Parameter(name = "id", description = "ID", required = true, example = "1024") |
|
51 |
public CommonResult<WashPlanEntity> getWashPlan(@RequestParam("id") String id) { |
|
52 |
WashPlanEntity data = washPlanService.getInfo(id); |
|
53 |
return success(BeanUtils.toBean(data, WashPlanEntity.class)); |
|
54 |
} |
|
55 |
|
|
56 |
@GetMapping("/page") |
|
57 |
@Operation(summary = "分页") |
|
58 |
public CommonResult<PageResult<WashPlanEntity>> getWashPlanPage(@Valid WashPlanPageReqVO pageVO) { |
|
59 |
PageResult<WashPlanEntity> pageResult = washPlanService.getPage(pageVO); |
|
60 |
return success(BeanUtils.toBean(pageResult, WashPlanEntity.class)); |
|
61 |
} |
|
62 |
} |