|
|
@@ -15,13 +15,11 @@
|
|
|
#include <QNetworkAccessManager>
|
|
|
#include <QNetworkRequest>
|
|
|
#include <QNetworkReply>
|
|
|
+#include <QUuid>
|
|
|
#include "ytServiceShm.h"
|
|
|
-#include "db_syncthread.h"
|
|
|
#include "QReplyTimeout.h"
|
|
|
-#include "datacenter.h"
|
|
|
#include "wscenter.h"
|
|
|
#include "logthread.h"
|
|
|
-#include "subsysreport.h"
|
|
|
|
|
|
class YpYwSyncRep {
|
|
|
public:
|
|
|
@@ -46,85 +44,82 @@ public:
|
|
|
QString JsonStr;
|
|
|
};
|
|
|
|
|
|
-class YpXySyncRep {
|
|
|
+class YPSyncDev{
|
|
|
public:
|
|
|
- explicit YpXySyncRep(int xh=0,QString id="",QString str=""){
|
|
|
- Xh = xh;
|
|
|
+ explicit YPSyncDev(int id=0, QString ownerName="", QString ownerCode="",QString unitinfo="",QString company="",int deviceType=0)
|
|
|
+ {
|
|
|
Id = id;
|
|
|
- JsonStr = str;
|
|
|
+ OwnerName = ownerName;
|
|
|
+ OwnerCode = ownerCode;
|
|
|
+ Unitinfo = unitinfo;
|
|
|
+ Company = company;
|
|
|
+ DeviceType = deviceType;
|
|
|
}
|
|
|
- int Xh;
|
|
|
- QString Id;
|
|
|
- QString JsonStr;
|
|
|
-};
|
|
|
|
|
|
-class CnSyncRep {
|
|
|
-public:
|
|
|
- explicit CnSyncRep(int xh=0,QString id="", QString str="", int devcategory=0){
|
|
|
- Xh = xh;
|
|
|
- Id = id;
|
|
|
- JsonStr = str;
|
|
|
- devCategory =devcategory;
|
|
|
- }
|
|
|
-
|
|
|
- int Xh;
|
|
|
- int devCategory;
|
|
|
- QString Id;
|
|
|
- QString JsonStr;
|
|
|
+ int Id;
|
|
|
+ QString OwnerName;
|
|
|
+ QString OwnerCode;
|
|
|
+ QString Unitinfo;
|
|
|
+ QString Company;
|
|
|
+ int DeviceType;
|
|
|
};
|
|
|
|
|
|
-class NewCnSyncRep {
|
|
|
+class XfzdSyncDev{
|
|
|
public:
|
|
|
- explicit NewCnSyncRep(int xh=0,QString id="", QString str="", int devcategory=0){
|
|
|
- Xh = xh;
|
|
|
- Id = id;
|
|
|
- JsonStr = str;
|
|
|
- devCategory =devcategory;
|
|
|
+ explicit XfzdSyncDev(QString deviceCode="", QString deviceName="", QString descript="",int deviceType=0, QString deviceTypeName="", QString openProjectId="", int devtype=0, QString data="",QString port="",QString deviceFloor="")
|
|
|
+ {
|
|
|
+ DeviceCode = deviceCode;
|
|
|
+ DeviceName = deviceName;
|
|
|
+ Descript = descript;
|
|
|
+ DeviceType = deviceType;
|
|
|
+ DeviceTypeName = deviceTypeName;
|
|
|
+ OpenProjectId= openProjectId;
|
|
|
+ devCategory = devtype;
|
|
|
+ Data = data;
|
|
|
+ Port = port;
|
|
|
+ DeviceFloor = deviceFloor;
|
|
|
}
|
|
|
|
|
|
- int Xh;
|
|
|
+ QString DeviceCode;
|
|
|
+ QString DeviceName;
|
|
|
+ QString Descript;
|
|
|
+ int DeviceType;
|
|
|
+ QString DeviceTypeName;
|
|
|
+ QString OpenProjectId;
|
|
|
int devCategory;
|
|
|
- QString Id;
|
|
|
- QString JsonStr;
|
|
|
+ QString Data;
|
|
|
+ QString Port;
|
|
|
+ QString DeviceFloor;
|
|
|
};
|
|
|
|
|
|
class XfzdSyncRep {
|
|
|
public:
|
|
|
- explicit XfzdSyncRep(int xh=0,QString id="", QString str="", int devcategory=0){
|
|
|
+ explicit XfzdSyncRep(int xh=0,QString id="", QString str="", int devcategory=0, QString devicecode=""){
|
|
|
Xh = xh;
|
|
|
Id = id;
|
|
|
JsonStr = str;
|
|
|
devCategory =devcategory;
|
|
|
+ deviceCode = devicecode;
|
|
|
}
|
|
|
|
|
|
int Xh;
|
|
|
int devCategory;
|
|
|
QString Id;
|
|
|
QString JsonStr;
|
|
|
+ QString deviceCode;
|
|
|
};
|
|
|
|
|
|
-class JaSyncRep {
|
|
|
+class CnPno{
|
|
|
public:
|
|
|
- explicit JaSyncRep(int xh=0,QString id="",QString str=""){
|
|
|
- Xh = xh;
|
|
|
- Id = id;
|
|
|
- JsonStr = str;
|
|
|
+ explicit CnPno(QString name="", int pno=0, QString def=""){
|
|
|
+ PName = name;
|
|
|
+ Pno = pno;
|
|
|
+ Default = def;
|
|
|
}
|
|
|
- int Xh;
|
|
|
- QString Id;
|
|
|
- QString JsonStr;
|
|
|
-};
|
|
|
|
|
|
-class HpSyncRep {
|
|
|
-public:
|
|
|
- explicit HpSyncRep(int xh=0,QString id="",QString str=""){
|
|
|
- Xh = xh;
|
|
|
- Id = id;
|
|
|
- JsonStr = str;
|
|
|
- }
|
|
|
- int Xh;
|
|
|
- QString Id;
|
|
|
- QString JsonStr;
|
|
|
+ QString PName;
|
|
|
+ int Pno;
|
|
|
+ QString Default;
|
|
|
};
|
|
|
|
|
|
class Core : public QObject
|
|
|
@@ -135,78 +130,38 @@ public:
|
|
|
void start();
|
|
|
bool chk_table(QString tablename, QStringList tables);
|
|
|
void db_init();
|
|
|
- QList<JaPno> getJaPnoValue(QString pnoset);
|
|
|
QList<CnPno> getPnoValue(QString pnoset);
|
|
|
|
|
|
signals:
|
|
|
- void set_cndevlist(QList<CNSyncDev> list);
|
|
|
|
|
|
public slots:
|
|
|
void time_out();
|
|
|
void SyncData(QString uuid, QString jsonstr);
|
|
|
- void SyncDisData(QString uuid, QString jsonstr);
|
|
|
- void SyncXyData(int xh,QString uuid, QString jsonstr);
|
|
|
- void cnSyncData(int xh,QString uuid, QString jsonstr, int devCategory);
|
|
|
- void NewcnSyncData(int xh,QString uuid, QString jsonstr, int devCategory);
|
|
|
- void XfzdSyncData(int xh,QString uuid, QString jsonstr, int devCategory);
|
|
|
- void jaSyncData(int xh,QString uuid,QString jsonstr);
|
|
|
- void hpSyncData(int xh,QString uuid,QString jsonstr);
|
|
|
- void ypYwSyncData(int xh,QString uuid,QString jsonstr);
|
|
|
void companyAlarmChanged(QString companyCode);
|
|
|
void finishedSlot(QNetworkReply *reply);
|
|
|
void reply_timeout();
|
|
|
- void finishedSlot2(QNetworkReply *reply);
|
|
|
- void finishedSlot3(QNetworkReply *reply);
|
|
|
- void finishedSlot4(QNetworkReply *reply);
|
|
|
- void finishedSlot5(QNetworkReply *reply);
|
|
|
- void finishedSlot6(QNetworkReply *reply);
|
|
|
- void finishedSlot7(QNetworkReply *reply);
|
|
|
- void finishedSlot8(QNetworkReply *reply);
|
|
|
- void finishedSlot9(QNetworkReply *reply);
|
|
|
- void reply_timeout2();
|
|
|
- void reply_timeout3();
|
|
|
- void reply_timeout4();
|
|
|
- void reply_timeout5();
|
|
|
- void reply_timeout6();
|
|
|
- void reply_timeout7();
|
|
|
- void reply_timeout8();
|
|
|
- void reply_timeout9();
|
|
|
void appendLog(QString log);
|
|
|
void needSync(QString deviceCode);
|
|
|
- void subReport(quint16 subType, QString DeviceID, quint64 insertId, bool flag);
|
|
|
- void subReport1(quint16 subType, QString DeviceID, quint64 insertId, quint16 flag, QString CompanyCode, QString evt_name, QString evt, QString alarm_time);
|
|
|
- void subReport2(quint16 subType, QString artificial_id, quint16 area_status, QString reason, QString handler, QString mobile);
|
|
|
+ void XfzdSyncData(int xh,QString uuid, QString jsonstr, int devCategory, QString deviceCode);
|
|
|
+ void finishedSlot9(QNetworkReply *reply);
|
|
|
+ void reply_timeout9();
|
|
|
private:
|
|
|
QSqlDatabase db,mdb;
|
|
|
- time_t work_time,jaworktime,ypdisworktime,ypxyworktime,xfzdworktime;
|
|
|
- bool isRunning,isSending,isSending2,isSending3,isSending4,isSending5,isSending6,isSending7,isSending8,isSending9,mdbOpened;
|
|
|
+ time_t lhworktime,work_time,xfzdworktime,lhworktime1;
|
|
|
+ bool isRunning,isSending,mdbOpened,isSending9;
|
|
|
int ypCount,ypdisCount,ypxyCount,cnCount,jaCount,hpCount;
|
|
|
QTimer *timer;
|
|
|
- DB_SyncThread *thread;
|
|
|
- QList<JASyncDev> jaDevList;
|
|
|
- QList<YPYWSyncDev> ypYwDevList;
|
|
|
- QList<HPSyncDev> hpDevList;
|
|
|
- QList<CNSyncDev> cnDevList;
|
|
|
- QList<NewCNSyncDev> NewcnDevList;
|
|
|
- QList<XfzdSyncDev> XfzdDevList;
|
|
|
QList<YPSyncDev> syncDevList;
|
|
|
- QList<YPSyncXyDev> syncXyDevList;
|
|
|
+ QList<XfzdSyncDev> XfzdDevList;
|
|
|
QList<YpYwSyncRep> ypYwSyncDataList;
|
|
|
QList<SyncRep> ypSyncdataList;
|
|
|
QList<SyncRep> ypSyncDisdataList;
|
|
|
- QList<YpXySyncRep> ypSyncXydataList;
|
|
|
- QList<CnSyncRep> cnSyncdataLiet;
|
|
|
- QList<NewCnSyncRep> NewcnSyncdataLiet;
|
|
|
QList<XfzdSyncRep> XfzdSyncdataLiet;
|
|
|
- QList<JaSyncRep> jaSyncdataLiet;
|
|
|
- QList<HpSyncRep> hpSyncdataLiet;
|
|
|
- QNetworkAccessManager *netAccessManager, *cnnetAccessManager, *janetAccessManager, *disnetAccessManager, *xynetAccessManager, *hpnetAccessManager,*NewcnnetAccessManager,*ypYwcnnetAccessManager,*XfzdnetAccessManager;
|
|
|
+ QNetworkAccessManager *netAccessManager,*XfzdnetAccessManager;
|
|
|
QStringList sqlList, sqlList2,sqlList3;
|
|
|
- DataCenter *dc;
|
|
|
WSCenter *wsCenter;
|
|
|
uint times;
|
|
|
LogThread *logThread;
|
|
|
- SubSysReport *subReportServer;
|
|
|
// WSCenter *wsCenter;
|
|
|
};
|
|
|
|