Commit 52084c97 by wuyang.zou

PCS插件

<1> PCS插件 拉取订单数据无效,重试 3次
<2> PCS插件 订单号后五位进行换行展示;
<2> PCS插件 针对权益单进行跳过存储;

Version: 4.2023.2.23
parent f40d6891
......@@ -53,6 +53,8 @@ FlowControl::FlowControl()
m_eleStoreStatus = UNKNOWNSTORE;
m_mopStoreStatus = UNKNOWNSTORE;
m_modStoreStatus = UNKNOWNSTORE;
m_mtModStoreStatus = UNKNOWNSTORE;
m_existNoAckNotice = 0;
//初始化上次心跳状态是否异常(false:代表心跳正常 | true:代表心跳异常);
m_bLastHeartIsError = false;
......@@ -163,6 +165,7 @@ void FlowControl::_TestInsertOrderData(){
bool FlowControl::_AppendOrderInfo2Redis(const OrderObject* orderObject) {
QLOG_INFO() << QString("[<<<<---FlowControl:: _AppendOrderInfo2Redis() orderId:%1 Begin --->>>>]").arg(orderObject->id);
return QtRedisClient::getInstance().pushOrder2Redis(orderObject);
}
......@@ -210,6 +213,8 @@ void FlowControl::_AddOrderPull(const QString &orderId, const QString &channel,
orderPull->pageNumber=pageNumber;
orderPull->pageSize=pageSize;
orderPull->callBackUrl=callBackUrl;
orderPull->skipPrint = false;
orderPull->pushOptions = QJsonObject();
orderPull->pullErrorCount = 0;
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FlowControl::_AddOrderPull orderId: %1 , callBackUrl: %2--->>>>]").arg(orderId).arg(callBackUrl);
m_orderPullList.append(orderPull);
......@@ -257,6 +262,8 @@ bool FlowControl::_TryAddOrderPull(const QString &orderId, const QString &channe
orderPull->pageNumber=pageNumber;
orderPull->pageSize=pageSize;
orderPull->pullErrorCount = 0;
orderPull->skipPrint = false;
orderPull->pushOptions = QJsonObject();
m_orderPullList.append(orderPull);
m_PullOrderDataMutex.unlock();
......@@ -343,10 +350,9 @@ void FlowControl::_NotifyPmsPullOrder()
QLOG_INFO()<<QString("[<<<<---FlowControl::_NotifyPmsPullOrder Insert Mysql DB Order:%1 bExistOrder:%2 insertRet:%3 updateRet:%4--->>>>]")
.arg(orderObject->id).arg(bExistOrder?1:0).arg(insertRet?1:0).arg(updateRet?1:0);
//如果订单 插入/更新 数据库成功后,向Redis中添加此订单信息;
if(insertRet || updateRet) {
if ( insertRet || updateRet ) {
for (int i=0;i<3;i++) {
if( _AppendOrderInfo2Redis(orderObject) ) {
if ( _AppendOrderInfo2Redis(orderObject) ) {
if (i) {
QLOG_INFO()<<QString("[<<<<---FlowControl::_NotifyPmsPullOrder _AppendOrderInfo2Redis Success Try times:%1--->>>>]").arg(i);
}
......@@ -358,19 +364,18 @@ void FlowControl::_NotifyPmsPullOrder()
break;
} else {
QLOG_ERROR()<<QString("[<<<<---FlowControl::_NotifyPmsPullOrder _AppendOrderInfo2Redis Failed, Try Again--->>>>]");
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FlowControl::_NotifyPmsPullOrder() Begin initQtRedisClient()--->>>>]");
m_initPmsRedisRet = QtRedisClient::getInstance().initQtRedisClient();
continue;
}
}
//如果订单插入/更新 数据库失败后;向服务端汇报订单落库情况;
} else {
QLOG_ERROR()<<QString("[<<<<---FlowControl::_NotifyPmsPullOrder Insert Mysql DB Order:%1 Insert/Update Failed--->>>>]")
.arg(orderObject->id);
QLOG_ERROR()<<QString("[<<<<---FlowControl::_NotifyPmsPullOrder Insert Mysql DB Order:%1 Insert/Update Failed--->>>>]").arg(orderObject->id);
//只有插入失败才 进行数据清理;防止与重新入机的订单数据出现重复; 删除 orders/order_item/order_item_condiments
if(!bExistOrder && !insertRet) {
PmsOrdersData::getInstance().deleteOrderData(orderObject);
}
//将此订单添加汇报队列中; 参数2: "1":代表成功; "2":代表失败; 参数3:入机备注;
_AddOrderInfo2ReportList(orderObject,QString("2"),QString::fromLocal8Bit("订单 插入/更新 PMS库数据失败"));
}
......@@ -383,6 +388,7 @@ void FlowControl::_NotifyPmsPullOrder()
}
}
void FlowControl::_NotifyPmsUpdateOrder()
{
if ( !m_simValidOrdersList.isEmpty() ) {
......@@ -423,8 +429,7 @@ void FlowControl::_NotifyPmsUpdateOrder()
if(insertRet || updateRet) {
for (int i=0;i<3;i++) {
if( _AppendOrderInfo2Redis(orderObject) ) {
if (i) {
if ( i ) {
QLOG_INFO()<<QString("[<<<<---FlowControl::_NotifyPmsUpdateOrder _AppendOrderInfo2Redis Success Try times:%1--->>>>]").arg(i);
}
//只有第一次插入DB成功,才会想OMS汇报入机情况;
......@@ -435,19 +440,18 @@ void FlowControl::_NotifyPmsUpdateOrder()
break;
} else {
QLOG_ERROR()<<QString("[<<<<---FlowControl::_NotifyPmsUpdateOrder _AppendOrderInfo2Redis Failed, Try Again--->>>>]");
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FlowControl::_NotifyPmsUpdateOrder() Begin initQtRedisClient()--->>>>]");
m_initPmsRedisRet = QtRedisClient::getInstance().initQtRedisClient();
continue;
}
}
//如果订单插入/更新 数据库失败后;向服务端汇报订单落库情况;
} else {
QLOG_ERROR()<<QString("[<<<<---FlowControl::_NotifyPmsUpdateOrder Insert Mysql DB Order:%1 Insert/Update Failed--->>>>]")
.arg(orderObject->id);
QLOG_ERROR()<<QString("[<<<<---FlowControl::_NotifyPmsUpdateOrder Insert Mysql DB Order:%1 Insert/Update Failed--->>>>]").arg(orderObject->id);
//只有插入失败才 进行数据清理;防止与重新入机的订单数据出现重复; 删除 orders/order_item/order_item_condiments
if(!bExistOrder && !insertRet) {
PmsOrdersData::getInstance().deleteOrderData(orderObject);
}
//将此订单添加汇报队列中; 参数2: "1":代表成功; "2":代表失败; 参数3:入机备注;
_AddOrderInfo2ReportList(orderObject,QString("2"),QString::fromLocal8Bit("订单 插入/更新 PMS库数据失败"));
}
......@@ -534,22 +538,29 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
orderObject->dataBaseIsORSCancleInt = 0;
orderObject->dataBasePosOrderCheckNo = "";
//插件程序内存中没有此订单时需要从数据库中获取该订单标志数据;同时在接受到退单情况时,也需要从数据库中重新获取(防止内存中标志数据未更新[入机后未更新]);
//查询此 订单+订单状态+制作状态+预约单提前到店 是否已经存在数据库中;
bool pmsMakeStatusIsExistRet = true;
int pmsArriveAheadFlag = 0;
bool pmsOrderStatusIsExistRet = PmsOrdersData::getInstance().isOrderAndStatusExist(orderObject->id, orderObject->orderStatus, orderObject->makeStatus, pmsMakeStatusIsExistRet, pmsArriveAheadFlag );
m_FmOrdersMap.insert(orderObject->id, orderObject);
QLOG_INFO() << QString("[<<<<---FmTakeout Valid Orders Map:Insert New Order[ OrderId: %1 OrderDesc: %2 OrderStatus: %3 "
" MakeStatus: %4 oldArriverAhead: %5 NewArriverAhead: %6 expectDate: %7 reserveMakeTime: %8 remindTicketTime: %9 ]--->>>>]")
.arg(orderObject->id).arg( orderObject->getOrderStatusDec() ).arg(orderObject->orderStatus)
.arg(orderObject->makeStatus).arg(pmsArriveAheadFlag).arg(orderObject->inAdvanceTakemeal)
.arg(orderObject->expectDate).arg(orderObject->reserveMakeTime).arg(orderObject->remindTicketTime);
if ( !pmsOrderStatusIsExistRet || !pmsMakeStatusIsExistRet || ( pmsArriveAheadFlag != orderObject->inAdvanceTakemeal ) || ( 3 == orderObject->inAdvanceTakemeal ) ) {
//程序刚启动+量大+ 异步也无碍 顾无需加锁;
m_simValidOrdersList.append(orderObject->id);
// 89 == orderType 标识订单是 ELE-权益卡单,无需存储与打印, 但是需要界面展示;
if ( 89 != orderObject->orderType ) {
//插件程序内存中没有此订单时需要从数据库中获取该订单标志数据;同时在接受到退单情况时,也需要从数据库中重新获取(防止内存中标志数据未更新[入机后未更新]);
//查询此 订单+订单状态+制作状态+预约单提前到店 是否已经存在数据库中;
bool pmsMakeStatusIsExistRet = true;
int pmsArriveAheadFlag = 0;
bool pmsOrderStatusIsExistRet = PmsOrdersData::getInstance().isOrderAndStatusExist(orderObject->id, orderObject->orderStatus,
orderObject->makeStatus, pmsMakeStatusIsExistRet, pmsArriveAheadFlag );
QLOG_INFO() << QString("[<<<<---FmTakeout Valid Orders Map:Insert New Order[ OrderId: %1 OrderDesc: %2 OrderStatus: %3 "
" MakeStatus: %4 oldArriverAhead: %5 NewArriverAhead: %6 expectDate: %7 reserveMakeTime: %8 remindTicketTime: %9 ]--->>>>]")
.arg(orderObject->id).arg( orderObject->getOrderStatusDec() ).arg(orderObject->orderStatus)
.arg(orderObject->makeStatus).arg(pmsArriveAheadFlag).arg(orderObject->inAdvanceTakemeal)
.arg(orderObject->expectDate).arg(orderObject->reserveMakeTime).arg(orderObject->remindTicketTime);
if ( !pmsOrderStatusIsExistRet || !pmsMakeStatusIsExistRet || ( pmsArriveAheadFlag != orderObject->inAdvanceTakemeal ) || ( 3 == orderObject->inAdvanceTakemeal ) ) {
//程序刚启动+量大+ 异步也无碍 顾无需加锁;
m_simValidOrdersList.append(orderObject->id);
}
} else {
QLOG_INFO() << QString::fromLocal8Bit("[<<<<---FmTakeout Valid Orders Map:Insert New Order[ OrderId: %1 (orderType=89 权益卡单Skip入库等操作) OrderDesc: %2 OrderStatus: %3 "
" MakeStatus: %4 ]--->>>>]").arg(orderObject->id).arg( orderObject->getOrderStatusDec() ).arg(orderObject->orderStatus) .arg(orderObject->makeStatus);
}
emit changeOrderStatus(orderObject);
......@@ -570,13 +581,16 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
if(oldStatus != orderObject->orderStatus || oldMakeStatus != orderObject->makeStatus
|| ( oldArriverAhead != orderObject->inAdvanceTakemeal ) || ( 3 == orderObject->inAdvanceTakemeal ) ) {
bRetOrderUpdateMutex =m_OrderUpdateMutex.tryLock(VALUE_TRYLOCKMEMTIMEOUT);
if(!bRetOrderUpdateMutex) {
QLOG_INFO() << QString("[<<<<---FmTakeout _OrderAnalysis:orderId:%1 OrderStatus:%2 MakeStatus:%3 ArriverAhead:%4 Changed, But m_OrderUpdateMutex.tryLock Failed --->>>>]")
.arg(orderObject->id).arg(orderObject->orderStatus).arg(orderObject->makeStatus).arg(orderObject->inAdvanceTakemeal);
} else {
m_waitUpdateOrderList.append(orderObject->id);
m_OrderUpdateMutex.unlock();
// 89 == orderType 标识订单是 ELE-权益卡单,无需存储(PCS无法控制打印指令,PCS无需给OMS上游提供入机回调结果) 与 打印, 但是需要界面展示;
if ( 89 != orderObject->orderType ) {
bRetOrderUpdateMutex =m_OrderUpdateMutex.tryLock(VALUE_TRYLOCKMEMTIMEOUT);
if(!bRetOrderUpdateMutex) {
QLOG_INFO() << QString("[<<<<---FmTakeout _OrderAnalysis:orderId:%1 OrderStatus:%2 MakeStatus:%3 ArriverAhead:%4 Changed, But m_OrderUpdateMutex.tryLock Failed --->>>>]")
.arg(orderObject->id).arg(orderObject->orderStatus).arg(orderObject->makeStatus).arg(orderObject->inAdvanceTakemeal);
} else {
m_waitUpdateOrderList.append(orderObject->id);
m_OrderUpdateMutex.unlock();
}
}
emit changeOrderStatus(orderObject, oldStatus);
}
......@@ -610,6 +624,7 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
}
}
void FlowControl::onGetNewStoreInfo()
{
QLOG_INFO()<<"[<<<<---Get New Store Info:Openssl support--->>>>]:"<<QSslSocket::supportsSsl();
......@@ -740,9 +755,11 @@ bool FlowControl::_Login()
m_eleStoreStatus = recvJson[JSON_ELESTORESTS].toInt();
m_modStoreStatus = recvJson[JSON_MODSTORESTS].toInt();
m_mopStoreStatus = recvJson[JSON_MOPSTORESTS].toInt();
QLOG_INFO()<<QString("[<<<<---FlowControl::_Login eleStoreStatus:%1;modStoreStatus:%2;mopStoreStatus:%3 --->>>>]").
arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus);
emit doUpdateStoreStatus(m_eleStoreStatus,m_modStoreStatus,m_mopStoreStatus);
m_mtModStoreStatus = recvJson[JSON_MTMODSTORESTS].toInt();
QLOG_INFO()<<QString("[<<<<---FlowControl::_Login eleStoreStatus: %1, modStoreStatus: %2, mopStoreStatus: %3, mtModStoreStatus: %4, existNoAckNotice:%5 --->>>>]")
.arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus).arg(m_mtModStoreStatus).arg(m_existNoAckNotice);
emit doUpdateStoreStatus( m_eleStoreStatus, m_modStoreStatus, m_mopStoreStatus, m_mtModStoreStatus, m_existNoAckNotice);
//***********************登陆时获取门店的营业状态 end ************************//
m_bLoginResult= true;
m_loginErrorCount = 0;
......@@ -808,28 +825,29 @@ bool FlowControl::_Login()
void FlowControl::_PullOrderData()
{
QLOG_INFO()<<"[<<<<----FlowControl::_PullOrderData ---->>>>>]";
if(m_orderPullList.isEmpty())
return;
emit hideAlert();
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);
if (!btryLock) {
QLOG_ERROR()<<"[<<<<----FlowControl::_PullOrderData Try Lock Failed ---->>>>>]";
QLOG_ERROR()<<"[<<<<----_PullOrderData Try Lock Failed ---->>>>>]";
return;
}
PullOrderInfo* info = m_orderPullList.takeFirst();
if ( info->pullErrorCount > 2 ) {
QLOG_INFO()<<QString( "[<<<<----FlowControl::_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);
m_orderPullList.removeOne(info);
// 获取 o2ofulfillment 订单列表数据失败3次,之后丢弃 此拉单列表请求 item, 不切换域名重试获取;
if ( info->orderId.isEmpty() && info->callBackUrl.contains("o2ofulfillment") ) {
QLOG_ERROR() << QString("[<<<<---FlowControl::_PullOrderData <o2ofulfillment> Error, And Don't Display Error--->>>>]");
QLOG_ERROR() << QString("[<<<<---_PullOrderData <o2ofulfillment> Error, And Don't Display Error--->>>>]");
delete info;
m_PullOrderDataMutex.unlock();
return;
......@@ -852,22 +870,22 @@ void FlowControl::_PullOrderData()
m_pullTimer->start(1000*4);
if ( _PullOrderList( info->pageSize, info->pageNumber, info->callBackUrl ) ) {
QLOG_INFO()<<"[<<<<----FlowControl::_PullOrderData _PullOrderList successful---->>>>>]";
QLOG_INFO()<<"[<<<<----_PullOrderData _PullOrderList successful---->>>>>]";
m_orderPullList.removeOne(info);
delete info;
} else {
QLOG_INFO()<<"[<<<<----FlowControl::_PullOrderData _PullOrderList failed---->>>>>]";
QLOG_INFO()<<"[<<<<----_PullOrderData _PullOrderList failed---->>>>>]";
m_orderPullList.removeOne(info);
info->pullErrorCount++;
m_orderPullList.append(info);
}
} else {
if ( _PullOrderDetail( info->orderId, info->channel, info->callBackUrl ) ) {
QLOG_INFO()<<"[<<<<----FlowControl::_PullOrderData _PullOrderDetail successful---->>>>>]";
if ( _PullOrderDetail( info->orderId, info->channel, info->callBackUrl, info->skipPrint, info->pushOptions ) ) {
QLOG_INFO()<<"[<<<<----_PullOrderData _PullOrderDetail successful---->>>>>]";
m_orderPullList.removeOne(info);
delete info;
} else {
QLOG_INFO()<<"[<<<<----FlowControl::_PullOrderData _PullOrderDetail fail---->>>>>]";
QLOG_INFO()<<"[<<<<----_PullOrderData _PullOrderDetail fail---->>>>>]";
m_orderPullList.removeOne(info);
info->pullErrorCount++;
m_orderPullList.append(info);
......@@ -878,7 +896,7 @@ void FlowControl::_PullOrderData()
return ;
}
bool FlowControl::_PullOrderDetail(const QString& orderId, const QString& channel, const QString &callBackUrl, const bool &skipErrorDisplay )
bool FlowControl::_PullOrderDetail(const QString& orderId, const QString& channel, const QString &callBackUrl, const bool& skipPrint, const QJsonObject& pushOptins, const bool &skipErrorDisplay )
{
if(m_pullOrderSocket==nullptr)
m_pullOrderSocket =new BillSocket(this);
......@@ -888,10 +906,7 @@ bool FlowControl::_PullOrderDetail(const QString& orderId, const QString& channe
QJsonObject recvJson;
if(ConfigManger::GetInstance().GetOrderSslConfig()) {
m_pullOrderSocket->SetSslConfig();
QLOG_INFO()<<"FlowControl::_PullOrderDetail load ssl";
} else {
QLOG_INFO()<<"FlowControl::_PullOrderDetail load not ssl";
m_pullOrderSocket->SetSslConfig();
}
if ( callBackUrl.length() ) {
......@@ -915,11 +930,8 @@ bool FlowControl::_PullOrderDetail(const QString& orderId, const QString& channe
if(!result) {
if ( !skipErrorDisplay ) {
emit setNetStatus(QString::fromLocal8Bit("<font color='#ff0000'>网络不稳定,正在重试</font>"));
// refresh gui defaultStoreStatus;
emit doUpdateStoreStatus(0,0,0);
}
} else {
qDebug()<<recvJson;
emit setNetStatus(QString::fromLocal8Bit("正常"));
if(JSON_STATUSCODE_OK != recvJson[JSON_ERRCODE].toInt())
{
......@@ -931,10 +943,28 @@ bool FlowControl::_PullOrderDetail(const QString& orderId, const QString& channe
result=false;
} else {
QJsonObject order = recvJson[JSON_DATA].toObject();
if ( !order.contains("callBackUrl") ) {
order.insert( "callBackUrl", callBackUrl );
// 服务端返回 code=100 , 但订单体中无订单详情数据;
if ( !order.contains( JSON_ID ) ) {
QLOG_ERROR()<<QString("[<<<<---Pull Order Detail Failed, OrderId= %1, Channel= %2 Code= 100, But 'data' Is Empty --->>>>]").arg( orderId ).arg( channel );
error = QString(" OrderId=%1, Code=100, But 'data' Is Empty ");
result = false;
if ( !skipErrorDisplay ) {
emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("获取订单失败![%1]").arg( error ) );
}
// 此种情况: 肯定服务端服务异常, 即使 result = false,下次拉单, 依旧还会失败, 顾再次放弃此订单详情的继续拉取;
} else {
if ( !order.contains( JSON_CALL_BACK_URL ) ) {
order.insert( JSON_CALL_BACK_URL, callBackUrl );
}
if ( !order.contains( JSON_SKIP_PRINT ) ) {
order.insert( JSON_SKIP_PRINT, skipPrint );
}
if ( !order.contains( JSON_PUSH_PLUGIN_OPTIONS ) ) {
order.insert( JSON_PUSH_PLUGIN_OPTIONS, pushOptins );
}
_OrderAnalysis(order);
}
_OrderAnalysis(order);
}
}
/*解析json数据失败则20秒后重新拉单*/
......@@ -944,6 +974,8 @@ bool FlowControl::_PullOrderDetail(const QString& orderId, const QString& channe
} else {
m_pullTimer->start(1000*2);
}
QLOG_INFO() << QString("[<<<<---Pull Order Detail Final Result: %1 --->>>>]").arg( result ? 1 : 0);
return result;
}
......@@ -963,6 +995,7 @@ bool FlowControl::_PullOrderList(const int &pageSize, const int &pageNo, const Q
QLOG_INFO() << QString("[<<<<---FlowControl::_PullOrderList: Pull Order List--->>>>][requestData:]")<<sendJson;
if(ConfigManger::GetInstance().GetOrderSslConfig()) {
m_pullOrderListSocket->SetSslConfig();
QLOG_INFO()<<"FlowControl::_PullOrderList load ssl";
}
if ( callBackUrl.length() ) {
......@@ -984,8 +1017,6 @@ bool FlowControl::_PullOrderList(const int &pageSize, const int &pageNo, const Q
QLOG_ERROR() << QString("[<<<<---FlowControl::_PullOrderList:Pull Order List <o2ofulfillment> Error, And Don't Display Error--->>>>]");
} else {
emit setNetStatus(QString::fromLocal8Bit("<font color='#ff0000'>网络不稳定,正在重试</font>"));
// refresh gui defaultStoreStatus;
emit doUpdateStoreStatus(0,0,0);
}
} else {
......@@ -1006,7 +1037,11 @@ bool FlowControl::_PullOrderList(const int &pageSize, const int &pageNo, const Q
} else {
QJsonArray orders = recvJson[JSON_DATA].toObject()[JSON_ORDERS].toArray();
foreach(QJsonValue order, orders) {
_OrderAnalysis(order.toObject());
QJsonObject orderObject = order.toObject();
// 订单 JsonObject -> OrderObject 前数据安全检查;
if ( orderObject.contains(JSON_ID) ) {
_OrderAnalysis( orderObject );
}
}
ordertotalSum=recvJson[JSON_DATA].toObject()[JSON_COUNT].toInt();
......@@ -1033,6 +1068,8 @@ bool FlowControl::_PullOrderList(const int &pageSize, const int &pageNo, const Q
orderPull->pageSize=pageSize;
orderPull->pullErrorCount = 0;
orderPull->callBackUrl = callBackUrl;
orderPull->skipPrint = false;
orderPull->pushOptions = QJsonObject();
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FlowControl::_PullOrderList: Next Page Order List :pageNo:%1 pageSize:%2--->>>>]").arg(pageNo+1).arg(pageSize);
m_orderPullList.append(orderPull);
//避免出现存在多页数据,导致出现死锁;
......@@ -1092,8 +1129,7 @@ bool FlowControl::_SendHeart()
m_bLastHeartIsError = true;
m_sendHeartErrorCount++;
emit setNetStatus(QString::fromLocal8Bit("<font color='#ff0000'>网络不稳定,正在重试</font>"));
// refresh gui defaultStoreStatus;
emit doUpdateStoreStatus(0,0,0);
emit doUpdateStoreStatus(0, 0, 0, 0, m_existNoAckNotice); //NetWork Is Error , Refresh Store Default Status;
} else {
QLOG_INFO() << QString("[<<<<---Send Heart Finish: code:%1--->>>>]").arg(recvJson[JSON_LOGINCODE].toInt());
if(JSON_STATUSCODE_OK != recvJson[JSON_LOGINCODE].toInt())
......@@ -1102,7 +1138,7 @@ bool FlowControl::_SendHeart()
m_bLastHeartIsError = true;
m_sendHeartErrorCount++;
emit setNetStatus(QString::fromLocal8Bit("<font color='#ff0000'>网络不稳定,正在重试</font>"));
emit doUpdateStoreStatus(0,0,0);
emit doUpdateStoreStatus(0, 0, 0, 0, m_existNoAckNotice); //Interface Return Error , Refresh Store Default Status;
} else {
result = true;
emit setNetStatus(QString::fromLocal8Bit("<font color='#f5f5f5'>正常</font>"));
......@@ -1115,9 +1151,13 @@ bool FlowControl::_SendHeart()
if( recvJson.contains(JSON_MOPSTORESTS) ){
m_mopStoreStatus = recvJson[JSON_MOPSTORESTS].toInt();
}
QLOG_INFO()<<QString("[<<<<---FlowControl::_SendHeart eleStoreStatus:%1;modStoreStatus:%2;mopStoreStatus:%3 --->>>>]").
arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus);
emit doUpdateStoreStatus(m_eleStoreStatus,m_modStoreStatus,m_mopStoreStatus);
if ( recvJson.contains(JSON_MTMODSTORESTS) ) {
m_mtModStoreStatus = recvJson[JSON_MTMODSTORESTS].toInt();
}
QLOG_INFO()<<QString("[<<<<---FlowControl::_SendHeart eleStoreStatus: %1, modStoreStatus: %2 , mopStoreStatus: %3 , mtModStoreStatus: %4, existNoAckNotice:%5 --->>>>]")
.arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus).arg(m_mtModStoreStatus).arg(m_existNoAckNotice);
emit doUpdateStoreStatus( m_eleStoreStatus, m_modStoreStatus, m_mopStoreStatus, m_mtModStoreStatus, m_existNoAckNotice );
//还原并标记上一次心跳为正常状态;
m_bLastHeartIsError = false;
......@@ -2096,9 +2136,14 @@ bool FlowControl::_ResponseOMS12Request(const QJsonObject &content, QJsonObject
m_eleStoreStatus = content[JSON_ELESTORESTS].toInt();
m_modStoreStatus = content[JSON_MODSTORESTS].toInt();
m_mopStoreStatus = content[JSON_MOPSTORESTS].toInt();
QLOG_INFO()<<QString("[<<<<---FlowControl::_ResponseOMS12Request eleStoreStatus:%1;modStoreStatus:%2;mopStoreStatus:%3 --->>>>]").
arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus);
emit doUpdateStoreStatus(m_eleStoreStatus,m_modStoreStatus,m_mopStoreStatus);
m_mtModStoreStatus = content[JSON_MTMODSTORESTS].toInt();
// m_existNoAckNotice = SaveNoticeMsgDB::getInstance().existNoAckNotice() ? 1 : 0;
m_existNoAckNotice = 0;
QLOG_INFO()<<QString("[<<<<---FlowControl::_ResponseOMS12Request eleStoreStatus: %1, modStoreStatus: %2 , mopStoreStatus: %3 , mtModStoreStatus: %4, existNoAckNotice:%5 --->>>>]").
arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus).arg(m_mtModStoreStatus).arg(m_existNoAckNotice);
emit doUpdateStoreStatus(m_eleStoreStatus, m_modStoreStatus, m_mopStoreStatus, m_mtModStoreStatus, m_existNoAckNotice);
error=QString("success");
result = true;
} else {
......@@ -2407,6 +2452,58 @@ void FlowControl::onGetOrderDetails(const QString& orderId)
emit showOrderDetails(m_FmOrdersMap.value(orderId));
}
void FlowControl::onGetEcMopOrderDetails(const QString& orderId, const QString& channel)
{
// 入参非法校验;
QString tempOrderId = orderId.trimmed(); // 返回一个字符串,移除从一开始到结尾的空白。也去掉头尾的空白【simplified】
if ( tempOrderId.isEmpty() || channel.isEmpty() || tempOrderId.length() < 17 || tempOrderId.length() > 25 ) {
QLOG_INFO() << QString("[<<<<---FlowControl::onGetEcMopOrderDetails: OrderId:%1 / channel:%2 Is Empty / Error --->>>>]").arg( tempOrderId ).arg( channel );
emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("扫描订单号异常") );
return;
} else {
QString callBackUrl = "";
// 入参有效;
// 判断插件是否登录成功了,没有登录成功,弹框提示;
if ( !m_bLoginResult ) {
emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("插件程序还未成功登录") );
return;
}
// 组装请求报文 [ 含门店编号:便于 OMS 校验此订单是否属于本门店 ] , 获取订单详情数据 ;[ 失败则弹框提示]
if ( m_FmOrdersMap.value( tempOrderId ) ) {
callBackUrl = m_FmOrdersMap.value( tempOrderId )->callBackUrl;
}
// 初步上线, 兼容现有环境, EC-MOP 如果拉取失败, 需要 跳过错误展示
bool pullOrderDetailRet = _PullOrderDetail( tempOrderId, channel, callBackUrl, false, QJsonObject(), true );
if ( !pullOrderDetailRet ) {
if ( ConfigManger::GetInstance().GetOrderServerUrl().contains(".stg") ) {
callBackUrl = GET_O2OFULFILLMENT_STG_CBL ;
} else if ( ConfigManger::GetInstance().GetOrderServerUrl().contains(".dev") ) {
callBackUrl = GET_O2OFULFILLMENT_DEV_CBL ;
} else if ( ConfigManger::GetInstance().GetOrderServerUrl().contains(".uat") ) {
callBackUrl = GET_O2OFULFILLMENT_UAT_CBL ;
} else {
callBackUrl = GET_O2OFULFILLMENT_PRO_CBL ;
}
pullOrderDetailRet = _PullOrderDetail( tempOrderId, channel , callBackUrl );
}
if ( pullOrderDetailRet ) {
// 展示跳转订单详情页面; // 同一线程, 理论无需 Sleep
Sleep(1000*3);
emit showOrderDetails( m_FmOrdersMap.value( tempOrderId ) );
}
}
}
void FlowControl::onSerachOrder(const QString &text)
{
QLOG_INFO() << QString::fromLocal8Bit("[<<<<---FlowControl::onSerachOrder:输入的数字串:%1 --->>>>]").arg(text);
......@@ -2449,9 +2546,9 @@ void FlowControl::onProcessRepealOrder(const QString &orderId, const int &reason
}
void FlowControl::onProcessReTryInputOrder(const QString &orderId)
void FlowControl::onProcessRetryInputOrder(const QString &orderId)
{
QLOG_INFO() << QString("[<<<<---FlowControl::onProcessReTryInputOrder: OrderId: %1 --->>>>]").arg(orderId);
QLOG_INFO() << QString("[<<<<---FlowControl::onProcessRetryInputOrder: OrderId: %1 --->>>>]").arg(orderId);
//先判断非码订单容器不为空;
if ( !m_FmOrdersMap.isEmpty() ) {
QMap<QString, OrderObject*>::iterator TempOrder;
......@@ -2462,7 +2559,7 @@ void FlowControl::onProcessReTryInputOrder(const QString &orderId)
OrderObject* TempOrderObject = TempOrder.value();
bool btryLock = m_PullOrderDataMutex.tryLock(VALUE_TRYLOCKNETTIMEOUT);
if (!btryLock) {
QLOG_ERROR()<<"[<<<<----FlowControl::onProcessReTryInputOrder Try Lock Failed ---->>>>>]";
QLOG_ERROR()<<"[<<<<----FlowControl::onProcessRetryInputOrder Try Lock Failed ---->>>>>]";
return;
}
/***组装从FM外卖service端的拉单请求参数***/
......@@ -2472,12 +2569,15 @@ void FlowControl::onProcessReTryInputOrder(const QString &orderId)
orderPull->pageNumber=1;
orderPull->pageSize=30;
orderPull->pullErrorCount = 0;
orderPull->skipPrint = false;
orderPull->pushOptions = QJsonObject();
orderPull->callBackUrl = TempOrderObject->callBackUrl;
m_orderPullList.append(orderPull);
m_PullOrderDataMutex.unlock();
}
}
} else {
QLOG_INFO() << QString("[<<<<---FlowControl::onProcessReTryInputOrder: m_FmOrdersMap Is Empty --->>>>]");
QLOG_INFO() << QString("[<<<<---FlowControl::onProcessRetryInputOrder: m_FmOrdersMap Is Empty --->>>>]");
}
}
......@@ -68,6 +68,9 @@ private:
QString orderId;
int pullErrorCount;
QString callBackUrl;
bool skipPrint;
QJsonObject pushOptions;
}PullOrderInfo;
typedef struct ORDER_OPERATION
......@@ -90,7 +93,10 @@ private:
QString storeId; //门店编号
QString remark; //备注:入机出错信息
QString checkNo; //小票号:入机成功时的小票号;
QString failCode; // 入机/存储 错误码 (成功时都给 "");
QString pluginVersion; //该订单入机后, 汇报给OMS对应程序的版本号;
int reqResult; //向OMS请求汇报结果;
}RepOMSRecordOrderInfo;
//定义门店的营业状态;
......@@ -117,6 +123,8 @@ private:
int m_eleStoreStatus;
int m_mopStoreStatus;
int m_modStoreStatus;
int m_mtModStoreStatus;
int m_existNoAckNotice;
bool m_bLastHeartIsError;
int m_orderCount;
int m_o2ofulfillmentOrderCount;
......@@ -229,7 +237,7 @@ signals:
* 参数:1 [ele开关店状态] 2[MOD开关店状态] 3[MOP开关店状态]
* 返回:Null
* */
void doUpdateStoreStatus(int eleStoreStatus,int modStoreStatus,int mopStoreStatus);
void doUpdateStoreStatus(int eleStoreStatus, int modStoreStatus, int mopStoreStatus, int mtStoreStatus, int existNoAckNotice);
/* 功能:设置主界面门店信息
......@@ -337,7 +345,8 @@ public slots:
* 参数:[1]订单编号
* 返回:是否成功
* */
bool _PullOrderDetail(const QString &orderId, const QString& channel, const QString &callBackUrl, const bool &skipErrorDisplay = false );
bool _PullOrderDetail( const QString& orderId, const QString& channel, const QString& callBackUrl, const bool& skipPrint = false, const QJsonObject& pushOptins = QJsonObject(),
const bool& skipErrorDisplay = false );
/* 功能:拉取订单
* 参数:NULL
* 返回:是否成功
......@@ -448,6 +457,13 @@ public slots:
* */
void onGetOrderDetails(const QString &orderId);
/* 功能:获取 EC-MOP 订单详情
* 参数: OrderId, Channel
* 返回:NULL
* */
void onGetEcMopOrderDetails(const QString &orderId, const QString &channel);
/* 功能:搜索订单
* 参数:[1]搜索内容
* 返回:NULL
......@@ -470,7 +486,7 @@ public slots:
* 参数:[1]订单号
* 返回:NULL
* */
void onProcessReTryInputOrder(const QString& orderId);
void onProcessRetryInputOrder(const QString& orderId);
/* 功能:获取门店营业状态
* 参数:NULL
......
......@@ -124,8 +124,17 @@ bool QtRedisClient::pushOrder2Redis(const OrderObject* orderObj ){
orderStatusObj.insert( "ARRIVEAHEAD", orderObj->inAdvanceTakemeal );
}
QJsonDocument orderStatusDoc = QJsonDocument(orderStatusObj);
cmdString.append(orderStatusDoc.toJson());
if ( !m_pRedisConnectOperat ) {
QLOG_INFO() << QString("[<<<<---QtRedisClient::pushOrder2Redis orderId:%1 m_pRedisConnectOperat Pointer Is Null, Wait Retry Init --->>>>]").arg(orderObj->id);
return bPushOrderSuc;
}
if ( !m_pRedisConnectOperat->isConnected() ) {
QLOG_INFO() << QString("[<<<<---QtRedisClient::pushOrder2Redis orderId:%1 m_pRedisConnectOperat Disconnet, Wait Retry Init --->>>>]").arg(orderObj->id);
return bPushOrderSuc;
}
try {
auto result = m_pRedisConnectOperat->command(cmdString);
QVariant val = result.result().value();
......
......@@ -138,6 +138,8 @@ QString OrderObject::getChannelName()
return QString::fromLocal8Bit("预-MOD-隔日");
} else if ( 8 == orderType ) {
return QString::fromLocal8Bit("拼-MOD");
} else if ( 89 == orderType ) {
return QString::fromLocal8Bit("权益卡");
} else {
if ( "4" == platformSource ) {
return QString::fromLocal8Bit("微信-MOD");
......@@ -151,6 +153,8 @@ QString OrderObject::getChannelName()
return QString::fromLocal8Bit("预-美团-当日");
} else if ( 11 == orderType ) {
return QString::fromLocal8Bit("预-美团-隔日");
} else if ( 89 == orderType ) {
return QString::fromLocal8Bit("权益卡");
} else {
return QString::fromLocal8Bit("美团-MOD");
}
......@@ -174,6 +178,8 @@ QString OrderObject::getChannelName()
return QString::fromLocal8Bit("预-饿了么-当日");
} else if ( 11 == orderType ) {
return QString::fromLocal8Bit("预-饿了么-隔日");
} else if ( 89 == orderType ) {
return QString::fromLocal8Bit("权益卡");
} else {
return QString::fromLocal8Bit("饿了么");
}
......@@ -193,6 +199,8 @@ QString OrderObject::getChannelName()
return QString::fromLocal8Bit("拼-MOP");
} else if (10 == orderType) {
return QString::fromLocal8Bit("星时刻");
} else if ( 89 == orderType ) {
return QString::fromLocal8Bit("权益卡");
} else {
if ( "5" == platformSource ) {
return QString::fromLocal8Bit("口碑-MOP");
......@@ -206,6 +214,8 @@ QString OrderObject::getChannelName()
return QString::fromLocal8Bit("预-美团-当日");
} else if ( 11 == orderType ) {
return QString::fromLocal8Bit("预-美团-隔日");
} else if ( 89 == orderType ) {
return QString::fromLocal8Bit("权益卡");
} else {
return QString::fromLocal8Bit("美团-MOP");
}
......
......@@ -25,32 +25,129 @@ 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 BRIEF_TIPS:
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;
case ACK_MSG:
ui->alertBtnOk->show();
ui->alertLabOk->hide();
ui->alertLabIng->hide();
// ui->alertLabWarn->show();
ui->alertLabError->hide();
break;
}
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 if ( type == ACK_MSG) {
/*
ui->alertLabWarn_space->hide();
ui->alertLabWarn1->hide();
ui->alertLabWarn2->hide();
ui->alertLabWarn3->hide();
ui->alertLabWarn4->hide();
ui->alertLabWarn5->hide();
*/
ui->alertLabMsg->hide();
} else {
/*
ui->alertLabWarn_space->hide();
ui->alertLabWarn1->hide();
ui->alertLabWarn2->hide();
ui->alertLabWarn3->hide();
ui->alertLabWarn4->hide();
ui->alertLabWarn5->hide();
*/
ui->alertLabMsg->setText(msg);
}
ui->alertLabMsg->setText(msg);
if(!m_timer->isActive())
m_timer->start(20000);
if ( type == WARNNING || type == ACK_MSG ) {
m_timer->stop();
} else if ( type == BRIEF_TIPS ) {
if(!m_timer->isActive() )
m_timer->start(3000);
} else {
if(!m_timer->isActive() )
m_timer->start(20000);
}
return;
}
......
......@@ -23,7 +23,10 @@ public:
SUCCESS=0,
MSGERROR,
LOADING,
SYNCDATA
BRIEF_TIPS,
SYNCDATA,
WARNNING,
ACK_MSG
}Type;
/* 功能:设置显示内容
......
......@@ -14,7 +14,7 @@ DetailForm::DetailForm(QWidget *parent) :
connect(this, &DetailForm::processOrder, &FlowControl::GetInstance(), &FlowControl::onProcessOrder);
connect(this, &DetailForm::processRejectOrder, &FlowControl::GetInstance(), &FlowControl::onProcessRejectOrder);
connect(this, &DetailForm::processRepealOrder, &FlowControl::GetInstance(), &FlowControl::onProcessRepealOrder);
connect(this, &DetailForm::processReTryInputOrder, &FlowControl::GetInstance(), &FlowControl::onProcessReTryInputOrder);
connect(this, &DetailForm::processRetryInputOrder, &FlowControl::GetInstance(), &FlowControl::onProcessRetryInputOrder);
m_rejectForm=NULL;
m_refuseForm=NULL;
......@@ -152,7 +152,9 @@ void DetailForm::InitData(OrderObject *orderObject)
CouponsObject* tempCouponObj = orderObject->coupList[coupNum];
ui->detailTable0->insertRow(pNum);
QString tempName = tempCouponObj->name.length()?tempCouponObj->name:QString::fromLocal8Bit("券");
ui->detailTable0->setItem(pNum, 0, new QTableWidgetItem(tempName)); // 券名
tempName.append("\r\n");
tempName.append(tempCouponObj->code);
ui->detailTable0->setItem(pNum, 0, new QTableWidgetItem(tempName)); // 券名+券号码
ui->detailTable0->item(pNum, 0)->setTextAlignment(Qt::AlignCenter);
ui->detailTable0->setItem(pNum, 1, new QTableWidgetItem(QString('-'))); // 券价格
ui->detailTable0->item(pNum, 1)->setTextAlignment(Qt::AlignCenter);
......@@ -365,9 +367,35 @@ void DetailForm::on_detailBtn0_clicked()
{
QLOG_INFO()<<QString("[<<<<---DetailForm::on_detailBtn0_clicked: begin:--->>>>]")<<QString("重新录单")<< m_orderObject->id;
if(m_orderObject) {
emit processReTryInputOrder(m_orderObject->id);
emit processRetryInputOrder(m_orderObject->id);
this->hide();
} else {
QLOG_ERROR()<<QString("[<<<<---DetailForm::on_detailBtn0_clicked: m_orderObject point is NULL--->>>>]");
}
}
void DetailForm::hideDetailAllFrom()
{
QLOG_INFO()<<QString("[<<<<---DetailForm::hideDetailAllFrom: begin:--->>>>]");
if ( m_refuseForm && m_refuseForm->isVisible() ) {
//delete m_refuseForm;
//m_refuseForm = NULL;
m_refuseForm->hideSelectProductFrom();
m_refuseForm->reject();
}
/*
if ( m_printTicketSelectForm && m_printTicketSelectForm->isVisible() ) {
m_printTicketSelectForm->reject();
m_printTicketSelectForm->hide();
}
*/
QLOG_INFO()<<QString("[<<<<---DetailForm::hideDetailAllFrom: middle:--->>>>]");
this->hide();
QLOG_INFO()<<QString("[<<<<---DetailForm::hideDetailAllFrom: Finished:--->>>>]");
}
......@@ -58,7 +58,7 @@ signals:
* 参数:[1]订单编号
* 返回:NULL
* */
void processReTryInputOrder(const QString& orderId);
void processRetryInputOrder(const QString& orderId);
private slots:
/* 功能:处理订单按钮点击
......@@ -81,6 +81,13 @@ private slots:
* */
void on_detailBtn0_clicked();
public slots:
/* 功能:退单和录单同时进行时,优先录单,在 mainFrom 最小化时,会调用 DetailForm 最小化,其内部的子对象需要释放,否则会引发程序崩溃退出;
* 参数:NULL
* 返回:NULL
* */
void hideDetailAllFrom();
};
#endif // DETAILFORM_H
......@@ -19,6 +19,7 @@ FloatForm::FloatForm(QWidget *parent) :
m_bReminding = false;
m_bStoreStatus = true; //程序启动后,初始化为开店状态;
m_bExistNoAckNotice = false; //程序启动后,初始化为不存在[NoAckNotice];
QPixmap imgStoreBusiStat(":StoreBusinessStatus.png");
m_imgStoreBusiStatSize = imgStoreBusiStat.size();
......@@ -191,8 +192,14 @@ void FloatForm::onShow()
m_raiseTimer.start();
}
void FloatForm::onHide()
{
hide();
m_raiseTimer.start();
}
void FloatForm::onLockFloatForm(){
QLOG_INFO()<<QString("[<<<----FloatForm::onLockFloatForm : Lock Float Form --->>>>]");
if( this->isEnabled() ){
this->setEnabled(false);
}
......@@ -200,75 +207,96 @@ void FloatForm::onLockFloatForm(){
void FloatForm::onUnLockFloatForm(){
QLOG_INFO()<<QString("[<<<----FloatForm::onUnLockFloatForm : unLock Float Form --->>>>]");
if( !this->isEnabled() ){
this->setEnabled(true);
}
}
void FloatForm::onUpdateStoreStatus(int eleStoreStatus, int modStoreStatus,int mopStoreStatus){
QLOG_INFO()<<QString("[<<<----FloatForm::onUpdateStoreStatus:eleStoreStatus, modStoreStatus, mopStoreStatus: --->>>>]")<<eleStoreStatus <<modStoreStatus <<mopStoreStatus ;
RefreshStoreStatus(eleStoreStatus, modStoreStatus,mopStoreStatus);
void FloatForm::onUpdateStoreStatus(int eleStoreStatus, int modStoreStatus, int mopStoreStatus, int mtStoreStatus, int existNoAckNotice){
QLOG_INFO()<<QString("[<<<----FloatForm::onUpdateStoreStatus: eleStoreStatus: %1, modStoreStatus: %2, mopStoreStatus: %3, mtStoreStatus: %4, existNoAckNotice:%5 --->>>>]")
.arg(eleStoreStatus).arg(modStoreStatus).arg(mopStoreStatus).arg(mtStoreStatus).arg(existNoAckNotice);
m_bExistNoAckNotice = existNoAckNotice;
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:--->>>>]");
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;
this->ui->Mod1Lable->resize(56, 14); //图片源文件大小
this->ui->Mod1Lable->move(10, 40); //左边距10像素;
this->ui->Mod1Lable->setPixmap(QPixmap(":ModTitle.png"));
this->ui->Mod2Lable->resize(44, 20); //图片源文件大小
this->ui->Mod2Lable->move(70, 36); // 在 Mod1Lable 基础上 x+4; y-4;
this->ui->Mod1Lable->move( first_x, first_y); //左边距 first_x 像素; 上边距: first_y 像素;
this->ui->Mod1Lable->setPixmap( QPixmap(":ModTitle.png").scaled(titleLab_w, titleLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
this->ui->Mod2Lable->move( first_x + titleLab_w + col_interval, first_y );
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){
this->ui->Mod2Lable->setPixmap(QPixmap(":StoreOff.png"));
this->ui->Mod2Lable->setPixmap( QPixmap(":StoreOff.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
}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;
this->ui->Eleme1Lable->resize(43, 14); //图片源文件大小
this->ui->Eleme1Lable->move(10, 66); //左边距10像素;高度距离上面一个标签 高度 + 10 像素间隔;
this->ui->Eleme1Lable->setPixmap(QPixmap(":ElemeTitle.png"));
this->ui->Eleme2Lable->resize(44, 20); //图片源文件大小
this->ui->Eleme2Lable->move(70, 62); // x 与 Mod1Lable 对齐; y-4;
this->ui->Eleme1Lable->move( first_x, first_y + 1* ( titleLab_h + row_interval ) );
this->ui->Eleme1Lable->setPixmap( QPixmap(":ElemeTitle.png").scaled(titleLab_w, titleLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
this->ui->Eleme2Lable->move(first_x + titleLab_w + col_interval, first_y + 1* ( statusLab_h + row_interval ) );
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){
this->ui->Eleme2Lable->setPixmap(QPixmap(":StoreOff.png"));
this->ui->Eleme2Lable->setPixmap( QPixmap(":StoreOff.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} 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;
this->ui->Mop1Lable->resize(56, 14); //图片源文件大小
this->ui->Mop1Lable->move(10, 92); //左边距10像素;高度距离上面一个标签 高度 + 10 像素间隔;
this->ui->Mop1Lable->setPixmap(QPixmap(":MopTitle.png"));
this->ui->Mop2Lable->resize(44, 20); //图片源文件大小
this->ui->Mop2Lable->move(70, 88); // x 与 Mod1Lable 对齐; y-4;
this->ui->Mop1Lable->move(first_x, first_y + 2* ( titleLab_h + row_interval ) );
this->ui->Mop1Lable->setPixmap( QPixmap(":MopTitle.png").scaled(titleLab_w, titleLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
this->ui->Mop2Lable->move(first_x + titleLab_w + col_interval, first_y + 2* ( statusLab_h + row_interval ) );
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) {
this->ui->Mop2Lable->setPixmap(QPixmap(":StoreOff.png"));
this->ui->Mop2Lable->setPixmap( QPixmap(":StoreOff.png").scaled(statusLab_w, statusLab_h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} else {
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; NomalOrderManager
this->ui->OrderManagerLable->move(3, 122);
if ( m_bExistNoAckNotice ) {
this->ui->OrderManagerLable->setPixmap( QPixmap(":SmallHorn.png").scaled(110, 30, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} else {
this->ui->Mop2Lable->setPixmap(QPixmap(":StoreDef.png"));
this->ui->OrderManagerLable->setPixmap( QPixmap(":NomalOrderManager.png").scaled(110, 30, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
}
//准备订单管理状态Label;
this->ui->OrderManagerLable->resize(120, 36); //图片源文件大小; x缩小10像素;
this->ui->OrderManagerLable->move(2, 118); //左边距0像素;高度距离上面一个标签 高度 + 10 像素间隔;
this->ui->OrderManagerLable->setPixmap(QPixmap(":NomalOrderManager.png"));
}
void FloatForm::RefreshOrderManagerStatus(int existNewOrder){
QLOG_INFO()<<QString("[<<<----FloatForm::RefreshOrderManagerStatus:%1--->>>>]").arg(existNewOrder);
if(existNewOrder){ //有新订单;
this->ui->OrderManagerLable->resize(120, 36); //图片源文件大小; x缩小10像素;
this->ui->OrderManagerLable->move(2, 118); //左边距0像素;高度距离上面一个标签 高度 + 10 像素间隔;
this->ui->OrderManagerLable->setPixmap(QPixmap(":ComeNewOrder.png"));
this->ui->OrderManagerLable->move(3, 122);
this->ui->OrderManagerLable->setPixmap( QPixmap(":ComeNewOrder.png").scaled(110, 30, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} else { //无新订单;
this->ui->OrderManagerLable->resize(120, 36); //图片源文件大小; x缩小10像素;
this->ui->OrderManagerLable->move(2, 118); //左边距0像素;高度距离上面一个标签 高度 + 10 像素间隔;
this->ui->OrderManagerLable->setPixmap(QPixmap(":NomalOrderManager.png"));
this->ui->OrderManagerLable->move(3, 122);
if ( m_bExistNoAckNotice ) {
this->ui->OrderManagerLable->setPixmap( QPixmap(":SmallHorn.png").scaled(110, 30, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
} else {
this->ui->OrderManagerLable->setPixmap( QPixmap(":NomalOrderManager.png").scaled(110, 30, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
}
}
}
......@@ -39,6 +39,9 @@ private:
// 记录门店营业状态
bool m_bStoreStatus;
// 临时记录是否存在 未ACK的门店通知;
bool m_bExistNoAckNotice;
// 记录提示状态图片的大小
QSize m_imgRemindSize;
// 三个渠道的门店营业状态;
......@@ -97,6 +100,12 @@ public slots:
* */
void onShow();
/* 功能:隐藏窗口
* 参数:NULL
* 返回:NULL
* */
void onHide();
/* 功能:锁住窗口:enable(false);
* 参数:NULL
* 返回:NULL
......@@ -113,13 +122,14 @@ public slots:
* 参数:1 [ele开关店状态] 2[MOD开关店状态] 3[MOP开关店状态]
* 返回:NULL
* */
void onUpdateStoreStatus(int eleStoreStatus, int modStoreStatus,int mopStoreStatus);
void onUpdateStoreStatus(int eleStoreStatus, int modStoreStatus, int mopStoreStatus, int mtStoreStatus, int existNoAckNotice);
/* 功能:更新多渠道门店营业状态显示;
* 参数:1 [ele开关店状态] 2[MOD开关店状态] 3[MOP开关店状态]
* 返回: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更新悬浮框显示;
* 参数:1 [是否存在新订单]
......
......@@ -119,6 +119,45 @@
<string/>
</property>
</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 class="QLabel" name="NoticeIconLabel">
<property name="geometry">
<rect>
<x>50</x>
<y>20</y>
<width>54</width>
<height>12</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
</item>
</layout>
......
......@@ -7,8 +7,8 @@ IDI_ICON ICON DISCARDABLE "logo.ico"
#endif
VS_VERSION_INFO VERSIONINFO
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
FILEVERSION 4,2022,8,1
PRODUCTVERSION 4,2022,8,1
FILEVERSION 4,2023,2,23
PRODUCTVERSION 4,2023,2,23
//*************************************************************************//
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
......@@ -27,12 +27,12 @@ VS_VERSION_INFO VERSIONINFO
VALUE "CompanyName", "ShangHai.Freemud Co., Ltd."
VALUE "FileDescription", "PMS Plugin Application"
VALUE "InternalName", "PmsPlugin.exe"
VALUE "LegalCopyright", "Copyright (C)2014-2022"
VALUE "LegalCopyright", "Copyright (C)2014-2023"
VALUE "OriginalFilename", "PmsPlugin.exe"
VALUE "ProductName", "PMS Plugin"
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
VALUE "ProductVersion", "4.2022.8.1"
VALUE "FileVersion", "4.2022.8.1"
VALUE "ProductVersion", "4.2023.2.23"
VALUE "FileVersion", "4.2023.2.23"
//*************************************************************************//
END
END
......
......@@ -110,6 +110,7 @@ int main(int argc, char *argv[])
qRegisterMetaType<AlertForm::Type>("AlertForm::Type");
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);
......
......@@ -40,6 +40,7 @@ MainForm::MainForm(QWidget *parent) :
connect(&m_timeTimer, &QTimer::timeout, this, &MainForm::onSetCurrentTime);
connect(this, &MainForm::processOrder, &FlowControl::GetInstance(), &FlowControl::onProcessOrder);
connect(this, &MainForm::getOrderDetails, &FlowControl::GetInstance(), &FlowControl::onGetOrderDetails);
connect(this, &MainForm::getEcMopOrderDetails, &FlowControl::GetInstance(), &FlowControl::onGetEcMopOrderDetails);
connect(this, &MainForm::PullDishes, &FlowControl::GetInstance(), &FlowControl::onPullDishes);
connect(this, &MainForm::GetBusinessStatus, &FlowControl::GetInstance(), &FlowControl::onGetBusinessStatus);
connect(this, &MainForm::GetOMSAllOrders, &FlowControl::GetInstance(), &FlowControl::onGetOMSAllOrders);
......@@ -73,6 +74,65 @@ MainForm::~MainForm()
delete ui;
}
void MainForm::mouseMoveEvent(QMouseEvent *event)
{
if ((event->buttons()==Qt::LeftButton) && m_bMousePress)
{
QPoint moveAmount = event->globalPos() - m_lastMousePos;
m_absMove += moveAmount;
move(pos() + moveAmount);
m_lastMousePos = event->globalPos();
m_bMouseMove = true;
}
}
void MainForm::mousePressEvent(QMouseEvent *event)
{
if (event->button()==Qt::LeftButton) {
m_bMousePress = true;
m_lastMousePos = event->globalPos();
m_absMove = QPoint(0,0);
}
/*
if(event->button()==Qt::RightButton) {
sInfoThread.terminate();
workThread.terminate();
qApp->exit(-1);
QProcess::startDetached(qApp->applicationFilePath(), QStringList(qApp->applicationFilePath()));
}
*/
}
void MainForm::mouseReleaseEvent(QMouseEvent *event)
{
if (event->button()==Qt::LeftButton)
{
m_bMousePress = false;
}
m_bMouseMove = false;
int x = m_absMove.x();
int y = m_absMove.y();
int form_width_x = this->width();
int from_height_y = this->height();
QPoint point = this->pos();
QLOG_INFO()<<QString("MainForm current Position(x:%1,y:%2) absMove: m_x=%3,m_y=%4").arg( point.x() ).arg( point.y() ).arg(x).arg(y);
int nWidth = GetSystemMetrics(SM_CXSCREEN);
int nHeight = GetSystemMetrics(SM_CYSCREEN);
QLOG_INFO()<<QString::fromLocal8Bit("MainForm active_Range(x: 0~%1,y: 0~%2)").arg( nWidth - form_width_x ).arg( nHeight -from_height_y );
if( (point.x() + form_width_x/3) < 0 || (point.x() + form_width_x) > (nWidth - 40)
|| (point.y() + from_height_y/3) < 0 || (point.y() + from_height_y) > (nHeight - 60) ) {
int reset_x = point.x() - x;
int reset_y = point.y() - y;
QLOG_INFO()<<QString::fromLocal8Bit("MainForm OutRange, Reset Position Before Move (x:%1,y:%2)").arg( reset_x ).arg( reset_y );
this->move( QPoint( reset_x, reset_y ) );
} else {
// this->move( QPoint( point.x()+x, point.y()+y ) ); // No Need Move, mouseMoveEvent Trigger Move;
}
}
void MainForm::MyShow()
{
#ifdef QT_DEBUG
......@@ -84,18 +144,17 @@ void MainForm::MyShow()
// 考虑到坐标问题放到这里构建
m_alertForm = new AlertForm(this);
// m_noticeForm = new NoticeForm(this);
m_settingForm = new SettingForm(this);
m_detailForm = new DetailForm(this);
m_padForm = new PadForm(this);
m_padForm->move(pos().x()+width()-300, pos().y()+height()-438);
m_padForm->hide();
connect(m_padForm, &PadForm::numClicked, this, &MainForm::onNumClicked);
connect(m_padForm, &PadForm::numDelete, this, &MainForm::onNumDelete);
connect(m_padForm, &PadForm::numClear, ui->mainEdtSearch, &ClickedLineEdit::clear);
connect(m_padForm, &PadForm::getEcMopOrder, this, &MainForm::onDisplayEcMopOrder);
m_resultForm = new QListWidget(this);
m_resultForm->setObjectName("mainListWdg0");
......@@ -105,9 +164,7 @@ void MainForm::MyShow()
connect(m_resultForm, &QListWidget::itemClicked, this, &MainForm::onSearchResultItemClicked);
m_dishesForm = new dishesForm(this);
m_bunisStatusForm = new BStatusForm(this);
m_dailyReportForm =new DailyReportForm(this);
//变更此 "日结" 按钮 为"自测" 按钮;
//ui->mainBtnDayReport->hide();
......@@ -123,8 +180,8 @@ void MainForm::MyShow()
void MainForm::_Init()
{
this->setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
//this->showFullScreen();
this->setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Tool);
QLOG_INFO()<<QString::fromLocal8Bit("MainForm _Init Size(width:%1,height:%2)").arg( this->width() ).arg( this->height() );
// 显示托盘
m_tray.show();
......@@ -143,8 +200,7 @@ void MainForm::_Init()
foreach(QTableWidget *table, m_tableList)
{
table->hide();
if(table == ui->mainTableFinsh /*||
table == ui->mainTableReserve*/)
if( table == ui->mainTableFinsh )
{
for(int i=0; i<5; i++)
{
......@@ -187,9 +243,13 @@ void MainForm::_onTableWidgetHeaderClick(int index){
void MainForm::onSetCurrentTime()
{
if(m_raiseIndex++>10)
{
if(m_raiseIndex++>10){
m_raiseIndex=0;
//当点击Windows系统 底部应用任务logo时,会触发将应用最小化动作;故需要将该程序恢复正常状态显示;
if (windowState() == Qt::WindowMinimized) {
QLOG_INFO() << QString("[<<<<---MainForm::onSetCurrentTime: windowState: --->>>>]")<<windowState();
setWindowState(Qt::WindowNoState);
}
raise();
}
ui->mainSlabTime->setText(QDateTime::currentDateTime().toString(QString::fromLocal8Bit("yyyy年MM月dd日 hh:mm:ss")));
......@@ -225,18 +285,22 @@ void MainForm::on_mainBtnHide_clicked()
m_padForm->hide();
if(m_detailForm && m_detailForm->isVisible() ) {
QLOG_INFO() << QString("[<<<<---MainForm::on_mainBtnHide_clicked: m_detailForm=--->>>>]")<< m_detailForm;
m_detailForm->hide();
m_detailForm->hideDetailAllFrom();
}
if (m_alertForm) {
m_alertForm->hide();
}
/*
if ( m_noticeForm ) {
m_noticeForm->hide();
}
*/
emit showFloatForm();
}
/*
void MainForm::on_mainBtnHideAndLockForm()
{
on_mainBtnHide_clicked();
emit lockFloatForm();
}
*/
void MainForm::onShowOrderDetails(OrderObject *orderObject)
{
......@@ -246,8 +310,7 @@ void MainForm::onShowOrderDetails(OrderObject *orderObject)
void MainForm::onShowSearchOrderResult(const QMap<QString,QString>& orderIdList)
{
QLOG_INFO() << QString("[<<<<---MainForm::onShowSearchOrderResult: orderIdList.length:%1 --->>>>]")
.arg(orderIdList.count());
QLOG_INFO() << QString("[<<<<---MainForm::onShowSearchOrderResult: orderIdList.length:%1 --->>>>]").arg(orderIdList.count());
if(orderIdList.isEmpty()) {
m_resultForm->hide();
return;
......@@ -272,8 +335,13 @@ void MainForm::onOrderClear(const QString &orderId, const int &oldstatus)
table = findChild<QTableWidget*>(tabBtn->property("tableName").toString());
for(int i=0; i<table->rowCount(); i++)
{
if(!table->item(i, 1)->text().compare(orderId))
// 过期订单数据,主界面需要清除界面上订单记录 [订单号添加换行符用于比对查找];
int tempOrderIdLen = orderId.length();
QString tempOrderId = orderId.left( tempOrderIdLen -5 ).append( "\r\n" ).append( orderId.right(5) );
if(!table->item(i, 1)->text().compare(tempOrderId))
{
QLOG_INFO() << QString("[<<<<---MainForm::onOrderClear: Find orderId:%1, tempOrderId:%2 Then Clear Ui Item --->>>>]").arg(orderId).arg(tempOrderId);
table->removeRow(i);
QString btnText(tabBtn->property("name").toString());
btnText = QString("%1\n%2").arg(table->rowCount()).arg(btnText);
......@@ -350,6 +418,11 @@ void MainForm::onShowAlert(AlertForm::Type type, const QString &msg)
{
m_alertForm->SetContent(type, msg);
m_alertForm->show();
}else if ( AlertForm::WARNNING ==type || AlertForm::ACK_MSG ==type ) {
emit hideFloatForm();
this->show();
m_alertForm->SetContent(type, msg);
m_alertForm->show();
}
}
......@@ -388,8 +461,12 @@ void MainForm::onChangeOrderStatus(OrderObject *orderObject, int oldStatus)
for(int i=0; i<table->rowCount(); i++)
{
if(!table->item(i, 1)->text().compare(orderObject->id))
// 订单状态改变,主界面需要先移除Old Item后, 再添加New Item; [订单号添加换行符用于比对查找];
int tempOrderIdLen = orderObject->id.length();
QString tempOrderId = orderObject->id.left( tempOrderIdLen -5 ).append( "\r\n" ).append( orderObject->id.right(5) );
if( !table->item(i, 1)->text().compare(tempOrderId) )
{
QLOG_INFO() << QString("[<<<<---MainForm::onChangeOrderStatus:Find/RemoveItem: orderId:%1, tempOrderId:%2 --->>>>]").arg(orderObject->id).arg(tempOrderId);
table->removeRow(i);
QString btnText(tabBtn->property("name").toString());
btnText = QString("%1\n%2").arg(table->rowCount()).arg(btnText);
......@@ -397,7 +474,7 @@ void MainForm::onChangeOrderStatus(OrderObject *orderObject, int oldStatus)
}
}
}
// 将数据插入到表中
tabBtn = _GetTabBtnByOrderStatus(orderObject->orderStatus);
table = findChild<QTableWidget*>(tabBtn->property("tableName").toString());
......@@ -406,7 +483,11 @@ void MainForm::onChangeOrderStatus(OrderObject *orderObject, int oldStatus)
item0->setTextAlignment(Qt::AlignCenter);
table->setItem(0, 0, item0); // 渠道
QTableWidgetItem *item1 = new QTableWidgetItem(orderObject->id);
// 订单状态变更,插件主界面刷新主界面显示 [订单号添加换行符];
int tempOrderIdLen = orderObject->id.length();
QString tempOrderId = orderObject->id.left( tempOrderIdLen -5 ).append( "\r\n" ).append( orderObject->id.right(5) );
// QLOG_INFO() << QString("[<<<<---MainForm::onChangeOrderStatus:AddItem orderId:%1, tempOrderId:%2 --->>>>]").arg(orderObject->id).arg(tempOrderId);
QTableWidgetItem *item1 = new QTableWidgetItem(tempOrderId);
item1->setTextAlignment(Qt::AlignCenter);
table->setItem(0, 1, item1); // 订单ID
......@@ -607,20 +688,44 @@ void MainForm::onChangeOrderStatus(OrderObject *orderObject, int oldStatus)
// 检测是否需要提示
_SetTablesSortEnable(true);
}
void MainForm::on_mainBtnUp_clicked()
{
m_currentTable->scrollToTop();
}
void MainForm::on_mainBtnDown_clicked()
{
m_currentTable->scrollToBottom();
}
void MainForm::onMainTableItemClicked(QTableWidgetItem *item)
{
emit getOrderDetails(((QTableWidget*)sender())->item(item->row(), 1)->text());
{
// 插件主界面点击 Item行,进入订单详情界面展示 [订单号摘除换行符];
QString uiItemOrderId = ((QTableWidget*)sender())->item(item->row(), 1)->text();
QString originOrderId = uiItemOrderId;
int bpos = originOrderId.indexOf("\r");
originOrderId = originOrderId.mid(0,bpos) + originOrderId.mid( bpos + 2 );
QLOG_INFO() << QString("[<<<<---MainForm::onMainTableItemClicked: uiItemOrderId:%1, OrderId:%2 Then Entry Detail Ui--->>>>]").arg(uiItemOrderId).arg(originOrderId);
emit getOrderDetails(originOrderId);
}
/*
void MainForm::onMainNoticeItemClicked(QTableWidgetItem *item)
{
// 插件主界面点击 Item行,进入门店通告详情界面展示;
QString uiItemNoticeTitle = ( ( QTableWidget* )sender() )->item( item->row(), 0 )->text();
QString uiItemNoticeContent = ( ( QTableWidget* )sender() )->item( item->row(), 1 )->text();
int uiItemNoticeAckStatus = ( ( QTableWidget* )sender() )->item( item->row(), 2 )->text().toInt();
QString uiItemNoticeCreateDatetime = ( ( QTableWidget* )sender() )->item( item->row(), 3 )->text();
int uiItemNoticeInsertIdIndex = ( ( QTableWidget* )sender() )->item( item->row(), 4 )->text().toInt();
QLOG_INFO() << QString("[<<<<---MainForm::onMainNoticeItemClicked: title:%1, ackStatus:%2, CreateDatetime:%3, InsertIdIndex:%4 Then Entry Detail Ui--->>>>]")
.arg(uiItemNoticeTitle).arg(uiItemNoticeAckStatus).arg(uiItemNoticeCreateDatetime).arg(uiItemNoticeInsertIdIndex);
onShowNotice(NoticeForm::ACK_MSG, uiItemNoticeTitle, uiItemNoticeContent, uiItemNoticeInsertIdIndex);
}
*/
void MainForm::on_mainEdtSearch_clicked()
{
......@@ -638,6 +743,17 @@ void MainForm::onNumDelete()
ui->mainEdtSearch->setText(text.left(text.length()-1));
}
void MainForm::onDisplayEcMopOrder()
{
QString orderId = ui->mainEdtSearch->text();
ui->mainEdtSearch->clear();
QLOG_INFO() << QString("[<<<<---MainForm::onDisplayEcMopOrder: orderId:%1--->>>>]").arg(orderId);
onShowAlert(AlertForm::BRIEF_TIPS, QString::fromLocal8Bit("获取 EC-MOP 订单数据......"));
emit getEcMopOrderDetails(orderId, "EC-MOP");
}
void MainForm::onSearchResultItemClicked(QListWidgetItem *item)
{
ui->mainEdtSearch->clear();
......
......@@ -33,8 +33,24 @@ public:
* 返回:NULL
* */
void MyShow();
protected:
void mouseMoveEvent(QMouseEvent * event);
void mousePressEvent(QMouseEvent * event);
void mouseReleaseEvent(QMouseEvent * event);
private:
Ui::MainForm *ui;
// 记录左键按下去后是否移动过
bool m_bMouseMove;
// 记录左键是否按下去
bool m_bMousePress;
// 拖动前鼠标坐标
QPoint m_lastMousePos;
// 此次拖动一共移动的距离
QPoint m_absMove;
// 时间定时器
QTimer m_timeTimer;
......@@ -102,6 +118,12 @@ signals:
* */
void showFloatForm();
/* 功能:通知悬浮窗隐藏
* 参数:NULL
* 返回:NULL
* */
void hideFloatForm();
/* 功能:通知悬浮窗开始提示
* 参数:[1]提示类型 0新订单1退款申请
* 返回:NULL
......@@ -120,6 +142,12 @@ signals:
* */
void getOrderDetails(const QString& orderId);
/* 功能:获取 EC-MOP 订单详情
* 参数:NULL
* 返回:NULL
* */
void getEcMopOrderDetails(const QString& orderId, const QString& channel);
/* 功能:开启流程
* 参数:NULL
* 返回:NULL
......@@ -227,6 +255,13 @@ private slots:
* 返回:NULL
* */
void onNumDelete();
/* 功能:键盘获取EC-MOP订单详情处理
* 参数:NULL
* 返回:NULL
* */
void onDisplayEcMopOrder();
/* 功能:点击搜索结果订单对应动作
* 参数:NULL
* 返回:NULL
......
......@@ -31,3 +31,9 @@ void PadForm::on_padBtnClearn_clicked()
emit numClear();
hide();
}
void PadForm::on_padBtnEcMop_clicked()
{
hide();
emit getEcMopOrder();
}
......@@ -35,10 +35,17 @@ private slots:
* */
void on_padBtnClearn_clicked();
/* 功能: 电商-MOP 按钮 触发获取订单详情数据接口获取成功后,直接跳转到 订单详情界面; 获取失败后,直接弹窗提示;
* 参数:NULL
* 返回:NULL
* */
void on_padBtnEcMop_clicked();
signals:
void numClicked(const QString& num);
void numDelete();
void numClear();
void getEcMopOrder();
};
#endif // PADFORM_H
......@@ -19,7 +19,8 @@
//#define APP_VERSION "4.2022.3.3"
//#define APP_VERSION "4.2022.4.11"
//#define APP_VERSION "4.2022.4.28"
#define APP_VERSION "4.2022.8.1"
//#define APP_VERSION "4.2022.8.1"
#define APP_VERSION "4.2023.2.23"
//修正版本号时,切记修正 FmTakeout.rc 中的版本号
#define SERVER_PASSWORD "posoperator@freemud.cn"
......@@ -137,6 +138,16 @@
#define JSON_POSIPADDRESS "posAddress"
#define JSON_CHANNEL "channel"
#define JSON_CALL_BACK_URL "callBackUrl"
#define JSON_SKIP_PRINT "skipPrint"
#define JSON_PUSH_OPTIONS "options"
#define JSON_PUSH_PLUGIN_OPTIONS "pluginOptions"
#define JSON_PRINT_OPT "printOpt"
#define JSON_PRINT_OPT_ALL "all"
#define JSON_PRINT_OPT_SUM "summary"
#define JSON_PRINT_OPT_CUP "cup"
#define JSON_PRINT_OPT_SUB "subscribe"
#define JSON_PRINT_OPT_STR "street"
#define JSON_BUSINESSSTATUS "business_status"
#define JSON_CODE "code"
#define JSON_PAGENUMBER "pageNo"
......
......@@ -114,11 +114,82 @@ 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::on_reason7_toggled(bool checked)
{
if(checked)
{
ui->refuseBtnOk->setEnabled(true);
m_reasonStr=QString::fromLocal8Bit("生活馆到店退单");
m_reasonCode=20;
}
}
void RefuseForm::_Init()
{
qDebug() << __FUNCTION__;
clearAllRadioBtnCheck();
m_refundDishesList.clear();
m_refundDishesListString.clear();
ui->reasonNULL->toggle();
ui->refuseBtnOk->setEnabled(false);
}
void RefuseForm::clearAllRadioBtnCheck(){
QLOG_INFO() << QString("[<<<<---RefuseForm::clearAllRadioBtnCheck Clear All Check --->>>>]");
ui->reason1->setAutoExclusive(false);
ui->reason1->setChecked(false);
ui->reason1->setAutoExclusive(true);
ui->reason2->setAutoExclusive(false);
ui->reason2->setChecked(false);
ui->reason2->setAutoExclusive(true);
ui->reason3->setAutoExclusive(false);
ui->reason3->setChecked(false);
ui->reason3->setAutoExclusive(true);
ui->reason4->setAutoExclusive(false);
ui->reason4->setChecked(false);
ui->reason4->setAutoExclusive(true);
ui->reason5->setAutoExclusive(false);
ui->reason5->setChecked(false);
ui->reason5->setAutoExclusive(true);
/*
ui->reason6->setAutoExclusive(false);
ui->reason6->setChecked(false);
ui->reason6->setAutoExclusive(true);
ui->reason7->setAutoExclusive(false);
ui->reason7->setChecked(false);
ui->reason7->setAutoExclusive(true);
*/
}
void RefuseForm::hideSelectProductFrom(){
if ( m_refDishesForm && m_refDishesForm->isVisible() ) {
QLOG_INFO() << QString("[<<<<---RefuseForm::hideSelectProductFrom Before m_refDishesForm->reject(); --->>>>]");
m_refDishesForm->reject();
/*
if ( m_refDishesForm ) {
m_refDishesForm->deleteLater();
QLOG_INFO() << QString("[<<<<---RefuseForm::hideSelectProductFrom m_refDishesForm->deleteLater(); --->>>>]");
}
*/
QLOG_INFO() << QString("[<<<<---RefuseForm::hideSelectProductFrom After m_refDishesForm->reject(); --->>>>]");
} else {
QLOG_INFO() << QString("[<<<<---RefuseForm::hideSelectProductFrom Finished --->>>>]");
}
}
......@@ -51,6 +51,15 @@ private slots:
void on_reason5_toggled(bool checked);
void on_reason6_toggled(bool checked);
void on_reason7_toggled(bool checked);
public slots:
void clearAllRadioBtnCheck();
void hideSelectProductFrom();
private:
Ui::RefuseForm *ui;
......
run/skin/MopTitle.png

1.05 KB | W: | H:

run/skin/MopTitle.png

1.15 KB | W: | H:

run/skin/MopTitle.png
run/skin/MopTitle.png
run/skin/MopTitle.png
run/skin/MopTitle.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -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>
......@@ -39,10 +40,12 @@
<file>ComeNewOrder.png</file>
<file>NomalOrderManager.png</file>
<file>ElemeTitle.png</file>
<file>MtTitle.png</file>
<file>ModTitle.png</file>
<file>MopTitle.png</file>
<file>StoreOff.png</file>
<file>StoreOn.png</file>
<file>StoreDef.png</file>
<file>SmallHorn.png</file>
</qresource>
</RCC>
\ No newline at end of file
......@@ -77,8 +77,8 @@ QWidget
}
#mainLabPlacard
{
color: #b9b9b9;
background-color: #262626;
color: rgb(255, 0, 0);
background-color: #303030;
}
#mainSlabStoreid,#mainSlabOpeStatus,#mainSlabNetStatus,#mainSlabVersion,#mainSlabCashier,
#mainSlabTime,#mainLabStoreid,#mainLabOpeStatus,#mainLabNetStatus,#mainLabVersion,#mainLabCashier
......@@ -505,13 +505,13 @@ QTabBar QToolButton::left-arrow:disabled {
color: #ffffff;
border-image: url(:numBtn_press.png);
}
#padBtnClearn
#padBtnClose
{
font: 11pt "微软雅黑";
color: rgb(98, 98, 98);
border-image: url(:numBtn_normal.png);
}
#padBtnClearn:pressed
#padBtnClose:pressed
{
color: #ffffff;
border-image: url(:numBtn_press.png);
......@@ -526,6 +526,17 @@ QTabBar QToolButton::left-arrow:disabled {
border-image: url(:numBtn_press.png);
image: url(:delBtn_press.png);
}
#padBtnEcMop
{
font: 11pt "微软雅黑";
color: rgb(98, 98, 98);
border-image: url(:numBtn_normal.png);
}
#padBtnEcMop:pressed
{
color: #ffffff;
border-image: url(:numBtn_press.png);
}
/*---------------------------------padForm[ end ]---------------------------------*/
/*---------------------------------alertForm[begin]---------------------------------*/
......@@ -541,6 +552,10 @@ QTabBar QToolButton::left-arrow:disabled {
{
border-image: url(:ok.png);
}
#alertLabWarn
{
border-image: url(:warn.png);
}
#alertLabMsg
{
color: rgb(129, 129, 129);
......@@ -561,6 +576,58 @@ QTabBar QToolButton::left-arrow:disabled {
}
/*---------------------------------alertForm[ end ]---------------------------------*/
/*---------------------------------noticeForm[begin]---------------------------------*/
#noticeWdg
{
border-image: url(:alert_bg.png);
}
#noticeLabError
{
border-image: url(:error.png);
}
#noticeLabOk
{
border-image: url(:ok.png);
}
#noticeLabWarn
{
border-image: url(:warn.png);
}
#noticeTitleLab
{
color: rgb(129, 129, 129);
}
#noticeBtnOk
{
color: #878787;
background-color: #ffffff;
border: 1px solid #878787;
border-radius: 4px;
}
#noticeBtnOk:pressed
{
color: #3de17b;
background-color: #ffffff;
border: 1px solid #3de17b;
border-radius: 4px;
}
#noticeBtnIgnore
{
color: #878787;
background-color: #ffffff;
border: 1px solid #878787;
border-radius: 4px;
}
#noticeBtnIgnore:pressed
{
color: #3de17b;
background-color: #ffffff;
border: 1px solid #3de17b;
border-radius: 4px;
}
/*---------------------------------noticeForm[ end ]---------------------------------*/
/*---------------------------------DetailForm[begin]---------------------------------*/
#DetailForm
{
......@@ -617,21 +684,21 @@ QTabBar QToolButton::left-arrow:disabled {
color: rgb(173, 223, 152);
}
#detailSlab0,#detailSlab1,#detailSlab2,#detailSlab3,#detailSlab4,
#detailSlab5,#detailSlab6,#detailSlab7,#detailSlab8
#detailSlab5,#detailSlab6,#detailSlab7,#detailSlab8,#detailSlab10
{
color: #a6a6a6;
background-color: #faf9f9;
border: 1px solid #ececec;
}
#detailLab0,#detailLab2,#detailLab3,#detailLab4,
#detailLab5,#detailLab6,#detailLab7,#detailLab8
#detailLab5,#detailLab6,#detailLab7,#detailLab10
{
border-top: 1px solid #ececec;
border-bottom: 1px solid #ececec;
color: #4d4d4d;
background-color: #faf9f9;
}
#detailLab1
#detailLab1,#detailLab8
{
color: rgb(190, 63, 0);
background-color: #faf9f9;
......@@ -740,7 +807,7 @@ QTabBar QToolButton::left-arrow:disabled {
background-color: rgb(222,184,135);
border-radius: 3px;
}
#reason1,#reason2,#reason3,#reason4,#reason5
#reason1,#reason2,#reason3,#reason4,#reason5,#reason6,#reason7
{
font: 14pt "微软雅黑";
}
......@@ -752,14 +819,37 @@ QTabBar QToolButton::left-arrow:disabled {
}
/*---------------------------------refuseForm[end]-------------------------------------*/
/*---------------------------------PrintTicketSelectForm[start]-------------------------------------*/
#PrintTicketSelectForm
{
background-color:rgb(245,245,245);
}
#ticketSelectLab0
{
font: 14pt "微软雅黑";
background-color:rgb(238, 122, 42);
}
#BtnOk,#BtnCancle
{
font: 14pt "微软雅黑";
color: rgb(255, 255, 255);
background-color: rgb(238,122,42);
border-radius: 3px;
}
#BtnOk:pressed,#BtnCancle:pressed
{
color: rgb(161, 161, 161);
background-color: rgb(222,184,135);
border-radius: 3px;
}
#summaryTicket,#cupTicket,#reserveTicket,#curbsideTicket,#allTicket
{
font: 14pt "微软雅黑";
}
#BtnOk:disabled
{
color: #3d3d3d;
background-color: rgb(230, 230, 230);
border-radius: 3px;
}
/*---------------------------------PrintTicketSelectForm[end]-------------------------------------*/
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