package com.dsk.web.controller.dsk;


import com.dsk.common.core.domain.R;
import com.dsk.common.core.domain.model.*;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.system.dskService.EnterpriseBussinessService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.Map;

/**
*@Description: 央企经营管理系统企业业务相关
*@Author: zhangyi
*@date: 2023/5/17 9:03
*/
@Slf4j
@RestController
@RequestMapping(value = "/enterpriseBussiness")
public class EnterpriseBussinessController {
    @Autowired
    EnterpriseBussinessService enterpriseBussinessService;

    @ApiOperation(value = "客户信息列表")
    @RequestMapping(value = "/clientPage", method = RequestMethod.POST)
    public TableDataInfo clientPage(@RequestBody @Valid EnterpriseBussinessClientPageBody body) throws Exception {
        return enterpriseBussinessService.clientPage(body);
    }

    @ApiOperation(value = "客户项目列表")
    @RequestMapping(value = "/clientProjectPage", method = RequestMethod.POST)
    public Map<String, Object> clientProjectPage(@RequestBody @Valid EnterpriseBussinessClientProjectPageBody body) throws Exception {
        return enterpriseBussinessService.clientProjectPage(body);
    }

    @ApiOperation(value = "投标记录列表（开标记录）")
    @RequestMapping(value = "/tenderPage",method = RequestMethod.POST)
    public TableDataInfo tenderPage(@RequestBody @Valid EnterpriseBussinessTenderPageBody body) throws Exception {
        return enterpriseBussinessService.tenderPage(body);
    }

    @ApiOperation(value = "投标记录详情（开标记录）")
    @RequestMapping(value = "/tenderDetail",method = RequestMethod.POST)
    public R tenderDetail(@RequestBody @Valid EnterpriseBussinessTenderDetailBody body) throws Exception {
        return enterpriseBussinessService.tenderDetail(body);
    }

    @ApiOperation(value = "供应商列表")
    @RequestMapping(value = "/supplierPage",method = RequestMethod.POST)
    public TableDataInfo supplierPage(@RequestBody @Valid EnterpriseBussinessSupplierPageBody body) throws Exception {
        return enterpriseBussinessService.supplierPage(body);
    }

    @ApiOperation(value = "供应商项目列表")
    @RequestMapping(value = "/supplierProjectPage",method = RequestMethod.POST)
    public Map<String, Object> supplierProjectPage(@RequestBody @Valid EnterpriseBussinessSupplierProjectPageBody body) throws Exception {
        return enterpriseBussinessService.supplierProjectPage(body);
    }

    @ApiOperation(value = "中标项目详情")
    @RequestMapping(value = "/projectDetail", method = RequestMethod.POST)
    public R projectDetail(@RequestBody @Valid EnterpriseBussinessProjectDetailBody body) throws Exception {
        return enterpriseBussinessService.projectDetail(body);
    }

    @ApiOperation(value = "招标代理常合作代理机构列表")
    @RequestMapping(value = "/oftenAgencyPage",method = RequestMethod.POST)
    public TableDataInfo oftenAgencyPage(@RequestBody @Valid EnterpriseBussinessOftenAgencyPageBody body) throws Exception {
        return enterpriseBussinessService.oftenAgencyPage(body);
    }

    @ApiOperation(value = "招标合作明细列表")
    @RequestMapping(value = "/bidCooperatePage", method = RequestMethod.POST)
    public TableDataInfo bidCooperatePage(@RequestBody @Valid EnterpriseBussinessBidCooperatePageBody body) throws Exception {
        return enterpriseBussinessService.bidCooperatePage(body);
    }

    @ApiOperation(value = "历史发包列表")
    @RequestMapping(value = "/historySendPage", method = RequestMethod.POST)
    public TableDataInfo historySendPage(@RequestBody @Valid EnterpriseBussinessHistorySendPageBody body) throws Exception {
        return enterpriseBussinessService.historySendPage(body);
    }

    @ApiOperation(value = "历史发包省份")
    @RequestMapping(value = "/historySendProvince", method = RequestMethod.POST)
    public R historySendProvince(@RequestBody @Valid EnterpriseBussinessHistorySendProvinceBody body) throws Exception {
        return enterpriseBussinessService.historySendProvince(body);
    }


}
