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


import cn.hutool.poi.excel.ExcelUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.v2.v1.entity.JsStockInfoRequest;
import com.ruoyi.web.v2.v1.service.IJsStockInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.service.Response;

import javax.servlet.http.HttpServletResponse;

import static com.ruoyi.common.core.domain.AjaxResult.error;
import static com.ruoyi.common.core.domain.AjaxResult.success;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-11-11
 */
@RestController
@RequestMapping("/js-stock-info")
public class JsStockInfoController {
    @Autowired
    private IJsStockInfoService stockInfoService;
    @ApiOperation("分页获取化学品登记表")
    @PostMapping("/list/page")
    public AjaxResult listVillageSpecialByPage(@RequestBody JsStockInfoRequest jsStockInfoRequest) {
        if (jsStockInfoRequest == null) {
            return error("请求参数为空");
        }

        return success(stockInfoService.listPage(jsStockInfoRequest));
    }

    @ApiOperation("分页获取化学品登记表")
    @PostMapping("/list/list")
    public AjaxResult listList(@RequestBody JsStockInfoRequest jsStockInfoRequest, HttpServletResponse response ) {
        if (jsStockInfoRequest == null) {
            return error("请求参数为空");
        }

        return success(stockInfoService.listList(jsStockInfoRequest));
    }
}
