package com.pine.admin.modules.business.service.impl;

import com.pine.admin.modules.business.dao.CarBackOrderDao;
import com.pine.admin.modules.business.dao.CarOrderDao;
import com.pine.admin.modules.business.entity.CarBackOrder;
import com.pine.admin.modules.business.entity.CarOrder;
import org.checkerframework.checker.units.qual.C;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.omg.CORBA.PUBLIC_MEMBER;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

import static org.junit.jupiter.api.Assertions.*;

/**
 * com.pine.admin.modules.business.service.impl
 *
 * @author Pine
 * @email 771190883@qq.com
 * @date 2019/9/17
 */

@RunWith(SpringRunner.class)
@SpringBootTest
public class CarBackOrderServiceImplTest {

    @Autowired
    private CarBackOrderDao carBackOrderDao;
    @Autowired
    private CarOrderDao carOrderDao;
    @Test
    public void test1(){
        List<CarBackOrder> carBackOrders = carBackOrderDao.queryAll(null);
        System.out.println(carBackOrders.size());
        int n = 0 ;
        carBackOrders.stream().forEach(c->{
            CarOrder carOrder = new CarOrder();
            carOrder.setCode(c.getOrderCode());
            CarOrder carOrder1 = carOrderDao.queryOne(carOrder);
            if (null == carOrder1){
                System.out.println("无订单:" + carOrder.getCode());
            }
        });
    }


}
