提交 | 用户 | 时间
|
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.WarehouseStockEntity; |
|
7 |
import com.iailab.module.pms.production.warehouse.service.WarehouseStockService; |
|
8 |
import com.iailab.module.pms.production.warehouse.vo.WarehouseStockPageReqVO; |
|
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年01月03日 15:01:00 |
|
24 |
*/ |
|
25 |
@RestController |
e16f4e
|
26 |
@RequestMapping("/xmcpms/warehouse/stock") |
532d0b
|
27 |
public class WarehouseStockController { |
D |
28 |
|
|
29 |
|
|
30 |
@Resource |
|
31 |
private WarehouseStockService warehouseStockService; |
|
32 |
|
|
33 |
@PostMapping("/create") |
|
34 |
@Operation(summary = "新增") |
|
35 |
public CommonResult<String> createWarehouseStock(@Valid @RequestBody WarehouseStockEntity createEntity) { |
|
36 |
return success(warehouseStockService.create(createEntity)); |
|
37 |
} |
|
38 |
|
|
39 |
@PutMapping("/update") |
|
40 |
@Operation(summary = "更新") |
|
41 |
public CommonResult<Boolean> updateWarehouseStock(@Valid @RequestBody WarehouseStockEntity updateEntity) { |
|
42 |
warehouseStockService.update(updateEntity); |
|
43 |
return success(true); |
|
44 |
} |
|
45 |
|
|
46 |
@DeleteMapping("/delete") |
|
47 |
@Operation(summary = "删除") |
|
48 |
@Parameter(name = "id", description = "ID", required = true, example = "1024") |
|
49 |
public CommonResult<Boolean> deleteWarehouseStock(@RequestParam("id") String id) { |
|
50 |
warehouseStockService.delete(id); |
|
51 |
return success(true); |
|
52 |
} |
|
53 |
|
|
54 |
@GetMapping("/get") |
|
55 |
@Operation(summary = "详情") |
|
56 |
@Parameter(name = "id", description = "ID", required = true, example = "1024") |
|
57 |
public CommonResult<WarehouseStockEntity> getWarehouseStock(@RequestParam("id") String id) { |
|
58 |
WarehouseStockEntity data = warehouseStockService.getInfo(id); |
|
59 |
return success(BeanUtils.toBean(data, WarehouseStockEntity.class)); |
|
60 |
} |
|
61 |
|
|
62 |
@GetMapping("/page") |
|
63 |
@Operation(summary = "分页") |
|
64 |
public CommonResult<PageResult<WarehouseStockEntity>> getWarehouseStockPage(@Valid WarehouseStockPageReqVO pageVO) { |
|
65 |
PageResult<WarehouseStockEntity> pageResult = warehouseStockService.getPage(pageVO); |
|
66 |
return success(BeanUtils.toBean(pageResult, WarehouseStockEntity.class)); |
|
67 |
} |
|
68 |
|
|
69 |
} |