|
|
@@ -12,6 +12,8 @@
|
|
|
#include "vr_db.h"
|
|
|
#include "vr_devices.h"
|
|
|
#include "md5.h"
|
|
|
+#include "vr_ext.h"
|
|
|
+#include "tool.h"
|
|
|
|
|
|
|
|
|
using namespace VR::notify;
|
|
|
@@ -21,7 +23,17 @@ extern devices_tree g_devices_tree;
|
|
|
|
|
|
CWebLink_BJ::CWebLink_BJ()
|
|
|
{
|
|
|
- m_bGetToken = TRUE;
|
|
|
+ m_bGetToken = FALSE;
|
|
|
+
|
|
|
+ char chpw[100];
|
|
|
+ GetPrivateProfileStringA("UserID", "pw", "", chpw, 100, ".//conn.ini");
|
|
|
+ m_pw = chpw;
|
|
|
+
|
|
|
+ if (!m_pw.empty())
|
|
|
+ {
|
|
|
+ m_pw = DecryptionAES(m_pw, "111VTG9991sit2c5");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -121,9 +133,9 @@ void CWebLink_BJ::PackWebData_Config(VR::WebData& webdata, int nozzlenum)
|
|
|
sprintf_s(chType, "%02d", webdata.type);
|
|
|
|
|
|
|
|
|
- strdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
|
|
- strdata += "<root>";
|
|
|
- strdata += "<VERSION>V1.1</VERSION>";
|
|
|
+ //strdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
|
|
+ //strdata += "<root>";
|
|
|
+ strdata += "<VERSION>V2.0.1</VERSION>";
|
|
|
strdata += "<DATAID>" + string(chDataID) + "</DATAID>";
|
|
|
strdata += "<USERID>" + *m_pUserId + "</USERID>";
|
|
|
strdata += "<TIME>" + string(chTime) + "</TIME>";
|
|
|
@@ -131,7 +143,7 @@ void CWebLink_BJ::PackWebData_Config(VR::WebData& webdata, int nozzlenum)
|
|
|
strdata += "<SEC>1</SEC>";
|
|
|
strdata += "<BUSINESSCONTENT>" + base64 + "</BUSINESSCONTENT>";
|
|
|
strdata += "<HMAC></HMAC>";
|
|
|
- strdata += "</root>";
|
|
|
+ //strdata += "</root>";
|
|
|
|
|
|
|
|
|
webdata.data = strdata;
|
|
|
@@ -279,9 +291,8 @@ void CWebLink_BJ::PackWebData_Warning(VR::WebData& webdata, int type, int warnin
|
|
|
sprintf_s(chType, "%02d", webdata.type);
|
|
|
|
|
|
|
|
|
- strdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
|
|
- strdata += "<root>";
|
|
|
- strdata += "<VERSION>V1.1</VERSION>";
|
|
|
+
|
|
|
+ strdata += "<VERSION>V2.0.1</VERSION>";
|
|
|
strdata += "<DATAID>" + string(chDataID) + "</DATAID>";
|
|
|
strdata += "<USERID>" + *m_pUserId + "</USERID>";
|
|
|
strdata += "<TIME>" + string(chTime) + "</TIME>";
|
|
|
@@ -289,7 +300,6 @@ void CWebLink_BJ::PackWebData_Warning(VR::WebData& webdata, int type, int warnin
|
|
|
strdata += "<SEC>1</SEC>";
|
|
|
strdata += "<BUSINESSCONTENT>" + base64 + "</BUSINESSCONTENT>";
|
|
|
strdata += "<HMAC></HMAC>";
|
|
|
- strdata += "</root>";
|
|
|
|
|
|
|
|
|
webdata.data = strdata;
|
|
|
@@ -415,6 +425,18 @@ void CWebLink_BJ::PackWebData_Record(VR::WebData& webdata, const VR::notify::fil
|
|
|
{
|
|
|
data += "<YZ>NULL</YZ>";
|
|
|
}
|
|
|
+
|
|
|
+ string begtime = string(record.tmBegin);
|
|
|
+ if (begtime == "")
|
|
|
+ {
|
|
|
+ begtime = string(record.tmEnd);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ data += "<KSDATE>" + begtime + "</KSDATE>";
|
|
|
+ data += "<JSDATE>" + string(record.tmEnd) + "</JSDATE>";
|
|
|
+ data += "<JYGCZT>" + string("0") + "</JYGCZT>";
|
|
|
+
|
|
|
data += "</row>";
|
|
|
data += "</rows>";
|
|
|
|
|
|
@@ -426,9 +448,8 @@ void CWebLink_BJ::PackWebData_Record(VR::WebData& webdata, const VR::notify::fil
|
|
|
char chTime[15];
|
|
|
get_current_time(chTime);
|
|
|
|
|
|
- strdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
|
|
- strdata += "<root>";
|
|
|
- strdata += "<VERSION>V1.1</VERSION>";
|
|
|
+
|
|
|
+ strdata += "<VERSION>V2.0.1</VERSION>";
|
|
|
strdata += "<DATAID>" + string(chDataID) + "</DATAID>";
|
|
|
strdata += "<USERID>" + *m_pUserId + "</USERID>";
|
|
|
strdata += "<TIME>" + string(chTime) + "</TIME>";
|
|
|
@@ -436,7 +457,7 @@ void CWebLink_BJ::PackWebData_Record(VR::WebData& webdata, const VR::notify::fil
|
|
|
strdata += "<SEC>1</SEC>";
|
|
|
strdata += "<BUSINESSCONTENT>" + base64 + "</BUSINESSCONTENT>";
|
|
|
strdata += "<HMAC></HMAC>";
|
|
|
- strdata += "</root>";
|
|
|
+
|
|
|
|
|
|
webdata.data = strdata;
|
|
|
}
|
|
|
@@ -524,9 +545,8 @@ void CWebLink_BJ::PackWebData_Environment(VR::WebData& webdata)
|
|
|
char chTime[15];
|
|
|
get_current_time(chTime);
|
|
|
|
|
|
- strdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
|
|
- strdata += "<root>";
|
|
|
- strdata += "<VERSION>V1.1</VERSION>";
|
|
|
+
|
|
|
+ strdata += "<VERSION>V2.0.1</VERSION>";
|
|
|
strdata += "<DATAID>" + string(chDataID) + "</DATAID>";
|
|
|
strdata += "<USERID>" + *m_pUserId + "</USERID>";
|
|
|
strdata += "<TIME>" + string(chTime) + "</TIME>";
|
|
|
@@ -534,7 +554,6 @@ void CWebLink_BJ::PackWebData_Environment(VR::WebData& webdata)
|
|
|
strdata += "<SEC>1</SEC>";
|
|
|
strdata += "<BUSINESSCONTENT>" + base64 + "</BUSINESSCONTENT>";
|
|
|
strdata += "<HMAC></HMAC>";
|
|
|
- strdata += "</root>";
|
|
|
|
|
|
webdata.data = strdata;
|
|
|
}
|
|
|
@@ -570,9 +589,8 @@ void CWebLink_BJ::PackWebData_Error(VR::WebData& webdata, string code, string st
|
|
|
sprintf_s(chType, "%02d", webdata.type);
|
|
|
|
|
|
|
|
|
- strdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
|
|
- strdata += "<root>";
|
|
|
- strdata += "<VERSION>V1.1</VERSION>";
|
|
|
+
|
|
|
+ strdata += "<VERSION>V2.0.1</VERSION>";
|
|
|
strdata += "<DATAID>" + string(chDataID) + "</DATAID>";
|
|
|
strdata += "<USERID>" + *m_pUserId + "</USERID>";
|
|
|
strdata += "<TIME>" + string(chTime) + "</TIME>";
|
|
|
@@ -580,7 +598,6 @@ void CWebLink_BJ::PackWebData_Error(VR::WebData& webdata, string code, string st
|
|
|
strdata += "<SEC>1</SEC>";
|
|
|
strdata += "<BUSINESSCONTENT>" + base64 + "</BUSINESSCONTENT>";
|
|
|
strdata += "<HMAC></HMAC>";
|
|
|
- strdata += "</root>";
|
|
|
|
|
|
|
|
|
webdata.data = strdata;
|
|
|
@@ -620,9 +637,8 @@ void CWebLink_BJ::PackWebData_NozControl(VR::WebData& webdata, int fip, int noz,
|
|
|
sprintf_s(chType, "%02d", webdata.type);
|
|
|
|
|
|
|
|
|
- strdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
|
|
- strdata += "<root>";
|
|
|
- strdata += "<VERSION>V1.1</VERSION>";
|
|
|
+
|
|
|
+ strdata += "<VERSION>V2.0.1</VERSION>";
|
|
|
strdata += "<DATAID>" + string(chDataID) + "</DATAID>";
|
|
|
strdata += "<USERID>" + *m_pUserId + "</USERID>";
|
|
|
strdata += "<TIME>" + string(chTime) + "</TIME>";
|
|
|
@@ -630,7 +646,6 @@ void CWebLink_BJ::PackWebData_NozControl(VR::WebData& webdata, int fip, int noz,
|
|
|
strdata += "<SEC>1</SEC>";
|
|
|
strdata += "<BUSINESSCONTENT>" + base64 + "</BUSINESSCONTENT>";
|
|
|
strdata += "<HMAC></HMAC>";
|
|
|
- strdata += "</root>";
|
|
|
|
|
|
|
|
|
webdata.data = strdata;
|
|
|
@@ -695,9 +710,8 @@ void CWebLink_BJ::PackWebData_NozState(VR::WebData& webdata, string strDate)
|
|
|
sprintf_s(chType, "%02d", webdata.type);
|
|
|
|
|
|
|
|
|
- strdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
|
|
- strdata += "<root>";
|
|
|
- strdata += "<VERSION>V1.1</VERSION>";
|
|
|
+
|
|
|
+ strdata += "<VERSION>V2.0.1</VERSION>";
|
|
|
strdata += "<DATAID>" + string(chDataID) + "</DATAID>";
|
|
|
strdata += "<USERID>" + *m_pUserId + "</USERID>";
|
|
|
strdata += "<TIME>" + string(chTime) + "</TIME>";
|
|
|
@@ -705,51 +719,10 @@ void CWebLink_BJ::PackWebData_NozState(VR::WebData& webdata, string strDate)
|
|
|
strdata += "<SEC>1</SEC>";
|
|
|
strdata += "<BUSINESSCONTENT>" + base64 + "</BUSINESSCONTENT>";
|
|
|
strdata += "<HMAC></HMAC>";
|
|
|
- strdata += "</root>";
|
|
|
|
|
|
|
|
|
webdata.data = strdata;
|
|
|
}
|
|
|
|
|
|
|
|
|
-/*
|
|
|
-//自定义心跳
|
|
|
-void CWebLink_BJ::PackWebData_HeartBeat(VR::WebData& webdata)
|
|
|
-{
|
|
|
- string strdata = "";
|
|
|
-
|
|
|
- char chDataID[7];
|
|
|
- sprintf_s(chDataID, "%06d", webdata.ID);
|
|
|
-
|
|
|
- string data = "";
|
|
|
-
|
|
|
- //用空环境数据包来做心跳检测
|
|
|
- data += "<rows>";
|
|
|
- data += "</rows>";
|
|
|
-
|
|
|
-
|
|
|
- string base64 = base64_encode((BYTE*)data.data(), data.length());
|
|
|
- char chType[3];
|
|
|
- sprintf_s(chType, "%02d", webdata.type);
|
|
|
-
|
|
|
- char chTime[15];
|
|
|
- get_current_time(chTime);
|
|
|
-
|
|
|
- strdata += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
|
|
- strdata += "<root>";
|
|
|
- strdata += "<VERSION>V1.1</VERSION>";
|
|
|
- strdata += "<DATAID>" + string(chDataID) + "</DATAID>";
|
|
|
- strdata += "<USERID>" + *m_pUserId + "</USERID>";
|
|
|
- strdata += "<TIME>" + string(chTime) + "</TIME>";
|
|
|
- strdata += "<TYPE>" + string(chType) + "</TYPE>";
|
|
|
- strdata += "<SEC>1</SEC>";
|
|
|
- strdata += "<BUSINESSCONTENT>" + base64 + "</BUSINESSCONTENT>";
|
|
|
- strdata += "<HMAC></HMAC>";
|
|
|
- strdata += "</root>";
|
|
|
-
|
|
|
- webdata.data = strdata;
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
-*/
|
|
|
|