package com.dsk.search.service;

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.Map;

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

    @Autowired
    private DskOpenApiUtil dskOpenApiUtil;

    public AjaxResult areaGroupByProvince() {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/areaGroupByProvince", new JSONObject());
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult certGroupByMajorAndLevel() {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/certGroupByMajorAndLevel", new JSONObject());
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult certGroupByMajorProvinceLevel()  {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/certGroupByMajorProvinceLevel", new JSONObject());
        return BeanUtil.toBean(map, AjaxResult.class);
    }

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

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

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

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

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

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

    public AjaxResult countNewsBidByYear() {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/countNewsBidByYear", new JSONObject());
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult countLandMarketByYear() {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/countLandMarketByYear", new JSONObject());
        return BeanUtil.toBean(map, AjaxResult.class);
    }

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

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

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

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

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

    public AjaxResult rangeBidFiveYears() {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/rangeBidFiveYears", new JSONObject());
        return BeanUtil.toBean(map, AjaxResult.class);
    }

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

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