Browse Source

修复数据拼接错误

zhczh_c
zhczyx@163.com 1 month ago
parent
commit
1c36437e0f
  1. 90
      src/main/java/com/techsor/datacenter/sender/service/KingIOServerService.java

90
src/main/java/com/techsor/datacenter/sender/service/KingIOServerService.java

@ -390,9 +390,9 @@ public class KingIOServerService {
case 100441: case 100441:
case 100461: case 100461:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Status_Flags == 111 //Status_Flags == 111
case 100102: case 100102:
case 100202: case 100202:
case 100302: case 100302:
@ -402,9 +402,9 @@ public class KingIOServerService {
case 100442: case 100442:
case 100462: case 100462:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Event_State == 36 //Event_State == 36
case 100103: case 100103:
case 100203: case 100203:
case 100303: case 100303:
@ -414,29 +414,29 @@ public class KingIOServerService {
case 100443: case 100443:
case 100463: case 100463:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//High_Limit == 45 //High_Limit == 45
case 100304: case 100304:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Low_Limit == 59 //Low_Limit == 59
case 100305: case 100305:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Deadband == 25 //Deadband == 25
case 100306: case 100306:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Limit_Enable == 52 //Limit_Enable == 52
case 100307: case 100307:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Event_Timestamp == 250.1 //Event_Timestamp == 250.1
case 100108: case 100108:
case 100308: case 100308:
case 100325: case 100325:
@ -445,9 +445,9 @@ public class KingIOServerService {
case 100446: case 100446:
case 100467: case 100467:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":\"%s\"",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":\"%s\"}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Event_Type == 250.2 //Event_Type == 250.2
case 100109: case 100109:
case 100309: case 100309:
case 100326: case 100326:
@ -456,9 +456,9 @@ public class KingIOServerService {
case 100447: case 100447:
case 100468: case 100468:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Nofity_Type == 250.3 //Nofity_Type == 250.3
case 100110: case 100110:
case 100310: case 100310:
case 100327: case 100327:
@ -467,9 +467,9 @@ public class KingIOServerService {
case 100448: case 100448:
case 100469: case 100469:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//From_State == 250.4 //From_State == 250.4
case 100111: case 100111:
case 100311: case 100311:
case 100328: case 100328:
@ -478,9 +478,9 @@ public class KingIOServerService {
case 100449: case 100449:
case 100470: case 100470:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//To_State == 250.5 //To_State == 250.5
case 100112: case 100112:
case 100312: case 100312:
case 100329: case 100329:
@ -489,9 +489,9 @@ public class KingIOServerService {
case 100450: case 100450:
case 100471: case 100471:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Event_Value == 250.6 //Event_Value == 250.6
case 100113: case 100113:
case 100313: case 100313:
case 100330: case 100330:
@ -500,9 +500,9 @@ public class KingIOServerService {
case 100451: case 100451:
case 100472: case 100472:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Reliability == 103 //Reliability == 103
case 100104: case 100104:
case 100204: case 100204:
case 100324: case 100324:
@ -511,9 +511,9 @@ public class KingIOServerService {
case 100444: case 100444:
case 100464: case 100464:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Out_Of_Service == 81 //Out_Of_Service == 81
case 100105: case 100105:
case 100206: case 100206:
case 100405: case 100405:
@ -521,50 +521,50 @@ public class KingIOServerService {
case 100445: case 100445:
case 100465: case 100465:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Change_Of_State_Count == 15 //Change_Of_State_Count == 15
case 100106: case 100106:
case 100426: case 100426:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Elapsed_Active_Time == 33 //Elapsed_Active_Time == 33
case 100107: case 100107:
case 100427: case 100427:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Polaroty == 84 //Polarity == 84
case 100406: case 100406:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Feedback_Value == 40 //Feedback_Value == 40
case 100407: case 100407:
case 100466: case 100466:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Buffer_Size == 126 //Buffer_Size == 126
case 100601: case 100601:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Log_Buffer == 131 //Log_Buffer == 131
case 100602: case 100602:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":\"%s\"",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":\"%s\"}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Record_Count == 141 //Record_Count == 141
case 100603: case 100603:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
//Total_Record_Count == 145 //Total_Record_Count == 145
case 100604: case 100604:
tempKey = ""; tempKey = "";
finalStr = String.format("{\"%s"+tempKey+"\":%s",deviceItem.getDeviceSN(),dataItem.getValue().toString()+"}"); finalStr = String.format("{\"%s%s\":%s}", deviceItem.getDeviceSN(), tempKey, dataItem.getValue().toString());
break; break;
default: default:

Loading…
Cancel
Save