提交 | 用户 | 时间
|
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.WarehousePositionEntity; |
|
7 |
import com.iailab.module.pms.production.warehouse.service.WarehousePositionService; |
|
8 |
import com.iailab.module.pms.production.warehouse.vo.WarehousePositionPageReqVO; |
|
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月17日 15:51:00 |
|
24 |
*/ |
|
25 |
@RestController |
e16f4e
|
26 |
@RequestMapping("/xmcpms/warehouse/position") |
532d0b
|
27 |
public class WarehousePositionController { |
D |
28 |
|
|
29 |
|
|
30 |
@Resource |
|
31 |
private WarehousePositionService warehousePositionService; |
|
32 |
|
|
33 |
@PostMapping("/create") |
|
34 |
@Operation(summary = "新增") |
|
35 |
public CommonResult<String> createWarehousePosition(@Valid @RequestBody WarehousePositionEntity createEntity) { |
|
36 |
return success(warehousePositionService.create(createEntity)); |
|
37 |
} |
|
38 |
|
|
39 |
@PutMapping("/update") |
|
40 |
@Operation(summary = "更新") |
|
41 |
public CommonResult<Boolean> updateWarehousePosition(@Valid @RequestBody WarehousePositionEntity updateEntity) { |
|
42 |
warehousePositionService.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> deleteWarehousePosition(@RequestParam("id") String id) { |
|
50 |
warehousePositionService.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<WarehousePositionEntity> getWarehousePosition(@RequestParam("id") String id) { |
|
58 |
WarehousePositionEntity data = warehousePositionService.getInfo(id); |
|
59 |
return success(BeanUtils.toBean(data, WarehousePositionEntity.class)); |
|
60 |
} |
|
61 |
|
|
62 |
@GetMapping("/page") |
|
63 |
@Operation(summary = "分页") |
|
64 |
public CommonResult<PageResult<WarehousePositionEntity>> getWarehousePositionPage(@Valid WarehousePositionPageReqVO pageVO) { |
|
65 |
PageResult<WarehousePositionEntity> pageResult = warehousePositionService.getPage(pageVO); |
|
66 |
return success(BeanUtils.toBean(pageResult, WarehousePositionEntity.class)); |
|
67 |
} |
|
68 |
|
|
69 |
} |