提交 | 用户 | 时间
|
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.ToWashPageReqVO; |
|
7 |
import com.iailab.module.pms.production.wash.entity.ToWashEntity; |
|
8 |
import com.iailab.module.pms.production.wash.service.ToWashService; |
|
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/toWash") |
532d0b
|
22 |
public class ToWashController { |
D |
23 |
|
|
24 |
@Resource |
|
25 |
private ToWashService toWashService; |
|
26 |
|
|
27 |
@PostMapping("/create") |
|
28 |
@Operation(summary = "新增") |
|
29 |
public CommonResult<String> createToWash(@Valid @RequestBody ToWashEntity createEntity) { |
|
30 |
return success(toWashService.create(createEntity)); |
|
31 |
} |
|
32 |
|
|
33 |
@PutMapping("/update") |
|
34 |
@Operation(summary = "更新") |
|
35 |
public CommonResult<Boolean> updateToWash(@Valid @RequestBody ToWashEntity updateEntity) { |
|
36 |
toWashService.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> deleteToWash(@RequestParam("id") String id) { |
|
44 |
toWashService.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<ToWashEntity> getToWash(@RequestParam("id") String id) { |
|
52 |
ToWashEntity data = toWashService.getInfo(id); |
|
53 |
return success(BeanUtils.toBean(data, ToWashEntity.class)); |
|
54 |
} |
|
55 |
|
|
56 |
@GetMapping("/page") |
|
57 |
@Operation(summary = "分页") |
|
58 |
public CommonResult<PageResult<ToWashEntity>> getToWashPage(@Valid ToWashPageReqVO pageVO) { |
|
59 |
PageResult<ToWashEntity> pageResult = toWashService.getPage(pageVO); |
|
60 |
return success(BeanUtils.toBean(pageResult, ToWashEntity.class)); |
|
61 |
} |
|
62 |
} |