AnalysisRoute.java
2.7 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
package com.sy.controller;
import com.sy.bwAnalysis.*;
import com.sy.bwAssist.Message;
import com.sy.model.*;
import com.sy.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.List;
@Component
public class AnalysisRoute {
@Autowired
private aironeExStockService exStockService;
@Autowired
private aironeImStockService imStockService;
@Autowired
private GATService gatService;
@Autowired
private CLRService clrService;
@Autowired
private GatherInfoService infoService;
private static AnalysisRoute route;
private static MessageAnalysis analysis = new MessageAnalysis();
private static CLRAnalysis clrAnalysis = new CLRAnalysis();
private static ExStockAnalysis exStockAnalysis = new ExStockAnalysis();
private static ImStockAnalysis imStockAnalysis = new ImStockAnalysis();
private static GATAnaluysis gatAnaluysis = new GATAnaluysis();
private static GatherInfoAnalysis gatherInfoAnalysis = new GatherInfoAnalysis();
@PostConstruct
public void init(){
route = this;
route.clrService = this.clrService;
route.exStockService = this.exStockService;
route.imStockService = this.imStockService;
route.gatService = this.gatService;
route.infoService = this.infoService;
}
public void analysis(String string) {
Message message = analysis.readTicketsXml(string);
String stype = analysis.getStype();
if (stype.equals("CARM")) {
gatherinfo info = gatherInfoAnalysis.toJavaBean(message);
route.infoService.save(info);
} else if (stype.equals("ES1")) {
airone_ex_stock exStock = exStockAnalysis.toExStock(message);
route.exStockService.save(exStock);
} else if (stype.equals("CLR")) {
v_express_billno billno = clrAnalysis.toBill(message);
route.clrService.save(billno);
} else if (stype.equals("IS1")) {
airone_im_stock imStock = imStockAnalysis.toImStock(message);
route.imStockService.save(imStock);
} else if (stype.equals("GAT")) {
port_manifest_head portHead = gatAnaluysis.toPortHead(message);
route.gatService.savePortHead(portHead);
List<port_manifest_body> portBody = gatAnaluysis.toPortBody(message);
for (int a = 0; a<portBody.size();a++){
route. gatService.savePortBody(portBody.get(a));
}
port_manifest_head_stat portStat = gatAnaluysis.toPortStat(message);
route.gatService.savePortStat(portStat);
}
}
}