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
package com.example.erp.controller.mm;
 
 
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.mm.MaterialStore;
import com.example.erp.exception.ServiceException;
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.Map;
 
@RestController
@RequestMapping("/MaterialStore")
@Api(value="物料controller",tags={"物料操作接口"})
public class MaterialStoreController {
    @Autowired
    MaterialStoreService materialStoreService;
 
    @ApiOperation("物料新增接口")
    @PostMapping("/saveMaterialStore")
    public Result saveMaterialStore( @RequestBody Map<String,Object>  object){
        if(materialStoreService.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(materialStoreService.getSelectMaterialStore(pageNum,pageSize,materialStore));
    }
 
    @ApiOperation("物料删除接口")
    @PostMapping("/deleteMaterialStore")
    public Result deleteMaterialStore( @RequestBody Map<String,Object>  object){
        if(materialStoreService.deleteMaterialStore(object)){
 
            return Result.seccess();
 
        }else {
            throw new ServiceException(Constants.Code_500,"删除失败");
 
        }
    }
 
 
}