Commit ced0f218 by wuyang.zou

new feature:

1 解耦POS准备工作,先存POS本地数据库,在根据参数进行选择性入机;
2 修改 Ali-MOP 修改预约时间 插件提醒,数据同步给打印相关供应商;
3 避免重复入机
parent 192dc3ce
Pipeline #25382 failed with stage
in 0 seconds
......@@ -107,6 +107,7 @@ private:
bool m_bLastHeartIsError;
int m_orderCount;
int m_clickPosCount;
int m_skipRecordPos;
//订单清除定时器
QTimer *m_clearTimer;
QTimer *m_heartTimer;
......@@ -114,6 +115,7 @@ private:
QTimer *m_reportOMSReocrdOrderTimer;
QTimer *m_loginTimer;
QTimer *m_notifySimPullTimer;
QTimer *m_storageOrderTimer;
QTimer *m_remindCasherBlinkFloatTimer; //插件程序收到外卖订单后,需要一致提醒店员[直到此外卖订单被全部录入到POS系统]
// 网络通信
BillSocket *m_loginSocket;
......@@ -135,8 +137,14 @@ private:
LoaclHttpServer* loaclHttpServer;
QMap<QString, QMultiMap<QString, dishesObject> >m_dishesMap;
//等待存储POS数据库订单队列list [orderId]
QStringList m_storagePosOrdersList;
QMutex m_storageOrderMutex;
//等待Simphony拉取的有效订单队列list[orderId]
QStringList m_simValidOrdersList;
//订单号与pos短号映射:[可能同时存在两种状态:1:新单记录;2:退单记录;但是小票号就存一个;]
QMap<QString,QString> m_orderIdToPosCheckNoMap;
//记录当前订单操作
......@@ -375,13 +383,16 @@ private slots:
void _ClickOMSAssignArea();
void _ClickToLogin();
void _ClickToNotifySimPullOrder();
// 功能:将队列 m_storagePosOrdersList 中的订单数据 持久化存储到POS本地数据库;
void _StoragePosOrderData();
void _RemindCasherBlinkFloatForm();
void _OrderAnalysis(const QJsonObject &jsonObject);
//减轻压测插件时: 插件崩溃(STACK_OVERFLOW_Qt5Gui!std::_Mutex::_Mutex+266) + POS收银系统奔溃(POS机屏幕点击频率过高 + 总次数过高 导致崩溃)
void _SmartTriggerClickPosBtn(const bool bTimerTrigger = false);
public slots:
/* 功能:获取到新的门店信息
* 参数:[1]操作员ID[2]POS机ID
......@@ -472,6 +483,8 @@ public slots:
* */
void onDailyReport();
void onTriggerFlowContrlAlert(AlertForm::Type alterType, const QString& msg);
/* 功能:获取Http返回Json数据
* 参数:NULL
......
......@@ -180,6 +180,12 @@ int ConfigManger::GetSubStoreSkipVerify()
return m_config->value(INI_SUBSTORESKIPVERIFY).toInt();
}
int ConfigManger::GetSkipRecordPos()
{
return m_config->value(INI_SKIPRECORDPOS).toInt();
}
......
......@@ -139,7 +139,9 @@ public:
int GetLoginSslConfig();
int GetOrderSslConfig();
int GetSubStoreSkipVerify();
int GetSkipRecordPos();
private:
ConfigManger();
......
......@@ -42,13 +42,41 @@ public:
**/
bool insertOrderProduct(OrderObject* orderObj, const QString& posCheckNo);
/**
*功能:插入订单 券 商品列表到pos本地数据库中;
*参数:[1]订单对象指针 [2]小票号
*返回:true操作成功,false失败
**/
bool insertCouponProd(OrderObject* orderObj, const QString& posCheckNo);
/**
*功能:插入订单 券子商品 商品列表到pos本地数据库中;
*参数:[1] [2]
*返回:true操作成功,false失败
**/
bool insertCouponSubProd(OrderObject* orderObj, const int mainProdIndex, QList<SingleProductObject*> &couponSubProdList, const QString& posCheckNo);
/**
*功能:插入订单 正常 商品列表到pos本地数据库中;
*参数:[1]订单对象指针 [2]小票号
*返回:true操作成功,false失败
**/
bool insertNormalProd(OrderObject* orderObj, const QString& posCheckNo);
/**
*功能:插入订单 正常 子商品列表到pos本地数据库中;
*参数:[1] [2]
*返回:true操作成功,false失败
**/
bool insertNormalSubProd(OrderObject* orderObj, const int mainProdIndex, QList<dishesObject*> &subProdList, const QString& posCheckNo);
/**
*功能:更新 订单商品列表 订单状态和小票号;
*参数:[1]订单对象指针 [2]小票号
*返回:true操作成功,false失败
**/
bool updateOrderProduct(OrderObject* orderObj,const QString& posCheckNo);
bool updateOrderProductCheckNum(OrderObject* orderObj,const QString& posCheckNo);
/**
......
......@@ -10,6 +10,7 @@
#include <QObject>
#include <QMutex>
#include <Model/orderObject.h>
#include "alertForm.h"
#include "preDefine.h"
#include "windows.h"
......@@ -51,6 +52,13 @@ public:
bool alterTablePrintSumBillPosDB20();
/**
*功能:变更pos本地数据库打印小票信息表中 store_name store_address 两个字段 长度;
*参数:[无]
*返回:true: 变更成功,false: 变更失败
**/
bool alterTablePrintSumBillPosDBLength();
/**
*功能:插入一条汇总单信息到pos本地数据库中;
*参数:[1]订单号 [2]小票号
*返回:true操作成功,false失败
......@@ -117,6 +125,7 @@ private:
QSqlDatabase m_sqlDb;
signals:
void triggerFlowContrlAlert(AlertForm::Type alterType, const QString msg);
public slots:
};
......
......@@ -85,6 +85,8 @@ class OrderObject : public QObject
Q_PROPERTY (int orderIndex READ getOrderIndex WRITE setOrderIndex)
Q_PROPERTY (QString expectDate READ getExpectDate WRITE setExpectDate)
Q_PROPERTY (QString lastExpectDate READ getLastExpectDate WRITE setLastExpectDate)
Q_PROPERTY (QString reserveMakeTime READ getReserveMakeTime WRITE setReserveMakeTime)
Q_PROPERTY (int inAdvanceTakemeal READ getInAdvanceTakemeal WRITE setInAdvanceTakemeal)
Q_PROPERTY (QString subStoreId READ getSubStoreId WRITE setSubStoreId)
......@@ -186,6 +188,8 @@ public:
QString businessType; //订单业务类型: 10:预约单 20:杯贴祝福 30:拼团
QString expectDate; // 预约时间 [预约单-顾客预计取餐时间]
QString lastExpectDate; // 上一次预约时间【新增字段:string】
QString reserveMakeTime; // 预约制作时间【新增字段:string】
int inAdvanceTakemeal; // 预约单提前到店标志【新增字段:int】
QString subStoreId; // 子门店号 【新增字段:string】
......@@ -435,6 +439,9 @@ public:
inline QString getExpectDate()const{return expectDate;}
inline void setExpectDate(const QString& v){expectDate = v;}
inline QString getLastExpectDate()const{return lastExpectDate;}
inline void setLastExpectDate(const QString& v){lastExpectDate = v;}
inline QString getReserveMakeTime()const{return reserveMakeTime;}
inline void setReserveMakeTime(const QString& v){reserveMakeTime = v;}
......
......@@ -25,32 +25,99 @@ void AlertForm::SetContent(AlertForm::Type type, const QString &msg)
ui->alertBtnOk->show();
ui->alertLabOk->show();
ui->alertLabIng->hide();
ui->alertLabWarn->hide();
ui->alertLabError->hide();
break;
case MSGERROR:
ui->alertBtnOk->show();
ui->alertLabOk->hide();
ui->alertLabIng->hide();
ui->alertLabWarn->hide();
ui->alertLabError->show();
break;
case LOADING:
ui->alertBtnOk->hide();
ui->alertLabOk->hide();
ui->alertLabIng->show();
ui->alertLabWarn->hide();
ui->alertLabError->hide();
break;
case SYNCDATA:
ui->alertBtnOk->hide();
ui->alertLabOk->hide();
ui->alertLabIng->show();
ui->alertLabWarn->hide();
ui->alertLabError->hide();
m_timer->stop();
m_timer->start(20000);
break;
case WARNNING:
ui->alertBtnOk->show();
ui->alertLabOk->hide();
ui->alertLabIng->hide();
ui->alertLabWarn->show();
ui->alertLabError->hide();
break;
}
ui->alertLabMsg->setText(msg);
if(!m_timer->isActive())
m_timer->start(20000);
if ( type == WARNNING ) {
ui->alertLabMsg->hide();
QStringList mopExceptInfoList = msg.split(';');
if ( mopExceptInfoList.size() >4 ) {
ui->alertLabWarn1->setText( mopExceptInfoList[0] );
ui->alertLabWarn1->setAlignment(Qt::AlignCenter);
QFont font1 ( "Microsoft YaHei", 14, QFont::Bold);
ui->alertLabWarn1->setFont(font1);
ui->alertLabWarn1->show();
ui->alertLabWarn_space->show();
ui->alertLabWarn2->setText( mopExceptInfoList[1] );
ui->alertLabWarn2->setAlignment(Qt::AlignLeft);
QPalette palette2;
palette2.setColor(QPalette::WindowText,Qt::red);
ui->alertLabWarn2->setPalette(palette2);
ui->alertLabWarn2->show();
ui->alertLabWarn3->setText( mopExceptInfoList[2] );
ui->alertLabWarn3->setAlignment(Qt::AlignLeft);
QPalette palette3;
palette3.setColor(QPalette::WindowText,Qt::black);
ui->alertLabWarn3->setPalette(palette3);
ui->alertLabWarn3->show();
ui->alertLabWarn4->setText( mopExceptInfoList[3] );
ui->alertLabWarn4->setAlignment(Qt::AlignLeft);
ui->alertLabWarn4->setPalette(palette2);
ui->alertLabWarn4->show();
ui->alertLabWarn5->setText( mopExceptInfoList[4] );
ui->alertLabWarn5->setAlignment(Qt::AlignLeft);
ui->alertLabWarn5->setPalette(palette3);
ui->alertLabWarn5->show();
} else {
ui->alertLabMsg->setText(msg);
}
} else {
ui->alertLabWarn_space->hide();
ui->alertLabWarn1->hide();
ui->alertLabWarn2->hide();
ui->alertLabWarn3->hide();
ui->alertLabWarn4->hide();
ui->alertLabWarn5->hide();
ui->alertLabMsg->setText(msg);
}
if ( type == WARNNING ) {
m_timer->start(30000);
} else {
if(!m_timer->isActive() )
m_timer->start(20000);
}
return;
}
......
......@@ -23,7 +23,8 @@ public:
SUCCESS=0,
MSGERROR,
LOADING,
SYNCDATA
SYNCDATA,
WARNNING
}Type;
/* 功能:设置显示内容
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>295</width>
<height>273</height>
<width>340</width>
<height>320</height>
</rect>
</property>
<property name="windowTitle">
......@@ -31,7 +31,7 @@
</property>
<item row="0" column="0">
<widget class="QWidget" name="alertWdg" native="true">
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,1,0">
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0">
<property name="spacing">
<number>5</number>
</property>
......@@ -100,20 +100,85 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="alertLabWarn">
<property name="minimumSize">
<size>
<width>68</width>
<height>68</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>68</width>
<height>68</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="alertLabMsg">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="alertLabMsg">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="alertLabWarn1">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="alertLabWarn_space">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="alertLabWarn2">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="alertLabWarn3">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="alertLabWarn4">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="alertLabWarn5">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
......@@ -135,7 +200,7 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>确 </string>
<string>确 </string>
</property>
</widget>
</item>
......
......@@ -336,7 +336,8 @@ void DetailForm::onOperaBtnClicked()
if(m_refuseForm->exec()==QDialog::Accepted)
{
QLOG_INFO() << QString("[<<<<---DetailForm::onOperaBtnClicked: m_refuseForm->exec()==QDialog::Accepted--->>>>]");
QLOG_INFO() << QString("[<<<<---DetailForm::onOperaBtnClicked: --->>>>]")<<m_refuseForm->m_reasonCode<<m_refuseForm->m_reasonStr<<m_refuseForm->m_refundDishesListString;
QLOG_INFO() << QString("[<<<<---DetailForm::onOperaBtnClicked: --->>>>]")<< m_refuseForm->m_reasonCode
<< m_refuseForm->m_reasonStr << m_refuseForm->m_refundDishesListString;
emit processRepealOrder( pBtn->property("orderId").toString(),m_refuseForm->m_reasonCode,m_refuseForm->m_reasonStr,m_refuseForm->m_refundDishesListString);
hide(); //为了友好用户的使用体验感,hide() 还是需要在接受完取消订单原因后,再隐藏;
}
......
......@@ -214,6 +214,11 @@ void FloatForm::onShow()
m_raiseTimer.start();
}
void FloatForm::onHide()
{
hide();
m_raiseTimer.start();
}
void FloatForm::onLockFloatForm(){
QLOG_INFO()<<QString("[<<<----FloatForm::onLockFloatForm : Lock Float Form --->>>>]");
......
......@@ -97,6 +97,12 @@ public slots:
* */
void onShow();
/* 功能:显示窗口
* 参数:NULL
* 返回:NULL
* */
void onHide();
/* 功能:锁住窗口:enable(false);
* 参数:NULL
* 返回:NULL
......
......@@ -7,8 +7,8 @@ IDI_ICON ICON DISCARDABLE "logo.ico"
#endif
VS_VERSION_INFO VERSIONINFO
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
FILEVERSION 2,2020,8,10
PRODUCTVERSION 2,2020,8,10
FILEVERSION 2,2020,9,28
PRODUCTVERSION 2,2020,9,28
//*************************************************************************//
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
......@@ -31,8 +31,8 @@ VS_VERSION_INFO VERSIONINFO
VALUE "OriginalFilename", "fmTakeout.exe"
VALUE "ProductName", "Delivery Order Plugin"
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
VALUE "ProductVersion", "2.2020.8.10"
VALUE "FileVersion", "2.2020.8.10"
VALUE "ProductVersion", "2.2020.9.28"
VALUE "FileVersion", "2.2020.9.28"
//*************************************************************************//
END
END
......
......@@ -104,6 +104,7 @@ int main(int argc, char *argv[])
FloatForm f;
MainForm w;
QObject::connect(&w, &MainForm::showFloatForm, &f, &FloatForm::onShow);
QObject::connect(&w, &MainForm::hideFloatForm, &f, &FloatForm::onHide);
QObject::connect(&FlowControl::GetInstance(), &FlowControl::startRemind, &f, &FloatForm::onStartRemind);
QObject::connect(&FlowControl::GetInstance(), &FlowControl::doHideMainShowFloatFrom, &w, &MainForm::on_mainBtnHide_clicked);
......
......@@ -353,6 +353,11 @@ void MainForm::onShowAlert(AlertForm::Type type, const QString &msg)
{
m_alertForm->SetContent(type, msg);
m_alertForm->show();
}else if( AlertForm::WARNNING ==type ) {
emit hideFloatForm();
this->show();
m_alertForm->SetContent(type, msg);
m_alertForm->show();
}
}
......
......@@ -102,6 +102,12 @@ signals:
* */
void showFloatForm();
/* 功能:通知悬浮窗隐藏
* 参数:NULL
* 返回:NULL
* */
void hideFloatForm();
/* 功能:通知悬浮窗开始提示
* 参数:[1]提示类型 0新订单1退款申请
* 返回:NULL
......
......@@ -28,7 +28,8 @@
//#define APP_VERSION "2.2020.312.1"
//#define APP_VERSION "2.2020.5.26"
//#define APP_VERSION "2.2020.6.29"
#define APP_VERSION "2.2020.8.10"
//#define APP_VERSION "2.2020.8.10"
#define APP_VERSION "2.2020.9.28"
//修正版本号时,切记修正 FmTakeout.rc 中的版本号
......@@ -65,6 +66,8 @@
#define INI_POSNO "Software/posno"
#define INI_SUBSTOREID "Software/substoreid"
#define INI_SUBSTORESKIPVERIFY "Software/substoreSkipVerify"
#define INI_SKIPRECORDPOS "Software/skipRecordPos"
#define INI_PASSWORD "Software/password"
#define INI_AUTOCONFIRM "Software/autoconfirm"
#define INI_PARTNERID "Software/partnerid"
......@@ -80,6 +83,7 @@
#define JSON_ELESTORESTS "eleStoreStatus"
#define JSON_MODSTORESTS "modStoreStatus"
#define JSON_MOPSTORESTS "mopStoreStatus"
#define JSON_SKIPRECORDPOS "skipRecord"
#define JSON_PASSWORD "password"
#define JSON_IPADDRESS "iPAddress"
#define JSON_MACHINECODE "machineCode"
......
......@@ -12,10 +12,7 @@ RefuseForm::RefuseForm(QWidget *parent) :
setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint);
this->setModal(true);
ui->refuseBtnOk->setEnabled(false);
m_refDishesForm = new refDishesForm(this);
ui->reasonNULL->hide();
}
RefuseForm::~RefuseForm()
......@@ -114,11 +111,21 @@ void RefuseForm::on_reason5_toggled(bool checked)
}
}
void RefuseForm::on_reason6_toggled(bool checked)
{
if(checked)
{
ui->refuseBtnOk->setEnabled(true);
m_reasonStr=QString::fromLocal8Bit("留言无法打印");
m_reasonCode=17;
}
}
void RefuseForm::_Init()
{
qDebug() << __FUNCTION__;
m_refundDishesList.clear();
m_refundDishesListString.clear();
ui->reasonNULL->toggle();
ui->reason_empty->toggle();
ui->refuseBtnOk->setEnabled(false);
}
......@@ -51,6 +51,8 @@ private slots:
void on_reason5_toggled(bool checked);
void on_reason6_toggled(bool checked);
private:
Ui::RefuseForm *ui;
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>250</width>
<height>340</height>
<width>291</width>
<height>437</height>
</rect>
</property>
<property name="windowTitle">
......@@ -174,7 +174,7 @@
</widget>
</item>
<item>
<widget class="QRadioButton" name="reasonNULL">
<widget class="QRadioButton" name="reason6">
<property name="minimumSize">
<size>
<width>0</width>
......@@ -188,7 +188,26 @@
</font>
</property>
<property name="text">
<string>NULL</string>
<string>留言无法打印</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="reason_empty">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
......
......@@ -7,6 +7,7 @@
<file>fm.png</file>
<file>pickBtn_select.png</file>
<file>error.png</file>
<file>warn.png</file>
<file>ok.png</file>
<file>loading.gif</file>
<file>alert_bg.png</file>
......
......@@ -541,6 +541,10 @@ QTabBar QToolButton::left-arrow:disabled {
{
border-image: url(:ok.png);
}
#alertLabWarn
{
border-image: url(:warn.png);
}
#alertLabMsg
{
color: rgb(129, 129, 129);
......
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