Commit 77f0ed83 by yunpeng.song

增加可配置partnerId,修复重复new 拒单界面的bug,修改音频文件 的路径

parent 59a0e60e
......@@ -30,6 +30,8 @@ FlowControl::FlowControl()
QString m_dbserverIp=ConfigManger::GetInstance().GetDbServerIp();
int m_dbserverPort=ConfigManger::GetInstance().GetDbServerPort();
autoconfirm=ConfigManger::GetInstance().GetAutoconfirm();
m_partnerId=ConfigManger::GetInstance().GetPartnerId();
m_password=ConfigManger::GetInstance().GetPassword();
FmPlugin::GetInstance().SetRemoteInfo(m_dbserverIp,m_dbserverPort);
QLOG_INFO() << QString("DBserverIp is %1,port is %2").arg(m_dbserverIp).arg(QString::number(m_dbserverPort));
}
......@@ -61,11 +63,11 @@ void FlowControl::onGetNewStoreInfo(const QString &operator_id, const QString &p
m_procOrderSocket = new BillSocket(this);
_Login();
}else
}/*else
{
emit setStoreInfo(m_storeId);
emit setCashierInfo(m_cashierId);
}
}*/
}
bool FlowControl::_Login()
......@@ -75,7 +77,7 @@ bool FlowControl::_Login()
QJsonObject sendJson;
QJsonObject recvJson;
sendJson = DataManger::GetInstance().GetLoginData(m_storeId, SERVER_PASSWORD, m_posId, m_cashierId);
sendJson = DataManger::GetInstance().GetLoginData(m_storeId, m_partnerId,m_password, m_posId, m_cashierId);
emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在登录......"));
QLOG_INFO() << QString("[---login---][requestData:%1]").arg(_GetJsonStr(sendJson));
result = m_loginSocket->Request(sendJson, recvJson, error);
......@@ -626,7 +628,6 @@ void FlowControl::onProcessRejectOrder(const QString &orderId, const int &reason
void FlowControl::stopFlow()
{
qDebug()<<"flowthread stop";
m_available=false;
if(m_loginSocket)
{
......@@ -643,7 +644,6 @@ void FlowControl::stopFlow()
m_procOrderSocket->deleteLater();
m_procOrderSocket=NULL;
}
}
......@@ -30,6 +30,7 @@ private:
int autoconfirm;
QString m_storeId;
QString m_password;
QString m_partnerId;
QString m_posId;
QString m_cashierId;
QDateTime m_bDate;
......
......@@ -14,8 +14,7 @@ void ConfigManger::GetStoreInfo(QString &storeId, QString &posNo,QString &cashie
storeId=_settings->GetValue(INI_STOREID).toString();
posNo=_settings->GetValue(INI_POSNO).toString();
cashierId="001";
//password=_settings->GetValue(INI_PASSWORD).toString();
password=SERVER_PASSWORD;
password=_settings->GetValue(INI_PASSWORD).toString();
}
ConfigManger &ConfigManger::GetInstance()
......@@ -69,5 +68,15 @@ int ConfigManger::GetAutoconfirm()
return _settings->GetValue(INI_AUTOCONFIRM).toInt();
}
QString ConfigManger::GetPassword()
{
return _settings->GetValue(INI_PASSWORD).toString();
}
QString ConfigManger::GetPartnerId()
{
return _settings->GetValue(INI_PARTNERID).toString();
}
......@@ -69,6 +69,8 @@ public:
* */
int GetDbServerPort();
int GetAutoconfirm();
QString GetPassword();
QString GetPartnerId();
private:
ConfigManger(){}
......
......@@ -26,7 +26,7 @@ QJsonObject DataManger::GetLoginData(const QString &storeId, const QString &pass
{
QJsonObject rObj, cObj;
rObj.insert(JSON_REQTYPE, LOGIN);
cObj.insert(JSON_USERNAME, storeId);
cObj.insert(JSON_USERNAME, QString("%1%2").arg(partnerId).arg(storeId));
cObj.insert(JSON_PASSWORD, password);
rObj.insert(JSON_CURRENTUSER, cObj);
rObj.insert(JSON_STATIONID, stationId);
......
......@@ -15,7 +15,7 @@ DetailForm::DetailForm(QWidget *parent) :
ui->setupUi(this);
connect(this, &DetailForm::processOrder, &FlowControl::GetInstance(), &FlowControl::onProcessOrder);
connect(this, &DetailForm::processRejectOrder, &FlowControl::GetInstance(), &FlowControl::onProcessRejectOrder);
m_rejectForm=NULL;
_Init();
}
......
......@@ -140,12 +140,12 @@ void FloatForm::onStartRemind(int type)
switch(type)
{
case 0:
m_remindWav = QString("%1/wav/msg.wav").arg(QApplication::applicationDirPath());
m_remindWav = QString("%1/wav/msg.wav").arg(QApplication::applicationDirPath().replace("bins","rcc"));
// 加上音频的时长
m_wavPlayInterval = ConfigManger::GetInstance().GetSoundInterval() + VALUE_NEWORDERTIME;
break;
case 1:
m_remindWav = QString("%1/wav/msg1.wav").arg(QApplication::applicationDirPath());
m_remindWav = QString("%1/wav/msg1.wav").arg(QApplication::applicationDirPath().replace("bins","rcc"));
m_wavPlayInterval = ConfigManger::GetInstance().GetSoundInterval() + VALUE_REFUNDORDERTIME;
break;
}
......
......@@ -37,7 +37,6 @@ void FMPInitTask::LoadTheme(const QString &theme)
{
QString rccPath = QString("%1/skin/%2.rcc").arg(g_appDir.replace("bins","rcc")).arg(theme);
qDebug()<<rccPath;
if(!QFile(rccPath).exists())
{
return;
......@@ -62,9 +61,8 @@ void FMPInitTask::Init()
// 将控制器移到工作线程
// 将门店信息获取控制器移到工作线程
//SInfoControl::GetInstance().SetListenPort(ConfigManger::GetInstance().GetTcpServerPort());
sInfoThread.start();
SInfoControl::GetInstance().moveToThread(&sInfoThread);
sInfoThread.start();
connect(&sInfoThread, &QThread::started, &SInfoControl::GetInstance(), &SInfoControl::run,Qt::QueuedConnection);
connect(this, &FMPInitTask::stopThread, &SInfoControl::GetInstance(), &SInfoControl::stopSinfo,Qt::DirectConnection);
connect(&SInfoControl::GetInstance(), &SInfoControl::getNewStoreInfo,
......@@ -101,7 +99,6 @@ void FMPInitTask::terminateThread()
emit stopThread();
sInfoThread.wait(10000);
sInfoThread.quit();
//workThread.wait(10000);
workThread.quit();
entryThread.quit();
}
......
......@@ -24,6 +24,7 @@
#define INI_POSNO "Takeout/PosNo"
#define INI_PASSWORD "Takeout/Password"
#define INI_AUTOCONFIRM "Takeout/AutoConfirm"
#define INI_PARTNERID "Takeout/PartnerId"
#define JSON_REQTYPE "reqtype"
#define JSON_CURRENTUSER "current_user"
......
......@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 3
#define VER_BUILD 4
//! Convert version numbers to string
#define _STR(S) #S
......
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