package com.ho.datacollect.service.impl;

import com.ho.business.service.ElecPriceService;
import com.ho.datacollect.api.constant.DataCollectConstant;
import com.ho.datacollect.api.vo.req.add.DataSetParam;
import com.ho.datacollect.feignclient.DataCollectTdFeignClient;
import com.ho.datacollect.service.DataCollectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author GuYan
 * @version 1.0.0
 * @ClassName ElecPriceCellDataConllectServiseImpl.java
 * @Description 电价数据入库
 * @createTime 2022年09月09日 11:04:00
 */
@Service(DataCollectConstant.KEY_MAP.PRICE)
@Slf4j
public class ElecPriceCellDataConllectServiseImpl implements DataCollectService {
    @Autowired
    ElecPriceService elecPriceService;


    @Autowired
    DataCollectTdFeignClient tdFeignClient;

    @Override
    public void doService(DataSetParam dataSetParam) {
        /*try {
            if (linkedHashMap == null || linkedHashMap.isEmpty()) {
                return;
            }
            //取电站id
            Integer stationId = (Integer) params.get(OrgConstant.STATION_ID);
            //取电价price
            JSONArray jsonArray  = (JSONArray) linkedHashMap.get(DataCollectConstant.LIST);
            List<ElecPrice> elecPrices = jsonArray.toJavaList(ElecPrice.class);
            if (!elecPrices.isEmpty()) {
                for (ElecPrice elecPrice : elecPrices) {
                    elecPrice.setStationId(stationId);
                    elecPriceService.insertSelective(elecPrice);
                }
            }
        } catch (Exception e) {
            log.error("添加电价数据失败");
        }*/


    }
}
