廖井涛
2024-05-16 b79c8277a4a7a2e137e20055fbcd7339daaab7da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
package com.example.erp.controller.mm;
 
 
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.mm.*;
import com.example.erp.entity.pp.OptimizeUse;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.mm.MaterialInventoryService;
import com.example.erp.service.mm.MaterialStoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
import java.util.Map;
 
@RestController
@RequestMapping("/MaterialInventory")
@Api(value="物料库存controller",tags={"物料库存操作接口"})
public class MaterialInventoryController {
    @Autowired
    MaterialInventoryService materialInventoryService;
 
    @ApiOperation("物料出库新增接口")
    @SaCheckPermission("CreateOutbound.add")
    @PostMapping("/saveMaterialOutbound")
    public Result saveMaterialOutbound( @RequestBody Map<String,Object>  object){
        if(materialInventoryService.saveMaterialOutbound(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"保存失败");
 
        }
    }
 
    @ApiOperation("物料新增接口")
    @SaCheckPermission("SelectIngredientsStock.add")
    @PostMapping("/saveMaterialInventory")
    public Result saveMaterialInventory( @RequestBody Map<String,Object>  object){
        if(materialInventoryService.saveMaterialInventory(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"保存失败");
 
        }
    }
 
    @ApiOperation("物料库存加时间查询接口")
    @SaCheckPermission("SelectIngredientsStock.search")
    @PostMapping("/getSelectMaterialInventoryDate/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectMaterialInventoryDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> selectDate, @RequestBody MaterialInventory materialInventory){
        return Result.seccess(materialInventoryService.getSelectMaterialInventoryDate(pageNum,pageSize,selectDate,materialInventory));
    }
 
    @ApiOperation("物料库存工程加时间查询接口")
    @SaCheckPermission("SelectIngredientsStock.search")
    @PostMapping("/getSelectMaterialInventoryEngineeringDate/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectMaterialInventoryEngineeringDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> selectDate, @RequestBody MaterialInventory materialInventory){
        return Result.seccess(materialInventoryService.getSelectMaterialInventoryEngineeringDate(pageNum,pageSize,selectDate,materialInventory));
    }
 
    @ApiOperation("物料库存查询接口")
    @SaCheckPermission("CreateOutbound.search")
    @PostMapping("/getSelectMaterialInventory/{pageNum}/{pageSize}")
    public Result getSelectMaterialInventory(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody MaterialInventory materialInventory){
        return Result.seccess(materialInventoryService.getSelectMaterialInventory(pageNum,pageSize,materialInventory));
    }
 
    @ApiOperation("物料库存工程查询接口")
    @SaCheckPermission("SelectIngredientsStock.search")
    @PostMapping("/getSelectMaterialInventoryEngineering/{pageNum}/{pageSize}")
    public Result getSelectMaterialInventoryEngineering(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OptimizeUse optimizeUse){
        return Result.seccess(materialInventoryService.getSelectMaterialInventoryEngineering(pageNum,pageSize,optimizeUse));
    }
 
    @ApiOperation("材料出库加时间查询接口")
    @SaCheckPermission("MaterialOutbound.search")
    @PostMapping("/getSelectMaterialOutboundDate/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectMaterialOutboundDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> selectDate, @RequestBody MaterialOutbound materialOutbound){
        return Result.seccess(materialInventoryService.getSelectMaterialOutboundDate(pageNum,pageSize,selectDate, materialOutbound));
    }
 
    @ApiOperation("材料出库查询接口")
    @SaCheckPermission("CreateOutbound.search")
    @PostMapping("/getSelectMaterialOutbound/{pageNum}/{pageSize}")
    public Result getSelectMaterialOutbound(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody MaterialOutboundDetail materialOutboundDetail){
        return Result.seccess(materialInventoryService.getSelectMaterialOutbound(pageNum,pageSize,materialOutboundDetail));
    }
 
 
    @ApiOperation("材料出库审核接口")
    @SaCheckPermission("CreateOutbound.review")
    @PostMapping("/updateMaterialOutboundToExamine")
    public Result updateMaterialOutboundToExamine( @RequestBody Map<String,Object> object){
        return Result.seccess(materialInventoryService.updateMaterialOutboundToExamine(object));
    }
 
    @ApiOperation("材料出库删除接口")
    @SaCheckPermission("MaterialOutbound.delete")
    @PostMapping("/deleteMaterialOutbound")
    public Result deleteMaterialOutbound( @RequestBody Map<String,Object>  object){
        return Result.seccess(materialInventoryService.deleteMaterialOutbound(object));
    }
 
    @ApiOperation("物料返库新增接口")
    @SaCheckPermission("ReturnToStorageCreate.add")
    @PostMapping("/saveReturningWarehouse")
    public Result saveReturningWarehouse( @RequestBody Map<String,Object>  object){
        return Result.seccess(materialInventoryService.saveReturningWarehouse(object));
    }
 
    @ApiOperation("物料返库新增查询接口")
    @SaCheckPermission("ReturnToStorageCreate.search")
    @PostMapping("/getSelectReturningWarehouse/{pageNum}/{pageSize}")
    public Result getSelectReturningWarehouse(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody ReturningWarehouseDetail returningWarehouseDetail){
        return Result.seccess(materialInventoryService.getSelectReturningWarehouse(pageNum,pageSize,returningWarehouseDetail));
    }
 
    @ApiOperation("物料返库审核接口")
    @SaCheckPermission("ReturnToStorageCreate.review")
    @PostMapping("/updateReturningWarehouseToExamine")
    public Result updateReturningWarehouseToExamine( @RequestBody Map<String,Object> object){
        return Result.seccess(materialInventoryService.updateReturningWarehouseToExamine(object));
    }
 
 
    @ApiOperation("物料返库查询接口")
    @SaCheckPermission("ReturnToStorage.search")
    @PostMapping("/getSelectReturningWarehouseDate/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectReturningWarehouseDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> selectDate, @RequestBody ReturningWarehouse returningWarehouse){
        return Result.seccess(materialInventoryService.getSelectReturningWarehouseDate(pageNum,pageSize,selectDate, returningWarehouse));
    }
 
 
 
 
}