package vip.xiaonuo.erp.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.ErpBdOrg;
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.ErpVoucher;
import vip.xiaonuo.erp.mapper.ErpBdDepartmentMapper;
import vip.xiaonuo.erp.mapper.ErpBdOrgMapper;
import vip.xiaonuo.erp.service.IErpHeXinService;
import vip.xiaonuo.timer.ErpVoucherTimer;

import java.util.List;


@Service
public class ErpHeXinServiceImpl implements IErpHeXinService {
    @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 getJinLiRun() {
        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 getZiJinYvE() {
        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 getXiaoShouE() {
        ResponseEntity<List<XiaoShouE>> response = restTemplate.exchange(
                "http://127.0.0.1:9200/erp-center/getXiaoShouE?date=",
                HttpMethod.GET,
                null,
                new ParameterizedTypeReference<List<XiaoShouE>>() {}
        );
        List<XiaoShouE> forObjects = response.getBody();
        System.out.println(forObjects);
    }

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

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

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