I2代码优化ceshi

master
liuguijing 1 year ago
parent 9d08b1aaf8
commit 4a2096b570

@ -164,7 +164,7 @@ 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();

@ -88,35 +88,44 @@ public class XydlI2ServiceImpl implements XydlI2Service {
// @Value("${webservice.sendlimit}") // @Value("${webservice.sendlimit}")
// public int sendlimit; // public int sendlimit;
public static int sendlimit = 1000; public static int sendlimit = 500;
@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; //查询目前上传的变压器局部放电的id 记录变压器局部放电上传的id大小
while (iscontiue) { Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.BYQJBFDID);
//查询目前上传的变压器局部放电的id 记录变压器局部放电上传的id大小 BigInteger value = null;
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.BYQJBFDID); if (upload_check == null) {
BigInteger value = null; value = BigInteger.valueOf(0);
if (upload_check == null) { } else {
value = upload_check.getValue();
if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
} else {
value = upload_check.getValue();
if (value == null) {
value = BigInteger.valueOf(0);
}
} }
}
// Boolean iscontiue = true;
// while (iscontiue) {
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); log.info("查询byq_jbfd的数据量 sendlimit " + sendlimit);
if (data_byq_jbfdlist.size() < 1000) { // if (data_byq_jbfdlist.size() < 1000) {
iscontiue = false; // iscontiue = false;
} // }
// BigDecimal add = NumberUtil.add(value, data_byq_jbfdlist.size());
// value = add.toBigInteger();
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < data_byq_jbfdlist.size(); index++) { for (int index = 0; index < data_byq_jbfdlist.size(); index++) {
Data_Byq_Jbfd item = data_byq_jbfdlist.get(index); Data_Byq_Jbfd item = data_byq_jbfdlist.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -182,18 +191,18 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
} }
} }
asyncMethod.updateRecordId(maxid, Constant.BYQJBFDID); asyncMethod.updateRecordId(maxid, Constant.BYQJBFDID);
} else { } else {
iscontiue = false; // 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; // Boolean iscontiue = true;
while (iscontiue) { // 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) {
@ -208,14 +217,20 @@ public class XydlI2ServiceImpl implements XydlI2Service {
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询cnj的数据量" + list.size()); log.info("查询cnj的数据量" + list.size());
log.info("查询cnj的数据量 sendlimit " + sendlimit); log.info("查询cnj的数据量 sendlimit " + sendlimit);
if (list.size() < 1000) { // if (list.size() < 1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Cnj item = list.get(index); Data_Cnj item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -258,16 +273,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.CNJID); asyncMethod.updateRecordId(maxid, Constant.CNJID);
} else { } else {
iscontiue = false; // 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; // Boolean iscontiue = true;
while (iscontiue) { // 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) {
@ -281,14 +296,20 @@ 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) { // if (list.size() < 1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Dcyw item = list.get(index); Data_Dcyw item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -331,16 +352,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.DCYWID); asyncMethod.updateRecordId(maxid, Constant.DCYWID);
} else { } else {
iscontiue = false; // 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; // Boolean iscontiue = true;
while (iscontiue) { // 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) {
@ -355,14 +376,20 @@ public class XydlI2ServiceImpl implements XydlI2Service {
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); log.info("查询dlq_jbfd的数据量 sendlimit " + sendlimit);
if (list.size() < 1000) { // if (list.size() < 1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Dlq_Jbfd item = list.get(index); Data_Dlq_Jbfd item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -426,16 +453,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.DLQJBFDID); asyncMethod.updateRecordId(maxid, Constant.DLQJBFDID);
} else { } else {
iscontiue = false; // 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; // Boolean iscontiue = true;
while (iscontiue) { // 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) {
@ -449,14 +476,22 @@ 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) { // if (list.size() < 1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Dr_Jyjc item = list.get(index); Data_Dr_Jyjc item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -535,16 +570,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.DRJYJCID); asyncMethod.updateRecordId(maxid, Constant.DRJYJCID);
} else { } else {
iscontiue = false; // 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; // Boolean iscontiue = true;
while (iscontiue) { // 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) {
@ -558,14 +593,20 @@ 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) { // if (list.size()<1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Fhdlbx item = list.get(index); Data_Fhdlbx item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -615,16 +656,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.FHDLBXID); asyncMethod.updateRecordId(maxid, Constant.FHDLBXID);
} else { } else {
iscontiue = false; // 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; // Boolean iscontiue = true;
while (iscontiue) { // 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) {
@ -638,14 +679,20 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Fhzxq> list = data_fhzxqDao.selectUploadById(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) { // if (list.size()<1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Fhzxq item = list.get(index); Data_Fhzxq item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -695,16 +742,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.FHZXQID); asyncMethod.updateRecordId(maxid, Constant.FHZXQID);
} else { } else {
iscontiue = false; // 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; // Boolean iscontiue = true;
while (iscontiue) { // 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) {
@ -719,14 +766,20 @@ public class XydlI2ServiceImpl implements XydlI2Service {
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); log.info("查询jsyhw_jyjc的数据量 sendlimit " + sendlimit);
if (list.size()<1000) { // if (list.size()<1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Jsyhw_Jyjc item = list.get(index); Data_Jsyhw_Jyjc item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -797,16 +850,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.JSYHWJYJCID); asyncMethod.updateRecordId(maxid, Constant.JSYHWJYJCID);
} else { } else {
iscontiue = false; // 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; // Boolean iscontiue = true;
while (iscontiue) { // 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) {
@ -820,14 +873,20 @@ 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) { // if (list.size()<1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_SF6_Qtsf item = list.get(index); Data_SF6_Qtsf item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -877,39 +936,43 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.SF6QTSFID); asyncMethod.updateRecordId(maxid, Constant.SF6QTSFID);
} else { } else {
iscontiue = false; // 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) {
Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTYLID); // Boolean iscontiue = true;
BigInteger value = null; // while (iscontiue) {
if (upload_check == null) { Upload_check upload_check = upload_checkDao.selectByPrimaryKey(Constant.SF6QTYLID);
value = BigInteger.valueOf(0); BigInteger value = null;
}else { if (upload_check == null) {
value = upload_check.getValue();
if (value == null) {
value = BigInteger.valueOf(0); value = BigInteger.valueOf(0);
}else {
value = upload_check.getValue();
if (value == null) {
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)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询sf6_qtyl的数据量" + list.size()); log.info("查询sf6_qtyl的数据量" + list.size());
if (list.size()<1000) { // if (list.size()<1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
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(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -974,16 +1037,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.SF6QTYLID); asyncMethod.updateRecordId(maxid, Constant.SF6QTYLID);
} else { } else {
iscontiue = false; // iscontiue = false;
log.info("没有查询到sf6_qtyl的数据"); log.info("没有查询到sf6_qtyl的数据");
} }
} // }
} }
@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; // Boolean iscontiue = true;
while (iscontiue) { // 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) {
@ -997,14 +1060,20 @@ 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) { // if (list.size()<1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Tx item = list.get(index); Data_Tx item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -1047,16 +1116,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.TXID); asyncMethod.updateRecordId(maxid, Constant.TXID);
} else { } else {
iscontiue = false; // 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; // Boolean iscontiue = true;
while (iscontiue) { // 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) {
@ -1070,14 +1139,20 @@ 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) { // if (list.size()<1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Ws item = list.get(index); Data_Ws item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -1120,16 +1195,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.WSID); asyncMethod.updateRecordId(maxid, Constant.WSID);
} else { } else {
iscontiue = false; // 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; // Boolean iscontiue = true;
while (iscontiue) { // 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;
@ -1144,14 +1219,20 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_Ysp> list = data_yspDao.selectUploadById(value); List<Data_Ysp> list = data_yspDao.selectUploadById(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询ysp的数据量" + list.size()); log.info("查询ysp的数据量" + list.size());
if (list.size()<1000) { // if (list.size()<1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Ysp item = list.get(index); Data_Ysp item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -1248,7 +1329,6 @@ public class XydlI2ServiceImpl implements XydlI2Service {
log.info("测试断点3"); log.info("测试断点3");
if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) { if ((index != 0 && index % sendlimit == 0) || index == (list.size() - 1)) {
log.info("测试断点4"); log.info("测试断点4");
ArrayList<BigInteger> list1 = new ArrayList<>();
String xml = GenerateI2Xml.generateEndCacXml(cacdatalist); String xml = GenerateI2Xml.generateEndCacXml(cacdatalist);
log.info("ysp组装完成开始上传"); log.info("ysp组装完成开始上传");
asyncMethod.sendData2(client, xml); asyncMethod.sendData2(client, xml);
@ -1261,16 +1341,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.YSPID); asyncMethod.updateRecordId(maxid, Constant.YSPID);
} else { } else {
iscontiue = false; // 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; // Boolean iscontiue = true;
while (iscontiue) { // 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) {
@ -1284,14 +1364,20 @@ 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) { // if (list.size()<1000) {
iscontiue = false; // iscontiue = false;
} // }
ArrayList<String> cacdatalist = new ArrayList<>(); ArrayList<String> cacdatalist = new ArrayList<>();
BigInteger maxid = null; BigInteger maxid = value;
for (int index = 0; index < list.size(); index++) { for (int index = 0; index < list.size(); index++) {
Data_Microclimate item = list.get(index); Data_Microclimate item = list.get(index);
maxid = item.getId(); BigInteger ids = item.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
Niec_Sensors sensors = equipMap.get(item.getEqmid()); Niec_Sensors sensors = equipMap.get(item.getEqmid());
if (sensors == null) { if (sensors == null) {
continue; continue;
@ -1369,16 +1455,16 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.MICROCLIMATEID); asyncMethod.updateRecordId(maxid, Constant.MICROCLIMATEID);
} else { } else {
iscontiue = false; // 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);
BigInteger value = null; BigInteger value = null;
if (upload_check == null) { if (upload_check == null) {
@ -1392,10 +1478,10 @@ public class XydlI2ServiceImpl implements XydlI2Service {
List<Data_YxlDto> list = data_yxDao.selectByPrimaryKey(value); List<Data_YxlDto> list = data_yxDao.selectByPrimaryKey(value);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
log.info("查询yx的数据量" + list.size()); log.info("查询yx的数据量" + list.size());
if (list.size() < 1000) { // if (list.size() < 1000) {
iscontiue = false; // iscontiue = false;
} // }
BigInteger maxid = null; BigInteger maxid = value;
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();
@ -1406,7 +1492,13 @@ public class XydlI2ServiceImpl implements XydlI2Service {
Integer ival = data_yxlDto.getIval(); Integer ival = data_yxlDto.getIval();
Integer sadr = data_yxlDto.getSadr(); Integer sadr = data_yxlDto.getSadr();
String phase = data_yxlDto.getPhase(); String phase = data_yxlDto.getPhase();
maxid = data_yxlDto.getId(); BigInteger ids = data_yxlDto.getId();
if (ids != null) {
int i = ids.compareTo(maxid);
if (i == 1) {
maxid = ids;
}
}
YxAttrBean<Integer> attr = new YxAttrBean<>(); YxAttrBean<Integer> attr = new YxAttrBean<>();
attr.setSensorid(sensorid); attr.setSensorid(sensorid);
@ -1461,10 +1553,10 @@ public class XydlI2ServiceImpl implements XydlI2Service {
} }
asyncMethod.updateRecordId(maxid, Constant.YXID); asyncMethod.updateRecordId(maxid, Constant.YXID);
} else { } else {
iscontiue = false; // iscontiue = false;
log.info("没有查询到yx的数据"); log.info("没有查询到yx的数据");
} }
} // }
} }
@Override @Override

@ -1,15 +1,80 @@
# Spring配置 # Spring配置
#spring:
# datasource:
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://127.0.0.1:3306/iec104?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: 123456
# type: com.alibaba.druid.pool.DruidDataSource
# task:
# scheduling:
# pool:
# size: 20
spring: spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/iec104?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
type: com.alibaba.druid.pool.DruidDataSource
task: task:
scheduling: scheduling:
pool: pool:
size: 20 size: 20
# 数据源配置
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
# url: jdbc:mysql://192.168.200.63:3306/xymp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: xymp
# password: xymp@123
url: jdbc:mysql://127.0.0.1:3306/iec104?allowMultiQueries=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 20
# 最小连接池数量
minIdle: 20
# 最大连接池数量
maxActive: 40
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: root
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# 开发环境配置 # 开发环境配置
server: server:
@ -20,7 +85,7 @@ server:
logging: logging:
config: classpath:log4j2.xml config: classpath:log4j2.xml
level: level:
com.shxy: info com.shxy: trace
org.springframework: warn org.springframework: warn
# MyBatis配置 # MyBatis配置

@ -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} limit 1000 data_byq_jbfd t1 where t1.id <![CDATA[>]]> #{maxid}
</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} limit 1000 where id <![CDATA[>]]> #{maxid}
</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} limit 1000 where id <![CDATA[>]]> #{maxid}
</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} limit 1000 where t1.id <![CDATA[>]]> #{maxid}
</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} limit 1000 where id <![CDATA[>]]> #{maxid}
</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} limit 1000 where id <![CDATA[>]]> #{maxid}
</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} limit 1000 where id <![CDATA[>]]> #{maxid}
</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} limit 1000 where id <![CDATA[>]]> #{maxid}
</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} limit 1000 where id <![CDATA[>]]> #{maxid}
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

@ -36,7 +36,7 @@
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from data_sf6_qtyl from data_sf6_qtyl
where id <![CDATA[>]]> #{maxid} limit 1000 where id <![CDATA[>]]> #{maxid}
</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} limit 1000 where id <![CDATA[>]]> #{maxid}
</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} limit 1000 where id <![CDATA[>]]> #{maxid}
</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} limit 1000 data_ysp t1 where t1.id <![CDATA[>]]> #{maxid}
</select> </select>

@ -26,7 +26,7 @@
c.table_name as table_name, c.table_name as table_name,
c.phase as phase c.phase as phase
from data_yx a left join niec_points b on a.sadr = b.sadr left join niec_sensors c on b.sensor_id = c.id from data_yx a left join niec_points b on a.sadr = b.sadr left join niec_sensors c on b.sensor_id = c.id
where a.id <![CDATA[>]]> #{maxid} limit 1000 where a.id <![CDATA[>]]> #{maxid}
</select> </select>
<delete id="deleteData" > <delete id="deleteData" >

@ -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} limit 1000 where id <![CDATA[>]]> #{maxid}
</select> </select>
<select id="selectUpload" resultMap="BaseResultMap"> <select id="selectUpload" resultMap="BaseResultMap">

Loading…
Cancel
Save