package com.ruoyi.web.controller.projectV2;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import org.apache.catalina.security.SecurityUtil;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.projectV2.ZsyzJzqkTs;
import com.ruoyi.system.service.projectV2.IZsyzJzqkTsService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)Controller
 * 
 * @author ruoyi
 * @date 2023-03-06
 */
@RestController
@RequestMapping("/projectV2/ts")
public class ZsyzJzqkTsController extends BaseController
{
    @Autowired
    private IZsyzJzqkTsService zsyzJzqkTsService;

    /**
     * 查询招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)列表
     */
    @PreAuthorize("@ss.hasPermi('system:ts:list')")
    @GetMapping("/list")
    public TableDataInfo list(ZsyzJzqkTs zsyzJzqkTs)
    {
        startPage();
        SysUser user = SecurityUtils.getLoginUser().getUser();
        zsyzJzqkTs.setDeptId(user.getDeptId());
        zsyzJzqkTs.setIsDel("N");
        List<ZsyzJzqkTs> list = zsyzJzqkTsService.selectZsyzJzqkTsList(zsyzJzqkTs);
        return getDataTable(list);
    }

    /**
     * 导出招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)列表
     */
    @PreAuthorize("@ss.hasPermi('system:ts:export')")
    @Log(title = "招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ZsyzJzqkTs zsyzJzqkTs)
    {
        List<ZsyzJzqkTs> list = zsyzJzqkTsService.selectZsyzJzqkTsList(zsyzJzqkTs);
        ExcelUtil<ZsyzJzqkTs> util = new ExcelUtil<ZsyzJzqkTs>(ZsyzJzqkTs.class);
        util.exportExcel(response, list, "招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)数据");
    }

    /**
     * 获取招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:ts:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(zsyzJzqkTsService.selectZsyzJzqkTsById(id));
    }

    /**
     * 新增招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)
     */
    @PreAuthorize("@ss.hasPermi('system:ts:add')")
    @Log(title = "招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ZsyzJzqkTs zsyzJzqkTs)
    {
        return toAjax(zsyzJzqkTsService.insertZsyzJzqkTs(zsyzJzqkTs));
    }

    /**
     * 修改招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)
     */
    @PreAuthorize("@ss.hasPermi('system:ts:edit')")
    @Log(title = "招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ZsyzJzqkTs zsyzJzqkTs)
    {
        return toAjax(zsyzJzqkTsService.updateZsyzJzqkTs(zsyzJzqkTs));
    }

    /**
     * 删除招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)
     */
    @PreAuthorize("@ss.hasPermi('system:ts:remove')")
    @Log(title = "招商引资_进展情况_提示(当承接地已承接，但15天未填写签约信息的记录信息，前端给出提示框)", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(zsyzJzqkTsService.deleteZsyzJzqkTsByIds(ids));
    }
}
