Commit 20fcae70 by wuyang.zou

New Branch: Add Baffle For YaCe By ZWY

Version: 2.2022.9.8
parent 5eaa8db0
...@@ -205,7 +205,7 @@ void FlowControl::_GetIpAddress() ...@@ -205,7 +205,7 @@ void FlowControl::_GetIpAddress()
} }
void FlowControl::_AddOrderPull(const QString& orderId, const QString& channel, const QString& callBackUrl, const bool& skipPrint, const int& pageNumber, const int& pageSize) void FlowControl::_AddOrderPull(const QString& orderId, const QString& channel, const QString& callBackUrl, const bool& skipPrint, const int& pageNumber, const int& pageSize, const int& status)
{ {
bool btryLock = m_PullOrderDataMutex.tryLock(VALUE_TRYLOCKNETTIMEOUT); bool btryLock = m_PullOrderDataMutex.tryLock(VALUE_TRYLOCKNETTIMEOUT);
if ( btryLock ) { if ( btryLock ) {
...@@ -217,6 +217,7 @@ void FlowControl::_AddOrderPull(const QString& orderId, const QString& channel, ...@@ -217,6 +217,7 @@ void FlowControl::_AddOrderPull(const QString& orderId, const QString& channel,
orderPull->pageSize=pageSize; orderPull->pageSize=pageSize;
orderPull->callBackUrl=callBackUrl; orderPull->callBackUrl=callBackUrl;
orderPull->skipPrint=skipPrint; orderPull->skipPrint=skipPrint;
orderPull->status = status;
orderPull->pullErrorCount = 0; orderPull->pullErrorCount = 0;
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FlowControl::_AddOrderPull orderId: %1 , callBackUrl: %2 , skipPrint: %3 --->>>>]").arg(orderId).arg(callBackUrl).arg( skipPrint ? 1 : 0 ); QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FlowControl::_AddOrderPull orderId: %1 , callBackUrl: %2 , skipPrint: %3 --->>>>]").arg(orderId).arg(callBackUrl).arg( skipPrint ? 1 : 0 );
m_orderPullList.append(orderPull); m_orderPullList.append(orderPull);
...@@ -227,7 +228,7 @@ void FlowControl::_AddOrderPull(const QString& orderId, const QString& channel, ...@@ -227,7 +228,7 @@ void FlowControl::_AddOrderPull(const QString& orderId, const QString& channel,
} }
bool FlowControl::_TryAddOrderPull(const QString& orderId, const QString& channel, const QString& callBackUrl, const bool& skipPrint, const int& pageNumber, const int& pageSize) bool FlowControl::_TryAddOrderPull(const QString& orderId, const QString& channel, const QString& callBackUrl, const bool& skipPrint, const int& pageNumber, const int& pageSize, const int& status)
{ {
bool btryLock = m_PullOrderDataMutex.tryLock(VALUE_TRYLOCKNETTIMEOUT); bool btryLock = m_PullOrderDataMutex.tryLock(VALUE_TRYLOCKNETTIMEOUT);
if (btryLock) { if (btryLock) {
...@@ -265,6 +266,7 @@ bool FlowControl::_TryAddOrderPull(const QString& orderId, const QString& channe ...@@ -265,6 +266,7 @@ bool FlowControl::_TryAddOrderPull(const QString& orderId, const QString& channe
orderPull->pageSize=pageSize; orderPull->pageSize=pageSize;
orderPull->pullErrorCount = 0; orderPull->pullErrorCount = 0;
orderPull->skipPrint = skipPrint; orderPull->skipPrint = skipPrint;
orderPull->status = status;
m_orderPullList.append(orderPull); m_orderPullList.append(orderPull);
m_PullOrderDataMutex.unlock(); m_PullOrderDataMutex.unlock();
...@@ -1340,10 +1342,7 @@ void FlowControl::_PullOrderData() ...@@ -1340,10 +1342,7 @@ void FlowControl::_PullOrderData()
if(m_orderPullList.isEmpty()) if(m_orderPullList.isEmpty())
return; return;
emit hideAlert();
QLOG_INFO()<<QString("[<<<<----_PullOrderData ListSize=%1, FirstOne: %2 ---->>>>>]").arg( m_orderPullList.size() ).arg( m_orderPullList.size()?m_orderPullList.first()->orderId:"" ); QLOG_INFO()<<QString("[<<<<----_PullOrderData ListSize=%1, FirstOne: %2 ---->>>>>]").arg( m_orderPullList.size() ).arg( m_orderPullList.size()?m_orderPullList.first()->orderId:"" );
bool btryLock = m_PullOrderDataMutex.tryLock(VALUE_TRYLOCKNETTIMEOUT); bool btryLock = m_PullOrderDataMutex.tryLock(VALUE_TRYLOCKNETTIMEOUT);
if (!btryLock) { if (!btryLock) {
QLOG_ERROR()<<"[<<<<----_PullOrderData Try Lock Failed ---->>>>>]"; QLOG_ERROR()<<"[<<<<----_PullOrderData Try Lock Failed ---->>>>>]";
...@@ -1351,6 +1350,20 @@ void FlowControl::_PullOrderData() ...@@ -1351,6 +1350,20 @@ void FlowControl::_PullOrderData()
} }
PullOrderInfo* info = m_orderPullList.takeFirst(); PullOrderInfo* info = m_orderPullList.takeFirst();
// 上游压测时新增挡板功能-> 直接跳过存储和入机,添加入机汇报队列中结束;
if ( ConfigManger::GetInstance().GetOpenBaffle() ){
if ( info->orderId.isEmpty() ) {
QLOG_INFO() << QString("[<<<<---_PullOrderData Open Baffle True, Skip Input Pos && StorageDb, Direct Report OMS--->>>>]");
} else {
QString reqType = info->status == 6 ? 6 : 3;
_AddOrUpdateReportOmsList(info->orderId, info->channel, reqType, "1", "", "Mock 入机成功", QString(""), info->callBackUrl );
}
m_orderPullList.removeOne(info);
m_PullOrderDataMutex.unlock();
return;
}
if ( info->pullErrorCount > 2 ) { if ( info->pullErrorCount > 2 ) {
QLOG_INFO()<<QString( "[<<<<----_PullOrderData orderId:%1,Channel:%2,PullErrorCount:%3, CallBackUrl:%4, Pull Faild More Than 3 Times, Abandon This Item ---->>>>>]" ) QLOG_INFO()<<QString( "[<<<<----_PullOrderData orderId:%1,Channel:%2,PullErrorCount:%3, CallBackUrl:%4, Pull Faild More Than 3 Times, Abandon This Item ---->>>>>]" )
.arg(info->orderId).arg(info->channel).arg(info->pullErrorCount).arg(info->callBackUrl); .arg(info->orderId).arg(info->channel).arg(info->pullErrorCount).arg(info->callBackUrl);
...@@ -1879,6 +1892,11 @@ void FlowControl::_ReportOMSRecordOrderInfo() ...@@ -1879,6 +1892,11 @@ void FlowControl::_ReportOMSRecordOrderInfo()
callBackUrl = m_FmOrdersMap.value( RepOMSRecOrderIn->orderNo )->callBackUrl; callBackUrl = m_FmOrdersMap.value( RepOMSRecOrderIn->orderNo )->callBackUrl;
} }
// 上游压测时新增挡板功能-> 直接跳过入机落库功能,使用正确 callbackUrl 汇报入机;
if ( ConfigManger::GetInstance().GetOpenBaffle() ) {
callBackUrl = RepOMSRecOrderIn->callbackUrl;
}
if ( callBackUrl.length() ) { if ( callBackUrl.length() ) {
url = callBackUrl + "/pos/" + ConfigManger::GetInstance().GetInterfaceName(INI_INTERFACE_REPORTOMSRECORDORDER); url = callBackUrl + "/pos/" + ConfigManger::GetInstance().GetInterfaceName(INI_INTERFACE_REPORTOMSRECORDORDER);
} else { } else {
...@@ -1959,7 +1977,7 @@ void FlowControl::_PresistOrderInputPosSuccessRecord() { ...@@ -1959,7 +1977,7 @@ void FlowControl::_PresistOrderInputPosSuccessRecord() {
void FlowControl::_AddOrUpdateReportOmsList(const QString &orderId, const QString &channel, const QString &repType, const QString &status, const QString &chkNum, void FlowControl::_AddOrUpdateReportOmsList(const QString &orderId, const QString &channel, const QString &repType, const QString &status, const QString &chkNum,
const QString &error, const QString &errorCode) { const QString &error, const QString &errorCode, const QString& callbackUrl) {
bool repReportLockRet = m_RepOMSRecordOrderMutex.tryLock(VALUE_TRYLOCKNETTIMEOUT); bool repReportLockRet = m_RepOMSRecordOrderMutex.tryLock(VALUE_TRYLOCKNETTIMEOUT);
if (repReportLockRet) { if (repReportLockRet) {
...@@ -2002,6 +2020,7 @@ void FlowControl::_AddOrUpdateReportOmsList(const QString &orderId, const QStri ...@@ -2002,6 +2020,7 @@ void FlowControl::_AddOrUpdateReportOmsList(const QString &orderId, const QStri
repOMSRecordOrder->failCode = errorCode; repOMSRecordOrder->failCode = errorCode;
repOMSRecordOrder->checkNo = chkNum; repOMSRecordOrder->checkNo = chkNum;
repOMSRecordOrder->posPluginVersion = APP_VERSION; repOMSRecordOrder->posPluginVersion = APP_VERSION;
repOMSRecordOrder->callbackUrl = callbackUrl;
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FlowControl::_AddOrUpdateReportOmsList:m_orderRecordRepOMSList.append() orderId:%1 error:%2--->>>>]").arg(orderId).arg(error); QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FlowControl::_AddOrUpdateReportOmsList:m_orderRecordRepOMSList.append() orderId:%1 error:%2--->>>>]").arg(orderId).arg(error);
m_orderRecordRepOMSList.append(repOMSRecordOrder); m_orderRecordRepOMSList.append(repOMSRecordOrder);
m_RepOMSRecordOrderMutex.unlock(); m_RepOMSRecordOrderMutex.unlock();
...@@ -2881,6 +2900,7 @@ bool FlowControl::_ResponseOMS11Request(const QJsonObject &content, QJsonObject ...@@ -2881,6 +2900,7 @@ bool FlowControl::_ResponseOMS11Request(const QJsonObject &content, QJsonObject
delayOrderPull_p->channel=omsPushOrderChannel; delayOrderPull_p->channel=omsPushOrderChannel;
delayOrderPull_p->callBackUrl = omsCallBackUrl; delayOrderPull_p->callBackUrl = omsCallBackUrl;
delayOrderPull_p->skipPrint = omsSkipPrint; delayOrderPull_p->skipPrint = omsSkipPrint;
delayOrderPull_p->status = omsPushOrderStatus;
m_delayGetRefundDetailList.append(delayOrderPull_p); m_delayGetRefundDetailList.append(delayOrderPull_p);
QLOG_INFO()<<QString("[<<<<---_ResponseOMS11Request: orderId: %1 Append Success, m_delayGetRefundDetailList size: %2 And FirstOne: %3 --->>>>>]") QLOG_INFO()<<QString("[<<<<---_ResponseOMS11Request: orderId: %1 Append Success, m_delayGetRefundDetailList size: %2 And FirstOne: %3 --->>>>>]")
.arg( omsPushOrderId ).arg( m_delayGetRefundDetailList.size() ).arg( m_delayGetRefundDetailList.isEmpty()? " " : m_delayGetRefundDetailList.first()->orderId ); .arg( omsPushOrderId ).arg( m_delayGetRefundDetailList.size() ).arg( m_delayGetRefundDetailList.isEmpty()? " " : m_delayGetRefundDetailList.first()->orderId );
...@@ -2889,7 +2909,7 @@ bool FlowControl::_ResponseOMS11Request(const QJsonObject &content, QJsonObject ...@@ -2889,7 +2909,7 @@ bool FlowControl::_ResponseOMS11Request(const QJsonObject &content, QJsonObject
} else { } else {
// 接受到非码oms插过来的订单,进行向队列中进行添加; // 接受到非码oms插过来的订单,进行向队列中进行添加;
// Case3: 添加前 筛选是否已经存在待拉取的状态; // Case3: 添加前 筛选是否已经存在待拉取的状态;
result = _TryAddOrderPull( omsPushOrderId, omsPushOrderChannel, omsCallBackUrl, omsSkipPrint ); result = _TryAddOrderPull( omsPushOrderId, omsPushOrderChannel, omsCallBackUrl, omsSkipPrint, omsPushOrderStatus );
} }
} }
......
...@@ -71,6 +71,7 @@ private: ...@@ -71,6 +71,7 @@ private:
int pullErrorCount; int pullErrorCount;
QString callBackUrl; QString callBackUrl;
bool skipPrint; bool skipPrint;
int status;
} PullOrderInfo; } PullOrderInfo;
...@@ -81,6 +82,7 @@ private: ...@@ -81,6 +82,7 @@ private:
QString orderId; QString orderId;
QString callBackUrl; QString callBackUrl;
bool skipPrint; bool skipPrint;
int status;
} DelayPullOrderInfo; } DelayPullOrderInfo;
...@@ -118,6 +120,7 @@ private: ...@@ -118,6 +120,7 @@ private:
QString failCode; // 入机/存储 错误码 (成功时都给 ""); QString failCode; // 入机/存储 错误码 (成功时都给 "");
QString posPluginVersion; //该订单入机后, 汇报给OMS对应程序的版本号; QString posPluginVersion; //该订单入机后, 汇报给OMS对应程序的版本号;
int reqResult; //向OMS请求汇报结果; int reqResult; //向OMS请求汇报结果;
QString callbackUrl; //汇报callbackUrl
} RepOMSRecordOrderInfo; } RepOMSRecordOrderInfo;
...@@ -447,9 +450,9 @@ private slots: ...@@ -447,9 +450,9 @@ private slots:
QString _Penny2Dollar(int penny); QString _Penny2Dollar(int penny);
void _GetIpAddress(); void _GetIpAddress();
void _AddOrderPull ( const QString& orderId=0, const QString& channel=0, const QString& callBackUrl="", const bool& skipPrint=false, const int& pageNumber=1, const int& pageSize=30 ); void _AddOrderPull ( const QString& orderId=0, const QString& channel=0, const QString& callBackUrl="", const bool& skipPrint=false, const int& pageNumber=1, const int& pageSize=30, const int &status=0);
// 避免获取较多历史订单的同时,OMS又有推单过来,导致死锁; // 避免获取较多历史订单的同时,OMS又有推单过来,导致死锁;
bool _TryAddOrderPull ( const QString& orderId=0, const QString& channel=0, const QString& callBackUrl="", const bool& skipPrint=false, const int& pageNumber=1, const int& pageSize=30); bool _TryAddOrderPull ( const QString& orderId=0, const QString& channel=0, const QString& callBackUrl="", const bool& skipPrint=false, const int& pageNumber=1, const int& pageSize=30, const int &status=0);
//点击屏幕指定区域 //点击屏幕指定区域
void _ClickOMSAssignArea(); void _ClickOMSAssignArea();
...@@ -500,7 +503,7 @@ public slots: ...@@ -500,7 +503,7 @@ public slots:
* 参数:NULL * 参数:NULL
* 返回:NULL * 返回:NULL
* */ * */
void _AddOrUpdateReportOmsList( const QString& orderId, const QString& channel, const QString& repType, const QString& status, const QString& chkNum, const QString& error, const QString& errorCode ); void _AddOrUpdateReportOmsList( const QString& orderId, const QString& channel, const QString& repType, const QString& status, const QString& chkNum, const QString& error, const QString& errorCode, const QString& callbackUrl = "" );
/* 功能: 订单入机成功本地持久化队列, 添加新项; /* 功能: 订单入机成功本地持久化队列, 添加新项;
* 参数: 同上 * 参数: 同上
......
...@@ -129,6 +129,11 @@ bool ConfigManger::GetOpenTcpChannel() ...@@ -129,6 +129,11 @@ bool ConfigManger::GetOpenTcpChannel()
return m_config->value(INI_OPEN_TCP_CHANNEL, false).toBool(); return m_config->value(INI_OPEN_TCP_CHANNEL, false).toBool();
} }
bool ConfigManger::GetOpenBaffle()
{
return m_config->value(INI_OPEN_BAFFLE, false).toBool();
}
QString ConfigManger::GetPartnerId() QString ConfigManger::GetPartnerId()
{ {
return m_config->value(INI_PARTNERID).toString(); return m_config->value(INI_PARTNERID).toString();
......
...@@ -116,6 +116,12 @@ public: ...@@ -116,6 +116,12 @@ public:
* */ * */
bool GetOpenTcpChannel(); bool GetOpenTcpChannel();
/* 功能:获取 开通 挡板 Config
* 参数:NULL
* 返回: true: 开通; false:关闭;
* */
bool GetOpenBaffle();
/* 功能:获取商户号 /* 功能:获取商户号
* 参数:NULL * 参数:NULL
* 返回:前缀 * 返回:前缀
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
//#define APP_VERSION "2.2021.12.20" //#define APP_VERSION "2.2021.12.20"
//#define APP_VERSION "2.2022.1.18" //#define APP_VERSION "2.2022.1.18"
//#define APP_VERSION "2.2022.8.1" //#define APP_VERSION "2.2022.8.1"
#define APP_VERSION "2.2022.8.18" #define APP_VERSION "2.2022.9.8"
//修正版本号时,切记修正 FmTakeout.rc 中的版本号 //修正版本号时,切记修正 FmTakeout.rc 中的版本号
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
#define INI_SUBSTORESKIPVERIFY "Software/substoreSkipVerify" #define INI_SUBSTORESKIPVERIFY "Software/substoreSkipVerify"
#define INI_HURRYPRINTSUM "Software/hurryPrintSum" #define INI_HURRYPRINTSUM "Software/hurryPrintSum"
#define INI_NOHURRYRECORDPOS "Software/noHurryRecordPos" #define INI_NOHURRYRECORDPOS "Software/noHurryRecordPos"
#define INI_OPEN_BAFFLE "Software/openBaffle"
#define INI_OPEN_TCP_CHANNEL "Software/openTcpChannel" #define INI_OPEN_TCP_CHANNEL "Software/openTcpChannel"
#define INI_POSKEYEXISTVERIFY "Software/poskeyExistVerify" #define INI_POSKEYEXISTVERIFY "Software/poskeyExistVerify"
......
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