|
|
|
@ -11,6 +11,7 @@ import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
|
|
|
|
|
import org.apache.cxf.transport.http.HTTPConduit;
|
|
|
|
|
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
@ -31,28 +32,39 @@ public class WebServiceImpl implements Webservcies {
|
|
|
|
|
@Autowired
|
|
|
|
|
private Niec_SensorsDao niec_sensorsDao;
|
|
|
|
|
|
|
|
|
|
private static String address = "http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl";
|
|
|
|
|
|
|
|
|
|
@Value("${webservice.address}")
|
|
|
|
|
public String address;
|
|
|
|
|
|
|
|
|
|
@Value("${webservice.connecttime}")
|
|
|
|
|
public Integer connecttime;
|
|
|
|
|
|
|
|
|
|
@Value("${webservice.receivetime}")
|
|
|
|
|
public Integer receivetime;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 上传cac数据
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public void uploadData() {
|
|
|
|
|
log.info("实时数据定时任务启动");
|
|
|
|
|
// 动态客户端
|
|
|
|
|
JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
|
|
|
|
|
log.info("实时数据 publicsecurity webService url : {}", address);
|
|
|
|
|
//根据WebServices接口地址创建client
|
|
|
|
|
Client client = clientFactory.createClient(address);
|
|
|
|
|
HTTPConduit conduit = (HTTPConduit) client.getConduit();
|
|
|
|
|
HTTPClientPolicy policy = new HTTPClientPolicy();
|
|
|
|
|
policy.setAllowChunking(false);
|
|
|
|
|
// 连接服务器超时时间 60秒
|
|
|
|
|
policy.setConnectionTimeout(60000);
|
|
|
|
|
// 等待服务器响应超时时间 60秒
|
|
|
|
|
policy.setReceiveTimeout(30000);
|
|
|
|
|
conduit.setClient(policy);
|
|
|
|
|
|
|
|
|
|
// log.info("实时数据定时任务启动");
|
|
|
|
|
// // 动态客户端
|
|
|
|
|
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
|
|
|
|
|
// log.info("实时数据 publicsecurity webService url : {}", address);
|
|
|
|
|
// //根据WebServices接口地址创建client
|
|
|
|
|
// Client client = clientFactory.createClient(address);
|
|
|
|
|
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
|
|
|
|
|
// HTTPClientPolicy policy = new HTTPClientPolicy();
|
|
|
|
|
// policy.setAllowChunking(false);
|
|
|
|
|
// // 连接服务器超时时间 60秒
|
|
|
|
|
// policy.setConnectionTimeout(connecttime);
|
|
|
|
|
// // 等待服务器响应超时时间 60秒
|
|
|
|
|
// policy.setReceiveTimeout(receivetime);
|
|
|
|
|
// conduit.setClient(policy);
|
|
|
|
|
Client client = null;
|
|
|
|
|
log.info("开始执行定时任务-查询数据库");
|
|
|
|
|
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
|
|
|
|
|
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
|
|
|
|
@ -60,65 +72,37 @@ public class WebServiceImpl implements Webservcies {
|
|
|
|
|
equipMap.put(item.getId(), item);
|
|
|
|
|
}
|
|
|
|
|
xydlI2Service.upload_sf6_qtyl(client, equipMap);
|
|
|
|
|
xydlI2Service.upload_dcyw(client, equipMap);
|
|
|
|
|
|
|
|
|
|
xydlI2Service.upload_fhdlbx(client, equipMap);
|
|
|
|
|
xydlI2Service.upload_fhzxq(client, equipMap);
|
|
|
|
|
xydlI2Service.upload_sf6_qtsf(client, equipMap);
|
|
|
|
|
xydlI2Service.upload_tx(client, equipMap);
|
|
|
|
|
xydlI2Service.upload_ws(client, equipMap);
|
|
|
|
|
xydlI2Service.upload_dr_jyjc(client, equipMap);
|
|
|
|
|
xydlI2Service.upload_jsyhw_jyjc(client, equipMap);
|
|
|
|
|
|
|
|
|
|
xydlI2Service.upload_microclimate(client, equipMap);
|
|
|
|
|
xydlI2Service.upload_cnj(client, equipMap);
|
|
|
|
|
xydlI2Service.upload_yx(client);
|
|
|
|
|
|
|
|
|
|
log.info("实时数据定时任务结束");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
// * 上传cac数据
|
|
|
|
|
// */
|
|
|
|
|
// @Override
|
|
|
|
|
// public void uploadYxData() {
|
|
|
|
|
// log.info("实时数据遥信定时任务启动");
|
|
|
|
|
//// 动态客户端
|
|
|
|
|
//放到配置文件
|
|
|
|
|
@Override
|
|
|
|
|
public void uploadyspData() {
|
|
|
|
|
// log.info("油色谱数据定时任务启动");
|
|
|
|
|
// // 动态客户端
|
|
|
|
|
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
|
|
|
|
|
// log.info("实时数据 publicsecurity webService url : {}", address);
|
|
|
|
|
// log.info("油色谱数据 publicsecurity webService url : {}", address);
|
|
|
|
|
// //根据WebServices接口地址创建client
|
|
|
|
|
// Client client = clientFactory.createClient(address);
|
|
|
|
|
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
|
|
|
|
|
// HTTPClientPolicy policy = new HTTPClientPolicy();
|
|
|
|
|
// policy.setAllowChunking(false);
|
|
|
|
|
// // 连接服务器超时时间 60秒
|
|
|
|
|
// policy.setConnectionTimeout(60000);
|
|
|
|
|
// policy.setConnectionTimeout(connecttime);
|
|
|
|
|
// // 等待服务器响应超时时间 60秒
|
|
|
|
|
// policy.setReceiveTimeout(30000);
|
|
|
|
|
// policy.setReceiveTimeout(receivetime);
|
|
|
|
|
// conduit.setClient(policy);
|
|
|
|
|
// log.info("开始执行定时遥信任务-查询数据库");
|
|
|
|
|
// xydlI2Service.upload_yx(client);
|
|
|
|
|
//
|
|
|
|
|
// log.info("实时数据定时遥信任务结束");
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void uploadyspData() {
|
|
|
|
|
log.info("油色谱数据定时任务启动");
|
|
|
|
|
// 动态客户端
|
|
|
|
|
JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
|
|
|
|
|
log.info("油色谱数据 publicsecurity webService url : {}", address);
|
|
|
|
|
//根据WebServices接口地址创建client
|
|
|
|
|
Client client = clientFactory.createClient(address);
|
|
|
|
|
HTTPConduit conduit = (HTTPConduit) client.getConduit();
|
|
|
|
|
HTTPClientPolicy policy = new HTTPClientPolicy();
|
|
|
|
|
policy.setAllowChunking(false);
|
|
|
|
|
// 连接服务器超时时间 60秒
|
|
|
|
|
policy.setConnectionTimeout(60000);
|
|
|
|
|
// 等待服务器响应超时时间 60秒
|
|
|
|
|
policy.setReceiveTimeout(60000);
|
|
|
|
|
conduit.setClient(policy);
|
|
|
|
|
|
|
|
|
|
Client client = null;
|
|
|
|
|
log.info("开始执行定时任务-查询数据库");
|
|
|
|
|
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
|
|
|
|
|
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
|
|
|
|
@ -131,21 +115,21 @@ public class WebServiceImpl implements Webservcies {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void uploadjfjcData() {
|
|
|
|
|
|
|
|
|
|
log.info("局放监测数据定时任务启动");
|
|
|
|
|
// 动态客户端
|
|
|
|
|
JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
|
|
|
|
|
log.info("局放监测数据 publicsecurity webService url : {}", address);
|
|
|
|
|
//根据WebServices接口地址创建client
|
|
|
|
|
Client client = clientFactory.createClient(address);
|
|
|
|
|
HTTPConduit conduit = (HTTPConduit) client.getConduit();
|
|
|
|
|
HTTPClientPolicy policy = new HTTPClientPolicy();
|
|
|
|
|
policy.setAllowChunking(false);
|
|
|
|
|
// 连接服务器超时时间 60秒
|
|
|
|
|
policy.setConnectionTimeout(60000);
|
|
|
|
|
// 等待服务器响应超时时间 60秒
|
|
|
|
|
policy.setReceiveTimeout(60000);
|
|
|
|
|
conduit.setClient(policy);
|
|
|
|
|
// log.info("局放监测数据定时任务启动");
|
|
|
|
|
// // 动态客户端
|
|
|
|
|
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
|
|
|
|
|
// log.info("局放监测数据 publicsecurity webService url : {}", address);
|
|
|
|
|
// //根据WebServices接口地址创建client
|
|
|
|
|
// Client client = clientFactory.createClient(address);
|
|
|
|
|
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
|
|
|
|
|
// HTTPClientPolicy policy = new HTTPClientPolicy();
|
|
|
|
|
// policy.setAllowChunking(false);
|
|
|
|
|
// // 连接服务器超时时间 60秒
|
|
|
|
|
// policy.setConnectionTimeout(connecttime);
|
|
|
|
|
// // 等待服务器响应超时时间 60秒
|
|
|
|
|
// policy.setReceiveTimeout(receivetime);
|
|
|
|
|
// conduit.setClient(policy);
|
|
|
|
|
Client client = null;
|
|
|
|
|
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
|
|
|
|
|
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
|
|
|
|
|
for (Niec_Sensors item : niec_sensors) {
|
|
|
|
@ -156,4 +140,85 @@ public class WebServiceImpl implements Webservcies {
|
|
|
|
|
log.info("局放监测数据定时任务结束");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void uploadyxData() {
|
|
|
|
|
// log.info("实时数据定时任务启动");
|
|
|
|
|
// // 动态客户端
|
|
|
|
|
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
|
|
|
|
|
// log.info("实时数据 publicsecurity webService url : {}", address);
|
|
|
|
|
// //根据WebServices接口地址创建client
|
|
|
|
|
// Client client = clientFactory.createClient(address);
|
|
|
|
|
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
|
|
|
|
|
// HTTPClientPolicy policy = new HTTPClientPolicy();
|
|
|
|
|
// policy.setAllowChunking(false);
|
|
|
|
|
// // 连接服务器超时时间 60秒
|
|
|
|
|
// policy.setConnectionTimeout(connecttime);
|
|
|
|
|
// // 等待服务器响应超时时间 60秒
|
|
|
|
|
// policy.setReceiveTimeout(receivetime);
|
|
|
|
|
// conduit.setClient(policy);
|
|
|
|
|
Client client = null;
|
|
|
|
|
log.info("开始执行定时任务-查询数据库");
|
|
|
|
|
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
|
|
|
|
|
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
|
|
|
|
|
for (Niec_Sensors item : niec_sensors) {
|
|
|
|
|
equipMap.put(item.getId(), item);
|
|
|
|
|
}
|
|
|
|
|
xydlI2Service.upload_yx(client);
|
|
|
|
|
log.info("实时数据定时任务结束");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void uploaddcywData() {
|
|
|
|
|
// log.info("实时数据定时任务启动");
|
|
|
|
|
// // 动态客户端
|
|
|
|
|
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
|
|
|
|
|
// log.info("实时数据 publicsecurity webService url : {}", address);
|
|
|
|
|
// //根据WebServices接口地址创建client
|
|
|
|
|
// Client client = clientFactory.createClient(address);
|
|
|
|
|
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
|
|
|
|
|
// HTTPClientPolicy policy = new HTTPClientPolicy();
|
|
|
|
|
// policy.setAllowChunking(false);
|
|
|
|
|
// // 连接服务器超时时间 60秒
|
|
|
|
|
// policy.setConnectionTimeout(connecttime);
|
|
|
|
|
// // 等待服务器响应超时时间 60秒
|
|
|
|
|
// policy.setReceiveTimeout(receivetime);
|
|
|
|
|
// conduit.setClient(policy);
|
|
|
|
|
Client client = null;
|
|
|
|
|
log.info("开始执行定时任务-查询数据库");
|
|
|
|
|
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
|
|
|
|
|
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
|
|
|
|
|
for (Niec_Sensors item : niec_sensors) {
|
|
|
|
|
equipMap.put(item.getId(), item);
|
|
|
|
|
}
|
|
|
|
|
xydlI2Service.upload_dcyw(client, equipMap);
|
|
|
|
|
log.info("实时数据定时任务结束");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void uploadjsyhwjyjcData() {
|
|
|
|
|
// log.info("实时数据定时任务启动");
|
|
|
|
|
// // 动态客户端
|
|
|
|
|
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
|
|
|
|
|
// log.info("实时数据 publicsecurity webService url : {}", address);
|
|
|
|
|
// //根据WebServices接口地址创建client
|
|
|
|
|
// Client client = clientFactory.createClient(address);
|
|
|
|
|
// HTTPConduit conduit = (HTTPConduit) client.getConduit();
|
|
|
|
|
// HTTPClientPolicy policy = new HTTPClientPolicy();
|
|
|
|
|
// policy.setAllowChunking(false);
|
|
|
|
|
// // 连接服务器超时时间 60秒
|
|
|
|
|
// policy.setConnectionTimeout(connecttime);
|
|
|
|
|
// // 等待服务器响应超时时间 60秒
|
|
|
|
|
// policy.setReceiveTimeout(receivetime);
|
|
|
|
|
// conduit.setClient(policy);
|
|
|
|
|
Client client = null;
|
|
|
|
|
log.info("开始执行定时任务-查询数据库");
|
|
|
|
|
HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
|
|
|
|
|
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
|
|
|
|
|
for (Niec_Sensors item : niec_sensors) {
|
|
|
|
|
equipMap.put(item.getId(), item);
|
|
|
|
|
}
|
|
|
|
|
xydlI2Service.upload_jsyhw_jyjc(client, equipMap);
|
|
|
|
|
log.info("实时数据定时任务结束");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|