package com.ozs.web.controller.home;

import com.ozs.common.annotation.Log;
import com.ozs.common.constant.ModularConstans;
import com.ozs.common.core.controller.BaseController;
import com.ozs.common.core.domain.AjaxResult;
import com.ozs.common.enums.BusinessType;
import com.ozs.plan.doman.vo.responseVo.PlanQuarterResponseVo;
import com.ozs.plan.service.PlanYearsService;
import com.ozs.pm.doman.vo.responseVo.PmDemandResVo;
import com.ozs.pm.service.IPmDemandService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * 系统首页控制层
 *
 * @author buzhanyi
 */
@RestController
@RequestMapping("/home/systemHomepage")
public class SystemHomepageController extends BaseController {
    @Resource
    private PlanYearsService planYearsService;
    @Resource
    private IPmDemandService pmDemandService;

    @ApiOperation(value = "需求单位首页计划管理总数")
    @GetMapping("/demandUnit/planManagement/total")
    public AjaxResult demandUnitPlanManagementTotal() {
        return planYearsService.demandUnitPlanManagementTotal();
    }

    @ApiOperation(value = "需求单位首页需求管理总数")
    @GetMapping("/demandUnit/demandManagement/total")
    public AjaxResult demandUnitDemandManagementTotal() {
        return planYearsService.demandUnitDemandManagementTotal();
    }

    @ApiOperation(value = "需求单位首页合同管理总数")
    @GetMapping("/demandUnit/contractManagement/total")
    public AjaxResult demandUnitContractManagementTotal() {
        return planYearsService.demandUnitContractManagementTotal();
    }

    @ApiOperation(value = "需求单位首页建设管理总数")
    @GetMapping("/demandUnit/constructionManagement/total")
    public AjaxResult demandUnitConstructionManagementTotal() {
        return planYearsService.demandUnitConstructionManagementTotal();
    }

    @ApiOperation(value = "采购管理部门首页计划管理总数")
    @GetMapping("/purchasingManagement/planManagement/total")
    public AjaxResult purchasingManagementPurchasingManagementTotal() {
        return planYearsService.purchasingManagementPurchasingManagementTotal();
    }

    @ApiOperation(value = "采购管理部门首页需求管理总数")
    @GetMapping("/purchasingManagement/demandManagement/total")
    public AjaxResult purchasingManagementDemandManagementTotal() {
        return planYearsService.purchasingManagementDemandManagementTotal();
    }

    @ApiOperation(value = "采购管理部门首页任务下达管理总数")
    @GetMapping("/purchasingManagement/taskRelease/total")
    public AjaxResult purchasingManagementTaskReleaseTotal() {
        return planYearsService.purchasingManagementTaskReleaseTotal();
    }

    @ApiOperation(value = "采购办首页采购执行管理总数")
    @GetMapping("/procurementOffice/procurementExecution/total")
    public AjaxResult procurementOfficeProcurementExecutionTotal() {
        return planYearsService.procurementOfficeProcurementExecutionTotal();
    }

    @ApiOperation(value = "采购办首已中标项目理总数")
    @GetMapping("/procurementOffice/winningTheBid/total")
    public AjaxResult procurementOfficeWinningTheBidTotal() {
        return planYearsService.procurementOfficeWinningTheBidTotal();
    }

    @ApiOperation(value = "采购办首未中标项目理总数")
    @GetMapping("/procurementOffice/failureToWinTheBid/total")
    public AjaxResult procurementOfficeFailureToWinTheBidTotal() {
        return planYearsService.procurementOfficeFailureToWinTheBidTotal();
    }

    @ApiOperation(value = "需求单位首页待办事项（全部）")
    @GetMapping("/demandUnit/will/total")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult demandUnitWillManipulateTotal() {
        return planYearsService.demandUnitWillManipulateTotal();
    }

    @ApiOperation(value = "需求单位首页待办事项（计划待提交）")
    @GetMapping("/demandUnit/will/planWaitCommit")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult planWaitCommit() {
        List<PlanQuarterResponseVo> vos = planYearsService.planWaitCommit();
        return AjaxResult.success(vos);
    }

    @ApiOperation(value = "需求单位首页待办事项（需求待提交）")
    @GetMapping("/demandUnit/will/demandWaitCommit")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult demandUnit() {
        List<PmDemandResVo> resVos = pmDemandService.demandWaitCommit();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "需求单位首页待办事项（合同待填制）")
    @GetMapping("/demandUnit/will/contractWaitFilled")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult contractWaitFilled() {
        List<PmDemandResVo> resVos = pmDemandService.contractWaitFilled();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "需求单位首页待办事项（项目建设待完成）")
    @GetMapping("/demandUnit/will/projectWaitFinish")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult projectWaitFinish() {
        List<PmDemandResVo> resVos = pmDemandService.projectWaitFinish();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "采购管理部门首页待办事项（全部）")
    @GetMapping("/purchasingManagement/will/total")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult purchasingManagementWillManipulateTotal() {
        return planYearsService.purchasingManagementWillManipulateTotal();
    }

    @ApiOperation(value = "采购管理部门首页待办事项（计划待审核）")
    @GetMapping("/purchasingManagement/will/planWaitExamine")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult planWaitExamine() {
        List<PlanQuarterResponseVo> resVos = planYearsService.planWaitExamine();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "采购管理部门首页待办事项（需求待审核）")
    @GetMapping("/purchasingManagement/will/demandWaitExamine")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult demandWaitExamine() {
        List<PmDemandResVo> resVos = pmDemandService.demandWaitExamine();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "采购管理部门首页待办事项（任务待下达）")
    @GetMapping("/purchasingManagement/will/taskWaitRelease")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult taskWaitRelease() {
        List<PmDemandResVo> resVos = pmDemandService.taskWaitRelease();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "采购办首页待办事项（全部）")
    @GetMapping("/procurementOffice/will/total")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult procurementOfficeWillManipulateTotal() {
        return pmDemandService.procurementOfficeWillManipulateTotal();
    }

    @ApiOperation(value = "采购办首页待办事项（待选取代理）")
    @GetMapping("/procurementOffice/will/waitSelectAgent")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult waitSelectAgent() {
        List<PmDemandResVo> resVos = pmDemandService.waitSelectAgent();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "采购办首页待办事项（待上传招标文件）")
    @GetMapping("/procurementOffice/will/waitUpBidFile")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult waitUpBidFile() {
        List<PmDemandResVo> resVos = pmDemandService.waitUpBidFile();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "采购办首页待办事项（待发布公告）")
    @GetMapping("/procurementOffice/will/waitAnnouncement")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult waitAnnouncement() {
        List<PmDemandResVo> resVos = pmDemandService.waitAnnouncement();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "采购办首页待办事项（待开标）")
    @GetMapping("/procurementOffice/will/waitOpenBid")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult waitOpenBid() {
        List<PmDemandResVo> resVos = pmDemandService.waitOpenBid();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "采购办首页待办事项（待发布中标公告）")
    @GetMapping("/procurementOffice/will/waitBidAnnouncement")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult waitBidAnnouncement() {
        List<PmDemandResVo> resVos = pmDemandService.waitBidAnnouncement();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "采购办首页待办事项（中标公示中）")
    @GetMapping("/procurementOffice/will/biddingPublicity")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult biddingPublicity() {
        List<PmDemandResVo> resVos = pmDemandService.biddingPublicity();
        return AjaxResult.success(resVos);
    }

    @ApiOperation(value = "采购办首页待办事项（发函催告）")
    @GetMapping("/procurementOffice/will/sendLetter")
    @Log(title = ModularConstans.systemHome, businessType = BusinessType.QUERY)
    public AjaxResult willSendLetter() {
        List<PlanQuarterResponseVo> vos = planYearsService.willSendLetter();
        return AjaxResult.success(vos);
    }
}
