guoyuji
2024-03-27 baeae530bc5dfdd23359f34b047f449c1541359f
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
package com.example.erp.controller.mm;
 
 
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.mm.MaterialInventory;
import com.example.erp.entity.mm.MaterialOutbound;
import com.example.erp.entity.mm.MaterialOutboundDetail;
import com.example.erp.entity.mm.MaterialStore;
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("物料出库新增接口")
    @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("物料新增接口")
    @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("物料库存加时间查询接口")
    @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("物料库存查询接口")
    @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("材料出库查询接口")
    @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("材料出库查询接口")
    @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("材料出库修改接口")
    @PostMapping("/updateMaterialOutboundToExamine")
    public Result updateMaterialOutboundToExamine( @RequestBody Map<String,Object> object){
        if(materialInventoryService.updateMaterialOutboundToExamine(object)){
            return Result.seccess();
 
        }else {
            throw new ServiceException(Constants.Code_500,"审核失败");
 
        }
    }
 
    @ApiOperation("物料删除接口")
    @PostMapping("/deleteMaterialOutbound")
    public Result deleteMaterialOutbound( @RequestBody Map<String,Object>  object){
        if(materialInventoryService.deleteMaterialOutbound(object)){
 
            return Result.seccess();
 
        }else {
            throw new ServiceException(Constants.Code_500,"删除失败");
 
        }
    }
 
 
 
 
}