Commit 97c2a3db by wuyang.zou

POS-Plugin 悬浮框新增 美团-MOD 营业状态展示

parent e9e6bcf5
Pipeline #38354 failed with stage
in 0 seconds
...@@ -377,7 +377,7 @@ void SocketCommunicate::acceptTcpSvrSendMsg() ...@@ -377,7 +377,7 @@ void SocketCommunicate::acceptTcpSvrSendMsg()
data.clear(); data.clear();
QJsonObject inputJsonObj; QJsonObject inputJsonObj;
//<1.1> Case: Recv HeartBeat Msg; //<1.1> Case: Recv PosAgent Service HeartBeat Request Msg;
if(outDataHead.type == CMD_RECV_HEARTBEAT_REQ) if(outDataHead.type == CMD_RECV_HEARTBEAT_REQ)
{ {
( _sslSocket && ( QAbstractSocket::ConnectedState == _sslSocket->state() ) ) ? _sslSocket->read(outDataHead.length) : ""; ( _sslSocket && ( QAbstractSocket::ConnectedState == _sslSocket->state() ) ) ? _sslSocket->read(outDataHead.length) : "";
...@@ -411,7 +411,15 @@ void SocketCommunicate::acceptTcpSvrSendMsg() ...@@ -411,7 +411,15 @@ void SocketCommunicate::acceptTcpSvrSendMsg()
<< ( _isTimeout ? " TimeOut" : " Success")<< " syncHeartBeatStamp: "<<_socketHeartBeatDateTime.toString("yyyy-MM-dd hh:mm:ss"); << ( _isTimeout ? " TimeOut" : " Success")<< " syncHeartBeatStamp: "<<_socketHeartBeatDateTime.toString("yyyy-MM-dd hh:mm:ss");
continue; continue;
} }
//<1.2> Case: Recv Push OrderStatus Msg; //<1.2> Case: Recv PosAgent Service Response Plugin'self heartbeat Msg;
else if ( outDataHead.type == CMD_RECV_HEARTBEAT_RESP )
{
QByteArray msgData = ( _sslSocket && ( QAbstractSocket::ConnectedState == _sslSocket->state() ) ) ? _sslSocket->read(outDataHead.length) : "";
QLOG_INFO() << "acceptTcpSvrSendMsg:: Recv HeartBeat Response From PosAgnet Success, Sequence: " << outDataHead.sequence << " Msg: " << msgData.data();
_socketHeartBeatDateTime = QDateTime::currentDateTime();
continue;
}
//<1.3> Case: Recv Push OrderStatus Msg;
else if(outDataHead.type == CMD_RECV_MSG_REQ) else if(outDataHead.type == CMD_RECV_MSG_REQ)
{ {
// Recv Server Push OrderStatus Msg; // Recv Server Push OrderStatus Msg;
...@@ -456,7 +464,7 @@ void SocketCommunicate::acceptTcpSvrSendMsg() ...@@ -456,7 +464,7 @@ void SocketCommunicate::acceptTcpSvrSendMsg()
continue; continue;
} }
//<1.3> Case: Recv Auth Login Resp Msg [ impossible]; //<1.4> Case: Recv Auth Login Resp Msg [ impossible];
else if(outDataHead.type == CMD_AUTH_LOGIN_RESP) else if(outDataHead.type == CMD_AUTH_LOGIN_RESP)
{ {
// Recv Server Response Msg Of Self Login Request ; // Recv Server Response Msg Of Self Login Request ;
...@@ -502,7 +510,7 @@ void SocketCommunicate::acceptTcpSvrSendMsg() ...@@ -502,7 +510,7 @@ void SocketCommunicate::acceptTcpSvrSendMsg()
continue; continue;
} }
//<1.4> Case: Recv Socket Msg Type No Process , DataHead.type Havn't Match Success [ Maybe ]; Need Response, Or POS Agent Will Still Push; //<1.5> Case: Recv Socket Msg Type No Process , DataHead.type Havn't Match Success [ Maybe ]; Need Response, Or POS Agent Will Still Push;
else { else {
// Recv Pos Agent Pushed Undefine Action Id Msg; // Recv Pos Agent Pushed Undefine Action Id Msg;
QByteArray msgData = ( _sslSocket && ( QAbstractSocket::ConnectedState == _sslSocket->state() ) ) ? _sslSocket->read(outDataHead.length) : "" ; QByteArray msgData = ( _sslSocket && ( QAbstractSocket::ConnectedState == _sslSocket->state() ) ) ? _sslSocket->read(outDataHead.length) : "" ;
...@@ -697,46 +705,9 @@ bool SocketCommunicate::sendSocketHeart() ...@@ -697,46 +705,9 @@ bool SocketCommunicate::sendSocketHeart()
return false; return false;
} else { } else {
QLOG_INFO() << "sendSocketHeart:: Send HeartBeat To PosAgnet Success , len: "<< len ; QLOG_INFO() << "sendSocketHeart:: Send HeartBeat To PosAgnet Success , len: "<< len ;
_socketHeartBeatDateTime = QDateTime::currentDateTime();
} }
_isTimeout = true;
{
QEventLoop loop;
QTimer timer;
connect(this, &SocketCommunicate::quit, &loop, &QEventLoop::quit);
connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit);
connect(this, &SocketCommunicate::readReady, &loop, &QEventLoop::quit);
timer.start(30*1000);
loop.exec();
}
// <2.1> Read HeartBeat Response Faild;
if ( _isTimeout ) {
QLOG_ERROR() << "sendSocketHeart:: Receive HeartBeat Response From PosAgnet Failed, TimeOut: " << ( _sslSocket ? _sslSocket->errorString() : " _sslSocket Is Null ");
_sslSocket ? _sslSocket->disconnectFromHost() : 0;
_needTcpLogin = 1;
return false;
}
// <2.2> Read HeartBeat Response Success;
QByteArray headByteData = ( _sslSocket && ( QAbstractSocket::ConnectedState == _sslSocket->state() ) ) ? _sslSocket->read( sizeof(Data_Head) ) : "" ;
Data_Head outDataHead = {0};
if ( !SocketCommuProcess::getHeadAllData( headByteData, outDataHead ) )
{
QLOG_ERROR() << "sendSocketHeart:: Receive HeartBeat Head Failed / Msg Too Short Or Msg Type Not Match";
( _sslSocket && ( QAbstractSocket::ConnectedState == _sslSocket->state() ) ) ? _sslSocket->readAll() : 0 ;
_sslSocket ? _sslSocket->disconnectFromHost() : 0 ;
_needTcpLogin = 1;
return false;
}
// <2.3> Compare Recv HeartBeat Response Body, Maybe Recv Other Normal Type Msg, Will Miss Msg;
QByteArray body = ( _sslSocket && ( QAbstractSocket::ConnectedState == _sslSocket->state() ) ) ? _sslSocket->read(outDataHead.length) : "" ;
QLOG_INFO() << "sendSocketHeart:: Receive HeartBeat Response From PosAgnet: " << body;
// <3> To be confirmed Something;
_socketHeartBeatDateTime = QDateTime::currentDateTime();
return true; return true;
} }
......
...@@ -32,6 +32,23 @@ FlowControl &FlowControl::GetInstance() ...@@ -32,6 +32,23 @@ FlowControl &FlowControl::GetInstance()
return fc; return fc;
} }
FlowControl::~FlowControl()
{
QLOG_INFO() << "FlowControl::~FlowControl()........";
m_clearTimer->deleteLater();
m_heartTimer->deleteLater();
m_pullTimer->deleteLater();
m_reportOMSReocrdOrderTimer->deleteLater();
m_loginTimer->deleteLater();
m_notifySimPullTimer->deleteLater();
m_storageOrderTimer->deleteLater();
m_delayGetRefundDetailTimer->deleteLater();
m_remindCasherBlinkFloatTimer->deleteLater();
loaclHttpServer->deleteLater();
}
FlowControl::FlowControl() FlowControl::FlowControl()
{ {
m_bLoginResult =false; m_bLoginResult =false;
...@@ -50,6 +67,7 @@ FlowControl::FlowControl() ...@@ -50,6 +67,7 @@ FlowControl::FlowControl()
m_eleStoreStatus = UNKNOWNSTORE; m_eleStoreStatus = UNKNOWNSTORE;
m_mopStoreStatus = UNKNOWNSTORE; m_mopStoreStatus = UNKNOWNSTORE;
m_modStoreStatus = UNKNOWNSTORE; m_modStoreStatus = UNKNOWNSTORE;
m_mtModStoreStatus = UNKNOWNSTORE;
//初始化上次心跳状态是否异常(false:代表心跳正常 | true:代表心跳异常); //初始化上次心跳状态是否异常(false:代表心跳正常 | true:代表心跳异常);
m_bLastHeartIsError = false; m_bLastHeartIsError = false;
...@@ -1133,9 +1151,10 @@ bool FlowControl::_Login() ...@@ -1133,9 +1151,10 @@ bool FlowControl::_Login()
m_eleStoreStatus = recvJson[JSON_ELESTORESTS].toInt(); m_eleStoreStatus = recvJson[JSON_ELESTORESTS].toInt();
m_modStoreStatus = recvJson[JSON_MODSTORESTS].toInt(); m_modStoreStatus = recvJson[JSON_MODSTORESTS].toInt();
m_mopStoreStatus = recvJson[JSON_MOPSTORESTS].toInt(); m_mopStoreStatus = recvJson[JSON_MOPSTORESTS].toInt();
QLOG_INFO()<<QString("[<<<<---FlowControl::_Login eleStoreStatus:%1; modStoreStatus:%2; mopStoreStatus:%3; --->>>>]") m_mtModStoreStatus = recvJson[JSON_MTMODSTORESTS].toInt();
.arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus); QLOG_INFO()<<QString("[<<<<---FlowControl::_Login eleStoreStatus: %1, modStoreStatus: %2, mopStoreStatus: %3, mtModStoreStatus: %4 --->>>>]")
emit doUpdateStoreStatus(m_eleStoreStatus,m_modStoreStatus,m_mopStoreStatus); .arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus).arg(m_mtModStoreStatus);
emit doUpdateStoreStatus( m_eleStoreStatus, m_modStoreStatus, m_mopStoreStatus, m_mtModStoreStatus);
//***********************登陆时获取门店的营业状态 end ************************// //***********************登陆时获取门店的营业状态 end ************************//
m_bLoginResult= true; m_bLoginResult= true;
...@@ -1383,7 +1402,7 @@ bool FlowControl::_SendHeart() ...@@ -1383,7 +1402,7 @@ bool FlowControl::_SendHeart()
{ {
m_bLastHeartIsError = true; m_bLastHeartIsError = true;
emit setNetStatus(QString::fromLocal8Bit("<font color='#ff0000'>网络不稳定,正在重试</font>")); emit setNetStatus(QString::fromLocal8Bit("<font color='#ff0000'>网络不稳定,正在重试</font>"));
emit doUpdateStoreStatus(0,0,0); //NetWork Is Error , Refresh Store Default Status; emit doUpdateStoreStatus(0, 0, 0, 0); //NetWork Is Error , Refresh Store Default Status;
}else }else
{ {
QLOG_INFO() << QString("[<<<<---Send Heart Finish: code:%1--->>>>]").arg(recvJson[JSON_LOGINCODE].toInt()); QLOG_INFO() << QString("[<<<<---Send Heart Finish: code:%1--->>>>]").arg(recvJson[JSON_LOGINCODE].toInt());
...@@ -1392,7 +1411,7 @@ bool FlowControl::_SendHeart() ...@@ -1392,7 +1411,7 @@ bool FlowControl::_SendHeart()
result = false; result = false;
m_bLastHeartIsError = true; m_bLastHeartIsError = true;
emit setNetStatus(QString::fromLocal8Bit("<font color='#ff0000'>网络不稳定,正在重试</font>")); emit setNetStatus(QString::fromLocal8Bit("<font color='#ff0000'>网络不稳定,正在重试</font>"));
emit doUpdateStoreStatus(0,0,0); //Interface Return Error , Refresh Store Default Status; emit doUpdateStoreStatus(0, 0, 0, 0); //Interface Return Error , Refresh Store Default Status;
}else{ }else{
result = true; result = true;
emit setNetStatus(QString::fromLocal8Bit("<font color='#f5f5f5'>正常</font>")); emit setNetStatus(QString::fromLocal8Bit("<font color='#f5f5f5'>正常</font>"));
...@@ -1407,9 +1426,12 @@ bool FlowControl::_SendHeart() ...@@ -1407,9 +1426,12 @@ bool FlowControl::_SendHeart()
if ( recvJson.contains(JSON_MOPSTORESTS) ) { if ( recvJson.contains(JSON_MOPSTORESTS) ) {
m_mopStoreStatus = recvJson[JSON_MOPSTORESTS].toInt(); m_mopStoreStatus = recvJson[JSON_MOPSTORESTS].toInt();
} }
QLOG_INFO()<<QString("[<<<<---FlowControl::_SendHeart eleStoreStatus:%1;modStoreStatus:%2;mopStoreStatus:%3 --->>>>]"). if ( recvJson.contains(JSON_MTMODSTORESTS) ) {
arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus); m_mtModStoreStatus = recvJson[JSON_MTMODSTORESTS].toInt();
emit doUpdateStoreStatus(m_eleStoreStatus,m_modStoreStatus,m_mopStoreStatus); }
QLOG_INFO()<<QString("[<<<<---FlowControl::_SendHeart eleStoreStatus: %1, modStoreStatus: %2 , mopStoreStatus: %3 , mtModStoreStatus: %4 --->>>>]").
arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus).arg(m_mtModStoreStatus);
emit doUpdateStoreStatus( m_eleStoreStatus, m_modStoreStatus, m_mopStoreStatus, m_mtModStoreStatus );
//还原并标记上一次心跳为正常状态; //还原并标记上一次心跳为正常状态;
m_bLastHeartIsError = false; m_bLastHeartIsError = false;
} }
...@@ -2513,10 +2535,11 @@ bool FlowControl::_ResponseOMS12Request(const QJsonObject &content, QJsonObject ...@@ -2513,10 +2535,11 @@ bool FlowControl::_ResponseOMS12Request(const QJsonObject &content, QJsonObject
m_eleStoreStatus = content[JSON_ELESTORESTS].toInt(); m_eleStoreStatus = content[JSON_ELESTORESTS].toInt();
m_modStoreStatus = content[JSON_MODSTORESTS].toInt(); m_modStoreStatus = content[JSON_MODSTORESTS].toInt();
m_mopStoreStatus = content[JSON_MOPSTORESTS].toInt(); m_mopStoreStatus = content[JSON_MOPSTORESTS].toInt();
QLOG_INFO()<<QString("[<<<<---FlowControl::_ResponseOMS12Request eleStoreStatus:%1;modStoreStatus:%2;mopStoreStatus:%3 --->>>>]"). m_mtModStoreStatus = content[JSON_MTMODSTORESTS].toInt();
arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus); QLOG_INFO()<<QString("[<<<<---FlowControl::_ResponseOMS12Request eleStoreStatus: %1, modStoreStatus: %2 , mopStoreStatus: %3 , mtModStoreStatus: %4 --->>>>]").
arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus).arg(m_mtModStoreStatus);
emit doUpdateStoreStatus(m_eleStoreStatus,m_modStoreStatus,m_mopStoreStatus); emit doUpdateStoreStatus(m_eleStoreStatus, m_modStoreStatus, m_mopStoreStatus, m_mtModStoreStatus);
error=QString("success"); error=QString("success");
result = true; result = true;
......
...@@ -26,6 +26,8 @@ class FlowControl : public QObject ...@@ -26,6 +26,8 @@ class FlowControl : public QObject
public: public:
static FlowControl& GetInstance(); static FlowControl& GetInstance();
~FlowControl();
/* 功能:获取目前插件FC 核心数据; /* 功能:获取目前插件FC 核心数据;
* 参数: 1. 是否登录成功; 2.门店号; 3.PosPluginIp; 4.PosPlugin Port; * 参数: 1. 是否登录成功; 2.门店号; 3.PosPluginIp; 4.PosPlugin Port;
* 返回: Void; * 返回: Void;
...@@ -121,6 +123,7 @@ private: ...@@ -121,6 +123,7 @@ private:
int m_eleStoreStatus; int m_eleStoreStatus;
int m_mopStoreStatus; int m_mopStoreStatus;
int m_modStoreStatus; int m_modStoreStatus;
int m_mtModStoreStatus;
bool m_bLastHeartIsError; bool m_bLastHeartIsError;
int m_orderCount; int m_orderCount;
int m_clickPosCount; int m_clickPosCount;
...@@ -239,7 +242,7 @@ signals: ...@@ -239,7 +242,7 @@ signals:
* 参数:1 [ele开关店状态] 2[MOD开关店状态] 3[MOP开关店状态] * 参数:1 [ele开关店状态] 2[MOD开关店状态] 3[MOP开关店状态]
* 返回:Null * 返回:Null
* */ * */
void doUpdateStoreStatus(int eleStoreStatus,int modStoreStatus,int mopStoreStatus); void doUpdateStoreStatus(int eleStoreStatus, int modStoreStatus, int mopStoreStatus, int mtStoreStatus);
/* 功能:设置主界面门店信息 /* 功能:设置主界面门店信息
......
...@@ -234,71 +234,77 @@ void FloatForm::onUnLockFloatForm(){ ...@@ -234,71 +234,77 @@ void FloatForm::onUnLockFloatForm(){
} }
} }
void FloatForm::onUpdateStoreStatus(int eleStoreStatus, int modStoreStatus,int mopStoreStatus){ void FloatForm::onUpdateStoreStatus(int eleStoreStatus, int modStoreStatus, int mopStoreStatus, int mtStoreStatus){
QLOG_INFO()<<QString("[<<<----FloatForm::onUpdateStoreStatus:eleStoreStatus, modStoreStatus, mopStoreStatus: --->>>>]")<<eleStoreStatus <<modStoreStatus <<mopStoreStatus ; QLOG_INFO()<<QString("[<<<----FloatForm::onUpdateStoreStatus: eleStoreStatus: %1, modStoreStatus: %2, mopStoreStatus: %3, mtStoreStatus: %4 --->>>>]")
RefreshStoreStatus(eleStoreStatus, modStoreStatus,mopStoreStatus); .arg(eleStoreStatus).arg(modStoreStatus).arg(mopStoreStatus).arg(mtStoreStatus);
RefreshStoreStatus( eleStoreStatus, modStoreStatus, mopStoreStatus, mtStoreStatus );
} }
void FloatForm::RefreshStoreStatus(int eleStoreStatus, int modStoreStatus,int mopStoreStatus){ void FloatForm::RefreshStoreStatus(int eleStoreStatus, int modStoreStatus, int mopStoreStatus, int mtStoreStatus){
QLOG_INFO()<<QString("[<<<----FloatForm::RefreshStoreStatus:--->>>>]"); QLOG_INFO()<<QString("[<<<----FloatForm::RefreshStoreStatus:--->>>>]");
int titleLab_w = 35, titleLab_h = 14, statusLab_w = 30, statusLab_h = 14;
int first_x = 15, first_y = 35, col_interval = 15, row_interval = 10;
//准备MOD门店营业状态Label; //准备MOD门店营业状态Label;
this->ui->Mod1Lable->resize(56, 14); //图片源文件大小 this->ui->Mod1Lable->move( first_x, first_y); //左边距 first_x 像素; 上边距: first_y 像素;
this->ui->Mod1Lable->move(10, 40); //左边距10像素; this->ui->Mod1Lable->setPixmap( QPixmap(":ModTitle.png").scaled(titleLab_w, titleLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
this->ui->Mod1Lable->setPixmap(QPixmap(":ModTitle.png")); this->ui->Mod2Lable->move( first_x + titleLab_w + col_interval, first_y );
this->ui->Mod2Lable->resize(44, 20); //图片源文件大小
this->ui->Mod2Lable->move(70, 36); // 在 Mod1Lable 基础上 x+4; y-4;
if(1 == modStoreStatus){ if(1 == modStoreStatus){
this->ui->Mod2Lable->setPixmap(QPixmap(":StoreOn.png")); this->ui->Mod2Lable->setPixmap( QPixmap(":StoreOn.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
}else if(2 == modStoreStatus){ }else if(2 == modStoreStatus){
this->ui->Mod2Lable->setPixmap(QPixmap(":StoreOff.png")); this->ui->Mod2Lable->setPixmap( QPixmap(":StoreOff.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
}else { }else {
this->ui->Mod2Lable->setPixmap(QPixmap(":StoreDef.png")); this->ui->Mod2Lable->setPixmap( QPixmap(":StoreDef.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} }
//准备Eleme门店营业状态Label; //准备Eleme门店营业状态Label;
this->ui->Eleme1Lable->resize(43, 14); //图片源文件大小 this->ui->Eleme1Lable->move( first_x, first_y + 1* ( titleLab_h + row_interval ) );
this->ui->Eleme1Lable->move(10, 66); //左边距10像素;高度距离上面一个标签 高度 + 10 像素间隔; this->ui->Eleme1Lable->setPixmap( QPixmap(":ElemeTitle.png").scaled(titleLab_w, titleLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
this->ui->Eleme1Lable->setPixmap(QPixmap(":ElemeTitle.png")); this->ui->Eleme2Lable->move(first_x + titleLab_w + col_interval, first_y + 1* ( statusLab_h + row_interval ) );
this->ui->Eleme2Lable->resize(44, 20); //图片源文件大小
this->ui->Eleme2Lable->move(70, 62); // x 与 Mod1Lable 对齐; y-4;
if(1 == eleStoreStatus){ if(1 == eleStoreStatus){
this->ui->Eleme2Lable->setPixmap(QPixmap(":StoreOn.png")); this->ui->Eleme2Lable->setPixmap( QPixmap(":StoreOn.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
}else if(2 == eleStoreStatus){ }else if(2 == eleStoreStatus){
this->ui->Eleme2Lable->setPixmap(QPixmap(":StoreOff.png")); this->ui->Eleme2Lable->setPixmap( QPixmap(":StoreOff.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} else { } else {
this->ui->Eleme2Lable->setPixmap(QPixmap(":StoreDef.png")); this->ui->Eleme2Lable->setPixmap( QPixmap(":StoreDef.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} }
//准备Mop门店营业状态Label; //准备Mop门店营业状态Label;
this->ui->Mop1Lable->resize(56, 14); //图片源文件大小 this->ui->Mop1Lable->move(first_x, first_y + 2* ( titleLab_h + row_interval ) );
this->ui->Mop1Lable->move(10, 92); //左边距10像素;高度距离上面一个标签 高度 + 10 像素间隔; this->ui->Mop1Lable->setPixmap( QPixmap(":MopTitle.png").scaled(titleLab_w, titleLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
this->ui->Mop1Lable->setPixmap(QPixmap(":MopTitle.png")); this->ui->Mop2Lable->move(first_x + titleLab_w + col_interval, first_y + 2* ( statusLab_h + row_interval ) );
this->ui->Mop2Lable->resize(44, 20); //图片源文件大小
this->ui->Mop2Lable->move(70, 88); // x 与 Mod1Lable 对齐; y-4;
if(1 == mopStoreStatus){ if(1 == mopStoreStatus){
this->ui->Mop2Lable->setPixmap(QPixmap(":StoreOn.png")); this->ui->Mop2Lable->setPixmap( QPixmap(":StoreOn.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} else if(2 == mopStoreStatus) { } else if(2 == mopStoreStatus) {
this->ui->Mop2Lable->setPixmap(QPixmap(":StoreOff.png")); this->ui->Mop2Lable->setPixmap( QPixmap(":StoreOff.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} else { } else {
this->ui->Mop2Lable->setPixmap(QPixmap(":StoreDef.png")); this->ui->Mop2Lable->setPixmap( QPixmap(":StoreDef.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
}
//准备美团 门店营业状态Label;
this->ui->Mt1Lable->move(first_x, first_y + 3* ( titleLab_h + row_interval ) );
this->ui->Mt1Lable->setPixmap( QPixmap(":MtTitle.png").scaled(titleLab_w, titleLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
this->ui->Mt2Lable->move(first_x + titleLab_w + col_interval, first_y + 3* ( titleLab_h + row_interval ) );
if(1 == mtStoreStatus){
this->ui->Mt2Lable->setPixmap( QPixmap(":StoreOn.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} else if(2 == mtStoreStatus) {
this->ui->Mt2Lable->setPixmap( QPixmap(":StoreOff.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} else {
this->ui->Mt2Lable->setPixmap( QPixmap(":StoreDef.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} }
//准备订单管理状态Label; //准备订单管理状态Label;
this->ui->OrderManagerLable->resize(120, 36); //图片源文件大小; x缩小10像素; this->ui->OrderManagerLable->move(3, 122);
this->ui->OrderManagerLable->move(2, 118); //左边距0像素;高度距离上面一个标签 高度 + 10 像素间隔; this->ui->OrderManagerLable->setPixmap( QPixmap(":NomalOrderManager.png").scaled(110, 30, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
this->ui->OrderManagerLable->setPixmap(QPixmap(":NomalOrderManager.png"));
} }
void FloatForm::RefreshOrderManagerStatus(int existNewOrder){ void FloatForm::RefreshOrderManagerStatus(int existNewOrder){
QLOG_INFO()<<QString("[<<<----FloatForm::RefreshOrderManagerStatus:%1--->>>>]").arg(existNewOrder); QLOG_INFO()<<QString("[<<<----FloatForm::RefreshOrderManagerStatus:%1--->>>>]").arg(existNewOrder);
if(existNewOrder){ //有新订单; if(existNewOrder){ //有新订单;
this->ui->OrderManagerLable->resize(120, 36); //图片源文件大小; x缩小10像素; this->ui->OrderManagerLable->move(3, 122);
this->ui->OrderManagerLable->move(2, 118); //左边距0像素;高度距离上面一个标签 高度 + 10 像素间隔; this->ui->OrderManagerLable->setPixmap( QPixmap(":ComeNewOrder.png").scaled(110, 30, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
this->ui->OrderManagerLable->setPixmap(QPixmap(":ComeNewOrder.png"));
} else { //无新订单; } else { //无新订单;
this->ui->OrderManagerLable->resize(120, 36); //图片源文件大小; x缩小10像素; this->ui->OrderManagerLable->move(3, 122);
this->ui->OrderManagerLable->move(2, 118); //左边距0像素;高度距离上面一个标签 高度 + 10 像素间隔; this->ui->OrderManagerLable->setPixmap( QPixmap(":NomalOrderManager.png").scaled(110, 30, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
this->ui->OrderManagerLable->setPixmap(QPixmap(":NomalOrderManager.png"));
} }
} }
...@@ -119,13 +119,13 @@ public slots: ...@@ -119,13 +119,13 @@ public slots:
* 参数:1 [ele开关店状态] 2[MOD开关店状态] 3[MOP开关店状态] * 参数:1 [ele开关店状态] 2[MOD开关店状态] 3[MOP开关店状态]
* 返回:NULL * 返回:NULL
* */ * */
void onUpdateStoreStatus(int eleStoreStatus, int modStoreStatus,int mopStoreStatus); void onUpdateStoreStatus(int eleStoreStatus, int modStoreStatus, int mopStoreStatus, int mtStoreStatus);
/* 功能:更新多渠道门店营业状态显示; /* 功能:更新多渠道门店营业状态显示;
* 参数:1 [ele开关店状态] 2[MOD开关店状态] 3[MOP开关店状态] * 参数:1 [ele开关店状态] 2[MOD开关店状态] 3[MOP开关店状态]
* 返回:NULL * 返回:NULL
* */ * */
void RefreshStoreStatus(int eleStoreStatus=0, int modStoreStatus=0,int mopStoreStatus=0); void RefreshStoreStatus(int eleStoreStatus=0, int modStoreStatus=0, int mopStoreStatus=0, int mtStoreStatus=0);
/* 功能:新订单到POS更新悬浮框显示; /* 功能:新订单到POS更新悬浮框显示;
* 参数:1 [是否存在新订单] * 参数:1 [是否存在新订单]
......
...@@ -119,6 +119,32 @@ ...@@ -119,6 +119,32 @@
<string/> <string/>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="Mt1Lable">
<property name="geometry">
<rect>
<x>0</x>
<y>100</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="Mt2Lable">
<property name="geometry">
<rect>
<x>60</x>
<y>90</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
#define JSON_ELESTORESTS "eleStoreStatus" #define JSON_ELESTORESTS "eleStoreStatus"
#define JSON_MODSTORESTS "modStoreStatus" #define JSON_MODSTORESTS "modStoreStatus"
#define JSON_MOPSTORESTS "mopStoreStatus" #define JSON_MOPSTORESTS "mopStoreStatus"
#define JSON_MTMODSTORESTS "mtModStoreStatus"
#define JSON_SKIPRECORDPOS "skipRecord" #define JSON_SKIPRECORDPOS "skipRecord"
#define JSON_PASSWORD "password" #define JSON_PASSWORD "password"
#define JSON_IPADDRESS "iPAddress" #define JSON_IPADDRESS "iPAddress"
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
<file>ComeNewOrder.png</file> <file>ComeNewOrder.png</file>
<file>NomalOrderManager.png</file> <file>NomalOrderManager.png</file>
<file>ElemeTitle.png</file> <file>ElemeTitle.png</file>
<file>MtTitle.png</file>
<file>ModTitle.png</file> <file>ModTitle.png</file>
<file>MopTitle.png</file> <file>MopTitle.png</file>
<file>StoreOff.png</file> <file>StoreOff.png</file>
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment