package cn.cecep.talroad.controller;

import cn.cecep.talroad.common.core.exception.CommonException;
import cn.cecep.talroad.common.core.utils.poi.ExcelUtil;
import cn.cecep.talroad.common.core.web.controller.BasesController;
import cn.cecep.talroad.common.core.web.domain.AjaxResults;
import cn.cecep.talroad.common.log.annotation.Log;
import cn.cecep.talroad.common.log.enums.BusinessType;
import cn.cecep.talroad.common.security.annotation.RequiresPermissions;
import cn.cecep.talroad.domain.SMainDynamicControlParam;
import cn.cecep.talroad.service.ISMainDynamicControlParamService;
import cn.cecep.talroad.vo.SMainDynamicControlParamVo;
import cn.cecep.talroad.vo.query.SMainDynamicControlParamQuery;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.security.InvalidParameterException;
import java.util.Arrays;
import java.util.List;


/**
 * * 开发公司：中节能天融科技有限公司
 * 基本信息-废气、废水排口档案-动态管控信息调整 -参数Controller 控制层
 *
 * @author szhpt
 * @date 2023-02-02*/
@Api(tags = "基本信息-废气、废水排口档案-动态管控信息调整 -参数")
@RestController
@RequestMapping("/smainDynamicControlParam")
public class SMainDynamicControlParamController extends BasesController
{
    @Autowired
    private ISMainDynamicControlParamService sMainDynamicControlParamService;

    /**
     * 查询基本信息-废气、废水排口档案-动态管控信息调整 -参数列表
     */
    @ApiOperation(value = "查询基本信息-废气、废水排口档案-动态管控信息调整 -参数")
    @GetMapping("/list")
    public AjaxResults<IPage<SMainDynamicControlParam>> list(SMainDynamicControlParamQuery sMainDynamicControlParam)
    {
        Page<SMainDynamicControlParam> page = new Page<>(sMainDynamicControlParam.getPageNum(), sMainDynamicControlParam.getPageSize());
        IPage<SMainDynamicControlParam> list = sMainDynamicControlParamService.page(page, SMainDynamicControlParamQuery.createLambdaQueryWrapper(sMainDynamicControlParam));
        return AjaxResults.success(list);
    }

    @ApiOperation(value = "获取动态管控信息参数表格数据")
    @GetMapping("/paramTableData")
    public AjaxResults<SMainDynamicControlParamVo.Table> list(String factoryId, String outletId, String controlTypeCode)
    {
        SMainDynamicControlParamVo.Table data = sMainDynamicControlParamService.getParamTableData(factoryId, outletId, controlTypeCode);
        return AjaxResults.success(data);
    }
    

}
