package com.dsk.system.dskService;

import cn.hutool.core.bean.BeanUtil;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.domain.model.*;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.utils.DskOpenApiUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class EnterpriseBussinessService {

    private static final Logger log = LoggerFactory.getLogger(EnterpriseService.class);

    @Autowired
    private DskOpenApiUtil dskOpenApiUtil;


    public TableDataInfo clientPage(EnterpriseBussinessClientPageBody body) throws Exception {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseBussiness/clientPage", BeanUtil.beanToMap(body, false, false));
        return dskOpenApiUtil.responsePage(map);
    }


    public TableDataInfo clientProjectPage(EnterpriseBussinessClientProjectPageBody body) throws Exception {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseBussiness/clientProjectPage", BeanUtil.beanToMap(body, false, false));
        return dskOpenApiUtil.responsePage(map);
    }


    public TableDataInfo tenderPage(EnterpriseBussinessTenderPageBody body) throws Exception {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseBussiness/tenderPage", BeanUtil.beanToMap(body, false, false));
        return dskOpenApiUtil.responsePage(map);
    }


    public R tenderDetail(EnterpriseBussinessTenderDetailBody body) throws Exception {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseBussiness/tenderDetail", BeanUtil.beanToMap(body, false, false));
        return BeanUtil.toBean(map, R.class);
    }


    public TableDataInfo supplierPage(EnterpriseBussinessSupplierPageBody body) throws Exception {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseBussiness/supplierPage", BeanUtil.beanToMap(body, false, false));
        return dskOpenApiUtil.responsePage(map);
    }


    public TableDataInfo supplierProjectPage(EnterpriseBussinessSupplierProjectPageBody body) throws Exception {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseBussiness/supplierProjectPage", BeanUtil.beanToMap(body, false, false));
        return dskOpenApiUtil.responsePage(map);
    }


    public R projectDetail(EnterpriseBussinessProjectDetailBody body) throws Exception {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseBussiness/projectDetail", BeanUtil.beanToMap(body, false, false));
        return BeanUtil.toBean(map, R.class);
    }


    public TableDataInfo oftenAgencyPage(EnterpriseBussinessOftenAgencyPageBody body) throws Exception {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseBussiness/oftenAgencyPage", BeanUtil.beanToMap(body, false, false));
        return dskOpenApiUtil.responsePage(map);
    }


    public TableDataInfo bidCooperatePage(EnterpriseBussinessBidCooperatePageBody body) throws Exception {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseBussiness/bidCooperatePage", BeanUtil.beanToMap(body, false, false));
        return dskOpenApiUtil.responsePage(map);
    }


    public TableDataInfo historySendPage(EnterpriseBussinessHistorySendPageBody body) throws Exception {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseBussiness/historySendPage", BeanUtil.beanToMap(body, false, false));
        return dskOpenApiUtil.responsePage(map);
    }


    public R historySendProvince(EnterpriseBussinessHistorySendProvinceBody body) throws Exception {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/operate/enterpriseBussiness/historySendProvince", BeanUtil.beanToMap(body, false, false));
        return BeanUtil.toBean(map, R.class);
    }
}
