Commit 92620284 by 黄强

解析json 模板比你且複製,還差變量替換

parent 26e1aaff
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,9 +2,7 @@ package com.jln.system.web.action.mqtt;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.jln.common.enums.MqttEnum;
import com.jln.system.web.action.mqtt.pojo.dto.*;
import com.jln.system.web.action.mqtt.pojo.entity.EoStatistics;
import com.jln.system.web.action.mqtt.pojo.vo.StaticData;
import com.jln.system.web.action.mqtt.server.EoStatisticsService;
import org.slf4j.Logger;
......@@ -43,701 +41,6 @@ public class MqttStartClient {
private static Logger logger = LoggerFactory.getLogger(MqttStartClient.class);
/**
* 大件坡口机器人01
*
* @param txtFile
* @param skFileUrl
* @param comparison
* @param deviceId
*/
public void djpk01StartLj(String txtFile, String skFileUrl, Map<String, String> comparison, String deviceId,XBMqttDataUtil xbMqttDataUtil) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
reportDto.put("productKey", "GrooveRobot");
//实体类信息 从文件中查询基本信息
Map<String, String> sites = readTxtFileToMap(txtFile);
reportDto.put("clientUuid", sites.get("设备ID"));
PkjqrReportDataDto pkjqrReportDataDto = new PkjqrReportDataDto();
pkjqrReportDataDto.setDeviceID(sites.get("设备ID"));
pkjqrReportDataDto.setCompanyNo(sites.get("公司编码"));
pkjqrReportDataDto.setFactoryNo(sites.get("工厂编码"));
pkjqrReportDataDto.setAssetNo(sites.get("资产编码"));
pkjqrReportDataDto.setDeviceName(sites.get("设备名称"));
pkjqrReportDataDto.setDeviceType(sites.get("设备类型"));
pkjqrReportDataDto.setCncType(sites.get("系统型号"));
pkjqrReportDataDto.setSerNum(sites.get("序列号"));
pkjqrReportDataDto.setNcVer(sites.get("系统版本"));
//设备状态统计
EoStatistics eo = new EoStatistics();
eo.setSb(deviceId+"01");
//1 redis和mqtt分开
if (separate == 1) {
//2 redis和mqtt统一
while (true) {
Map<String, Object> objectMap = base64decrypt.pkjqr01SendString(comparison, deviceId, pkjqrReportDataDto, reportDto);
String json = new Gson().toJson(objectMap);
StaticData.data.put(deviceId+"01", objectMap);
xbMqttDataUtil.publish(json);
System.out.println("--------数据发送成功---------");
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
} else if (separate == 2) {
//3 只发送redis
while (true) {
Map<String, Object> objectMap = base64decrypt.pkjqr01SendString(comparison, deviceId, pkjqrReportDataDto, reportDto);
StaticData.data.put(deviceId+"01", objectMap);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
} else if (separate == 3) {
//4 只发送mqtt
while (true) {
Map<String, Object> objectMap = base64decrypt.pkjqr01SendString(comparison, deviceId, pkjqrReportDataDto, reportDto);
String json = new Gson().toJson(objectMap);
try {
xbMqttDataUtil.publish(json);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
} catch (Exception e) {
continue;
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 大件坡口机器人02
*
* @param txtFile
* @param skFileUrl
* @param comparison
* @param deviceId
*/
public void djpk02StartLj(String txtFile, String skFileUrl, Map<String, String> comparison, String deviceId,XBMqttDataUtil xbMqttDataUtil) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
reportDto.put("productKey", "GrooveRobot");
//实体类信息 从文件中查询基本信息
Map<String, String> sites = readTxtFileToMap(txtFile);
reportDto.put("clientUuid", sites.get("设备ID"));
PkjqrReportDataDto pkjqrReportDataDto = new PkjqrReportDataDto();
pkjqrReportDataDto.setDeviceID(sites.get("设备ID"));
pkjqrReportDataDto.setCompanyNo(sites.get("公司编码"));
pkjqrReportDataDto.setFactoryNo(sites.get("工厂编码"));
pkjqrReportDataDto.setAssetNo(sites.get("资产编码"));
pkjqrReportDataDto.setDeviceName(sites.get("设备名称"));
pkjqrReportDataDto.setDeviceType(sites.get("设备类型"));
pkjqrReportDataDto.setCncType(sites.get("系统型号"));
pkjqrReportDataDto.setSerNum(sites.get("序列号"));
pkjqrReportDataDto.setNcVer(sites.get("系统版本"));
//设备状态统计
EoStatistics eo = new EoStatistics();
eo.setSb(deviceId+"02");
//1 redis和mqtt分开
if (separate == 1) {
//2 redis和mqtt统一
while (true) {
Map<String, Object> objectMap = base64decrypt.pkjqr02SendString(comparison, deviceId, pkjqrReportDataDto, reportDto);
StaticData.data.put(deviceId+"02", objectMap);
eoStatisticsService.isFlag(objectMap,eo);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
Thread.sleep(sleepTime);
}
} else if (separate == 2) {
//3 只发送redis
while (true) {
Map<String, Object> objectMap = base64decrypt.pkjqr02SendString(comparison, deviceId, pkjqrReportDataDto, reportDto);
StaticData.data.put(deviceId+"02", objectMap);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
} else if (separate == 3) {
//4 只发送mqtt
while (true) {
Map<String, Object> objectMap = base64decrypt.pkjqr02SendString(comparison, deviceId, pkjqrReportDataDto, reportDto);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish( json);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 400折弯机
* @param txtFile
* @param skFileUrl
* @param comparison
* @param deviceId
*/
public void zwj400(String txtFile, String skFileUrl, Map<String, String> comparison, String deviceId,XBMqttDataUtil xbMqttDataUtil) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
reportDto.put("productKey", "BendingMach");
//实体类信息 从文件中查询基本信息
Map<String, String> sites = readTxtFileToMap(txtFile);
reportDto.put("clientUuid", sites.get("设备ID"));
ZwjReportDataDto zwjReportDataDto = new ZwjReportDataDto();
zwjReportDataDto.setDeviceID(sites.get("设备ID"));
zwjReportDataDto.setCompanyNo(sites.get("公司编码"));
zwjReportDataDto.setFactoryNo(sites.get("工厂编码"));
zwjReportDataDto.setAssetNo(sites.get("资产编码"));
zwjReportDataDto.setDeviceName(sites.get("设备名称"));
zwjReportDataDto.setDeviceType(sites.get("设备类型"));
zwjReportDataDto.setCncType(sites.get("系统型号"));
zwjReportDataDto.setNcVer(sites.get("系统版本"));
zwjReportDataDto.setMaxPres(sites.get("系统最大压力"));
zwjReportDataDto.setTableSize(sites.get("工作台面尺寸"));
//设备变量统计
EoStatistics eo = new EoStatistics();
eo.setSb(deviceId);
//1 redis和mqtt分开
if (separate == 1) {
//2 redis和mqtt统一
while (true) {
Map<String, Object> objectMap = base64decrypt.zwjSendString(comparison, deviceId, zwjReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
Thread.sleep(sleepTime);
}
} else if (separate == 2) {
//3 只发送redis
while (true) {
Map<String, Object> objectMap = base64decrypt.zwjSendString(comparison, deviceId, zwjReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
} else if (separate == 3) {
//4 只发送mqtt
while (true) {
Map<String, Object> objectMap = base64decrypt.zwjSendString(comparison, deviceId, zwjReportDataDto, reportDto);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 800折弯机
* @param txtFile
* @param skFileUrl
* @param comparison
* @param deviceId
*/
public void zwj800(String txtFile, String skFileUrl, Map<String, String> comparison, String deviceId,XBMqttDataUtil xbMqttDataUtil) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
reportDto.put("productKey", "BendingMach");
//实体类信息 从文件中查询基本信息
Map<String, String> sites = readTxtFileToMap(txtFile);
reportDto.put("clientUuid", sites.get("设备ID"));
Zwj800ReportDataDto zwjReportDataDto = new Zwj800ReportDataDto();
zwjReportDataDto.setDeviceID(sites.get("设备ID"));
zwjReportDataDto.setCompanyNo(sites.get("公司编码"));
zwjReportDataDto.setFactoryNo(sites.get("工厂编码"));
zwjReportDataDto.setAssetNo(sites.get("资产编码"));
zwjReportDataDto.setDeviceName(sites.get("设备名称"));
zwjReportDataDto.setDeviceType(sites.get("设备类型"));
zwjReportDataDto.setCncType(sites.get("系统型号"));
zwjReportDataDto.setNcVer(sites.get("系统版本"));
zwjReportDataDto.setDeviceBrand(sites.get("设备品牌"));
zwjReportDataDto.setMaxPres(sites.get("最大压力"));
zwjReportDataDto.setTableSize(sites.get("工作台面尺寸"));
zwjReportDataDto.setLimitUpl(sites.get("轴行程正限位"));
zwjReportDataDto.setLimotDownl(sites.get("轴行程负限位"));
//设备状态统计
EoStatistics eo = new EoStatistics();
eo.setSb(deviceId);
//1 redis和mqtt分开
if (separate == 1) {
//2 redis和mqtt统一
while (true) {
Map<String, Object> objectMap = base64decrypt.zwj800SendString(comparison, deviceId, zwjReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
Thread.sleep(sleepTime);
}
} else if (separate == 2) {
//3 只发送redis
while (true) {
Map<String, Object> objectMap = base64decrypt.zwj800SendString(comparison, deviceId, zwjReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
} else if (separate == 3) {
//4 只发送mqtt
while (true) {
Map<String, Object> objectMap = base64decrypt.zwj800SendString(comparison, deviceId, zwjReportDataDto, reportDto);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 龙门铣
* @param lmxBjTxt
* @param skFileUrl
* @param comparison
* @param deviceId
* @param bjxx
*/
public void lmxStartLj(String lmxBjTxt, String skFileUrl, Map<String, List<String>> comparison, String deviceId, String bjxx,XBMqttDataUtil xbMqttDataUtil) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
//读取报警信息配置文件
Map<String, String> bjxxMap = readTxtFileToMap(bjxx);
reportDto.put("productKey", "CncMach");
//实体类信息 从文件中查询基本信息
Map<String, String> sites = readTxtFileToMap(lmxBjTxt);
reportDto.put("clientUuid", sites.get("设备ID"));
LmxReportDataDto lmxReportDataDto = new LmxReportDataDto();
lmxReportDataDto.setDeviceID(sites.get("设备ID"));
lmxReportDataDto.setNcVer(sites.get("系统版本"));
lmxReportDataDto.setAxes(sites.get("伺服轴数"));
lmxReportDataDto.setSpinNum(sites.get("主轴数"));
lmxReportDataDto.setMaxSpeed(sites.get("主轴最高转速"));
lmxReportDataDto.setDeviceName(sites.get("设备名称"));
lmxReportDataDto.setDeviceBrand(sites.get("设备品牌"));
lmxReportDataDto.setCompanyNo(sites.get("公司编码"));
lmxReportDataDto.setFactoryNo(sites.get("工厂编码"));
lmxReportDataDto.setAssetNo(sites.get("资产编码"));
lmxReportDataDto.setCncType(sites.get("系统型号"));
lmxReportDataDto.setDeviceType(sites.get("设备类型"));
//设备变量统计
EoStatistics eo = new EoStatistics();
eo.setSb(deviceId);
if (separate == 1) {
Map<String, Object> objectMap = base64decrypt.lmxSendString(comparison, deviceId, lmxReportDataDto, reportDto, bjxxMap);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
} else if (separate == 2) {
Map<String, Object> objectMap = base64decrypt.lmxSendString(comparison, deviceId, lmxReportDataDto, reportDto, bjxxMap);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
} else if (separate == 3) {
Map<String, Object> objectMap = base64decrypt.lmxSendString(comparison, deviceId, lmxReportDataDto, reportDto, bjxxMap);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
eoStatisticsService.isFlag(objectMap,eo);
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 平面钻
* @param pmzBjTxt
* @param skFileUrl
* @param comparison
* @param deviceId
*/
public void pmzStartLj(String pmzBjTxt, String skFileUrl, Map<String, List<String>> comparison, String deviceId,XBMqttDataUtil xbMqttDataUtil) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
reportDto.put("productKey", "CncMach");
//实体类信息 从文件中查询基本信息
Map<String, String> sites = readTxtFileToMap(pmzBjTxt);
reportDto.put("clientUuid", sites.get("设备ID"));
PmzReportDataDto pmzReportDataDto = new PmzReportDataDto();
pmzReportDataDto.setDeviceID(sites.get("设备ID"));
pmzReportDataDto.setCompanyNo(sites.get("公司编码"));
pmzReportDataDto.setFactoryNo(sites.get("工厂编码"));
pmzReportDataDto.setAssetNo(sites.get("资产编码"));
pmzReportDataDto.setDeviceName(sites.get("设备名称"));
pmzReportDataDto.setDeviceType(sites.get("设备类型"));
pmzReportDataDto.setCncType(sites.get("系统型号"));
pmzReportDataDto.setNcVer(sites.get("系统版本"));
pmzReportDataDto.setDeviceBrand(sites.get("设备品牌"));
pmzReportDataDto.setMaxSpeed(sites.get("最大卷板速度"));
//设备状态统计
EoStatistics eo = new EoStatistics();
eo.setSb(deviceId);
if (separate == 1) {
Map<String, Object> objectMap = base64decrypt.pmzSendString(comparison, deviceId, pmzReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
} else if (separate == 2) {
Map<String, Object> objectMap = base64decrypt.pmzSendString(comparison, deviceId, pmzReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
} else if (separate == 3) {
Map<String, Object> objectMap = base64decrypt.pmzSendString(comparison, deviceId, pmzReportDataDto, reportDto);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
eoStatisticsService.isFlag(objectMap,eo);
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* @param txtFileUrl 静态文件路径
* @param skFileUrl sk文件路径
* @param comparison scada中配置的点位
* @param deviceId 设备标识
*/
public void jgStartLj(String txtFileUrl, String skFileUrl, Map<String, String> comparison, String deviceId, XBMqttDataUtil xbMqttDataUtil) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
reportDto.put("productKey", "LaserCutMach"); // TODO 上报到客户那边数据中必要的参数值
//解析设备txt文本获取静态属性值
Map<String, String> sites = readTxtFileToMap(txtFileUrl);
JgReportDataDto jgReportDataDto = new JgReportDataDto();
if (!sites.isEmpty()) {
reportDto.put("clientUuid", sites.get("设备ID")); //TODO 上报到客户那边数据中必要的参数值
jgReportDataDto.setDeviceID(sites.get("设备ID"));
jgReportDataDto.setCompanyNo(sites.get("公司编码"));
jgReportDataDto.setFactoryNo(sites.get("工厂编码"));
jgReportDataDto.setAssetNo(sites.get("资产编码"));
jgReportDataDto.setDeviceName(sites.get("设备名称"));
jgReportDataDto.setDeviceType(sites.get("设备类型"));
jgReportDataDto.setCncType(sites.get("系统型号"));
jgReportDataDto.setNcVer(sites.get("系统版本"));
jgReportDataDto.setDeviceBrand(sites.get("设备品牌"));
jgReportDataDto.setSerNum(sites.get("序列号"));
}
EoStatistics eo = new EoStatistics();
eo.setSb(deviceId);
//1 redis和mqtt分开
if (separate == 1) {
//TODO 同时MQTT上报和推送前端数据
Map<String, Object> objectMap = base64decrypt.jgSendString(comparison, deviceId, jgReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish( json);
} else if (separate == 2) {
// TODO 只推送前端数据
Map<String, Object> objectMap = base64decrypt.jgSendString(comparison, deviceId, jgReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
} else if (separate == 3) {
//TODO 只发送mqtt
Map<String, Object> objectMap = base64decrypt.jgSendString(comparison, deviceId, jgReportDataDto, reportDto);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
eoStatisticsService.isFlag(objectMap,eo);
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 梅塞尔
* @param txtFile
* @param skFileUrl
* @param comparison
* @param deviceId
*/
public void msrStartLj(String txtFile, String skFileUrl, Map<String, List<String>> comparison, String deviceId,XBMqttDataUtil xbMqttDataUtil ) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
reportDto.put("productKey", "PlaCutMach");
//实体类信息 从文件中查询基本信息
Map<String, String> sites = readTxtFileToMap(txtFile);
reportDto.put("clientUuid", sites.get("设备ID"));
DlzReportDataDto dlzReportDataDto = new DlzReportDataDto();
String[] ids = sites.get("设备ID").split("/");
if ("mse52".equals(deviceId)) {
dlzReportDataDto.setDeviceID(ids[0]);
} else if ("mse53".equals(deviceId)) {
//dlzReportDataDto.setDeviceID(ids[1]);
dlzReportDataDto.setDeviceID(ids[0]);
} else {
dlzReportDataDto.setDeviceID(sites.get("设备ID"));
}
dlzReportDataDto.setCompanyNo(sites.get("公司编码"));
dlzReportDataDto.setFactoryNo(sites.get("工厂编码"));
dlzReportDataDto.setAssetNo(sites.get("资产编码"));
dlzReportDataDto.setDeviceName(sites.get("设备名称"));
dlzReportDataDto.setDeviceType(sites.get("设备类型"));
dlzReportDataDto.setCncType(sites.get("系统型号"));
dlzReportDataDto.setNcVer(sites.get("系统版本"));
dlzReportDataDto.setDeviceBrand(sites.get("设备品牌"));
//等离子电源型号=111
dlzReportDataDto.setElePowerType(sites.get("等离子电源型号"));
//最大空走速度=222
dlzReportDataDto.setMaxIdleSpeed(sites.get("最大空走速度"));
// 最大切割速度=333
dlzReportDataDto.setMaxCutSpeed(sites.get("最大切割速度"));
//切割零件范围=444
dlzReportDataDto.setCutRange(sites.get("切割零件范围"));
//割枪配置数量=555
dlzReportDataDto.setCutGunNo(sites.get("割枪配置数量"));
//各轴行程=666
dlzReportDataDto.setAxisTrip(sites.get("各轴行程"));
//定位精度=777
dlzReportDataDto.setPosAcc(sites.get("定位精度"));
//工作台面尺寸=888
dlzReportDataDto.setWorkSize(sites.get("工作台面尺寸"));
dlzReportDataDto.setCutGasType(sites.get("切割气体类型"));
dlzReportDataDto.setProGasType(sites.get("保护气体类型"));
dlzReportDataDto.setVoltage(sites.get("工作电压"));
dlzReportDataDto.setAxisName(sites.get("轴名称"));
dlzReportDataDto.setSerNum(sites.get("序列号"));
//设备变量统计
EoStatistics eo =new EoStatistics();
eo.setSb(deviceId);
//1 redis和mqtt分开
if (separate == 1) {
//2 redis和mqtt统一
Map<String, Object> objectMap = base64decrypt.msrSendString(comparison, deviceId, dlzReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
} else if (separate == 2) {
//3 只发送redis
Map<String, Object> objectMap = base64decrypt.msrSendString(comparison, deviceId, dlzReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
} else if (separate == 3) {
//4 只发送mqtt
Map<String, Object> objectMap = base64decrypt.msrSendString(comparison, deviceId, dlzReportDataDto, reportDto);
// objectMap.remove("reportedRedis");
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
eoStatisticsService.isFlag(objectMap,eo);
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 智能行车
* @param txtFile
* @param skFileUrl
* @param comparison
* @param deviceId
*/
public void znhcStartLj(String txtFile, String skFileUrl, Map<String, String> comparison, String deviceId,XBMqttDataUtil xbMqttDataUtil) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
reportDto.put("productKey", "SmartDrive");
//实体类信息 从文件中查询基本信息
Map<String, String> sites = readTxtFileToMap(txtFile);
reportDto.put("clientUuid", sites.get("设备ID"));
ZlhcReportDataDto zlhcReportDataDto = new ZlhcReportDataDto();
zlhcReportDataDto.setDeviceID(sites.get("设备ID"));
zlhcReportDataDto.setCompanyNo(sites.get("公司编码"));
zlhcReportDataDto.setFactoryNo(sites.get("公司编码"));
zlhcReportDataDto.setAssetNo(sites.get("资产编码"));
zlhcReportDataDto.setDeviceName(sites.get("设备名称"));
zlhcReportDataDto.setDeviceType(sites.get("设备类型"));
zlhcReportDataDto.setCncType(sites.get("系统型号"));
zlhcReportDataDto.setNcVer(sites.get("系统版本"));
//设备变量统计
EoStatistics eo = new EoStatistics();
eo.setSb(deviceId);
//1 redis和mqtt分开
if (separate == 1) {
//2 redis和mqtt统一
while (true) {
Map<String, Object> objectMap = base64decrypt.zlhcSendString(comparison, deviceId, zlhcReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
Thread.sleep(sleepTime);
}
} else if (separate == 2) {
//3 只发送redis
while (true) {
Map<String, Object> objectMap = base64decrypt.zlhcSendString(comparison, deviceId, zlhcReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
} else if (separate == 3) {
//4 只发送mqtt
while (true) {
Map<String, Object> objectMap = base64decrypt.zlhcSendString(comparison, deviceId, zlhcReportDataDto, reportDto);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 校平机
* @param txtFile
* @param skFileUrl
* @param comparison
* @param deviceId
*/
public void xpjStartLj(String txtFile, String skFileUrl, Map<String, String> comparison, String deviceId, XBMqttDataUtil xbMqttDataUtil) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
reportDto.put("productKey", "ShapMach");
//实体类信息 从文件中查询基本信息
Map<String, String> sites = readTxtFileToMap(txtFile);
reportDto.put("clientUuid", sites.get("设备ID"));
XpjReportDataDto xpjReportDataDto = new XpjReportDataDto();
xpjReportDataDto.setDeviceID(sites.get("设备ID"));
xpjReportDataDto.setCompanyNo(sites.get("公司编码"));
xpjReportDataDto.setFactoryNo(sites.get("工厂编码"));
xpjReportDataDto.setAssetNo(sites.get("资产编码"));
xpjReportDataDto.setDeviceName(sites.get("设备名称"));
xpjReportDataDto.setDeviceType(sites.get("设备类型"));
xpjReportDataDto.setCncType(sites.get("系统型号"));
xpjReportDataDto.setNcVer(sites.get("系统版本"));
xpjReportDataDto.setDeviceBrand(sites.get("设备品牌"));
//设备变量统计
EoStatistics eo = new EoStatistics();
eo.setSb(deviceId);
//1 redis和mqtt分开
if (separate == 1) {
//2 redis和mqtt统一
while (true) {
Map<String, Object> objectMap = base64decrypt.xpjSendString(comparison, deviceId, xpjReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
Thread.sleep(sleepTime);
}
} else if (separate == 2) {
//3 只发送redis
while (true) {
Map<String, Object> objectMap = base64decrypt.xpjSendString(comparison, deviceId, xpjReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
} else if (separate == 3) {
//4 只发送mqtt
while (true) {
Map<String, Object> objectMap = base64decrypt.xpjSendString(comparison, deviceId, xpjReportDataDto, reportDto);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 板链线
* @param txtFile
* @param skFileUrl
* @param comparison
* @param deviceId
*/
public void blxStartLj(String txtFile, String skFileUrl, Map<String, String> comparison, String deviceId, XBMqttDataUtil xbMqttDataUtil) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
reportDto.put("productKey", "ConveMach");
//实体类信息 从文件中查询基本信息
Map<String, String> sites = readTxtFileToMap(txtFile);
reportDto.put("clientUuid", sites.get("设备ID"));
QtxlReportDataDto qtxlReportDataDto = new QtxlReportDataDto();
qtxlReportDataDto.setDeviceID(sites.get("设备ID"));
qtxlReportDataDto.setCompanyNo(sites.get("公司编码"));
qtxlReportDataDto.setFactoryNo(sites.get("工厂编码"));
qtxlReportDataDto.setAssetNo(sites.get("资产编码"));
qtxlReportDataDto.setDeviceName(sites.get("设备名称"));
qtxlReportDataDto.setDeviceType(sites.get("设备类型"));
qtxlReportDataDto.setCncType(sites.get("系统型号"));
qtxlReportDataDto.setNcVer(sites.get("系统版本"));
qtxlReportDataDto.setDeviceBrand(sites.get("设备品牌"));
//统计设备状态
EoStatistics eo = new EoStatistics();
eo.setSb(deviceId);
//1 redis和mqtt分开
if (separate == 1) {
while (true) {
Map<String, Object> objectMap = base64decrypt.qtxlSendString(comparison, deviceId, qtxlReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
Thread.sleep(sleepTime);
}
} else if (separate == 2) {
//2 redis和mqtt统一
//3 只发送redis
while (true) {
Map<String, Object> objectMap = base64decrypt.qtxlSendString(comparison, deviceId, qtxlReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
} else if (separate == 3) {
while (true) {
Map<String, Object> objectMap = base64decrypt.qtxlSendString(comparison, deviceId, qtxlReportDataDto, reportDto);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
eoStatisticsService.isFlag(objectMap,eo);
Thread.sleep(sleepTime);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 解析sk文件并且放入map集合中固定的
......@@ -752,33 +55,12 @@ public class MqttStartClient {
return skReportDto;
}
JSONObject jsonObject = JSONObject.parseObject(skFileValue);
skReportDto.put("cmdId", "10");
//skReportDto.put("cmdId", "10");
skReportDto.put("version", jsonObject.getInteger("version"));
skReportDto.put("sequenceId", 1);
//skReportDto.put("sequenceId", 1);
return skReportDto;
}
//
// /**
// * 解析sk文件并且放入map集合中固定的
// *
// * @param skFile
// * @return
// */
// public Map<String, Object> skReportDto(String skFile) {
// String skFileValue = readSkFileToList(skFile);
// JSONObject jsonObject = JSONObject.parseObject(skFileValue);
// Map<String, Object> skReportDto = new HashMap<>();
// skReportDto.put("cmdId", "10");
// skReportDto.put("version", jsonObject.getInteger("version"));
// skReportDto.put("sequenceId", 1);
// skReportDto.put("edgeTime", Calendar.getInstance().getTimeInMillis());
// return skReportDto;
// }
/**
* reported对应的信息
*/
/**
* 获取证书sk解析后的码
......@@ -813,8 +95,8 @@ public class MqttStartClient {
* @param txtFileUrl
* @return
*/
public Map<String, String> readTxtFileToMap(String txtFileUrl) {
HashMap<String, String> sites = new HashMap<>();
public Map<String, Object> readTxtFileToMap(String txtFileUrl) {
HashMap<String, Object> sites = new HashMap<>();
List<String> txtFilelist = new ArrayList();
if (flag) {
txtFilelist = readJarSkFile(txtFileUrl);
......@@ -836,41 +118,6 @@ public class MqttStartClient {
return sites;
}
// public Map<String, String> readFileToMap(String txtFile) {
// HashMap<String, String> sites = new HashMap<>();
// List<String> txtFilelist = returnfilelist(txtFile);
// for (int i = 0; i < txtFilelist.size(); i++) {
// if (i > 1) {
// String[] split = txtFilelist.get(i).split(" ");
// sites.put(split[0], split[1]);
// }
// }
//
// return sites;
// }
// /**
// * 解析文件中的内容
// *
// * @param
// * @return
// */
// public List<String> filelist(String path) {
// List<String> listStr = new ArrayList<>();
// BufferedReader br;
// String str;
// try {
// br = new BufferedReader(new InputStreamReader(new FileInputStream(path), "UTF-8"));
// while ((str = br.readLine()) != null) {
// listStr.add(str);
// }
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// }
// return listStr;
// }
public List<String> readResourcesSkFile(String skFileUrl) {
List<String> listStr = new ArrayList<>();
......@@ -908,41 +155,42 @@ public class MqttStartClient {
/**
* 机器人测试
* @param txtFileUrl 静态文件路径
* @param skFileUrl sk文件路径
* @param comparison scada中配置的点位
* @param deviceId 设备标识
*/
public void jqr(String txtFileUrl, String skFileUrl, Map<String, String> comparison, String deviceId, XBMqttDataUtil xbMqttDataUtil) {
public void jqr( JsonDataDto jsonDataDto, XBMqttDataUtil xbMqttDataUtil) {
try {
//TODO 解析sk证书信息
Map<String, Object> reportDto = resolveSk(skFileUrl);
reportDto.put("productKey", "PaintRobot"); // TODO 上报到客户那边数据中必要的参数值
//解析sk证书信息
Map<String, Object> reportDto = resolveSk(jsonDataDto.getSkurl());
//reportDto.put("productKey", "PaintRobot");
//解析设备txt文本获取静态属性值
Map<String, String> sites = readTxtFileToMap(txtFileUrl);
Jqr jgReportDataDto = new Jqr();
if (!sites.isEmpty()) {
reportDto.put("clientUuid", sites.get("设备ID")); //TODO 上报到客户那边数据中必要的参数值
jgReportDataDto.setDeviceID(sites.get("设备ID"));
jgReportDataDto.setCompanyNo(sites.get("公司编码"));
jgReportDataDto.setFactoryNo(sites.get("工厂编码"));
jgReportDataDto.setDeviceName(sites.get("设备名称"));
jgReportDataDto.setDeviceType(sites.get("设备类型"));
Map<String, Object> fileSitesMap = readTxtFileToMap(jsonDataDto.getTxtFileUrl());
Map<String, Object> sites = new HashMap<>();
if (!fileSitesMap.isEmpty()) {
reportDto.put("clientUuid", jsonDataDto.getClientUuid()); //TODO 上报到客户那边数据中必要的参数值
reportDto.put("cmdId", jsonDataDto.getCmdId());//指 令 标 识
reportDto.put("productKey", jsonDataDto.getProductKey()); //必填,表示设备类型,设备类型在IoT平台上维护
reportDto.put("sequenceId", jsonDataDto.getSequenceId());//必填,值为1
sites.put("DeviceID",fileSitesMap.get("设备ID"));
sites.put("CompanyNo",fileSitesMap.get("公司编码"));
sites.put("factoryNo",fileSitesMap.get("工厂编码"));
//sites.put("AssetNo","");
sites.put("DeviceName",fileSitesMap.get("设备名称"));
sites.put("DeviceType",fileSitesMap.get("设备类型"));
//sites.put("CncType","");
}
//1 redis和mqtt分开
if (separate == 1) {
//TODO 同时MQTT上报和推送前端数据
Map<String, Object> objectMap = base64decrypt.jqrSendString(comparison, deviceId, jgReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
Map<String, Object> objectMap = base64decrypt.jqrSendString( jsonDataDto.getTableFiels(),sites, reportDto);
StaticData.data.put(jsonDataDto.getMongdbTableb(), objectMap);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish( json);
} else if (separate == 2) {
// TODO 只推送前端数据
Map<String, Object> objectMap = base64decrypt.jqrSendString(comparison, deviceId, jgReportDataDto, reportDto);
StaticData.data.put(deviceId, objectMap);
Map<String, Object> objectMap = base64decrypt.jqrSendString( jsonDataDto.getTableFiels(),sites,reportDto);
StaticData.data.put(jsonDataDto.getMongdbTableb(), objectMap);
} else if (separate == 3) {
//TODO 只发送mqtt
Map<String, Object> objectMap = base64decrypt.jqrSendString(comparison, deviceId, jgReportDataDto, reportDto);
Map<String, Object> objectMap = base64decrypt.jqrSendString( jsonDataDto.getTableFiels(),sites,reportDto);
String json = new Gson().toJson(objectMap);
xbMqttDataUtil.publish(json);
}
......
package com.jln.system.web.action.mqtt.init;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jln.system.web.action.mqtt.pojo.dto.JsonDataDto;
import com.jln.system.web.action.mqtt.server.SendMqttServer;
import com.sun.org.apache.bcel.internal.generic.NEW;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Component
public class InitHander implements CommandLineRunner {
......@@ -14,6 +23,144 @@ public class InitHander implements CommandLineRunner {
@Override
public void run(String... args){
sendMqttServer.sendMqtt();
List<JsonDataDto> jsonDataDtoList = analysisJsonParm();
sendMqttServer.sendMqtt(jsonDataDtoList);
}
public List<JsonDataDto> analysisJsonParm(){
String jsonStr = strJson();//模拟数据
List<JsonDataDto> jsonDataDtoList = new ArrayList<>();
List<JSONObject> list = JSONObject.parseObject(JSONArray.parseArray(jsonStr).toString(), List.class);
list.forEach(j->{
JsonDataDto jsonDataDto = new JsonDataDto();
List<JSONObject> mongdbTableList= JSONObject.parseObject(j.getJSONObject("reported").getJSONArray("singleField").toString(), List.class);
jsonDataDto.setCmdId(j.get("cmdId").toString());
jsonDataDto.setMongdbTableb(j.get("mongdbTableb").toString());
jsonDataDto.setSequenceId(j.get("sequenceId").toString());
jsonDataDto.setProductKey(j.get("productKey").toString());
jsonDataDto.setSkurl(j.get("skurl").toString());
jsonDataDto.setTxtFileUrl(j.get("txtFileUrl").toString());
jsonDataDto.setClientUuid(j.get("clientUuid").toString());
Map<String,Map<String,Object>> tableFiels = new HashMap<>();//存储对应的表和对应的字段
mongdbTableList.forEach(t->{
//处理字段
Map<String,Object> fields = new HashMap<>();//存储需要查询的表字段
String subTable = t.get("subTable").toString();//拿到表名
List<JSONObject> feildslist = JSONObject.parseObject(t.getJSONArray("feilds").toString(), List.class);
feildslist.forEach(f->{
//取出对应的字段和属性
String dbField = f.get("dbField").toString();//查询的表字段
String iotField = f.get("iotField").toString();//给iot 的字段
String fieldDataType = f.get("fieldDataType").toString(); //给iot的属性
/*Map<String,Object> objectMap = new HashMap<>();
objectMap.put(dbField,iotField);*/
fields.put(dbField,iotField);
});
tableFiels.put(subTable,fields);
jsonDataDto.setTableFiels(tableFiels);
});
jsonDataDtoList.add(jsonDataDto);
//查询数据
});
return jsonDataDtoList;
}
public static void main(String[] args) {
//analysisJsonParm();
}
private static String strJson (){
String str ="[\n" +
" {\n" +
" \"skurl\":\"\\\\cacert\\\\test.sk\",\n" +
"\t\t\"txtFileUrl\":\"\\\\cacert\\\\ptjqr1.txt\",\n" +
" \"mongdbTableb\":\"zhengchangshujushebei\",\n" +
" \"clientUuid\":\"5003820077\",\n" +
" \"cmdId\":\"10\",\n" +
" \"productKey\":\"PaintRobot\",\n" +
" \"sequenceId\":1,\n" +
" \"reported\":{\n" +
" \"singleField\":[\n" +
" {\n" +
" \"subTable\":\"zhengchangshujushebei01\",\n" +
" \"feilds\":[\n" +
" {\n" +
" \"dbField\":\"d1\",\n" +
" \"fieldDataType\":\"Int\",\n" +
" \"iotField\":\"设备1IOT1\"\n" +
" },\n" +
" {\n" +
" \"dbField\":\"d2\",\n" +
" \"fieldDataType\":\"String\",\n" +
" \"iotField\":\"设备1IOT2\"\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"subTable\":\"zhengchangshujushebei02\",\n" +
" \"feilds\":[\n" +
" {\n" +
" \"dbField\":\"d51\",\n" +
" \"fieldDataType\":\"Int\",\n" +
" \"iotField\":\"设备1IOT3\"\n" +
" },\n" +
" {\n" +
" \"dbField\":\"d52\",\n" +
" \"fieldDataType\":\"String\",\n" +
" \"iotField\":\"设备1IOT4\"\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" }\n" +
" },\n" +
"\t{\n" +
" \"skurl\":\"\\\\cacert\\\\test.sk\",\n" +
"\t\t\"txtFileUrl\":\"\\\\cacert\\\\sklmx.txt\",\n" +
" \"mongdbTableb\":\"chejiashebeibianliang\",\n" +
" \"clientUuid\":\"5003820077\",\n" +
" \"cmdId\":\"10\",\n" +
" \"productKey\":\"PaintRobot\",\n" +
" \"sequenceId\":1,\n" +
" \"reported\":{\n" +
" \"singleField\":[\n" +
" {\n" +
" \"subTable\":\"chejiashebeibianliang01\",\n" +
" \"feilds\":[\n" +
" {\n" +
" \"dbField\":\"d11\",\n" +
" \"fieldDataType\":\"Int\",\n" +
" \"iotField\":\"设备2IOT1\"\n" +
" },\n" +
" {\n" +
" \"dbField\":\"d2\",\n" +
" \"fieldDataType\":\"String\",\n" +
" \"iotField\":\"设备2IOT2\"\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"subTable\":\"chejiashebeibianliang02\",\n" +
" \"feilds\":[\n" +
" {\n" +
" \"dbField\":\"d51\",\n" +
" \"fieldDataType\":\"Int\",\n" +
" \"iotField\":\"设备2IOT4\"\n" +
" },\n" +
" {\n" +
" \"dbField\":\"d52\",\n" +
" \"fieldDataType\":\"String\",\n" +
" \"iotField\":\"设备2IOT5\"\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" }\n" +
" }\n" +
"]";
return str;
}
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("奔腾切割机上报数据对象类")
public class BtreportdataDto {
@ApiModelProperty(name = "设备品牌", example = "", dataType = "string")
@JsonProperty("DeviceBrand")
private String DeviceBrand;
@ApiModelProperty(name = "序列号", example = "", dataType = "string")
@JsonProperty("SerNum")
private String SerNum;
@ApiModelProperty(name = "设备状态", example = "", dataType = "string")
@JsonProperty("Status")
private String Status;
@ApiModelProperty(name = "急停", example = "", dataType = "string")
@JsonProperty("Emg")
private String Emg;
@ApiModelProperty(name = "报警", example = "", dataType = "string")
@JsonProperty("Alarm")
private String Alarm;
@ApiModelProperty(name = "工作模式", example = "", dataType = "string")
@JsonProperty("Mode")
private String Mode;
@ApiModelProperty(name = "轴名称", example = "", dataType = "string")
@JsonProperty("AxisName")
private String AxisName;
@ApiModelProperty(name = "机械坐标", example = "", dataType = "string")
@JsonProperty("AxisName")
private String MachPos;
@ApiModelProperty(name = "绝对坐标", example = "", dataType = "string")
@JsonProperty("AxisName")
private String AbsPos;
@ApiModelProperty(name = "程序运行状态", example = "", dataType = "string")
@JsonProperty("AxisName")
private String NcStatus;
@ApiModelProperty(name = "主程序号", example = "", dataType = "string")
@JsonProperty("AxisName")
private String MainPgm;
@ApiModelProperty(name = "当前程序号", example = "", dataType = "string")
@JsonProperty("AxisName")
private String CurPgm;
@ApiModelProperty(name = "程序行号", example = "", dataType = "string")
@JsonProperty("AxisName")
private String CurSeq;
@ApiModelProperty(name = "报警信息", example = "", dataType = "string")
@JsonProperty("AxisName")
private String AlarmMsg;
@ApiModelProperty(name = "激光器额定功率", example = "", dataType = "string")
@JsonProperty("AxisName")
private String LaserRatePower;
@ApiModelProperty(name = "最大空走速度", example = "", dataType = "string")
@JsonProperty("AxisName")
private String MaxIdleSpeed;
@ApiModelProperty(name = "最大切割速度", example = "", dataType = "string")
@JsonProperty("AxisName")
private String MaxCutSpeed;
@ApiModelProperty(name = "切割零件范围", example = "", dataType = "string")
@JsonProperty("AxisName")
private String CutRange;
@ApiModelProperty(name = "割枪配置数量", example = "", dataType = "string")
@JsonProperty("AxisName")
private String CutGunNo;
@ApiModelProperty(name = "定位精度", example = "", dataType = "string")
@JsonProperty("AxisName")
private String posAcc;
@ApiModelProperty(name = "工作台面尺寸", example = "", dataType = "string")
@JsonProperty("AxisName")
private String WorkSize;
@ApiModelProperty(name = "切割气体类型", example = "", dataType = "string")
@JsonProperty("AxisName")
private String CutGasType;
@ApiModelProperty(name = "切割气体流量", example = "", dataType = "string")
@JsonProperty("AxisName")
private String CutGasFlow;
@ApiModelProperty(name = "切割厚度", example = "", dataType = "string")
@JsonProperty("AxisName")
private String CutThick;
@ApiModelProperty(name = "激光输出功率", example = "", dataType = "string")
@JsonProperty("AxisName")
private String LaserPower;
@ApiModelProperty(name = "切割气体压力", example = "", dataType = "string")
@JsonProperty("AxisName")
private String CutGasPressure;
@ApiModelProperty(name = "电源电压", example = "", dataType = "string")
@JsonProperty("AxisName")
private String PowerVoltage;
@ApiModelProperty(name = "切割速度", example = "", dataType = "string")
@JsonProperty("AxisName")
private String CutSpeed;
@ApiModelProperty(name = "板材规格", example = "", dataType = "string")
@JsonProperty("AxisName")
private String PlateType;
@ApiModelProperty(name = "切割状态", example = "", dataType = "string")
@JsonProperty("AxisName")
private String CutStatus;
@ApiModelProperty(name = "总开机时间", example = "", dataType = "string")
@JsonProperty("AxisName")
private String LifeTimer;
@ApiModelProperty(name = "切割时间", example = "", dataType = "string")
@JsonProperty("AxisName")
private String WorkingTimer;
@ApiModelProperty(name = "出光时间", example = "", dataType = "string")
@JsonProperty("AxisName")
private String LaserOnTimer;
@ApiModelProperty(name = "加工时间", example = "", dataType = "string")
@JsonProperty("AxisName")
private String CycSec;
@ApiModelProperty(name = "相对坐标", example = "", dataType = "string")
@JsonProperty("AxisName")
private String RelPos;
}
package com.jln.system.web.action.mqtt.pojo.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel("证书数据")
public class CerExpDataDto {
private String uuid;
private String type;
private Integer version;
private String author;
private String issue;
private String due;
private String platform_id;
private String namespace;
private String productKey;
private String productType;
private String server;
private String accessKey;
private String secretKey;
private String pubkey;
private String description;
private String signature;
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("等离子切割机上报数据对象类")
public class DlzReportDataDto {
@JsonProperty("DeviceID")
private String DeviceID;
@JsonProperty("CompanyNo")
private String CompanyNo;
@JsonProperty("SerNum")
private String SerNum;
@JsonProperty("factoryNo")
private String factoryNo;
@JsonProperty("AssetNo")
private String AssetNo;
@JsonProperty("DeviceName")
private String DeviceName;
@JsonProperty("DeviceType")
private String DeviceType;
@JsonProperty("CncType")
private String CncType;
@JsonProperty("NcVer")
private String NcVer;
@JsonProperty("DeviceBrand")
private String DeviceBrand;
@JsonProperty("Status")
private String Status;
@JsonProperty("Emg")
private String Emg;
@JsonProperty("Alarm")
private String Alarm;
@JsonProperty("Mode")
private String Mode;
@JsonProperty("AxisName")
private String AxisName;
@JsonProperty("MachPos")
private String MachPos;
@JsonProperty("AbsPos")
private String AbsPos;
@JsonProperty("NcStatus")
private String NcStatus;
@JsonProperty("MainPgm")
private String MainPgm;
@JsonProperty("MainPgmMsg")
private String MainPgmMsg;
@JsonProperty("CurPgm")
private String CurPgm;
@JsonProperty("CurPgmMsg")
private String CurPgmMsg;
@JsonProperty("CycSec")
private String CycSec;
@JsonProperty("CurSeq")
private String CurSeq;
@JsonProperty("PartCnt")
private String PartCnt;
@JsonProperty("CurNcBlk")
private String CurNcBlk;
@JsonProperty("AlarmMsg")
private String AlarmMsg;
@JsonProperty("ElePowerType")
private String ElePowerType;
@JsonProperty("MaxIdleSpeed")
private String MaxIdleSpeed;
@JsonProperty("MaxCutSpeed")
private String MaxCutSpeed;
@JsonProperty("CutRange")
private String CutRange;
@JsonProperty("CutGunNo")
private String CutGunNo;
@JsonProperty("AxisTrip")
private String AxisTrip;
@JsonProperty("posAcc")
private String posAcc;
@JsonProperty("WorkSize")
private String WorkSize;
@JsonProperty("CutGasType")
private String CutGasType;
@JsonProperty("ProGasType")
private String ProGasType;
@JsonProperty("CutSpeed")
private String CutSpeed;
@JsonProperty("PlateType")
private String PlateType;
@JsonProperty("CutGasFlow")
private String CutGasFlow;
@JsonProperty("ProGasFlow")
private String ProGasFlow;
@JsonProperty("CutStatus")
private String CutStatus;
@JsonProperty("CutThick")
private String CutThick;
@JsonProperty("ArcStrikeTime")
private String ArcStrikeTime;
@JsonProperty("ArcVoltage")
private String ArcVoltage;
@JsonProperty("GapOffset")
private String GapOffset;
@JsonProperty("Voltage")
private String Voltage;
@JsonProperty("GasFlow")
private String GasFlow;
@JsonProperty("Current")
private String Current;
}
package com.jln.system.web.action.mqtt.pojo.dto;
public class EoDto {
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("激光切割机上报数据对象类")
public class JgReportDataDto {
@JsonProperty("DeviceID")
private String DeviceID;
@JsonProperty("CompanyNo")
private String CompanyNo;
@JsonProperty("SerNum")
private String SerNum;
@JsonProperty("factoryNo")
private String factoryNo;
@JsonProperty("AssetNo")
private String AssetNo;
@JsonProperty("DeviceName")
private String DeviceName;
@JsonProperty("DeviceType")
private String DeviceType;
@JsonProperty("CncType")
private String CncType;
@JsonProperty("NcVer")
private String NcVer;
@JsonProperty("DeviceBrand")
private String DeviceBrand;
@JsonProperty("Status")
private String Status;
@JsonProperty("Emg")
private String Emg;
@JsonProperty("Alarm")
private String Alarm;
@JsonProperty("Mode")
private String Mode;
@JsonProperty("AxisName")
private String AxisName;
@JsonProperty("MachPos")
private String MachPos;
@JsonProperty("AbsPos")
private String AbsPos;
@JsonProperty("NcStatus")
private String NcStatus;
@JsonProperty("MainPgm")
private String MainPgm;
@JsonProperty("CurPgm")
private String CurPgm;
@JsonProperty("CurSeq")
private String CurSeq;
@JsonProperty("AlarmMsg")
private String AlarmMsg;
@JsonProperty("LaserRatePower")
private String LaserRatePower;
@JsonProperty("MaxIdleSpeed")
private String MaxIdleSpeed;
@JsonProperty("MaxCutSpeed")
private String MaxCutSpeed;
@JsonProperty("CutRange")
private String CutRange;
@JsonProperty("CutGunNo")
private String CutGunNo;
@JsonProperty("posAcc")
private String posAcc;
@JsonProperty("WorkSize")
private String WorkSize;
@JsonProperty("CutGasType")
private String CutGasType;
@JsonProperty("CutGasFlow")
private String CutGasFlow;
@JsonProperty("CutThick")
private String CutThick;
@JsonProperty("LaserPower")
private String LaserPower;
@JsonProperty("GasPressure")
private String GasPressure;
@JsonProperty("PowerVoltage")
private String PowerVoltage;
@JsonProperty("CutSpeed")
private String CutSpeed;
@JsonProperty("PlateType")
private String PlateType;
@JsonProperty("CutStatus")
private String CutStatus;
@JsonProperty("CycSec")
private String CycSec;
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Data
public class JsonDataDto {
/**
* sk 路徑
*/
@JsonProperty("skurl")
private String skurl;
/**
* txt路徑
*/
@JsonProperty("txtFileUrl")
private String txtFileUrl;
/**
* 读取的数据表前缀
*/
@JsonProperty("mongdbTableb")
private String mongdbTableb;
@JsonProperty("cmdId")
private String cmdId;
@JsonProperty("productKey")
private String productKey;
@JsonProperty("sequenceId")
private String sequenceId;
@JsonProperty("clientUuid")
private String clientUuid;
/**
* 存放查询的表和字段
*/
@JsonProperty("tableFiels")
private Map<String, Map<String,Object>> tableFiels = new HashMap<>();
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel("数控龙门铣上报数据对象类")
public class LmxReportDataDto {
@JsonProperty("DeviceID")
private String DeviceID;
@JsonProperty("SerNum")
private String SerNum;
@JsonProperty("DeviceName")
private String DeviceName;
@JsonProperty("DeviceBrand")
private String DeviceBrand;
@JsonProperty("CompanyNo")
private String CompanyNo;
@JsonProperty("factoryNo")
private String factoryNo;
@JsonProperty("AssetNo")
private String AssetNo;
@JsonProperty("CncType")
private String CncType;
@JsonProperty("DeviceType")
private String DeviceType;
@JsonProperty("NcVer")
private String NcVer;
@JsonProperty("Axes")
private String Axes;
@JsonProperty("SpinNum")
private String SpinNum;
@JsonProperty("SpinLoad1")
private String SpinLoad1;
@JsonProperty("ActSpin")
private String ActSpin;
@JsonProperty("MaxSpeed")
private String MaxSpeed;
@JsonProperty("Status")
private String Status;
@JsonProperty("Emg")
private String Emg;
@JsonProperty("Mode")
private String Mode;
@JsonProperty("AxisName")
private String AxisName;
@JsonProperty("MachPos")
private String MachPos;
@JsonProperty("AbsPos")
private String AbsPos;
@JsonProperty("RelPos")
private String RelPos;
@JsonProperty("RemPos")
private String RemPos;
@JsonProperty("NcStatus")
private String NcStatus;
@JsonProperty("MainPgm")
private String MainPgm;
@JsonProperty("MainPgmMsg")
private String MainPgmMsg;
@JsonProperty("CurPgm")
private String CurPgm;
@JsonProperty("CurPgmMsg")
private String CurPgmMsg;
@JsonProperty("CutTime")
private String CutTime;
@JsonProperty("CycSec")
private String CycSec;
@JsonProperty("CurSeq")
private String CurSeq;
@JsonProperty("PartCnt")
private String PartCnt;
@JsonProperty("CurNcBlk")
private String CurNcBlk;
@JsonProperty("TCode")
private String TCode;
@JsonProperty("OvFeed")
private String OvFeed;
@JsonProperty("OvSpin")
private String OvSpin;
@JsonProperty("ActFeed")
private String ActFeed;
@JsonProperty("alarmNums")
private String alarmNums;
@JsonProperty("AlarmType")
private String AlarmType;
@JsonProperty("AlarmNo")
private String AlarmNo;
@JsonProperty("Alarm")
private String Alarm;
@JsonProperty("AlarmMsg")
private String AlarmMsg;
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel("坡口机器人上报数据对象类")
public class PkjqrReportDataDto {
@JsonProperty("DeviceID")
private String DeviceID;
@JsonProperty("CompanyNo")
private String CompanyNo;
@JsonProperty("factoryNo")
private String factoryNo;
@JsonProperty("AssetNo")
private String AssetNo;
@JsonProperty("DeviceName")
private String DeviceName;
@JsonProperty("DeviceType")
private String DeviceType;
@JsonProperty("CncType")
private String CncType;
@JsonProperty("SerNum")
private String SerNum;
@JsonProperty("NcVer")
private String NcVer;
@JsonProperty("Status")
private String Status;
@JsonProperty("Emg")
private String Emg;
@JsonProperty("Alarm")
private String Alarm;
@JsonProperty("AlarmMsg")
private String AlarmMsg;
@JsonProperty("Mode")
private String Mode;
@JsonProperty("J1")
private String J1;
@JsonProperty("J2")
private String J2;
@JsonProperty("J3")
private String J3;
@JsonProperty("J4")
private String J4;
@JsonProperty("J5")
private String J5;
@JsonProperty("J6")
private String J6;
@JsonProperty("UX")
private String UX;
@JsonProperty("UY")
private String UY;
@JsonProperty("UZ")
private String UZ;
@JsonProperty("UW")
private String UW;
@JsonProperty("UP")
private String UP;
@JsonProperty("UR")
private String UR;
@JsonProperty("WX")
private String WX;
@JsonProperty("WY")
private String WY;
@JsonProperty("WZ")
private String WZ;
@JsonProperty("WW")
private String WW;
@JsonProperty("WP")
private String WP;
@JsonProperty("WR")
private String WR;
@JsonProperty("NcStatus")
private String NcStatus;
@JsonProperty("MainPgm")
private String MainPgm;
@JsonProperty("MainPgmMsg")
private String MainPgmMsg;
@JsonProperty("CurPgm")
private String CurPgm;
@JsonProperty("CurPgmMsg")
private String CurPgmMsg;
@JsonProperty("CycSec")
private String CycSec;
@JsonProperty("CurSeq")
private String CurSeq;
@JsonProperty("CurNcBlk")
private String CurNcBlk;
@JsonProperty("CabType")
private String CabType;
@JsonProperty("PowerType")
private String PowerType;
@JsonProperty("GasPressure")
private String GasPressure;
@JsonProperty("CutSpeed")
private String CutSpeed;
@JsonProperty("Current")
private String Current;
@JsonProperty("WorkStatus")
private String WorkStatus;
@JsonProperty("GasFlow")
private String GasFlow;
/*@JsonProperty("BurnGas")
private String BurnGas;*/
@JsonProperty("ArcStrikeTime")
private String ArcStrikeTime;
@JsonProperty("ArcVoltage")
private String ArcVoltage;
@JsonProperty("GapOffset")
private String GapOffset;
@JsonProperty("Voltage")
private String Voltage;
@JsonProperty("WorkCurrent")
private String WorkCurrent;
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* @Author: 001
* @DateTime: 2021/4/30 10:35
*/
@Data
@ApiModel("数控平面钻上报数据对象类")
public class PmzReportDataDto {
@JsonProperty("DeviceID")
private String DeviceID;
@JsonProperty("CompanyNo")
private String CompanyNo;
@JsonProperty("factoryNo")
private String factoryNo;
@JsonProperty("AssetNo")
private String AssetNo;
@JsonProperty("DeviceName")
private String DeviceName;
@JsonProperty("DeviceType")
private String DeviceType;
@JsonProperty("CncType")
private String CncType;
@JsonProperty("DeviceBrand")
private String DeviceBrand;
@JsonProperty("SerNum")
private String SerNum;
@JsonProperty("NcVer")
private String NcVer;
@JsonProperty("Axes")
private String Axes;
@JsonProperty("SpinNum")
private String SpinNum;
@JsonProperty("MaxSpeed")
private String MaxSpeed;
@JsonProperty("Status")
private String Status;
@JsonProperty("Emg")
private String Emg;
@JsonProperty("Alarm")
private String Alarm;
@JsonProperty("Mode")
private String Mode;
@JsonProperty("AxisName")
private String AxisName;
@JsonProperty("MachPos")
private String MachPos;
@JsonProperty("AbsPos")
private String AbsPos;
@JsonProperty("RelPos")
private String RelPos;
@JsonProperty("RemPos")
private String RemPos;
@JsonProperty("NcStatus")
private String NcStatus;
@JsonProperty("MainPgm")
private String MainPgm;
@JsonProperty("MainPgmMsg")
private String MainPgmMsg;
@JsonProperty("CurPgm")
private String CurPgm;
@JsonProperty("CurPgmMsg")
private String CurPgmMsg;
@JsonProperty("CutTime")
private String CutTime;
@JsonProperty("CycSec")
private String CycSec;
@JsonProperty("CurSeq")
private String CurSeq;
@JsonProperty("PartCnt")
private String PartCnt;
@JsonProperty("CurNcBlk")
private String CurNcBlk;
@JsonProperty("TCode")
private String TCode;
@JsonProperty("OvFeed")
private String OvFeed;
@JsonProperty("OvSpin")
private String OvSpin;
@JsonProperty("ActFeed")
private String ActFeed;
@JsonProperty("FCode")
private String FCode;
@JsonProperty("ActSpin")
private String ActSpin;
@JsonProperty("SpinLoad1")
private String SpinLoad1;
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("其他下料上报数据对象类")
public class QtxlReportDataDto {
@JsonProperty("DeviceID")
private String DeviceID;
@JsonProperty("CompanyNo")
private String CompanyNo;
@JsonProperty("factoryNo")
private String factoryNo;
@JsonProperty("AssetNo")
private String AssetNo;
@JsonProperty("DeviceName")
private String DeviceName;
@JsonProperty("DeviceType")
private String DeviceType;
@JsonProperty("CncType")
private String CncType;
@JsonProperty("NcVer")
private String NcVer;
@JsonProperty("DeviceBrand")
private String DeviceBrand;
@JsonProperty("Status")
private String Status;
@JsonProperty("Alarm")
private String Alarm;
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class XpjReportDataDto {
@JsonProperty("DeviceID")
private String DeviceID;
@JsonProperty("CompanyNo")
private String CompanyNo;
@JsonProperty("factoryNo")
private String factoryNo;
@JsonProperty("AssetNo")
private String AssetNo;
@JsonProperty("DeviceName")
private String DeviceName;
@JsonProperty("DeviceType")
private String DeviceType;
@JsonProperty("CncType")
private String CncType;
@JsonProperty("NcVer")
private String NcVer;
@JsonProperty("DeviceBrand")
private String DeviceBrand;
@JsonProperty("Status")
private String Status;
@JsonProperty("Alarm")
private String Alarm;
@JsonProperty("MaxThickness")
private String MaxThickness;
@JsonProperty("MaxWidth")
private String MaxWidth;
@JsonProperty("MaxSpeed")
private String MaxSpeed;
@JsonProperty("RealLength")
private String RealLength;
@JsonProperty("RealAngle")
private String RealAngle;
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel("智能行车上报数据对象类")
public class ZlhcReportDataDto {
@JsonProperty("DeviceID")
private String DeviceID;
@JsonProperty("CompanyNo")
private String CompanyNo;
@JsonProperty("factoryNo")
private String factoryNo;
@JsonProperty("AssetNo")
private String AssetNo;
@JsonProperty("DeviceName")
private String DeviceName;
@JsonProperty("DeviceType")
private String DeviceType;
@JsonProperty("CncType")
private String CncType;
@JsonProperty("NcVer")
private String NcVer;
@JsonProperty("Status")
private String Status;
@JsonProperty("Alarm")
private String Alarm;
@JsonProperty("LiftWeight")
private String LiftWeight;
@JsonProperty("LiftHeight")
private String LiftHeight;
@JsonProperty("LiftSpeed")
private String LiftSpeed;
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* @Author: 001
* @DateTime: 2021/5/10 16:07
*/
@Data
@ApiModel("折弯机800上报数据对象类")
public class Zwj800ReportDataDto {
@JsonProperty("DeviceID")
private String DeviceID;
@JsonProperty("CompanyNo")
private String CompanyNo;
@JsonProperty("factoryNo")
private String factoryNo;
@JsonProperty("AssetNo")
private String AssetNo;
@JsonProperty("DeviceName")
private String DeviceName;
@JsonProperty("DeviceType")
private String DeviceType;
@JsonProperty("CncType")
private String CncType;
@JsonProperty("NcVer")
private String NcVer;
@JsonProperty("Status")
private String Status;
@JsonProperty("Alarm")
private String Alarm;
@JsonProperty("DeviceBrand")
private String DeviceBrand;
@JsonProperty("AlarmMsg")
private String AlarmMsg;
@JsonProperty("CurPgm")
private String CurPgm;
@JsonProperty("MaxPres")
private String MaxPres;
@JsonProperty("TableSize")
private String TableSize;
@JsonProperty("LimitUpl")
private String LimitUpl;
@JsonProperty("LimitDowml")
private String LimotDownl;
@JsonProperty("RtLimit")
private String RtLimit;
@JsonProperty("DwellTime")
private String DwellTime;
@JsonProperty("AngleResultValue")
private String AngleResultValue;
@JsonProperty("DeflectCom")
private String DeflectCom;
@JsonProperty("PreSpeed")
private String PreSpeed;
@JsonProperty("PrePress")
private String PrePress;
@JsonProperty("WorkStatus")
private String WorkStatus;
}
package com.jln.system.web.action.mqtt.pojo.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
@Data
@ApiModel("折弯机上报数据对象类")
public class ZwjReportDataDto {
@JsonProperty("DeviceID")
private String DeviceID;
@JsonProperty("CompanyNo")
private String CompanyNo;
@JsonProperty("factoryNo")
private String factoryNo;
@JsonProperty("AssetNo")
private String AssetNo;
@JsonProperty("DeviceName")
private String DeviceName;
@JsonProperty("DeviceType")
private String DeviceType;
@JsonProperty("CncType")
private String CncType;
@JsonProperty("NcVer")
private String NcVer;
@JsonProperty("Status")
private String Status;
@JsonProperty("Status")
private String Alarm;
@JsonProperty("AlarmMsg")
private String AlarmMsg;
@JsonProperty("CurPgm")
private String CurPgm;
@JsonProperty("MaxPres")
private String MaxPres;
@JsonProperty("TableSize")
private String TableSize;
@JsonProperty("LimitUpl")
private String LimitUpl;
@JsonProperty("LimitDowml")
private String LimotDownl;
@JsonProperty("RtLimit")
private String RtLimit;
@JsonProperty("DwellTime")
private String DwellTime;
@JsonProperty("AngleResultValue")
private String AngleResultValue;
@JsonProperty("DeflectCom")
private String DeflectCom;
@JsonProperty("PreSpeed")
private String PreSpeed;
@JsonProperty("PrePress")
private String PrePress;
@JsonProperty("WorkStatus")
private String WorkStatus;
}
package com.jln.system.web.action.mqtt.pojo.mongodb;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;
@Data
public class MongoDb {
private String id;
private String d1;
private String d2;
private String d3;
private String d4;
private String d5;
private String d6;
private String d7;
private String d8;
private String d9;
private String d10;
private String d11;
private String d12;
private String d13;
private String d14;
private String d15;
private String d16;
private String d17;
private String d18;
private String d19;
private String d20;
private String d21;
private String d22;
private String d23;
private String d24;
private String d25;
private String d26;
private String d27;
private String d28;
private String d29;
private String d30;
private String d31;
private String d32;
private String d33;
private String d34;
private String d35;
private String d36;
private String d37;
private String d38;
private String d39;
private String d40;
private String d41;
private String d42;
private String d43;
private String d44;
private String d45;
private String d46;
private String d47;
private String d48;
private String d49;
private String d50;
private Date time;
}
package com.jln.system.web.action.mqtt.server;
import com.jln.system.web.action.mqtt.pojo.dto.JsonDataDto;
import java.util.List;
public interface SendMqttServer {
void sendMqtt();
void sendMqtt(List<JsonDataDto> list);
}
......@@ -6,6 +6,7 @@ import com.jln.system.web.action.mqtt.MqttStartClient;
import com.jln.system.web.action.mqtt.XBMqttDataUtil;
import com.jln.system.web.action.mqtt.mapper.ScadaBiMapper;
import com.jln.system.web.action.mqtt.pojo.dto.JsonDataDto;
import com.jln.system.web.action.mqtt.pojo.vo.BldzCclmVo;
import com.jln.system.web.action.mqtt.server.SendMqttServer;
import lombok.extern.slf4j.Slf4j;
......@@ -85,10 +86,10 @@ public class SendMqttServerImpl implements SendMqttServer {
private Long sleepTime;
@Override
public void sendMqtt() {
public void sendMqtt(List<JsonDataDto> dtoList) {
// //解析sk文件
// String skFileValue = readSkFileToList(commonSk);
MqttStartClient mq = new MqttStartClient();
/* MqttStartClient mq = new MqttStartClient();
String skFileValue = mq.readSkFileToList(commonSk);
JSONObject jsonObject = JSONObject.parseObject(skFileValue);
Map<String, String> configParams = new HashMap<>();
......@@ -104,165 +105,7 @@ public class SendMqttServerImpl implements SendMqttServer {
String topic = "$SANY/gateway/pdev/sany/mdc/" + jsonObject.getString("accessKey") + "/data";
configParams.put(MqttEnum.MQTT_TOPIC.getMqttName(), topic);
XBMqttDataUtil xbMqttDataUtil = new XBMqttDataUtil(configParams);
// TODO 奔腾-》激光 已处理
/*new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
Map<String, String> dongtaishuju = jgqgj("奔腾切割机");
if (dongtaishuju != null && dongtaishuju.size() > 0) {
mqttStartClient.jgStartLj(btqgjTxt, commonSk, dongtaishuju, "jgqgj", xbMqttDataUtil);
}
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
continue;
}
}
}
}, "jg-Thread").start();
//板链线-》其他
new Thread(new Runnable() {
@Override
public void run() {
Map<String, String> blx = blx("板链线");
if (blx != null && blx.size() > 0) {
mqttStartClient.blxStartLj(blxTxt, commonSk, blx, "blx", xbMqttDataUtil);
}
}
}, "blx-Thread").start();
//TODO 小杠机车行-》智能行车 已处理
new Thread(new Runnable() {
@Override
public void run() {
Map<String, String> xgjx = xgjx("小港机行车");
if (xgjx != null && xgjx.size() > 0) {
mqttStartClient.znhcStartLj(xgjxcTxt, commonSk, xgjx, "xgjxc", xbMqttDataUtil);
}
}
}, "znhc-Thread").start();
//梅塞尔52-》等离子 以处理
new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
Map<String, List<String>> msedongtaizhi = mse("梅塞尔52");
if (msedongtaizhi != null && msedongtaizhi.size() > 0) {
mqttStartClient.msrStartLj(mse52Txt, commonSk, msedongtaizhi, "mse52", xbMqttDataUtil);
}
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
continue;
}
}
}
}, "msr52-Thread").start();
//梅塞尔53-》等离子
new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
Map<String, List<String>> mse = mse("梅塞尔53");
if (mse != null && mse.size() > 0) {
mqttStartClient.msrStartLj(mse53Txt, commonSk, mse, "mse53", xbMqttDataUtil);
}
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
continue;
}
}
}
}, "msr53-Thread").start();
//校平机 以处理
new Thread(new Runnable() {
@Override
public void run() {
Map<String, String> xpj = xpj("校平机");
if (xpj != null && xpj.size() > 0) {
mqttStartClient.xpjStartLj(xpjTxt, commonSk, xpj, "xpj", xbMqttDataUtil);
}
}
}, "xpj-Thread").start();
//数控龙门铣
new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
Map<String, List<String>> lmx = lmx("数控龙门铣");
if (lmx != null && lmx.size() > 0) {
mqttStartClient.lmxStartLj(lmxBjTxt, commonSk, lmx, "sklmx", bjxx, xbMqttDataUtil);
}
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
continue;
}
}
}
}, "sklmx-Thread").start();
//数控平面钻
new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
Map<String, List<String>> pmz = pmz("数控平面钻");
if (pmz != null && pmz.size() > 0) {
mqttStartClient.pmzStartLj(pmzBjTxt, commonSk, pmz, "skpmz", xbMqttDataUtil);
}
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
continue;
}
}
}
}, "skpmz-Thread").start();
// TODO 400T折弯机 已处理
new Thread(new Runnable() {
@Override
public void run() {
Map<String, String> zwj = zwj("400折弯机");
if (zwj != null && zwj.size() > 0) {
mqttStartClient.zwj400(zwj400Txt, commonSk, zwj, "400zwj", xbMqttDataUtil);
}
}
}, "400zwj-Thread").start();
//TODO 800T折弯机 已处理
new Thread(new Runnable() {
@Override
public void run() {
Map<String, String> zwj800 = zwj800("800折弯机");
if (zwj800 != null && zwj800.size() > 0) {
mqttStartClient.zwj800(zwj800Txt, commonSk, zwj800, "800zwj", xbMqttDataUtil);
}
}
}, "800zwj-Thread").start();
//坡口机器人1
new Thread(new Runnable() {
@Override
public void run() {
Map<String, String> djpk = djpk01("大件坡口");
if (djpk != null && djpk.size() > 0) {
mqttStartClient.djpk01StartLj(djpk01Txt, commonSk, djpk, "djpk", xbMqttDataUtil);
}
}
}, "djpk01-Thread").start();
//坡口机器人2
new Thread(new Runnable() {
@Override
public void run() {
Map<String, String> djpk = djpk02("大件坡口");
if (djpk != null && djpk.size() > 0) {
mqttStartClient.djpk02StartLj(djpk02Txt, commonSk, djpk, "djpk", xbMqttDataUtil);
}
}
}, "djpk02-Thread").start();*/
XBMqttDataUtil xbMqttDataUtil = new XBMqttDataUtil(configParams);*/
// TODO 动臂斗杆底漆喷涂机器人1
new Thread(new Runnable() {
......@@ -270,10 +113,13 @@ public class SendMqttServerImpl implements SendMqttServer {
public void run() {
while (true) {
try {
Map<String, String> dongtaishuju = jgqgj("正常数据设备");
if (dongtaishuju != null && dongtaishuju.size() > 0) {
mqttStartClient.jqr(ptjqr1, commonSk, dongtaishuju, "zhengchangshujushebei", xbMqttDataUtil);
}
dtoList.forEach(t->{
//Map<String, String> dongtaishuju = jgqgj("正常数据设备");
//if (dongtaishuju != null && dongtaishuju.size() > 0) {
mqttStartClient.jqr(t, null);
//}
});
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
continue;
......@@ -283,524 +129,6 @@ public class SendMqttServerImpl implements SendMqttServer {
}, "test-Thread").start();
}
public Map<String, String> djpk01(String name) {
List<BldzCclmVo> djpkVos = scadaMapper.find(name);
Map<String, String> djpkMap = new HashMap<>();
for (BldzCclmVo djpkVo : djpkVos) {
if (djpkVo != null) {
if ("设备状态1".equals(djpkVo.getBlmc())) {
djpkMap.put("Status", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("急停1".equals(djpkVo.getBlmc())) {
djpkMap.put("Emg", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("报警1".equals(djpkVo.getBlmc())) {
djpkMap.put("Alarm", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("AlarmMsg1".equals(djpkVo.getBlmc())) {
djpkMap.put("AlarmMsg", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("工作模式1".equals(djpkVo.getBlmc())) {
djpkMap.put("Mode", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标1J1".equals(djpkVo.getBlmc())) {
djpkMap.put("J1", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标1J2".equals(djpkVo.getBlmc())) {
djpkMap.put("J2", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标1J3".equals(djpkVo.getBlmc())) {
djpkMap.put("J3", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标1J4".equals(djpkVo.getBlmc())) {
djpkMap.put("J4", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标1J5".equals(djpkVo.getBlmc())) {
djpkMap.put("J5", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标1J6".equals(djpkVo.getBlmc())) {
djpkMap.put("J6", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标1UX".equals(djpkVo.getBlmc())) {
djpkMap.put("UX", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标1UY".equals(djpkVo.getBlmc())) {
djpkMap.put("UY", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标1UZ".equals(djpkVo.getBlmc())) {
djpkMap.put("UZ", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标1UW".equals(djpkVo.getBlmc())) {
djpkMap.put("UW", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标1UP".equals(djpkVo.getBlmc())) {
djpkMap.put("UP", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标1UR".equals(djpkVo.getBlmc())) {
djpkMap.put("UR", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标1UY".equals(djpkVo.getBlmc())) {
djpkMap.put("UY", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标1UZ".equals(djpkVo.getBlmc())) {
djpkMap.put("UZ", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标1UW".equals(djpkVo.getBlmc())) {
djpkMap.put("UW", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标1UP".equals(djpkVo.getBlmc())) {
djpkMap.put("UP", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标1UR".equals(djpkVo.getBlmc())) {
djpkMap.put("UR", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标1WX".equals(djpkVo.getBlmc())) {
djpkMap.put("WX", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标1WY".equals(djpkVo.getBlmc())) {
djpkMap.put("WY", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标1WZ".equals(djpkVo.getBlmc())) {
djpkMap.put("WZ", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标1WW".equals(djpkVo.getBlmc())) {
djpkMap.put("WW", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标1WP".equals(djpkVo.getBlmc())) {
djpkMap.put("WP", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标1WR".equals(djpkVo.getBlmc())) {
djpkMap.put("WR", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("程序运行状态1".equals(djpkVo.getBlmc())) {
djpkMap.put("NcStatus", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("主程序名称1".equals(djpkVo.getBlmc())) {
djpkMap.put("MainPgm", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("主程序注释1".equals(djpkVo.getBlmc())) {
djpkMap.put("MainPgmMsg", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("当前程序名称1".equals(djpkVo.getBlmc())) {
djpkMap.put("CurPgm", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("当前程序注释1".equals(djpkVo.getBlmc())) {
djpkMap.put("CurPgmMsg", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("作业时间1".equals(djpkVo.getBlmc())) {
djpkMap.put("CycSec", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("程序行号1".equals(djpkVo.getBlmc())) {
djpkMap.put("CurSeq", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("当前程序块1".equals(djpkVo.getBlmc())) {
djpkMap.put("CurNcBlk", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("控制柜型号1".equals(djpkVo.getBlmc())) {
djpkMap.put("CabType", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("切割电源型号1".equals(djpkVo.getBlmc())) {
djpkMap.put("PowerType", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("气体压力1".equals(djpkVo.getBlmc())) {
djpkMap.put("GasPressure", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("切割速度1".equals(djpkVo.getBlmc())) {
djpkMap.put("CutSpeed", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("切割电流1".equals(djpkVo.getBlmc())) {
djpkMap.put("Current", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("切割状态1".equals(djpkVo.getBlmc())) {
djpkMap.put("WorkStatus", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("气体流量1".equals(djpkVo.getBlmc())) {
djpkMap.put("GasFlow", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("燃烧气体类型1".equals(djpkVo.getBlmc())) {
djpkMap.put("BurnGas", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("引弧时间1".equals(djpkVo.getBlmc())) {
djpkMap.put("ArcStrikeTime", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("弧压1".equals(djpkVo.getBlmc())) {
djpkMap.put("ArcVoltage", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("隔缝补偿1".equals(djpkVo.getBlmc())) {
djpkMap.put("GapOffset", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("工作电压1".equals(djpkVo.getBlmc())) {
djpkMap.put("Voltage", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("工作电流1".equals(djpkVo.getBlmc())) {
djpkMap.put("WorkCurrent", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
}
}
return djpkMap;
}
public Map<String, String> djpk02(String name) {
List<BldzCclmVo> djpkVos = scadaMapper.find(name);
Map<String, String> djpkMap = new HashMap<>();
for (BldzCclmVo djpkVo : djpkVos) {
if (djpkVo != null) {
if ("设备状态2".equals(djpkVo.getBlmc())) {
djpkMap.put("Status", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("急停2".equals(djpkVo.getBlmc())) {
djpkMap.put("Emg", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("报警2".equals(djpkVo.getBlmc())) {
djpkMap.put("Alarm", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("报警信息2".equals(djpkVo.getBlmc())) {
djpkMap.put("AlarmMsg", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("工作模式2".equals(djpkVo.getBlmc())) {
djpkMap.put("Mode", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标2J1".equals(djpkVo.getBlmc())) {
djpkMap.put("J1", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标2J2".equals(djpkVo.getBlmc())) {
djpkMap.put("J2", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标2J3".equals(djpkVo.getBlmc())) {
djpkMap.put("J3", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标2J4".equals(djpkVo.getBlmc())) {
djpkMap.put("J4", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标2J5".equals(djpkVo.getBlmc())) {
djpkMap.put("J5", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标2J6".equals(djpkVo.getBlmc())) {
djpkMap.put("J6", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标2UX".equals(djpkVo.getBlmc())) {
djpkMap.put("UX", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标2UY".equals(djpkVo.getBlmc())) {
djpkMap.put("UY", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标2UZ".equals(djpkVo.getBlmc())) {
djpkMap.put("UZ", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标2UW".equals(djpkVo.getBlmc())) {
djpkMap.put("UW", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标2UP".equals(djpkVo.getBlmc())) {
djpkMap.put("UP", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("用户坐标2UR".equals(djpkVo.getBlmc())) {
djpkMap.put("UR", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标2UY".equals(djpkVo.getBlmc())) {
djpkMap.put("2UY", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标2UZ".equals(djpkVo.getBlmc())) {
djpkMap.put("2UZ", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标2UW".equals(djpkVo.getBlmc())) {
djpkMap.put("2UW", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标2UP".equals(djpkVo.getBlmc())) {
djpkMap.put("UP", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度坐标2UR".equals(djpkVo.getBlmc())) {
djpkMap.put("UR", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标2WX".equals(djpkVo.getBlmc())) {
djpkMap.put("WX", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标2WY".equals(djpkVo.getBlmc())) {
djpkMap.put("WY", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标2WZ".equals(djpkVo.getBlmc())) {
djpkMap.put("WZ", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标2WW".equals(djpkVo.getBlmc())) {
djpkMap.put("WW", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标2WP".equals(djpkVo.getBlmc())) {
djpkMap.put("WP", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("世界坐标2WR".equals(djpkVo.getBlmc())) {
djpkMap.put("WR", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("程序运行状态2".equals(djpkVo.getBlmc())) {
djpkMap.put("NcStatus", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("主程序名称2".equals(djpkVo.getBlmc())) {
djpkMap.put("MainPgm", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("主程序注释2".equals(djpkVo.getBlmc())) {
djpkMap.put("MainPgmMsg", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("当前程序名称2".equals(djpkVo.getBlmc())) {
djpkMap.put("CurPgm", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("当前程序注释2".equals(djpkVo.getBlmc())) {
djpkMap.put("CurPgmMsg", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("作业时间2".equals(djpkVo.getBlmc())) {
djpkMap.put("CycSec", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("程序行号2".equals(djpkVo.getBlmc())) {
djpkMap.put("CurSeq", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("当前程序块2".equals(djpkVo.getBlmc())) {
djpkMap.put("CurNcBlk", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("控制柜型号2".equals(djpkVo.getBlmc())) {
djpkMap.put("CabType", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("切割电源型号2".equals(djpkVo.getBlmc())) {
djpkMap.put("PowerType", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("气体压力2".equals(djpkVo.getBlmc())) {
djpkMap.put("GasPressure", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("切割速度2".equals(djpkVo.getBlmc())) {
djpkMap.put("CutSpeed", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("切割电流2".equals(djpkVo.getBlmc())) {
djpkMap.put("Current", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("切割状态2".equals(djpkVo.getBlmc())) {
djpkMap.put("WorkStatus", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("气体流量2".equals(djpkVo.getBlmc())) {
djpkMap.put("GasFlow", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("燃烧气体类型2".equals(djpkVo.getBlmc())) {
djpkMap.put("BurnGas", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("引弧时间2".equals(djpkVo.getBlmc())) {
djpkMap.put("ArcStrikeTime", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("弧压2".equals(djpkVo.getBlmc())) {
djpkMap.put("ArcVoltage", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("隔缝补偿2".equals(djpkVo.getBlmc())) {
djpkMap.put("GapOffset", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("工作电压2".equals(djpkVo.getBlmc())) {
djpkMap.put("Voltage", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("工作电流2".equals(djpkVo.getBlmc())) {
djpkMap.put("WorkCurrent", djpkVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
}
}
return djpkMap;
}
public Map<String, String> zwj(String name) {
List<BldzCclmVo> zwjVos = scadaMapper.find(name);
Map<String, String> zwjMap = new HashMap<>();
for (BldzCclmVo zwjVo : zwjVos) {
if (zwjVo != null) {
if ("状态".equals(zwjVo.getBlmc())) {
zwjMap.put("Status", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("报警".equals(zwjVo.getBlmc())) {
zwjMap.put("Alarm", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("AlarmMsg".equals(zwjVo.getBlmc())) {
zwjMap.put("AlarmMsg", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("程序号".equals(zwjVo.getBlmc())) {
zwjMap.put("CurPgm", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
/*if ("最大压力".equals(zwjVo.getBlmc())) {
zwjMap.put("MaxPres", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}*/
if ("工作台面尺寸".equals(zwjVo.getBlmc())) {
zwjMap.put("TableSize", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("轴行程正限位".equals(zwjVo.getBlmc())) {
zwjMap.put("LimitUpl", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("轴行程负限位".equals(zwjVo.getBlmc())) {
zwjMap.put("LimotDownl", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("实时下压行程".equals(zwjVo.getBlmc())) {
zwjMap.put("RtLimit", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("保压时间".equals(zwjVo.getBlmc())) {
zwjMap.put("DwellTime", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("角度检测值".equals(zwjVo.getBlmc())) {
zwjMap.put("AngleResultValue", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("挠度补偿值".equals(zwjVo.getBlmc())) {
zwjMap.put("DeflectCom", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("下压速度".equals(zwjVo.getBlmc())) {
zwjMap.put("PreSpeed", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("下压压力".equals(zwjVo.getBlmc())) {
zwjMap.put("PrePress", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("折弯状态".equals(zwjVo.getBlmc())) {
zwjMap.put("WorkStatus", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
zwjMap.put(zwjVo.getBldz(), zwjVo.getCclm().toLowerCase(Locale.ROOT));
}
}
return zwjMap;
}
public Map<String, String> zwj800(java.lang.String name) {
List<BldzCclmVo> zwjVos = scadaMapper.find(name);
Map<String, String> zwjMap = new HashMap<>();
for (BldzCclmVo zwjVo : zwjVos) {
if (zwjVo != null) {
if ("状态".equals(zwjVo.getBlmc())) {
zwjMap.put("Status", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
if ("程序号".equals(zwjVo.getBlmc())) {
zwjMap.put("CurPgm", zwjVo.getCclm().toLowerCase(Locale.ROOT));
continue;
}
}
}
return zwjMap;
}
public Map<String, String> jgqgj(String name) {
List<BldzCclmVo> jgqgjVos = scadaMapper.find(name);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论