Commit d44b2416 by wuyang.zou

fix support 订单入机卡单 超过 5 分钟告警;

Version: 2.2022.1.18
parent 05bdde09
......@@ -44,6 +44,7 @@ FlowControl::~FlowControl()
m_storageOrderTimer->deleteLater();
m_delayGetRefundDetailTimer->deleteLater();
m_remindCasherBlinkFloatTimer->deleteLater();
m_blockInputPosWarnningTimer->deleteLater();
loaclHttpServer->deleteLater();
}
......@@ -94,9 +95,11 @@ FlowControl::FlowControl()
m_storageOrderTimer = new QTimer(this);
m_delayGetRefundDetailTimer = new QTimer(this);
m_remindCasherBlinkFloatTimer = new QTimer(this);
m_blockInputPosWarnningTimer = new QTimer(this);
connect(m_loginTimer,&QTimer::timeout,this,&FlowControl::_ClickToLogin);
connect(m_notifySimPullTimer,&QTimer::timeout,this,&FlowControl::_ClickToNotifySimPullOrder);
connect(m_blockInputPosWarnningTimer,&QTimer::timeout,this,&FlowControl::_BlockInputPosWarnning);
connect(m_storageOrderTimer,&QTimer::timeout,this,&FlowControl::_StoragePosOrderData);
connect(m_delayGetRefundDetailTimer,&QTimer::timeout,this,&FlowControl::_ScanDelayGetRefundDetailList);
connect(m_remindCasherBlinkFloatTimer,&QTimer::timeout,this,&FlowControl::_RemindCasherBlinkFloatForm);
......@@ -324,13 +327,42 @@ void FlowControl::_ClickToNotifySimPullOrder()
{
m_notifySimPullTimer->start(1000*7);
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FM外卖插件通知 Simphony 获取订单数据--->>>>]");
// 录单防Block告警定时器开始计时( 阀值: 默认8分钟);
if ( ! m_blockInputPosWarnningTimer->isActive() ) {
m_blockInputPosWarnningTimer->start(1000 * 60 * 5);
}
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---触发按钮点击事件: Block Warnning Pending: %1--->>>>>]").arg( m_blockInputPosWarnningTimer->remainingTime() / 1000 );
//定时器触发的点击事件,不可避免;
_SmartTriggerClickPosBtn(true);
}else{
// 无待入机订单, 故无需运行此告警定时器;
if ( m_blockInputPosWarnningTimer->isActive() ) {
m_blockInputPosWarnningTimer->stop();
}
m_notifySimPullTimer->start(1000*20);
}
}
void FlowControl::_BlockInputPosWarnning() {
int blockInputSize = m_simValidOrdersList.size();
QString orderId = m_simValidOrdersList.first();
QLOG_INFO()<<QString("[<<<<---_BlockInputPosWarnning: m_simValidOrdersList size: %1 And FirstOne: %2 --->>>>>]").arg( blockInputSize ).arg( orderId );
QString orderChannel = m_FmOrdersMap.value(orderId) ? m_FmOrdersMap.value(orderId)->channel : "";
QString orderRequestType = "3";
if ( m_FmOrdersMap.value(orderId) ) {
m_FmOrdersMap.value(orderId)->orderStatus != 6 ? orderRequestType = "3" : orderRequestType = "6";
}
QString errorStorageOrderMsg = QString("BlockInputPosWarnning: StoreId: %1 Cashier: %2 BlockOrderId: %3 BlockSize: %4")
.arg(m_storeId).arg(m_cashierName).arg(orderId).arg(blockInputSize);
_AddOrUpdateReportOmsList(orderId, orderChannel, orderRequestType, "2", "", errorStorageOrderMsg, QString("1109") );
}
void FlowControl::_StoragePosOrderData() {
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---_StoragePosOrderData: m_storagePosOrdersList size: %1 And FirstOne: %2 --->>>>>]")
.arg( m_storagePosOrdersList.size() ).arg( m_storagePosOrdersList.isEmpty()? " " : m_storagePosOrdersList.first() );
......@@ -2309,6 +2341,10 @@ bool FlowControl::_ResponseSimphony04Request(const QJsonObject &content, QJsonOb
if(m_bFloatFromLockSt){
m_bFloatFromLockSt = false; //更新悬浮框的锁定状态 =false;
}
// 存在Action4说明POS有反应, 故停止 Block告警定时器;
if ( m_blockInputPosWarnningTimer->isActive() ) {
m_blockInputPosWarnningTimer->stop();
}
//为了避免压测插件时,高频的加锁悬浮框 与 高频点击POS机;所以将 及时点击POS机右下角按钮放到上次录单成功后再触发下一次录单事件;
_ClickOMSAssignArea();
return result;
......@@ -2406,11 +2442,16 @@ bool FlowControl::_ResponseSimphony05Request(const QJsonObject &content, QJsonOb
result=false;
error=QString::fromLocal8Bit("Request Action05: Pragram Error");
}
// 存在Action5说明POS有反应, 故停止 Block告警定时器;
if ( m_blockInputPosWarnningTimer->isActive() ) {
m_blockInputPosWarnningTimer->stop();
}
return result;
}
bool FlowControl::_ResponseSimphony06Request(const QJsonObject &content, QJsonObject &data, QString &error)
{
QLOG_INFO()<<__FUNCTION__;
......@@ -2462,6 +2503,11 @@ bool FlowControl::_ResponseSimphony06Request(const QJsonObject &content, QJsonOb
}
//*********** 新增一种优化case: 门店店员正在操作POS,从而阻塞插件程序录外卖订单,此时必须解锁悬浮框,从而减少Simphony队列中first出现OMS退单的请求; end ***********//
// 存在Action6说明POS有反应 && 且 不是POS存在CheckNum的情况, 故停止 Block告警定时器;
if ( m_blockInputPosWarnningTimer->isActive() ) {
m_blockInputPosWarnningTimer->stop();
}
//**************** 根据订单编号找到 非码订单Map容器中订单的详细信息; begin ****************//
OrderObject* order_p = m_FmOrdersMap.value(orderId);
if (!order_p) {
......
......@@ -143,6 +143,7 @@ private:
QTimer *m_storageOrderTimer;
QTimer *m_delayGetRefundDetailTimer;
QTimer *m_remindCasherBlinkFloatTimer; //插件程序收到外卖订单后,需要一致提醒店员[直到此外卖订单被全部录入到POS系统]
QTimer *m_blockInputPosWarnningTimer; //当有订单待入机时, 开始定时器计时, 当有录单有效动作时(不含CheckNum Open) 或 无待入机订单时 停止定时器.
// 网络通信
BillSocket *m_loginSocket;
BillSocket *m_pullOrderSocket;
......@@ -411,6 +412,7 @@ private slots:
void _ClickOMSAssignArea();
void _ClickToLogin();
void _ClickToNotifySimPullOrder();
void _BlockInputPosWarnning();
// 功能:将队列 m_storagePosOrdersList 中的订单数据 持久化存储到POS本地数据库;
void _StoragePosOrderData();
......
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