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.caigou.*;
import vip.xiaonuo.erp.entity.center.CaiGouJinE;
import vip.xiaonuo.erp.entity.center.DangQianYvQi;
import vip.xiaonuo.erp.entity.center.XiaoShouE;
import vip.xiaonuo.erp.entity.center.YangMaoZhiCaiGouJinE;
import vip.xiaonuo.erp.entity.voucher.ChanPinShouRu;
import vip.xiaonuo.erp.entity.voucher.ErpVoucher;
import vip.xiaonuo.erp.entity.voucher.JingLiRunQuShi;
import vip.xiaonuo.erp.entity.voucher.LinJinHuanKuanQi;
import vip.xiaonuo.erp.service.IErpCaiWuService;
import vip.xiaonuo.erp.service.IErpHeXinService;

import java.util.List;


@Service
public class ErpCaiWuServiceImpl implements IErpCaiWuService {
    @Autowired
    private RestTemplate restTemplate;

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }

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

    }
}
