gongchunyi
2 天以前 a274b897e58c958903c3e00da6c1ccb16646a979
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
package com.ruoyi.production.controller;
 
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.production.dto.ProductMaterialSkuDto;
import com.ruoyi.production.pojo.ProductMaterialSku;
import com.ruoyi.production.service.ProductMaterialSkuService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * <br>
 * 物料规格控制层
 * </br>
 *
 * @author deslrey
 * @version 1.0
 * @since 2026/03/12 10:43
 */
@RestController
@RequestMapping("/productMaterialSku")
public class ProductMaterialSkuController {
 
    @Autowired
    private ProductMaterialSkuService productMaterialSkuService;
 
    @GetMapping("/list")
    @ApiOperation("物料规格数据集合")
    @Log(title = "物料规格数据集合", businessType = BusinessType.OTHER)
    public AjaxResult productMaterialSkuList(@RequestParam("materialId") Long materialId) {
        List<ProductMaterialSkuDto> list = productMaterialSkuService.productMaterialSkuList(materialId);
        return AjaxResult.success(list);
    }
 
    @PostMapping("/add")
    @ApiOperation("新增物料规格")
    @Log(title = "新增物料规格", businessType = BusinessType.INSERT)
    public AjaxResult addProductMaterialSku(@RequestBody ProductMaterialSku productMaterialSku) {
        productMaterialSkuService.addProductMaterialSku(productMaterialSku);
        return AjaxResult.success();
    }
 
    @PutMapping("/update")
    @ApiOperation("修改物料规格")
    @Log(title = "修改物料规格", businessType = BusinessType.UPDATE)
    public AjaxResult updateProductMaterialSku(@RequestBody ProductMaterialSku productMaterialSku) {
        productMaterialSkuService.updateProductMaterialSku(productMaterialSku);
        return AjaxResult.success();
    }
 
    @DeleteMapping("/delete")
    @ApiOperation("删除物料规格")
    @Log(title = "删除物料规格", businessType = BusinessType.DELETE)
    public AjaxResult deleteProductMaterialSku(@RequestBody List<Long> ids) {
        productMaterialSkuService.deleteProductMaterialSku(ids);
        return AjaxResult.success();
    }
}