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 = "客户-下拉选项（openApi）")
    @RequestMapping(value = "/customSelect", method = RequestMethod.GET)
    public R customSelect() throws Exception {
        return enterpriseBussinessService.customSelect();
    }

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

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

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

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

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

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

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

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

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

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

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


}
