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.renshi.YuanGongShuLiang;
import vip.xiaonuo.erp.entity.voucher.ErpVoucher;
import vip.xiaonuo.erp.entity.xiaoshou.*;
import vip.xiaonuo.erp.service.IErpHrService;
import vip.xiaonuo.erp.service.IErpXiaoShouService;

import java.util.List;


@Service
public class ErpHrServiceImpl implements IErpHrService {
    @Autowired
    private RestTemplate restTemplate;


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