package vip.xiaonuo.erp.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import vip.xiaonuo.erp.entity.kucun.*;
import vip.xiaonuo.erp.entity.shengcan.ShiJiChanLiang;
import vip.xiaonuo.erp.service.IErpKuCunService;
import vip.xiaonuo.erp.service.IErpShengChanService;

import java.util.Date;
import java.util.List;


@Service
public class ErpShengChanServiceImpl implements IErpShengChanService {
    @Autowired
    private RestTemplate restTemplate;

    @Override
    public void getShiJiChanLiang() {
        ResponseEntity<List<ShiJiChanLiang>> response = restTemplate.exchange(
                "http://127.0.0.1:9200/erp-shengChan/getShiJiChanLiang?date=",
                HttpMethod.GET,
                null,
                new ParameterizedTypeReference<List<ShiJiChanLiang>>() {}
        );
        List<ShiJiChanLiang> forObjects = response.getBody();
        System.out.println(forObjects);
    }
}
