package com.ruoyi.web.v2.v1.controller;


import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.v2.v1.service.IJsStockService;
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;

/**
 * <p>
 * v2.0库存管理 前端控制器
 * </p>
 *
 * @author author
 * @since 2025-05-23
 */
@RestController
@RequestMapping("/js-stock")
@Api("2.0库存管理")
public class JsStockController {

    @Autowired
    private IJsStockService stockService;

    @ApiOperation("库存管理列表")
    @PostMapping("/list")
    public AjaxResult listAll(@RequestBody Map<String, String> paramsMap) {
        return stockService.listAll(paramsMap);
    }

    @ApiOperation("库存管理分页")
    @GetMapping("/page")
    public AjaxResult page(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize
            , @RequestParam(value = "materialBatch", required = false) String materialBatch
            , @RequestParam(value = "materialName", required = false) String materialName
            , @RequestParam(value = "materialType", required = false) Integer materialType) {

        return stockService.page(pageNum, pageSize, materialBatch,materialName,materialType);
    }

}
