package com.ruoyi.web.controller.fgw;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.fgw.FgwShyj;
import com.ruoyi.system.domain.fgw.FgwXmsb;
import com.ruoyi.system.domain.projectV2.ZsyzShyj;
import com.ruoyi.system.service.fgw.IFgwCommonService;
import com.ruoyi.system.service.fgw.IFgwShyjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
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;

/**
 * @Author: tjf
 * @Date: 2023/3/23 8:58
 * @Describe:
 */
@RestController
@RequestMapping("/fgw/common")
public class FgwCommonController {
    @Autowired
    private IFgwShyjService fgwShyjService;
    @Autowired
    private IFgwCommonService fgwCommonService;

    /**
     * 发改委项目审核/驳回接口 申报库到项目库审核
     * 参数是审核建议
     *
     * @return
     */
    @PostMapping("/xmsh")
    @PreAuthorize("@ss.hasPermi('fgw:common:xmsh')")
    public AjaxResult xssh(@RequestBody FgwShyj fgwShyj) {
        //所有审核需要往审核意见表插入数据
        return fgwShyjService.xssh(fgwShyj);
    }

    /**
     * 发改委项目审核/驳回接口 前期工作手续审核
     * 参数是审核建议
     *
     * @return
     */
    @PostMapping("/sxsh")
    @PreAuthorize("@ss.hasPermi('fgw:common:sxsh')")
    public AjaxResult sxsh(@RequestBody FgwShyj fgwShyj) {
        //所有审核需要往审核意见表插入数据
        return fgwShyjService.sxsh(fgwShyj);
    }

    /**
     * 发改委项目审核/驳回接口 建设阶段审核
     * 参数是审核建议
     *
     * @return
     */
    @PostMapping("/jssh")
    @PreAuthorize("@ss.hasPermi('fgw:common:jssh')")
    public AjaxResult jssh(@RequestBody FgwShyj fgwShyj) {
        //所有审核需要往审核意见表插入数据
        return fgwShyjService.jssh(fgwShyj);
    }

    /**
     * 发改委项目 竣工阶段申请
     *
     * @return
     */
    @PostMapping("/jgsq")
    @PreAuthorize("@ss.hasPermi('fgw:common:jgsq')")
    public AjaxResult jgsq(@RequestBody FgwXmsb fgwXmsb) {
        //所有审核需要往审核意见表插入数据
        return fgwShyjService.jgsq(fgwXmsb);
    }
    /**
     * 发改委项目审核/驳回接口 竣工阶段审核
     * 参数是审核建议
     *
     * @return
     */
    @PostMapping("/jgsh")
    @PreAuthorize("@ss.hasPermi('fgw:common:jgsh')")
    public AjaxResult jgsh(@RequestBody FgwShyj fgwShyj) {
        //所有审核需要往审核意见表插入数据
        return fgwShyjService.jgsh(fgwShyj);
    }

    /**
     * 发改委项目审核/驳回接口 进展情况审核
     * 参数是审核建议
     *
     * @return
     */
    @PostMapping("/jzqksh")
    @PreAuthorize("@ss.hasPermi('fgw:common:jzqksh')")
    public AjaxResult jzqksh(@RequestBody FgwShyj fgwShyj) {
        //所有审核需要往审核意见表插入数据
        return fgwShyjService.jzqksh(fgwShyj);
    }

    /**
     * 首页统计
     *
     * @return
     */
    @PostMapping("/census")
    @PreAuthorize("@ss.hasPermi('fgw:common:census')")
    public AjaxResult census() {
        return fgwCommonService.index();
    }

    /**
     * 首页统计--项目和节点统计
     *
     * @return
     */
    @PostMapping("/sbAndJdNum")
    @PreAuthorize("@ss.hasPermi('fgw:common:sbAndJdNum')")
    public AjaxResult sbAndJdNum() {
        return fgwCommonService.sbAndJdNum();
    }

    /**
     * 首页统计--责任单位超期
     *
     * @return
     */
    @PostMapping("/zrdwCqNum")
    @PreAuthorize("@ss.hasPermi('fgw:common:zrdwCqNum')")
    public AjaxResult zrdwCqNum() {
        return fgwCommonService.zrdwCqNum();
    }

    /**
     * 本月汇报进度
     *
     * @return
     */
    @PostMapping("/hbjd")
    @PreAuthorize("@ss.hasPermi('fgw:common:hbjd')")
    public AjaxResult hbjd() {
        return fgwCommonService.hbjd();
    }

    /**
     * 统计项目整体概况
     *
     * @return
     */
    @PostMapping("/xmztgk")
    @PreAuthorize("@ss.hasPermi('fgw:common:xmztgk')")
    public AjaxResult xmztgk() {
        return fgwCommonService.xmztgk();
    }
}
