package com.ruoyi.web.controller.projectV2;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.projectV2.ZsyzShyj;
import com.ruoyi.system.service.projectV2.IZsyzShyjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 招商引资_审核意见Controller
 * 
 * @author 博曼
 * @date 2023-02-22
 */
@RestController
@RequestMapping("/projectV2/shyj")
public class ZsyzShyjController extends BaseController
{
    @Autowired
    private IZsyzShyjService zsyzShyjService;

    /**
     * 查询招商引资_审核意见列表
     */
    @PreAuthorize("@ss.hasPermi('projectV2:shyj:list')")
    @GetMapping("/list")
    public TableDataInfo list(ZsyzShyj zsyzShyj)
    {
        startPage();
        List<ZsyzShyj> list = zsyzShyjService.selectZsyzShyjList(zsyzShyj);
        return getDataTable(list);
    }

/*    *//**
     * 查询招商引资_审核意见列表/APP使用首页问题列表
     *//*

    @GetMapping("/wt")
    public TableDataInfo wt(ZsyzShyj zsyzShyj)
    {
        startPage();
        List<ZsyzShyj> list = zsyzShyjService.selectZsyzShyjListByWt(zsyzShyj);
        return getDataTable(list);
    }*/

    /**
     * 导出招商引资_审核意见列表
     */
    @PreAuthorize("@ss.hasPermi('projectV2:shyj:export')")
    @Log(title = "招商引资_审核意见", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ZsyzShyj zsyzShyj)
    {
        List<ZsyzShyj> list = zsyzShyjService.selectZsyzShyjList(zsyzShyj);
        ExcelUtil<ZsyzShyj> util = new ExcelUtil<ZsyzShyj>(ZsyzShyj.class);
        return util.exportExcel(list, "shyj");
    }

    /**
     * 获取招商引资_审核意见详细信息
     */
    @PreAuthorize("@ss.hasPermi('projectV2:shyj:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(zsyzShyjService.selectZsyzShyjById(id));
    }

    /**
     * 新增招商引资_审核意见
     */
    @PreAuthorize("@ss.hasPermi('projectV2:shyj:add')")
    @Log(title = "招商引资_审核意见", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ZsyzShyj zsyzShyj)
    {
        return toAjax(zsyzShyjService.insertZsyzShyj(zsyzShyj));
    }

    /**
     * 修改招商引资_审核意见
     */
    @PreAuthorize("@ss.hasPermi('projectV2:shyj:edit')")
    @Log(title = "招商引资_审核意见", businessType = BusinessType.UPDATE)
    @PostMapping("/put")
    public AjaxResult edit(@RequestBody ZsyzShyj zsyzShyj)
    {
        return toAjax(zsyzShyjService.updateZsyzShyj(zsyzShyj));
    }

    /**
     * 删除招商引资_审核意见
     */
    @PreAuthorize("@ss.hasPermi('projectV2:shyj:remove')")
    @Log(title = "招商引资_审核意见", businessType = BusinessType.DELETE)
	@GetMapping("/delete/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(zsyzShyjService.deleteZsyzShyjByIds(ids));
    }
}
