package com.dsk.system.searchService;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson2.JSONObject;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.utils.DskOpenApiUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author liujie
 * @ClassName MarketAnalysisServiceImpl
 * @Date 2023/5/15 16:40
 **/
@Service
public class BusinessOpportunityRadarService {

    @Autowired
    private DskOpenApiUtil dskOpenApiUtil;

    public AjaxResult jskBidNewsPage(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/jskBid/news/page", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult jskBidTenderPage(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/jskBidTender/page", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult establishmentPage(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/establishment/page", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult jskBidPage(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/jskBid/page", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult landMarketPage(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/landMarket/page", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult enterpriseIndex(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/enterprice/index", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult enterprisePage(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/enterprice/page", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult enterpriseByName(String keyword) {
        Map<String, Object> params = new HashMap<>();
        params.put("keyword", keyword);
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/enterprice/findByName", params);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult bondProjectPage(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/bondProject/page", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult jskBidPlanPage(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/jskBidPlan/page", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult getCapitalSourceSelect() {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/jskBidPlan/getCapitalSourceSelect", null);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult keywordList() {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/project/keywordList", null);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult bidSourceList(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/jskBid/source", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }
}
