廖井涛
2024-03-19 a8eaef6328ae594fcefc0371865001c9163f6873
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
package com.example.erp.controller.mm;
 
 
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.mm.FinishedGoodsInventory;
import com.example.erp.entity.mm.FinishedOperateLog;
import com.example.erp.entity.mm.MaterialStore;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.Customer;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.mm.FinishedGoodsInventoryService;
import com.example.erp.service.mm.MaterialService;
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("/Material")
@Api(value="物料controller",tags={"物料操作接口"})
public class MaterialController {
    @Autowired
    MaterialService faterialService;
 
    @ApiOperation("物料新增接口")
    @PostMapping("/saveMaterialStore")
    public Result saveMaterialStore( @RequestBody Map<String,Object>  object){
        if(faterialService.saveMaterialStore(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"保存失败");
 
        }
    }
 
    @ApiOperation("物料查询接口")
    @PostMapping("/getSelectMaterialStore/{pageNum}/{pageSize}")
    public Result getSelectMaterialStore(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody MaterialStore materialStore){
        return Result.seccess(faterialService.getSelectMaterialStore(pageNum,pageSize,materialStore));
    }
 
    @ApiOperation("物料删除接口")
    @PostMapping("/deleteMaterialStore")
    public Result deleteMaterialStore( @RequestBody Map<String,Object>  object){
        if(faterialService.deleteMaterialStore(object)){
 
            return Result.seccess();
 
        }else {
            throw new ServiceException(Constants.Code_500,"删除失败");
 
        }
    }
 
 
}