PJDataSerivceSoap_PJDataSerivceSoap12_Client.java
4.26 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
104
105
106
107
108
109
110
111
112
package com.bsth.wsdl;
/**
* Please modify this class to meet your needs
* This class is not complete
*/
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.bsth.util.XmlToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import javax.xml.namespace.QName;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
/**
* This class was generated by Apache CXF 3.3.2
* 2019-06-25T10:55:23.727+08:00
* Generated source version: 3.3.2
*
*/
public final class PJDataSerivceSoap_PJDataSerivceSoap12_Client {
@Autowired
JdbcTemplate jdbcTemplate;
private static final QName SERVICE_NAME = new QName("http://www.pd-transport.com/", "PJDataSerivce");
private PJDataSerivceSoap_PJDataSerivceSoap12_Client() {
}
public static void main(String args[]) throws Exception {
URL wsdlURL = PJDataSerivce.WSDL_LOCATION;
if (args.length > 0 && args[0] != null && !"".equals(args[0])) {
File wsdlFile = new File(args[0]);
try {
if (wsdlFile.exists()) {
wsdlURL = wsdlFile.toURI().toURL();
} else {
wsdlURL = new URL(args[0]);
}
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
PJDataSerivce ss = new PJDataSerivce(wsdlURL, SERVICE_NAME);
PJDataSerivceSoap port = ss.getPJDataSerivceSoap12();
{
System.out.println("Invoking getRetiredInfor...");
String _getRetiredInfor_unintCode = "KD01.0110";
String _getRetiredInfor_beginDate = "1900-01-01";
String _getRetiredInfor_endDate = "2019-06-25";
String _getRetiredInfor__return = port.getRetiredInfor(_getRetiredInfor_unintCode, _getRetiredInfor_beginDate, _getRetiredInfor_endDate);
JSONObject jsonInfor = XmlToJson.xml2Json(_getRetiredInfor__return);
System.out.println("getRetiredInfor.result=" + _getRetiredInfor__return);
JSONArray jsonArr = JSONArray.parseArray(jsonInfor.get("Retire").toString());
for(int i=0;i<jsonArr.size()-1; i++){
JSONObject pjson = jsonArr.getJSONObject(i);
String codeArr[] = pjson.getString("Code").split("-");
// if(pjson.getString("EmployeeName").equals("潘英") || pjson.getString("EmployeeName").equals("陆志兴")|| pjson.getString("EmployeeName").equals("沈志钢")){
// System.out.print(pjson);
// }
// if(codeArr.length > 1){
// if(codeArr[1].equals("016007") || codeArr[1].equals("006005") || codeArr[1].equals("005634") || codeArr[1].equals("007969")){
// System.out.print(pjson);
// }
// } else {
// System.out.print(codeArr);
// }
}
}
// {
// System.out.println("Invoking getPAItem...");
// int _getPAItem_year = 0;
// int _getPAItem_period = 0;
// String _getPAItem__return = port.getPAItem(_getPAItem_year, _getPAItem_period);
// System.out.println("getPAItem.result=" + _getPAItem__return);
//
//
// }
{
System.out.println("Invoking getEmployee...");
String _getEmployee_unintCode = "KD01.0112";
String _getEmployee_idCard = "";
String _getEmployee__return = port.getEmployee(_getEmployee_unintCode, _getEmployee_idCard);
JSONObject jsonInfor = XmlToJson.xml2Json(_getEmployee__return);
JSONArray jsonArr = JSONArray.parseArray(jsonInfor.get("Emp").toString());
jsonArr.getJSONObject(0).get("Code");
// jsonArr = JSONArray.fromObject(jsonInfor.get("Emp").toString());
System.out.println("getEmployee.result=" + _getEmployee__return);
for(int i=0;i<jsonArr.size()-1; i++){
JSONObject pjson = jsonArr.getJSONObject(i);
String codeArr[] = pjson.getString("Code").split("-");
if(codeArr[1].equals("016007") || codeArr[1].equals("006005") || codeArr[1].equals("005634") || codeArr[1].equals("007969")){
System.out.print(pjson);
}
}
}
System.exit(0);
}
}