AcquirePartsTest.java
3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package cn.fw.parts;
import com.sucl.sbmp.MpStartApplication;
import com.sucl.sbmp.sys.biz.ChanganAutoEpcPartsBiz;
import com.sucl.sbmp.sys.biz.OldChanganAutoEpcPartsBiz;
import com.sucl.sbmp.sys.biz.SpecPartBiz;
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 SpecPartBiz specPartBiz;
@Autowired
private ChanganAutoEpcPartsBiz changanAutoEpcPartsBiz;
private OldChanganAutoEpcPartsBiz oldChanganAutoEpcPartsBiz;
@Before
public void setToken(){
// this.token = this.changanAutoEpcPartsBiz.setToken("381ec1fa12a84dce81e1d05db15bcc34");
this.token = this.changanAutoEpcPartsBiz.setToken("77054ffe926c416bb0d48412ab734f3f");
}
/**
* 将抽取的数据转换到specpart表中
*/
@Test
public void transferData(){
specPartBiz.transferData();
}
/**
* 新版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);
}
}