AcquirePartsTest.java 2.92 KB
package cn.fw.parts;

import com.sucl.sbmp.MpStartApplication;
import com.sucl.sbmp.sys.biz.ChanganAutoEpcPartsBiz;
import com.sucl.sbmp.sys.biz.OldChanganAutoEpcPartsBiz;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.HashMap;
import java.util.concurrent.CompletableFuture;

/**
 * ProjectName: fw-activity-v2
 * Description: 获取备件数据测试
 * User: wangkai <wangkai@feewee.cn>
 * Date: 2019/10/25
 * Time: 10:55 AM
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = MpStartApplication.class)
//@ActiveProfiles("local") //指定使用application-local.yml
//@TestPropertySource(properties = { "spring.config.location = classpath:test.properties" })
public class AcquirePartsTest {
    private HashMap<String, String> token;

    @Autowired
    private ChanganAutoEpcPartsBiz changanAutoEpcPartsBiz;

    private OldChanganAutoEpcPartsBiz oldChanganAutoEpcPartsBiz;
    @Before
    public void setToken(){
//        this.token =  this.changanAutoEpcPartsBiz.setToken("381ec1fa12a84dce81e1d05db15bcc34");
        this.token =  this.changanAutoEpcPartsBiz.setToken("93691923a9bb4d5eb8b0abe13c8d50db");
    }
    /**
     * 新版EPC数据抽取
     */
    @Test
    public void selectParts(){
        // 获取车系列表
//        this.changanAutoEpcPartsBiz.selectSeriesByBrand(token);
        // 根据车系ID获取车型编码
        this.changanAutoEpcPartsBiz.selectScCodeBySeriesId(token);
        // 根据车型编码获取对应车款
//        this.changanAutoEpcPartsBiz.selectScNameByScCode(token);
        // 根据具体车款获取系统大类
//        this.changanAutoEpcPartsBiz.selectSystemByScId(token);
        // 根据具体车款获取备件模块
//        this.changanAutoEpcPartsBiz.selectModuleByScId(token);
        // 根据模块获取备件
//        this.changanAutoEpcPartsBiz.selectPartsByModule(token);
    }

    /**
     * 老版EPC数据抽取
     */
    @Test
    public void selectOldParts(){
        this.oldChanganAutoEpcPartsBiz.selectSeriesByBrand(token);
    }



    
    @Test
    public void generateQrCodeImageTask() throws Exception {
        // 注意不要重复导入数据
       // changanAutoEpcPartsBiz.acquireAnalysisPersistenceParts();

        this.changanAutoEpcPartsBiz.robotsFetchPartsData();
    }
    @Test
    public void acquireAllScParts() throws Exception{

        this.changanAutoEpcPartsBiz.getAllScPart();
    }
   /* @Test
    public void generateQrCodeImageTask2() throws Exception{
        this.changanAutoEpcPartsBiz.robotsFetchPartsData2();
    }*/

    @Test
    public void generateQrCodeImageTask1() throws Exception{
        String scId = "316daf08756342b784398ed053b56586";
        this.changanAutoEpcPartsBiz.robotsFetchModulesData1(scId);
    }


}