Commit 8ebb5aa7 by wuyang.zou

Version 2.2020.5.16

1、完善 WSG-MOD 用星说
2、进行 预约单准备功能
parent 53f66b32
Pipeline #21735 failed with stage
in 0 seconds
......@@ -303,7 +303,7 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
orderObject->forwardPosStatus =0;
orderObject->negativePosStatus =0;
orderObject->businessType = "0";
orderObject->inAdvanceTakemeal = 0;
orderObject->FromJson(jsonObject);
orderObject->pushOrderType=0;
......@@ -367,17 +367,30 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
emit startRemind(REMIND_CONFIRMED_ORDER);
}
}
int syncOrderRet = PrintSumBillPosDB::getInstance().syncOrderDataToDB(orderObject);
QLOG_INFO() << QString("[<<<<---PrintSumBillPosDB.getInstance().syncOrderDataToDB orderId:%1 syncOrderRet:%2--->>>>]")
.arg(orderObject->id).arg(syncOrderRet);
QLOG_INFO() << QString("[<<<<---FmTakeout _OrderAnalysis-> changeOrderStatus--->>>>]");
emit changeOrderStatus(orderObject);
}
/***<2>:FM插件维护的有效订单容器中存在此订单:更新订单容器中此订单的订单状态***/
else {
int oldStatus = orderObject->orderStatus;
int oldArriveAhead = orderObject->inAdvanceTakemeal;
orderObject->FromJson(jsonObject);
QLOG_INFO() << QString("[<<<<---FmTakeout Valid Order Map:Update orderId:%1 OldStatus:%2: curStatus:%3]--->>>>]").arg(orderObject->id).arg(oldStatus).arg(orderObject->orderStatus);
if(oldStatus != orderObject->orderStatus) {
emit changeOrderStatus(orderObject, oldStatus);
}
if ( oldArriveAhead != orderObject->inAdvanceTakemeal ) {
int updateOrderRet = PrintSumBillPosDB::getInstance().updateOrderDataToDB(orderObject, QString("appointed_remindTemplate"));
QLOG_INFO() << QString("[<<<<---PrintSumBillPosDB.getInstance().updateOrderDataToDB orderId:%1 updateOrderRet:%2--->>>>]")
.arg(orderObject->id).arg(updateOrderRet);
}
}
orderObject->updateTime=QDateTime::currentDateTime().toTime_t();
......@@ -1504,13 +1517,14 @@ QString FlowControl::_GetJsonStr(const QJsonObject &json)
return QString(QJsonDocument(json).toJson(QJsonDocument::Compact)).replace("\"","");
}
QJsonObject FlowControl::_PackHttpReplyJson(const int status, const QString &msg, const QJsonObject &data,const int& iscontinue)
QJsonObject FlowControl::_PackHttpReplyJson(const int status, const QString &msg, const QJsonObject &data,const int& iscontinue, const QString &orderId)
{
QJsonObject rObj;
rObj.insert("statusCode", status);
rObj.insert("msg", msg);
rObj.insert("iscontinue",iscontinue);
rObj.insert("data", data);
rObj.insert("orderId", orderId);
return rObj;
}
......@@ -2095,7 +2109,7 @@ bool FlowControl::_ResponseSimphony05Request(const QJsonObject &content, QJsonOb
/***** 更新 POS本地数据库的商品数据是否成功;begin:*********/
int retSyncOrderProductInfo = 1; //默认是同步POS商品数据成功; 目前只有 businessType: 20:WSG-杯贴祝福; 30: 拼团;
if (order_p && ( "30"==order_p->businessType ||
if (order_p && ( 7 == order_p->orderType || 8 == order_p->orderType ||
("WSG-MOD" == order_p->channel && "4" == order_p->platformSource)
) ) {
if ( PrintCupStickPosDB ::getInstance().isOrderProductExist(orderId) ) {
......@@ -2605,7 +2619,7 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
int tempOrderType,tempOrderPayType,tempSbkAppPayType=0;
QString tempSbkAppPayValue="0";
// 转换成星巴克规定的订单类型;
//星巴克的订单类型:1:新订单; 2:预订单; 3:客诉单; 4:MOP自测订单; 5:预约订单
//星巴克的订单类型:1:新订单; 2:预订单; 3:客诉单; 4:MOP自测订单; 5:预约订单; 7:当日预约单;8拼单
if(3 == orderObject->getOrderType()) {
tempOrderType = 12;
tempOrderPayType = -1;
......@@ -2614,12 +2628,19 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
// OMS提供的数据://订单渠道: 星巴克-MOD,百度外卖,饿了么APP,美团外卖,星巴克-MOP;
// MOD渠道对应的业务逻辑 ;
else if ( "MOD" == orderObject->channel ) {
// platformSource:平台来源:1 app; 2 ele; 3 ors; 4 WeChat ; 5 口碑;
if ( "4" == orderObject->platformSource ) {
tempOrderType = 27;
if ( 7 == orderObject->orderType ) {
tempOrderType = 14;
} else if ( 8 == orderObject->orderType ) {
tempOrderType = 0; // 还未申请,等待申请
} else {
tempOrderType = 9;
// platformSource:平台来源:1 app; 2 ele; 3 ors; 4 WeChat ; 5 口碑;
if ( "4" == orderObject->platformSource ) {
tempOrderType = 27;
} else {
tempOrderType = 9;
}
}
tempOrderPayType = 84;
//星巴克App端支付方式: 1:支付宝; 2:微信; 3:银联; 4:SVC卡; 5/7:MOP使用券或星星抵扣 0元支付; 8:IStore订单; 9:银联支付(=3);
if(4 == orderObject->payWay){
......@@ -2647,12 +2668,19 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
} // 兼容渠道名称不统一问题
else if ( "WSG-MOD" == orderObject->channel ) {
// platformSource:平台来源:1 app; 2 ele; 3 ors; 4 WeChat; 5 口碑;
if ( "4" == orderObject->platformSource ) {
tempOrderType = 31;
if ( 7 == orderObject->orderType ) {
tempOrderType = 14;
} else if ( 8 == orderObject->orderType ) {
tempOrderType = 0; // 还未申请,等待申请
} else {
tempOrderType = 9;
// platformSource:平台来源:1 app; 2 ele; 3 ors; 4 WeChat; 5 口碑;
if ( "4" == orderObject->platformSource ) {
tempOrderType = 31;
} else {
tempOrderType = 9;
}
}
tempOrderPayType = 84;
tempSbkAppPayType = -1;
......@@ -2660,12 +2688,19 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
}// MOP渠道对应的业务逻辑;
else if ( "MOP" == orderObject->channel ){
// 区别:口碑-MOP / App-MOP;
if ( "5" == orderObject->platformSource ){
tempOrderType = 29;
if ( 7 == orderObject->orderType ) {
tempOrderType = 14;
} else if ( 8 == orderObject->orderType ) {
tempOrderType = 0; // 还未申请,等待申请
} else {
tempOrderType = 18;
// 区别:口碑-MOP / App-MOP;
if ( "5" == orderObject->platformSource ){
tempOrderType = 29;
} else {
tempOrderType = 18;
}
}
tempOrderPayType = 84;
//星巴克App端支付方式: 1:支付宝; 2:微信; 3:银联; 4:SVC卡; 5/7:MOP使用券或星星抵扣 0元支付; 8:IStore订单; 9:银联支付(=3);
if ( 4 == orderObject->payWay ) {
......@@ -2720,28 +2755,46 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
tempOrderType = 16;
}
else if ( "MOD" == orderObject->channel ) {
// platformSource:平台来源:1 app; 2 ele; 3 ors; 4 WeChat; 5 口碑;
if ( "4" == orderObject->platformSource ) {
tempOrderType = 28;
if ( 7 == orderObject->orderType ) {
tempOrderType = 15;
} else if ( 8 == orderObject->orderType ) {
tempOrderType = 0; // 还未申请,等待申请
} else {
tempOrderType = 17;
// platformSource:平台来源:1 app; 2 ele; 3 ors; 4 WeChat; 5 口碑;
if ( "4" == orderObject->platformSource ) {
tempOrderType = 28;
} else {
tempOrderType = 17;
}
}
} // 兼容渠道名称不统一问题
else if ( "WSG-MOD" == orderObject->channel ) {
// platformSource:平台来源:1 app; 2 ele; 3 ors; 4 WeChat; 5 口碑;
if ( "4" == orderObject->platformSource ) {
tempOrderType = 32;
if ( 7 == orderObject->orderType ) {
tempOrderType = 15;
} else if ( 8 == orderObject->orderType ) {
tempOrderType = 0; // 还未申请,等待申请
} else {
tempOrderType = 17;
// platformSource:平台来源:1 app; 2 ele; 3 ors; 4 WeChat; 5 口碑;
if ( "4" == orderObject->platformSource ) {
tempOrderType = 32;
} else {
tempOrderType = 17;
}
}
}
else if ( "MOP" == orderObject->channel ) {
// 区分: 口碑-MOP / App-MOP;
if ( "5" == orderObject->platformSource ) {
tempOrderType = 30;
if ( 7 == orderObject->orderType ) {
tempOrderType = 15;
} else if ( 8 == orderObject->orderType ) {
tempOrderType = 0; // 还未申请,等待申请
} else {
tempOrderType = 19;
// 区分: 口碑-MOP / App-MOP;
if ( "5" == orderObject->platformSource ) {
tempOrderType = 30;
} else {
tempOrderType = 19;
}
}
} //预约->配送费入机: 销售单订单类型:23; 退货单订单类型: 24; //预约->实物入机: 销售单订单类型:21;退货单订单类型:22;【此case不存在】
......@@ -3080,8 +3133,11 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
//**********************************整合包装费-begin*****************************************//
// 向商品列表尾部 添加 包装费项 + 包装费折扣项;
// 包装费 >0 + MOP 也不能入机【特别说明:WSG-MOD 配送费及配送费折扣信息存储 coupons中;故在此处排除】;
if(orderObject->packageFee > 0 && 18!=tempOrderType && 19!=tempOrderType && 20!=tempOrderType && 29!=tempOrderType && 30!=tempOrderType &&
31!=tempOrderType && 32!=tempOrderType ) {
if ( orderObject->packageFee > 0 && ( 18!=tempOrderType && 19!=tempOrderType && 20!=tempOrderType
&& 29!=tempOrderType && 30!=tempOrderType && 31!=tempOrderType && 32!=tempOrderType
&& 14!=tempOrderType && 15!=tempOrderType
|| ( (14==tempOrderType || 15==tempOrderType) && "MOD"==orderObject->channel ) )
) {
QJsonObject tPackageFeeObj;
tPackageFeeObj.insert("consume_num", orderObject->packageFee/100);
tPackageFeeObj.insert("pid", "6000201"); //包装费SKU;
......@@ -3102,8 +3158,11 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
products.push_back(tPackDiscountObj);
}
//打包费是0元时( MOP 包装费不能入机):需录入打包费[非-MOP(销售退货),非-MOP测试];
} else if (0 == orderObject->packageFee && 18!=tempOrderType && 19!=tempOrderType && 20!=tempOrderType && 29!=tempOrderType && 30!=tempOrderType &&
31!=tempOrderType && 32!=tempOrderType ) {
} else if (0 == orderObject->packageFee && ( 18!=tempOrderType && 19!=tempOrderType && 20!=tempOrderType
&& 29!=tempOrderType && 30!=tempOrderType && 31!=tempOrderType && 32!=tempOrderType
&& 14!=tempOrderType && 15!=tempOrderType
|| ( (14==tempOrderType || 15==tempOrderType) && "MOD"==orderObject->channel ) )
) {
QJsonObject tPackageFeeObj;
tPackageFeeObj.insert("consume_num", 1);
tPackageFeeObj.insert("pid","6000201"); //包装费SKU;
......@@ -3114,8 +3173,11 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
//**********************************整合配送费-begin*****************************************//
//向商品列表尾部 添加 配送费项 + 配送费折扣项; 【特别说明:WSG-MOD 配送费及配送费折扣信息存储 coupons中;故在此处排除】
if(orderObject->deliveryPrice > 0 && 18!=tempOrderType && 19!=tempOrderType && 20!=tempOrderType && 29!=tempOrderType && 30!=tempOrderType &&
31!=tempOrderType && 32!=tempOrderType ) {
if ( orderObject->deliveryPrice > 0 && ( 18!=tempOrderType && 19!=tempOrderType && 20!=tempOrderType
&& 29!=tempOrderType && 30!=tempOrderType && 31!=tempOrderType && 32!=tempOrderType
&& 14!=tempOrderType && 15!=tempOrderType
|| ( (14==tempOrderType || 15==tempOrderType) && "MOD"==orderObject->channel ) )
) {
QJsonObject tDeliveryFeeObj;
tDeliveryFeeObj.insert("consume_num", orderObject->deliveryPrice/100);
tDeliveryFeeObj.insert("pid", "6000101"); //配送费SKU;
......@@ -3136,8 +3198,11 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
products.push_back(tDeliveryDiscountObj);
}
//配送费是0元时:需录入配送费[非-MOP(销售退货),非-MOP测试; ];
} else if(0 == orderObject->deliveryPrice && 18!=tempOrderType && 19!=tempOrderType && 20!=tempOrderType && 29!=tempOrderType && 30!=tempOrderType &&
31!=tempOrderType && 32!=tempOrderType) {
} else if ( 0 == orderObject->deliveryPrice && ( 18!=tempOrderType && 19!=tempOrderType && 20!=tempOrderType
&& 29!=tempOrderType && 30!=tempOrderType && 31!=tempOrderType && 32!=tempOrderType
&& 14!=tempOrderType && 15!=tempOrderType
|| ( (14==tempOrderType || 15==tempOrderType) && "MOD"==orderObject->channel ) )
) {
QJsonObject tDeliveryFeeZoreObj;
tDeliveryFeeZoreObj.insert("consume_num", 9);
tDeliveryFeeZoreObj.insert("pid","6000101"); //配送费SKU;
......
......@@ -475,7 +475,7 @@ public slots:
* 参数:NULL
* 返回:Json对象
* */
QJsonObject _PackHttpReplyJson(const int status, const QString& msg, const QJsonObject& data, const int &iscontinue);
QJsonObject _PackHttpReplyJson(const int status, const QString& msg, const QJsonObject& data, const int &iscontinue, const QString &orderId);
/**
*功能:FM外卖插件为响应Simphony请求准备返回数据
......
......@@ -213,9 +213,9 @@ bool PrintCupStickPosDB::insertOrderProduct(OrderObject* orderObj,const QString&
}
}
/********************* 拼单-商品关联数据; **************************/
// "MOD" == orderObj->channel && "4" == orderObj->platformSource && "30" == orderObj->businessType
else if ( "30" == orderObj->businessType ) {
/********************* 预约+拼单-商品关联数据; **************************/
// orderType: 7 预约 ; 8 拼单;
else if ( 7 == orderObj->orderType || 8 == orderObj->orderType) {
for (int i=0; i < orderObj->proList.count(); i++) {
dishesObject* dish=orderObj->proList.at(i);
query.prepare("INSERT INTO tb_main_prod_refinfo(chk_num, order_id, order_status, create_datetime, "
......@@ -273,6 +273,8 @@ bool PrintCupStickPosDB::insertOrderProduct(OrderObject* orderObj,const QString&
}
return false;
}
......
......@@ -575,10 +575,16 @@ bool PrintSumBillPosDB::insertOrderSumBill(OrderObject* orderObj,const QString&
int tempBusinessType = orderObj->businessType.toInt();
if ( "WSG-MOD" == orderObj->channel && "4" == orderObj->platformSource)
tempBusinessType = 20;
if ( 7 == orderObj->orderType ) {
tempBusinessType = 10;
} else if ( 8 == orderObj->orderType ) {
tempBusinessType = 30;
}
query.addBindValue( tempBusinessType ); // --订单业务类型: 10:预约单 20:WSG-杯贴祝福 30:拼单
query.addBindValue(orderObj->appointedTime); // --
query.addBindValue(orderObj->appointedRemindTemplate);
query.addBindValue( tempBusinessType ); // --订单业务类型: 10:预约单 20:WSG-杯贴祝福 30:拼团
query.addBindValue(orderObj->expectDate); // -- 预约取餐时间
QString tempAppointedRemindTemplate = QString::number(orderObj->inAdvanceTakemeal) + ";" + orderObj->reserveMakeTime; // 预约模板;
query.addBindValue(tempAppointedRemindTemplate);
query.addBindValue(orderObj->orderType);
QString tempChannel = ("WSG-MOD" == orderObj->channel)?"MOD" :orderObj->channel;
......@@ -618,8 +624,8 @@ bool PrintSumBillPosDB::insertOrderSumBill(OrderObject* orderObj,const QString&
.arg((orderObj->waybillId).length()?orderObj->waybillId:QString("0"))
.arg(orderObj->pickupCode.length()==0?0:orderObj->pickupCode.toInt())
.arg(orderObj->riderPhone).arg(orderObj->riderName).arg(abs(orderObj->disPlateformFee))
.arg(orderObj->memo).arg(orderObj->secretSignal).arg(orderObj->consumerRemark).arg( tempBusinessType ).arg(orderObj->appointedTime)
.arg(orderObj->appointedRemindTemplate).arg(orderObj->orderType).arg(orderObj->channel).arg(orderObj->platformSource).arg(orderObj->payWay)
.arg(orderObj->memo).arg(orderObj->secretSignal).arg(orderObj->consumerRemark).arg( tempBusinessType ).arg(orderObj->expectDate)
.arg(tempAppointedRemindTemplate).arg(orderObj->orderType).arg(orderObj->channel).arg(orderObj->platformSource).arg(orderObj->payWay)
.arg(orderObj->customerId).arg(orderObj->customerName).arg(orderObj->msr_no).arg(orderObj->storeId).arg(orderObj->subStoreId)
.arg(orderObj->storeName).arg(orderObj->storeAddress).arg(orderObj->isPackage).arg(orderObj->orderDiscount).arg(orderObj->totalPrice);
} else {
......@@ -630,6 +636,103 @@ bool PrintSumBillPosDB::insertOrderSumBill(OrderObject* orderObj,const QString&
return result;
}
int PrintSumBillPosDB::syncOrderDataToDB(OrderObject* orderObj) {
// 0: 同步失败;1: 无需同步;2: 同步成功;
int syncAppointOrder = 1;
// 1、同步 预约当日订单的 "提前到店" 信息,避免出现 遗漏;
if ( OrderObject::Refunded != orderObj->orderStatus && 7 == orderObj->orderType && orderObj->inAdvanceTakemeal ) {
syncAppointOrder = syncAppointOrderInfo(orderObj);
QLOG_INFO()<<QString("[<<<<---syncOrderDataToDB syncAppointOrderInfo OrderId %1 ArriverAhead:%2 syncAppointOrder:%3--->>>>]")
.arg(orderObj->id).arg(orderObj->inAdvanceTakemeal).arg(syncAppointOrder);
}
// 2、同步其他......
return syncAppointOrder;
}
int PrintSumBillPosDB::syncAppointOrderInfo(OrderObject* orderObj) {
QMutexLocker mutex(&m_mutex);
// 0: 更新失败; 1:无需更新; 2: 更新成功;
int syncRet = 0;
if(!m_sqlDb.open()) {
QLOG_ERROR()<<"[<<<<---SqlServer Database:Open Failed--->>>>]"<<m_sqlDb.lastError().text();
return false;
}
// 先查找记录(退单无需更新) 判断是否需要同步;在记录同步记录结果;
QSqlQuery query(m_sqlDb);
query.prepare(QString(" select appointed_remindTemplate from tb_msr_customer_info where order_id='%1' and order_status !=6").arg(orderObj->id));
if(!query.exec()) {
QLOG_ERROR()<<query.lastError().text()<<QString("[<<<<---SqlServer Database: select OrderId %1 appointed_remindTemplate Failed--->>>>]").arg(orderObj->id);
syncRet= 0;
} else {
if ( query.first() && query.value(0).toString().length() ) {
QString tempRemindTemplate = query.value(0).toString().split(';').first();
if ( orderObj->inAdvanceTakemeal != tempRemindTemplate.toInt() ) {
QSqlQuery updateQuery(m_sqlDb);
updateQuery.prepare(QString("update tb_msr_customer_info set appointed_remindTemplate='%1' where order_id='%2' and order_status !=6")
.arg(QString::number(orderObj->inAdvanceTakemeal) + ";" + orderObj->reserveMakeTime).arg(orderObj->id));
if(!updateQuery.exec()) {
QLOG_ERROR()<<updateQuery.lastError().text()<<QString("[<<<<---SqlServer Database:Sync OrderId %1 appointed_remindTemplate Failed--->>>>]").arg(orderObj->id);
syncRet= 0;
} else {
QLOG_INFO()<<QString("[<<<<---SqlServer Database:Sync OrderId %1 appointed_remindTemplate success--->>>>]").arg(orderObj->id);
syncRet= 2;
}
} else {
syncRet= 1;
}
} else {
syncRet= 1;
}
}
m_sqlDb.close();
return syncRet;
}
int PrintSumBillPosDB::updateOrderDataToDB(OrderObject* orderObj, const QString &cloumnName) {
// 0: 更新失败;1: 无需更新; 2: 更新成功;
int updateAppointOrder = 1;
if ("appointed_remindTemplate"==cloumnName ) {
// 1、更新 预约当日订单的 "提前到店" 信息,避免出现 遗漏;
if ( OrderObject::Refunded != orderObj->orderStatus && 7 == orderObj->orderType && orderObj->inAdvanceTakemeal ) {
updateAppointOrder = updateAppointOrderInfo(orderObj) ? 2: 0 ;
QLOG_INFO()<<QString("[<<<<---updateOrderDataToDB updateAppointOrderInfo OrderId %1 ArriverAhead:%2 updateAppointOrder:%3--->>>>]")
.arg(orderObj->id).arg(orderObj->inAdvanceTakemeal).arg(updateAppointOrder);
}
}
return updateAppointOrder;
}
bool PrintSumBillPosDB::updateAppointOrderInfo(OrderObject* orderObj) {
QMutexLocker mutex(&m_mutex);
if(!m_sqlDb.open()) {
QLOG_ERROR()<<"[<<<<---SqlServer Database:Open Failed--->>>>]"<<m_sqlDb.lastError().text();
return false;
}
// 0: 更新失败; 2: 更新成功;
bool updateRet = false;
QSqlQuery query(m_sqlDb);
query.prepare(QString("update tb_msr_customer_info set appointed_remindTemplate='%1' where order_id='%2' and order_status !=6")
.arg(QString::number(orderObj->inAdvanceTakemeal) + ";" + orderObj->reserveMakeTime).arg(orderObj->id));
if(!query.exec()) {
QLOG_ERROR()<<query.lastError().text()<<QString("[<<<<---SqlServer Database:update OrderId %1 appointed_remindTemplate Failed--->>>>]").arg(orderObj->id);
updateRet= false;
} else {
QLOG_INFO()<<QString("[<<<<---SqlServer Database:Update OrderId %1 appointed_remindTemplate success--->>>>]").arg(orderObj->id);
updateRet = true;
}
m_sqlDb.close();
return updateRet;
}
bool PrintSumBillPosDB::updateOrderSumBillStatus(OrderObject* orderObj, const int &OrderStatus){
QMutexLocker mutex(&m_mutex);
if(!m_sqlDb.open()) {
......@@ -651,6 +754,7 @@ bool PrintSumBillPosDB::updateOrderSumBillStatus(OrderObject* orderObj, const in
return result;
}
bool PrintSumBillPosDB::isOrderAndCknoSumBillExist(const QString& orderId,const QString& posCheckNo){
QMutexLocker mutex(&m_mutex);
if(!m_sqlDb.open()) {
......
......@@ -58,6 +58,34 @@ public:
bool insertOrderSumBill(OrderObject* orderObj, const QString& posCheckNo);
/**
*功能: 根据订单对象指针 同步pos本地数据库中数据;
*参数:[1]订单对象指针
*返回: 0: 同步失败;1: 无需同步;2: 同步成功;
**/
int syncOrderDataToDB(OrderObject* orderObj);
/**
*功能: 根据订单对象 同步pos数据库中汇总单中的预约信息;
*参数:[1]订单对象指针
*返回: 0: 同步失败;1: 无需同步;2: 同步成功;
**/
int syncAppointOrderInfo(OrderObject* orderObj);
/**
*功能: 根据订单对象指针 更新pos本地数据库中数据;
*参数:[1]订单对象指针
*返回: 0: 更新失败;1: 无需更新; 2: 更新成功;
**/
int updateOrderDataToDB(OrderObject* orderObj, const QString &cloumnName);
/**
*功能: 根据订单对象 更新 pos数据库中汇总单中的预约信息;
*参数:[1]订单号
*返回:true操作成功,false失败
**/
bool updateAppointOrderInfo(OrderObject* orderObj);
/**
*功能: 根据订单ID 更新 pos本地数据库中汇总单状态信息;
*参数:[1]订单号[2] [3] [4] [5] [6]
*返回:true操作成功,false失败
......
......@@ -26,9 +26,10 @@ void LoaclHttpServer::run()
QJsonParseError jsonError;
QJsonObject recvObject;
QJsonObject replyObject;
int status; //解析json结果
int status; //解析json结果
QString msg;
QJsonObject data; //回复的内容json
QString orderId = ""; //接受推单过来的订单号
QJsonObject data; //回复的内容json
int iscontinue =0;
recvObject = QJsonDocument::fromJson(recvData.toUtf8(), &jsonError).object();
/***解析Http Request json格式: 解析失败***/
......@@ -48,9 +49,11 @@ void LoaclHttpServer::run()
if(!FlowControl::GetInstance()._SimValidOrdersListIsEmpty()) {
iscontinue=1;
}
orderId = recvObject["orderId"].toString();
}
/***将FM外卖插件中的合法有效数据返回给上面Http发过来的请求***/
replyObject = FlowControl::GetInstance()._PackHttpReplyJson(status, msg, data,iscontinue);
replyObject = FlowControl::GetInstance()._PackHttpReplyJson(status, msg, data, iscontinue, orderId);
QLOG_INFO() << QString::fromLocal8Bit("[<<<<---FM外卖插件回应Http拉单请求后的返回结果:--->>>>]") << replyObject;
session->replyJsonObject(replyObject);
}
......
......@@ -132,35 +132,42 @@ void OrderObject::FetchDataFromJson(const QJsonObject &json)
QString OrderObject::getChannelName()
{
QLOG_INFO() << QString("[<<<<---OrderObject:getChannelName [%1]--->>>>]").arg(channel);
if ("MOD" == channel && 3 != orderType) {
if ( "4" == platformSource ) {
if ( "30" == businessType) {
return QString::fromLocal8Bit("拼单-MOD");
}
return QString::fromLocal8Bit("微信-MOD");
if ( "MOD" == channel ) {
if ( 3 == orderType ) {
return QString::fromLocal8Bit("星-客诉");
}else if ( 7 == orderType ) {
return QString::fromLocal8Bit("预约-MOD");
}else if ( 8 == orderType ) {
return QString::fromLocal8Bit("拼团-MOD");
} else {
return QString::fromLocal8Bit("星-MOD");
if ( "4" == platformSource ) {
return QString::fromLocal8Bit("微信-MOD");
} else {
return QString::fromLocal8Bit("星-MOD");
}
}
}else if ("MOD" == channel && 3 == orderType) {
return QString::fromLocal8Bit("星-客诉");
}else if ("WSG-MOD" == channel) { // 兼容渠道名称不统一问题
return QString::fromLocal8Bit("微信用星说");
}else if("ELE" == channel){
return QString::fromLocal8Bit("饿了么");
}else if("MOP" == channel && 4 != orderType){
if ( "5" == platformSource ) {
return QString::fromLocal8Bit("口碑-MOP");
}else if ( "MOP" == channel ){
if ( 4 == orderType ) {
return QString::fromLocal8Bit("星-自测");
} else if ( 7 == orderType ) {
return QString::fromLocal8Bit("预约-MOP");
} else if ( 8 == orderType ) {
return QString::fromLocal8Bit("拼团-MOP");
} else {
return QString::fromLocal8Bit("星-MOP");
if ( "5" == platformSource ) {
return QString::fromLocal8Bit("口碑-MOP");
} else {
return QString::fromLocal8Bit("星-MOP");
}
}
}else if("MOP" == channel && 4 == orderType){
return QString::fromLocal8Bit("星-自测");
}else{
return QString::fromLocal8Bit("未知");
}
......
......@@ -84,8 +84,9 @@ class OrderObject : public QObject
Q_PROPERTY (QString platformSource READ getPlatformSource WRITE setPlatformSource)
Q_PROPERTY (int orderIndex READ getOrderIndex WRITE setOrderIndex)
Q_PROPERTY (QString appointedTime READ getAppointedTime WRITE setAppointedTime)
Q_PROPERTY (QString appointedRemindTemplate READ getAppointedRemindTemplate WRITE setAppointedRemindTemplate)
Q_PROPERTY (QString expectDate READ getExpectDate WRITE setExpectDate)
Q_PROPERTY (QString reserveMakeTime READ getReserveMakeTime WRITE setReserveMakeTime)
Q_PROPERTY (int inAdvanceTakemeal READ getInAdvanceTakemeal WRITE setInAdvanceTakemeal)
Q_PROPERTY (QString subStoreId READ getSubStoreId WRITE setSubStoreId)
public:
......@@ -181,9 +182,10 @@ public:
QString makeDeviceId; //PMS 更新制作状态的设备Id
QString businessType; //订单业务类型: 10:预约单 20:杯贴祝福 30:拼团
QString appointedTime; // 预约日期 [预约单-预约日期]
QString appointedRemindTemplate; // 预约提醒模板【新增字段:string】
QString subStoreId; // 子门店号 【新增字段:string】
QString expectDate; // 预约时间 [预约单-顾客预计取餐时间]
QString reserveMakeTime; // 预约制作时间【新增字段:string】
int inAdvanceTakemeal; // 预约单提前到店标志【新增字段:int】
QString subStoreId; // 子门店号 【新增字段:string】
int forwardPosStatus; // 正向单入机状态: 0:未知 1: 成功 2:失败;
int negativePosStatus; // 负向单同上;
......@@ -424,11 +426,14 @@ public:
inline QString getSecretSignal()const{return secretSignal;}
inline void setSecretSignal(const QString& v){secretSignal = v;}
inline QString getAppointedTime()const{return appointedTime;}
inline void setAppointedTime(const QString& v){appointedTime = v;}
inline QString getExpectDate()const{return expectDate;}
inline void setExpectDate(const QString& v){expectDate = v;}
inline QString getAppointedRemindTemplate()const{return appointedRemindTemplate;}
inline void setAppointedRemindTemplate(const QString& v){appointedRemindTemplate = v;}
inline QString getReserveMakeTime()const{return reserveMakeTime;}
inline void setReserveMakeTime(const QString& v){reserveMakeTime = v;}
inline int getInAdvanceTakemeal()const{return inAdvanceTakemeal;}
inline void setInAdvanceTakemeal(const int& v){inAdvanceTakemeal = v;}
inline QString getSubStoreId()const{return subStoreId;}
inline void setSubStoreId(const QString& v){subStoreId = v;}
......
......@@ -7,8 +7,8 @@ IDI_ICON ICON DISCARDABLE "logo.ico"
#endif
VS_VERSION_INFO VERSIONINFO
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
FILEVERSION 2,2020,5,21
PRODUCTVERSION 2,2020,5,21
FILEVERSION 2,2020,5,26
PRODUCTVERSION 2,2020,5,26
//*************************************************************************//
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.5.21"
VALUE "FileVersion", "2.2020.5.21"
VALUE "ProductVersion", "2.2020.5.26"
VALUE "FileVersion", "2.2020.5.26"
//*************************************************************************//
END
END
......
......@@ -26,7 +26,7 @@
//#define APP_VERSION "2.2019.916.2"
//#define APP_VERSION "2.2020.26.1"
//#define APP_VERSION "2.2020.312.1"
#define APP_VERSION "2.2020.5.21"
#define APP_VERSION "2.2020.5.26"
//修正版本号时,切记修正 FmTakeout.rc 中的版本号
......
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