package com.zjsgfa.project.zjsgfa.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
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.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zjsgfa.framework.aspectj.lang.annotation.Log;
import com.zjsgfa.framework.aspectj.lang.enums.BusinessType;
import com.zjsgfa.project.zjsgfa.domain.SjBcxx;
import com.zjsgfa.project.zjsgfa.service.ISjBcxxService;
import com.zjsgfa.framework.web.controller.BaseController;
import com.zjsgfa.framework.web.domain.AjaxResult;
import com.zjsgfa.common.utils.poi.ExcelUtil;
import com.zjsgfa.framework.web.page.TableDataInfo;

/**
 * 方案补充信息Controller
 * 
 * @author ruoyi
 * @date 2026-03-05
 */
@RestController
@RequestMapping("/system/sjBcxx")
public class SjBcxxController extends BaseController
{
    @Autowired
    private ISjBcxxService sjBcxxService;

    /**
     * 查询方案补充信息列表
     */
    //@PreAuthorize("@ss.hasPermi('system:sjBcxx:list')")
    @GetMapping("/list")
    public TableDataInfo list(SjBcxx sjBcxx)
    {
//        startPage();
        List<SjBcxx> list = sjBcxxService.selectSjBcxxList(sjBcxx);
        return getDataTable(list);
    }

    /**
     * 导出方案补充信息列表
     */
    //@PreAuthorize("@ss.hasPermi('system:sjBcxx:export')")
    @Log(title = "方案补充信息", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SjBcxx sjBcxx)
    {
        List<SjBcxx> list = sjBcxxService.selectSjBcxxList(sjBcxx);
        ExcelUtil<SjBcxx> util = new ExcelUtil<SjBcxx>(SjBcxx.class);
        util.exportExcel(response, list, "方案补充信息数据");
    }

    /**
     * 获取方案补充信息详细信息
     */
    //@PreAuthorize("@ss.hasPermi('system:sjBcxx:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(sjBcxxService.selectSjBcxxById(id));
    }

    /**
     * 新增方案补充信息
     */
    //@PreAuthorize("@ss.hasPermi('system:sjBcxx:add')")
    @Log(title = "方案补充信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SjBcxx sjBcxx)
    {
        return toAjax(sjBcxxService.insertSjBcxx(sjBcxx));
    }

    /**
     * 修改方案补充信息
     */
    //@PreAuthorize("@ss.hasPermi('system:sjBcxx:edit')")
    @Log(title = "方案补充信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SjBcxx sjBcxx)
    {
        return toAjax(sjBcxxService.updateSjBcxx(sjBcxx));
    }

    /**
     * 删除方案补充信息
     */
    //@PreAuthorize("@ss.hasPermi('system:sjBcxx:remove')")
    @Log(title = "方案补充信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(sjBcxxService.deleteSjBcxxByIds(ids));
    }
}
