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.EnterpriseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

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


/**
 * @ClassName EnterpriseController
 * @Description TODO
 * @Author zhangyi
 * @Date 2023/5/15 12:01
 * @Version 1.0
 */
@Api("企业数据相关")
@RestController
@RequestMapping("/enterprise")
public class EnterpriseController {

    @Autowired
    private EnterpriseService enterpriseService;

    @ApiOperation(value = "企业详情头部信息（建设库）")
    @PostMapping("/infoHeader")
    public R infoHeader(@RequestBody @Valid EnterpriseInfoHeaderBody body) throws Exception {
        return enterpriseService.infoHeader(body);
    }

    @ApiOperation(value = "企业统计信息（建设库）")
    @PostMapping(value = "statistic")
    public R statistic(@RequestBody @Valid EnterpriseStatisticBody vo) throws Exception {
        return enterpriseService.statistic(vo);
    }

    @ApiOperation(value = "招标偏好信息（openApi）")
    @PostMapping(value = "bidDataGroup")
    public R bidDataGroup(@RequestBody @Valid EnterpriseBidDataGroupBody vo) throws Exception {
        return enterpriseService.bidDataGroup(vo);
    }

    @ApiOperation(value = "甲方业绩数据（openApi）")
    @PostMapping(value = "projectTenderDataGroup")
    public R projectTenderDataGroup(@RequestBody @Valid EnterpriseProjectTenderDataGroupBody vo) throws Exception {
        return enterpriseService.projectTenderDataGroup(vo);
    }

    @ApiOperation(value = "股东列表（openApi）")
    @PostMapping(value = "partners")
    public TableDataInfo partners(@RequestBody @Valid EnterprisePartnersBody vo) throws Exception {
        return enterpriseService.partners(vo);
    }

    @ApiOperation(value = "对外投资列表（openApi）")
    @PostMapping(value = "investment")
    public TableDataInfo investment(@RequestBody @Valid EnterpriseInvestmentBody vo) throws Exception {
        return enterpriseService.investment(vo);
    }

    @ApiOperation(value = "分支机构列表（openApi）")
    @PostMapping(value = "affiliates")
    public TableDataInfo affiliates(@RequestBody @Valid EnterpriseAffiliatesBody vo) throws Exception {
        return enterpriseService.affiliates(vo);
    }

    @ApiOperation(value = "企业动态列表（建设库）")
    @PostMapping(value = "dynamicPage")
    public TableDataInfo dynamicPage(@RequestBody @Valid EnterpriseDynamicPageBody vo) throws Exception {
        return enterpriseService.dynamicPage(vo);
    }

    @ApiOperation(value = "工商基本信息（openApi）")
    @PostMapping(value = "icInfo")
    public R icInfo(@RequestBody @Valid EnterpriseIcInfoBody vo) throws Exception {
        return enterpriseService.icInfo(vo);
    }

    @ApiOperation(value = "工商变更信息列表（openApi）")
    @PostMapping(value = "changeInfo")
    public TableDataInfo changeInfo(@RequestBody @Valid EnterpriseChangeInfoBody vo) throws Exception {
        return enterpriseService.changeInfo(vo);
    }

    @ApiOperation(value = "高管信息列表（openApi）")
    @PostMapping(value = "keymembers")
    public TableDataInfo keymembers(@RequestBody @Valid EnterpriseKeymembersBody vo) throws Exception {
        return enterpriseService.keymembers(vo);
    }

    @ApiOperation(value = "工商股东信息（openApi）")
    @PostMapping(value = "bestStockPage")
    public TableDataInfo bestStockPage(@RequestBody @Valid EnterpriseBestStockPageBody vo) throws Exception {
        return enterpriseService.bestStockPage(vo);
    }

    @ApiOperation(value = "财务简析（openApi）")
    @PostMapping(value = "financial")
    public R financial(@RequestBody @Valid EnterpriseFinancialBody vo) throws Exception {
        return enterpriseService.financial(vo);
    }

    @ApiOperation(value = "城投平台企业查询（openApi）")
    @PostMapping(value = "uipSerach")
    public TableDataInfo uipSerach(@RequestBody @Valid EnterpriseUipSearchBody vo) throws Exception {
        return enterpriseService.uipSerach(vo);
    }

    @ApiOperation(value = "城投平台企业查询选项（openApi）")
    @PostMapping(value = "uipGroupData")
    public R financial() throws Exception {
        return enterpriseService.uipGroupData();
    }

    @ApiOperation(value = "建设库企业id解码）")
    @PostMapping(value = "remark")
    public R remark(@RequestBody @Valid EnterpriseRemarkBody vo) throws Exception {
        return enterpriseService.remark(vo);
    }

    @ApiOperation(value = "企业主体信用评级")
    @PostMapping(value = "bondCreditRating")
    public R bondCreditRating(@RequestBody @Valid EnterpriseBondCreditRatingBody vo) throws Exception {
        return enterpriseService.bondCreditRating(vo);
    }

    @ApiOperation(value = "通过建设库企业id批量获取城投企业id")
    @PostMapping(value = "getUipIdByCid")
    public R getUipIdByCid(@RequestBody List<Integer> vo) throws Exception {
        return enterpriseService.getUipIdByCid(vo);
    }

    @ApiOperation(value = "企业-财务数据")
    @PostMapping(value = "financialData")
    public R financialData(@RequestBody EnterpriseFinancialDataBody vo) throws Exception {
        return enterpriseService.financialData(vo);
    }

}
