I2代码优化ceshi

master
liuguijing 1 year ago
parent 8ed582cf61
commit 9d08b1aaf8

@ -166,28 +166,28 @@ public class AsyncMethod {
@Async(value = "asyncServiceExecutor") @Async(value = "asyncServiceExecutor")
public void sendData2(Client client, String xml) throws Exception { public void sendData2(Client client, String xml) throws Exception {
// Object[] objects = client.invoke("uploadCACData", xml); Object[] objects = client.invoke("uploadCACData", xml);
// String threadId = Thread.currentThread().getName(); String threadId = Thread.currentThread().getName();
// log.info("线程序号: " + threadId + "当前时间:" + new Date()); log.info("线程序号: " + threadId + "当前时间:" + new Date());
// if (objects != null && objects.length > 0) { if (objects != null && objects.length > 0) {
// String string = String.valueOf(objects[0]); String string = String.valueOf(objects[0]);
// log.info("返回的长度 " + objects.length + " 返回的对象 " + string); log.info("返回的长度 " + objects.length + " 返回的对象 " + string);
// JSONObject jsonObject = XML.toJSONObject(string); JSONObject jsonObject = XML.toJSONObject(string);
// if (jsonObject != null) { if (jsonObject != null) {
// JSONObject response = (JSONObject) jsonObject.get("response"); JSONObject response = (JSONObject) jsonObject.get("response");
// if (response != null) { if (response != null) {
// JSONObject result = (JSONObject) response.get("result"); JSONObject result = (JSONObject) response.get("result");
// if (result != null) { if (result != null) {
// Integer code = (Integer) result.get("code"); Integer code = (Integer) result.get("code");
// if (code != null && code.intValue() == 0) { if (code != null && code.intValue() == 0) {
// log.info("上传成功"); log.info("上传成功");
// } else { } else {
// log.info("上传失败"); log.info("上传失败");
// } }
// } }
// } }
// } }
// } }
} }
@ -218,6 +218,7 @@ public class AsyncMethod {
// } // }
} }
// @Async(value = "asyncServiceExecutor")
public void updateRecordId(BigInteger maxid,String type) { public void updateRecordId(BigInteger maxid,String type) {
if (maxid != null && maxid.longValue() > 0) { if (maxid != null && maxid.longValue() > 0) {
upload_checkDao.updateByPrimaryKey(type, maxid, new Date()); upload_checkDao.updateByPrimaryKey(type, maxid, new Date());

@ -35,36 +35,38 @@ public class WebServiceImpl implements Webservcies {
@Value("${webservice.address}") @Value("${webservice.address}")
public String address; public String address;
//
@Value("${webservice.connecttime}") @Value("${webservice.connecttime}")
public Integer connecttime; public int connecttime;
@Value("${webservice.receivetime}") @Value("${webservice.receivetime}")
public Integer receivetime; public int receivetime;
// private static String address = "http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl";
//
// public static int receivetime = 60;
//
// public static int connecttime = 60;
/** /**
* cac * cac
*/ */
@Override @Override
public void uploadData() { public void uploadData() {
// log.info("实时数据定时任务启动"); log.info("实时数据定时任务启动");
// // 动态客户端 // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("实时数据 publicsecurity webService url : {}", address); log.info("实时数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address); Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit(); HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy(); HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false); policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒 // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(connecttime); policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒 // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(receivetime); policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy); conduit.setClient(policy);
Client client = null;
log.info("开始执行定时任务-查询数据库"); log.info("开始执行定时任务-查询数据库");
HashMap<Integer, Niec_Sensors> equipMap = new HashMap(); HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll(); List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
@ -88,21 +90,20 @@ public class WebServiceImpl implements Webservcies {
//放到配置文件 //放到配置文件
@Override @Override
public void uploadyspData() { public void uploadyspData() {
// log.info("油色谱数据定时任务启动"); log.info("油色谱数据定时任务启动");
// // 动态客户端 // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("油色谱数据 publicsecurity webService url : {}", address); log.info("油色谱数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address); Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit(); HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy(); HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false); policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒 // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(connecttime); policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒 // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(receivetime); policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy); conduit.setClient(policy);
Client client = null;
log.info("开始执行定时任务-查询数据库"); log.info("开始执行定时任务-查询数据库");
HashMap<Integer, Niec_Sensors> equipMap = new HashMap(); HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll(); List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
@ -115,21 +116,20 @@ public class WebServiceImpl implements Webservcies {
@Override @Override
public void uploadjfjcData() { public void uploadjfjcData() {
// log.info("局放监测数据定时任务启动"); log.info("局放监测数据定时任务启动");
// // 动态客户端 // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("局放监测数据 publicsecurity webService url : {}", address); log.info("局放监测数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address); Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit(); HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy(); HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false); policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒 // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(connecttime); policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒 // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(receivetime); policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy); conduit.setClient(policy);
Client client = null;
HashMap<Integer, Niec_Sensors> equipMap = new HashMap(); HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll(); List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
for (Niec_Sensors item : niec_sensors) { for (Niec_Sensors item : niec_sensors) {
@ -142,21 +142,20 @@ public class WebServiceImpl implements Webservcies {
@Override @Override
public void uploadyxData() { public void uploadyxData() {
// log.info("实时数据定时任务启动"); log.info("实时数据定时任务启动");
// // 动态客户端 // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("实时数据 publicsecurity webService url : {}", address); log.info("实时数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address); Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit(); HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy(); HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false); policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒 // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(connecttime); policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒 // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(receivetime); policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy); conduit.setClient(policy);
Client client = null;
log.info("开始执行定时任务-查询数据库"); log.info("开始执行定时任务-查询数据库");
HashMap<Integer, Niec_Sensors> equipMap = new HashMap(); HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll(); List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
@ -169,21 +168,20 @@ public class WebServiceImpl implements Webservcies {
@Override @Override
public void uploaddcywData() { public void uploaddcywData() {
// log.info("实时数据定时任务启动"); log.info("实时数据定时任务启动");
// // 动态客户端 // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("实时数据 publicsecurity webService url : {}", address); log.info("实时数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address); Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit(); HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy(); HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false); policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒 // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(connecttime); policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒 // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(receivetime); policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy); conduit.setClient(policy);
Client client = null;
log.info("开始执行定时任务-查询数据库"); log.info("开始执行定时任务-查询数据库");
HashMap<Integer, Niec_Sensors> equipMap = new HashMap(); HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll(); List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();
@ -196,21 +194,20 @@ public class WebServiceImpl implements Webservcies {
@Override @Override
public void uploadjsyhwjyjcData() { public void uploadjsyhwjyjcData() {
// log.info("实时数据定时任务启动"); log.info("实时数据定时任务启动");
// // 动态客户端 // 动态客户端
// JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance();
// log.info("实时数据 publicsecurity webService url : {}", address); log.info("实时数据 publicsecurity webService url : {}", address);
// //根据WebServices接口地址创建client //根据WebServices接口地址创建client
// Client client = clientFactory.createClient(address); Client client = clientFactory.createClient(address);
// HTTPConduit conduit = (HTTPConduit) client.getConduit(); HTTPConduit conduit = (HTTPConduit) client.getConduit();
// HTTPClientPolicy policy = new HTTPClientPolicy(); HTTPClientPolicy policy = new HTTPClientPolicy();
// policy.setAllowChunking(false); policy.setAllowChunking(false);
// // 连接服务器超时时间 60秒 // 连接服务器超时时间 60秒
// policy.setConnectionTimeout(connecttime); policy.setConnectionTimeout(connecttime);
// // 等待服务器响应超时时间 60秒 // 等待服务器响应超时时间 60秒
// policy.setReceiveTimeout(receivetime); policy.setReceiveTimeout(receivetime);
// conduit.setClient(policy); conduit.setClient(policy);
Client client = null;
log.info("开始执行定时任务-查询数据库"); log.info("开始执行定时任务-查询数据库");
HashMap<Integer, Niec_Sensors> equipMap = new HashMap(); HashMap<Integer, Niec_Sensors> equipMap = new HashMap();
List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll(); List<Niec_Sensors> niec_sensors = niec_sensorsDao.selectAll();

@ -4,13 +4,13 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.shxy.i2.Tool.AsyncMethod; import com.shxy.i2.Tool.AsyncMethod;
import com.shxy.i2.Tool.GenerateI2Xml; import com.shxy.i2.Tool.GenerateI2Xml;
import com.shxy.i2.bean.AttrBean; import com.shxy.i2.bean.AttrBean;
import com.shxy.i2.bean.SendDataBean; import com.shxy.i2.bean.SendDataBean;
import com.shxy.i2.bean.YxAttrBean; import com.shxy.i2.bean.YxAttrBean;
import com.shxy.i2.constant.CommonStatus;
import com.shxy.i2.constant.Constant; import com.shxy.i2.constant.Constant;
import com.shxy.i2.dao.*; import com.shxy.i2.dao.*;
import com.shxy.i2.dto.Data_YxlDto; import com.shxy.i2.dto.Data_YxlDto;
@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@ -84,17 +85,21 @@ public class XydlI2ServiceImpl implements XydlI2Service {
@Autowired @Autowired
AsyncMethod asyncMethod; AsyncMethod asyncMethod;
@Value("${webservice.receivetime}") // @Value("${webservice.sendlimit}")
public int sendlimit; // public int sendlimit;
public static int sendlimit = 1000;
@Override @Override
public void upload_byq_jbfd(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_byq_jbfd(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
//查询目前上传的变压器局部放电的id 记录变压器局部放电上传的id大小 //查询目前上传的变压器局部放电的id 记录变压器局部放电上传的id大小
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.BYQJBFDID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.BYQJBFDID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
@ -103,6 +108,10 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Byq_Jbfd> data_byq_jbfdlist = data_byq_jbfdDao.selectUploadById(value); List<Data_Byq_Jbfd> data_byq_jbfdlist = data_byq_jbfdDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(data_byq_jbfdlist)) { if (CollectionUtil.isNotEmpty(data_byq_jbfdlist)) {
log.info("查询byq_jbfd的数据量" + data_byq_jbfdlist.size()); log.info("查询byq_jbfd的数据量" + data_byq_jbfdlist.size());
log.info("查询byq_jbfd的数据量 sendlimit " + sendlimit);
if (data_byq_jbfdlist.size() < 1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < data_byq_jbfdlist.size(); index++) { for (int index = 0; index < data_byq_jbfdlist.size(); index++) {
@ -173,19 +182,23 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.BYQJBFDID); asyncMethod.updateRecordId(maxid, Constant.BYQJBFDID);
} else { } else {
iscontiue = false;
log.info("没有查询byq_jbfd的数据量"); log.info("没有查询byq_jbfd的数据量");
} }
} }
}
@Override @Override
public void upload_cnj(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_cnj(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.CNJID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.CNJID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
@ -194,6 +207,10 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Cnj> list = data_cnjDao.selectUploadById(value); List<Data_Cnj> list = data_cnjDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询cnj的数据量" + list.size()); log.info("查询cnj的数据量" + list.size());
log.info("查询cnj的数据量 sendlimit " + sendlimit);
if (list.size() < 1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
@ -239,19 +256,23 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.CNJID); asyncMethod.updateRecordId(maxid, Constant.CNJID);
} else { } else {
iscontiue = false;
log.info("没有查询cnj的数据量"); log.info("没有查询cnj的数据量");
} }
} }
}
@Override @Override
public void upload_dcyw(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_dcyw(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DCYWID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DCYWID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
@ -260,6 +281,9 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Dcyw> list = data_dcywDao.selectUploadById(value); List<Data_Dcyw> list = data_dcywDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询dcyw的数据量" + list.size()); log.info("查询dcyw的数据量" + list.size());
if (list.size() < 1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
@ -305,19 +329,23 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.DCYWID); asyncMethod.updateRecordId(maxid, Constant.DCYWID);
} else { } else {
iscontiue = false;
log.info("没有查询dcyw的数据量"); log.info("没有查询dcyw的数据量");
} }
} }
}
@Override @Override
public void upload_dlq_jbfd(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_dlq_jbfd(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DLQJBFDID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DLQJBFDID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
@ -326,6 +354,10 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Dlq_Jbfd> list = data_dlq_jbfdDao.selectUploadById(value); List<Data_Dlq_Jbfd> list = data_dlq_jbfdDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询dlq_jbfd的数据量" + list.size()); log.info("查询dlq_jbfd的数据量" + list.size());
log.info("查询dlq_jbfd的数据量 sendlimit " + sendlimit);
if (list.size() < 1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
@ -382,11 +414,9 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
String cacdata = GenerateI2Xml.generateCacXml(Constant.DLQJBFD, sensorid, equipmentid, timestamp, attrlist); String cacdata = GenerateI2Xml.generateCacXml(Constant.DLQJBFD, sensorid, equipmentid, timestamp, attrlist);
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
BigInteger id = item.getId();
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client,xml); asyncMethod.sendData2(client, xml);
maxid = BigInteger.valueOf(0);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -394,19 +424,23 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.DLQJBFDID); asyncMethod.updateRecordId(maxid, Constant.DLQJBFDID);
} else { } else {
iscontiue = false;
log.info("没有查询到dlq的数据"); log.info("没有查询到dlq的数据");
} }
} }
}
@Override @Override
public void upload_dr_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_dr_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DRJYJCID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.DRJYJCID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
@ -415,6 +449,9 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Dr_Jyjc> list = data_dr_jyjcDao.selectUploadById(value); List<Data_Dr_Jyjc> list = data_dr_jyjcDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询dr_jyjc的数据量" + list.size()); log.info("查询dr_jyjc的数据量" + list.size());
if (list.size() < 1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
@ -496,19 +533,23 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.DRJYJCID); asyncMethod.updateRecordId(maxid, Constant.DRJYJCID);
} else { } else {
iscontiue = false;
log.info("没有查询dr_jyjc的数据量"); log.info("没有查询dr_jyjc的数据量");
} }
} }
}
@Override @Override
public void upload_fhdlbx(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_fhdlbx(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHDLBXID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHDLBXID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
@ -517,6 +558,9 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Fhdlbx> list = data_fhdlbxDao.selectUploadById(value); List<Data_Fhdlbx> list = data_fhdlbxDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询fhdlbx的数据量" + list.size()); log.info("查询fhdlbx的数据量" + list.size());
if (list.size()<1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
@ -561,7 +605,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
asyncMethod.sendData2(client,xml); asyncMethod.sendData2(client, xml);
cacdatalist = new ArrayList<>(); cacdatalist = new ArrayList<>();
} }
} catch (Exception e) { } catch (Exception e) {
@ -569,27 +613,34 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.FHDLBXID); asyncMethod.updateRecordId(maxid, Constant.FHDLBXID);
} else { } else {
iscontiue = false;
log.info("没有查询fhdlbx的数据量"); log.info("没有查询fhdlbx的数据量");
} }
} }
}
@Override @Override
public void upload_fhzxq(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_fhzxq(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHZXQID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.FHZXQID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
} }
} }
List<Data_Fhzxq> list = data_fhzxqDao.selectUpload(CommonStatus.UNUPLOAD.value()); List<Data_Fhzxq> list = data_fhzxqDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询fhzxq的数据量" + list.size()); log.info("查询fhzxq的数据量" + list.size());
if (list.size()<1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
@ -642,19 +693,23 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.FHZXQID); asyncMethod.updateRecordId(maxid, Constant.FHZXQID);
} else { } else {
iscontiue = false;
log.info("没有查询fhzxq的数据量"); log.info("没有查询fhzxq的数据量");
} }
} }
}
@Override @Override
public void upload_jsyhw_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_jsyhw_jyjc(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.JSYHWJYJCID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.JSYHWJYJCID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
@ -663,6 +718,10 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Jsyhw_Jyjc> list = data_jsyhw_jyjcDao.selectUploadById(value); List<Data_Jsyhw_Jyjc> list = data_jsyhw_jyjcDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询jsyhw_jyjc的数据量" + list.size()); log.info("查询jsyhw_jyjc的数据量" + list.size());
log.info("查询jsyhw_jyjc的数据量 sendlimit " + sendlimit);
if (list.size()<1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
@ -736,19 +795,23 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.JSYHWJYJCID); asyncMethod.updateRecordId(maxid, Constant.JSYHWJYJCID);
} else { } else {
iscontiue = false;
log.info("没有查询jsyhw_jyjc的数据量"); log.info("没有查询jsyhw_jyjc的数据量");
} }
} }
}
@Override @Override
public void upload_sf6_qtsf(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_sf6_qtsf(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTSFID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTSFID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
@ -757,6 +820,9 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_SF6_Qtsf> list = data_sf6_qtsfDao.selectUploadById(value); List<Data_SF6_Qtsf> list = data_sf6_qtsfDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询sf6_qtsf的数据量" + list.size()); log.info("查询sf6_qtsf的数据量" + list.size());
if (list.size()<1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
@ -809,17 +875,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.SF6QTSFID); asyncMethod.updateRecordId(maxid, Constant.SF6QTSFID);
} else { } else {
iscontiue = false;
log.info("没有查询sf6_qtsf的数据量"); log.info("没有查询sf6_qtsf的数据量");
} }
} }
}
@Override @Override
public void upload_sf6_qtyl(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_sf6_qtyl(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTYLID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTYLID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -830,14 +895,18 @@ public class XydlI2ServiceImpl implements XydlI2Service {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
} }
} }
Boolean iscontiue = true;
while (iscontiue) {
List<Data_SF6_Qtyl> list = data_sf6_qtylDao.selectUploadById(value); List<Data_SF6_Qtyl> list = data_sf6_qtylDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询sf6_qtyl的数据量" + list.size());
if (list.size()<1000) { if (list.size()<1000) {
iscontiue = false; iscontiue = false;
} }
if (CollectionUtil.isNotEmpty(list)) {
log.info("查询sf6_qtyl的数据量" + list.size());
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
BigDecimal add = NumberUtil.add(value, list.size());
value = add.toBigInteger();
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_SF6_Qtyl item = list.get(index); Data_SF6_Qtyl item = list.get(index);
maxid = item.getId(); maxid = item.getId();
@ -905,6 +974,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.SF6QTYLID); asyncMethod.updateRecordId(maxid, Constant.SF6QTYLID);
} else { } else {
iscontiue = false;
log.info("没有查询到sf6_qtyl的数据"); log.info("没有查询到sf6_qtyl的数据");
} }
} }
@ -912,11 +982,13 @@ public class XydlI2ServiceImpl implements XydlI2Service {
@Override @Override
public void upload_tx(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_tx(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.TXID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.TXID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
@ -925,6 +997,9 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Tx> list = data_txDao.selectUploadById(value); List<Data_Tx> list = data_txDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询tx的数据量" + list.size()); log.info("查询tx的数据量" + list.size());
if (list.size()<1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
@ -970,19 +1045,23 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.TXID); asyncMethod.updateRecordId(maxid, Constant.TXID);
} else { } else {
iscontiue = false;
log.info("没有查询到tx的数据"); log.info("没有查询到tx的数据");
} }
} }
}
@Override @Override
public void upload_ws(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_ws(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.WSID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.WSID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
@ -991,6 +1070,9 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Ws> list = data_wsDao.selectUploadById(value); List<Data_Ws> list = data_wsDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询ws的数据量" + list.size()); log.info("查询ws的数据量" + list.size());
if (list.size()<1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
@ -1036,32 +1118,39 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.WSID); asyncMethod.updateRecordId(maxid, Constant.WSID);
} else { } else {
iscontiue = false;
log.info("没有查询到ws的数据"); log.info("没有查询到ws的数据");
} }
} }
}
@Override @Override
public void upload_ysp(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_ysp(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
//查询目前上传的油色谱的id 记录油色谱上传的id大小 //查询目前上传的油色谱的id 记录油色谱上传的id大小
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.YSPID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.YSPID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
} }
} }
List<Data_Ysp> dataYspList = data_yspDao.selectUploadById(value); List<Data_Ysp> list = data_yspDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(dataYspList)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询ysp的数据量" + dataYspList.size()); log.info("查询ysp的数据量" + list.size());
if (list.size()<1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < dataYspList.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Ysp item = dataYspList.get(index); Data_Ysp item = list.get(index);
maxid = item.getId(); maxid = item.getId();
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
@ -1157,7 +1246,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
String cacdata = GenerateI2Xml.generateCacXml(Constant.YSP, sensorid, equipmentid, timestamp, attrlist); String cacdata = GenerateI2Xml.generateCacXml(Constant.YSP, sensorid, equipmentid, timestamp, attrlist);
cacdatalist.add(cacdata); cacdatalist.add(cacdata);
log.info("测试断点3"); log.info("测试断点3");
if ((index != 0 && index % sendlimit == 0) || index == (dataYspList.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
log.info("测试断点4"); log.info("测试断点4");
ArrayList<BigInteger> list1 = new ArrayList<>(); ArrayList<BigInteger> list1 = new ArrayList<>();
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
@ -1170,20 +1259,23 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.YSPID); asyncMethod.updateRecordId(maxid, Constant.YSPID);
} else { } else {
iscontiue = false;
log.info("没有查询到ysp的数据"); log.info("没有查询到ysp的数据");
} }
}
} }
@Override @Override
public void upload_microclimate(Client client, HashMap<Integer, Niec_Sensors> equipMap) { public void upload_microclimate(Client client, HashMap<Integer, Niec_Sensors> equipMap) {
Boolean iscontiue = true;
while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.MICROCLIMATEID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.MICROCLIMATEID);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else { } else {
value = upload_check.getValue(); value = upload_check.getValue();
if (value == null) { if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
@ -1192,6 +1284,9 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Microclimate> list = data_microclimateDao.selectUploadById(value); List<Data_Microclimate> list = data_microclimateDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询microclimate的数据量" + list.size()); log.info("查询microclimate的数据量" + list.size());
if (list.size()<1000) {
iscontiue = false;
}
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
@ -1272,17 +1367,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid,Constant.MICROCLIMATEID); asyncMethod.updateRecordId(maxid, Constant.MICROCLIMATEID);
} else { } else {
iscontiue = false;
log.info("没有查询到microcimate的数据"); log.info("没有查询到microcimate的数据");
} }
} }
}
@Override @Override
public void upload_yx(Client client) { public void upload_yx(Client client) {
Boolean iscontiue = true; Boolean iscontiue = true;
while (iscontiue) { while (iscontiue) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.YXID); Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.YXID);
@ -1296,12 +1390,12 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
List<Data_YxlDto> list = data_yxDao.selectByPrimaryKey(value); List<Data_YxlDto> list = data_yxDao.selectByPrimaryKey(value);
if (list.size()<1000) {
iscontiue = false;
}
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询yx的数据量" + list.size()); log.info("查询yx的数据量" + list.size());
BigInteger maxid =null; if (list.size() < 1000) {
iscontiue = false;
}
BigInteger maxid = null;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_YxlDto data_yxlDto = list.get(index); Data_YxlDto data_yxlDto = list.get(index);
Date dtime = data_yxlDto.getDtime(); Date dtime = data_yxlDto.getDtime();
@ -1365,7 +1459,10 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
asyncMethod.updateRecordId(maxid,Constant.YXID); asyncMethod.updateRecordId(maxid, Constant.YXID);
} else {
iscontiue = false;
log.info("没有查询到yx的数据");
} }
} }
} }
@ -1373,7 +1470,7 @@ public class XydlI2ServiceImpl implements XydlI2Service {
@Override @Override
public void clear_history() { public void clear_history() {
log.info("开启定时删除"); log.info("开启定时删除");
DateTime dateTime = DateUtil.offsetDay(new Date(), -7); DateTime dateTime = DateUtil.offsetDay(new Date(), -3);
data_byq_jbfdDao.deleteData(dateTime); data_byq_jbfdDao.deleteData(dateTime);
data_cnjDao.deleteData(dateTime); data_cnjDao.deleteData(dateTime);
data_dcywDao.deleteData(dateTime); data_dcywDao.deleteData(dateTime);

@ -26,56 +26,48 @@ public class ScheduledTask {
@Autowired @Autowired
XydlI2Service xydlI2Service; XydlI2Service xydlI2Service;
private int i1 = 0;
private int i2 = 0;
private int i3 = 0;
private int i4 = 0;
private int i5 = 0;
private int i6 = 0;
private int i7 = 0;
private int i8 = 0;
private int i9 = 0;
@Scheduled(fixedDelay = 60 * 60 * 1000) @Scheduled(fixedDelay = 60 * 60 * 1000)
public void cacyspupload() { public void cacyspupload() {
log.error("cacyspupload执行" + (i1++) ); log.info("cacyspupload执行" );
webservcies.uploadyspData(); webservcies.uploadyspData();
} }
@Scheduled(fixedDelay = 1 * 60 * 1000) @Scheduled(fixedDelay = 10 * 60 * 1000)
public void cacjfjcupload() { public void cacjfjcupload() {
log.error("cacjfjcupload执行" + (i2++) ); log.info("cacjfjcupload执行" );
webservcies.uploadjfjcData(); webservcies.uploadjfjcData();
} }
@Scheduled(fixedDelay = 1 * 30 * 1000) @Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacupload() { public void cacupload() {
log.error("cacupload执行" + (i3++) ); log.info("cacupload执行" );
webservcies.uploadData(); webservcies.uploadData();
} }
@Scheduled(fixedDelay = 1 * 30 * 1000) @Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacyxupload() { public void cacyxupload() {
log.error("cacyxupload执行" + (i4++) ); log.info("cacyxupload执行" );
webservcies.uploadyxData(); webservcies.uploadyxData();
} }
@Scheduled(fixedDelay = 1 * 30 * 1000) @Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacdcywupload() { public void cacdcywupload() {
log.error("cacdcywupload执行" + (i5++) ); log.info("cacdcywupload执行" );
webservcies.uploaddcywData(); webservcies.uploaddcywData();
} }
@Scheduled(fixedDelay = 1 * 30 * 1000) @Scheduled(fixedDelay = 1 * 30 * 1000)
public void cacjsyhwjyjcupload() { public void cacjsyhwjyjcupload() {
log.error("cacjsyhwjyjcupload执行" + (i6++) ); log.info("cacjsyhwjyjcupload执行" );
webservcies.uploadjsyhwjyjcData(); webservcies.uploadjsyhwjyjcData();
} }
// @Scheduled(cron = "0 0 13 * * ?") @Scheduled(cron = "0 0 13 * * ?")
// public void clear() { public void clear() {
// xydlI2Service.clear_history(); log.info("clear" );
// } xydlI2Service.clear_history();
}
} }

@ -9,7 +9,7 @@ spring:
task: task:
scheduling: scheduling:
pool: pool:
size: 8 size: 20
# 开发环境配置 # 开发环境配置
server: server:
@ -36,6 +36,6 @@ mybatis:
webservice: webservice:
# 超高压中心地址 # 超高压中心地址
address: http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl address: http://10.238.71.98:18096/ppa/webservice/CAGAccessService?wsdl
connecttime: 30 connecttime: 60000
receivetime: 30 receivetime: 60000
sendlimit: 100 sendlimit: 100

@ -23,7 +23,7 @@
t1.id, t1.eqmid, t1.acquisitionTime, t1.dischargeCapacity, t1.dischargePosition, t1.pulseCount, t1.isupload, t1.id, t1.eqmid, t1.acquisitionTime, t1.dischargeCapacity, t1.dischargePosition, t1.pulseCount, t1.isupload,
t1.dischargeWaveform,t1.create_time, t1.update_time t1.dischargeWaveform,t1.create_time, t1.update_time
FROM FROM
data_byq_jbfd t1 where t1.id <![CDATA[>]]> #{maxid} data_byq_jbfd t1 where t1.id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -18,7 +18,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from data_cnj from data_cnj
where id <![CDATA[>]]> #{maxid} where id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -18,7 +18,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from data_dcyw from data_dcyw
where id <![CDATA[>]]> #{maxid} where id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -26,7 +26,7 @@
t1.isupload,t1.dischargeWaveform,t1.create_time, t1.update_time t1.isupload,t1.dischargeWaveform,t1.create_time, t1.update_time
FROM FROM
data_dlq_jbfd t1 data_dlq_jbfd t1
where t1.id <![CDATA[>]]> #{maxid} where t1.id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -24,7 +24,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from data_dr_jyjc from data_dr_jyjc
where id <![CDATA[>]]> #{maxid} where id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -19,7 +19,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from data_fhdlbx from data_fhdlbx
where id <![CDATA[>]]> #{maxid} where id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -23,7 +23,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from data_jsyhw_jyjc from data_jsyhw_jyjc
where id <![CDATA[>]]> #{maxid} where id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -26,7 +26,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from data_microclimate from data_microclimate
where id <![CDATA[>]]> #{maxid} where id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -19,7 +19,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from data_sf6_qtsf from data_sf6_qtsf
where id <![CDATA[>]]> #{maxid} where id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -17,7 +17,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from data_tx from data_tx
where id <![CDATA[>]]> #{maxid} where id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -17,7 +17,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from data_ws from data_ws
where id <![CDATA[>]]> #{maxid} where id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -29,7 +29,7 @@
t1.id, t1.eqmid, t1.acquisitionTime, t1.H2, t1.CH4, t1.C2H6, t1.C2H4, t1.C2H2,t1.CO, t1.CO2, t1.O2, t1.N2, t1.id, t1.eqmid, t1.acquisitionTime, t1.H2, t1.CH4, t1.C2H6, t1.C2H4, t1.C2H2,t1.CO, t1.CO2, t1.O2, t1.N2,
t1.TotalHydrocarbon,t1.isupload, t1.create_time, t1.update_time t1.TotalHydrocarbon,t1.isupload, t1.create_time, t1.update_time
FROM FROM
data_ysp t1 where t1.id <![CDATA[>]]> #{maxid} data_ysp t1 where t1.id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>

@ -18,7 +18,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from data_fhzxq from data_fhzxq
where id <![CDATA[>]]> #{maxid} where id <![CDATA[>]]> #{maxid} limit 1000
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

Loading…
Cancel
Save