package com.dsk.web.controller.search.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson2.JSONObject;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.dtos.ComposeQueryDto;
import com.dsk.common.utils.DskOpenApiUtil;
import com.dsk.web.controller.search.service.BusinessOpportunityRadarService;
import com.dsk.web.controller.search.service.MarketAnalysisService;
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 BusinessOpportunityRadarServiceImpl implements BusinessOpportunityRadarService {

    @Autowired
    private DskOpenApiUtil dskOpenApiUtil;


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


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

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

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

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

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

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


    @Override
    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);
    }

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

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

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

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

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