提交 | 用户 | 时间
|
532d0b
|
1 |
package com.iailab.module.pms.production.warehouse.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.warehouse.entity.McMzEntity; |
|
7 |
import com.iailab.module.pms.production.warehouse.service.McMzService; |
|
8 |
import com.iailab.module.pms.production.warehouse.vo.McMzPageReqVO; |
|
9 |
import io.swagger.v3.oas.annotations.Operation; |
|
10 |
import io.swagger.v3.oas.annotations.Parameter; |
|
11 |
import org.springframework.web.bind.annotation.*; |
|
12 |
|
|
13 |
import javax.annotation.Resource; |
|
14 |
import javax.validation.Valid; |
|
15 |
|
|
16 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
|
17 |
|
|
18 |
/** |
|
19 |
* 煤仓煤种 |
|
20 |
* |
|
21 |
* @author DongYukun |
|
22 |
* @Description |
|
23 |
* @createTime 2023年12月20日 10:22:00 |
|
24 |
*/ |
|
25 |
@RestController |
e16f4e
|
26 |
@RequestMapping("/xmcpms/prod/warehouse/mcmz") |
532d0b
|
27 |
public class McMzController { |
D |
28 |
|
|
29 |
@Resource |
|
30 |
private McMzService mcmzService; |
|
31 |
|
|
32 |
@PostMapping("/create") |
|
33 |
@Operation(summary = "新增") |
|
34 |
public CommonResult<String> createMcMz(@Valid @RequestBody McMzEntity createEntity) { |
|
35 |
return success(mcmzService.create(createEntity)); |
|
36 |
} |
|
37 |
|
|
38 |
@PutMapping("/update") |
|
39 |
@Operation(summary = "更新") |
|
40 |
public CommonResult<Boolean> updateMcMz(@Valid @RequestBody McMzEntity updateEntity) { |
|
41 |
mcmzService.update(updateEntity); |
|
42 |
return success(true); |
|
43 |
} |
|
44 |
|
|
45 |
@DeleteMapping("/delete") |
|
46 |
@Operation(summary = "删除") |
|
47 |
@Parameter(name = "id", description = "ID", required = true, example = "1024") |
|
48 |
public CommonResult<Boolean> deleteMcMz(@RequestParam("id") String id) { |
|
49 |
mcmzService.delete(id); |
|
50 |
return success(true); |
|
51 |
} |
|
52 |
|
|
53 |
@GetMapping("/get") |
|
54 |
@Operation(summary = "详情") |
|
55 |
@Parameter(name = "id", description = "ID", required = true, example = "1024") |
|
56 |
public CommonResult<McMzEntity> getMcMz(@RequestParam("id") String id) { |
|
57 |
McMzEntity data = mcmzService.getInfo(id); |
|
58 |
return success(BeanUtils.toBean(data, McMzEntity.class)); |
|
59 |
} |
|
60 |
|
|
61 |
@GetMapping("/page") |
|
62 |
@Operation(summary = "分页") |
|
63 |
public CommonResult<PageResult<McMzEntity>> getMcMzPage(@Valid McMzPageReqVO pageVO) { |
|
64 |
PageResult<McMzEntity> pageResult = mcmzService.getPage(pageVO); |
|
65 |
return success(BeanUtils.toBean(pageResult, McMzEntity.class)); |
|
66 |
} |
|
67 |
} |