Commit 20df9727 by wuyang.zou

fix new Feature

    Support Main Product No Split Qty
parent 525ea836
Pipeline #25531 failed with stage
in 0 seconds
......@@ -2581,7 +2581,92 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
}
/**********************************************************************************/
//针对同一商品,多份数量需要将其,拆分成单份;[如果不拆分,将导致多份商品中配料价格出现 漏钱:POS中的账将会出现少金额]
// 新增 一种case: 餐具费项目需要合并, 进行不拆分 处理: qtyNoSplit
/**********************************************************************************/
if (dish->qtyNoSplit ) {
// ------> 不拆分主商品数量 --Begin ---->>>
//声明临时栈对象: 多个主商品;
QJsonObject noSplitMainProObj;
QJsonArray noSplitSubProductArry;
QJsonObject noSplitSubObj;
noSplitMainProObj.insert("consume_num", dish->qty);
noSplitMainProObj.insert("pid", dish->code);
noSplitMainProObj.insert("original_price", dish->price);
/**********************************************************************************/
// 处理原始的配料信息;
/**********************************************************************************/
if(!dish->sub_products.isEmpty()) {
for(int j=0; j < dish->sub_products.count(); j++) {
dishesObject* subDish=dish->sub_products.at(j);
//安全检查:Sku,Qty ...:不合法直接跳过录单
if(!subDish->code.isEmpty() && !subDish->code.contains("Default",Qt::CaseInsensitive) && subDish->qty ) {
//①code中以非数字开头直接退出本次录单;
//②code中长度小于3位 直接退出本次录单; [ '34' , '16' ]
//③code中长度大于9位 直接退出本次录单; [ '1234567890' ]
//④code 异常, 向oms 汇报异常;
QString tempSubCodeLeftHead = subDish->code.left(1);
if ( tempSubCodeLeftHead<QString('0') || tempSubCodeLeftHead>QString('9') || subDish->code.length()<3 || subDish->code.length()>9 ) {
error = QString::fromLocal8Bit("This Order SubProduct PosKey Is String And No Contains Default Or Sku Length < 3 Or Sku Length > 9 ");
m_OrderEntryMutex.lock();
m_simValidOrdersList.removeOne(orderObject->id);
m_OrderEntryMutex.unlock();
m_bFloatFromLockSt = false; //解锁悬浮框的锁定标志;
emit doUnLockFloatFrom(); //解锁悬浮框锁定
// 存储订单入机前异常信息并汇报OMS;
QString requestType = orderObject->orderStatus==6?QString::fromLocal8Bit("6"):QString::fromLocal8Bit("3");
_AddOrUpdateReportOmsList(orderObject->id, orderObject->channel,requestType, QString("2"), error);
return true;
}
noSplitSubObj.insert("consume_num", subDish->qty);
noSplitSubObj.insert("pid", subDish->code);
noSplitSubObj.insert("original_price", subDish->price);
noSplitSubProductArry.push_back(noSplitSubObj);
}
}
}
/**********************************************************************************/
// 处理商品的属性(热 -> 特别热)的额外配料信息;
/**********************************************************************************/
if(dish->options.length()){
noSplitSubObj.insert("consume_num", 1);
noSplitSubObj.insert("pid", dish->options);
noSplitSubObj.insert("original_price", 0);
noSplitSubProductArry.push_back(noSplitSubObj);
}
/**********************************************************************************/
// 不拆分商品合并:优惠折扣数量默认为 1 但是整单体现是 * 主商品数量;
/**********************************************************************************/
int promotionSum = (dish->promotionQty>0 && dish->promotionQty<555)?dish->promotionQty:0;
int promotionPrice = (dish->promotionPrice>1 && dish->promotionPrice<200000)?dish->promotionPrice:0;
if( promotionSum && promotionPrice && dish->promotionSku.length() ) {
noSplitSubObj.insert("consume_num", 1);
noSplitSubObj.insert("pid", dish->promotionSku);
noSplitSubObj.insert("original_price", promotionSum * promotionPrice);
noSplitSubProductArry.push_back(noSplitSubObj);
}
/**********************************************************************************/
// 新增支持星星优惠; 同上万能折扣;
int starPromotionSum = (dish->starPromotionQty>0 && dish->starPromotionQty<555)?dish->starPromotionQty:0;
int starPromotionPrice = (dish->starPromotionPrice>1 && dish->starPromotionPrice<200000)?dish->starPromotionPrice:0;
if( starPromotionSum && starPromotionPrice && dish->starPromotionSku.length() ){
noSplitSubObj.insert("consume_num", 1);
noSplitSubObj.insert("pid", dish->starPromotionSku);
noSplitSubObj.insert("original_price", starPromotionSum * starPromotionPrice);
noSplitSubProductArry.push_back(noSplitSubObj);
}
/**********************************************************************************/
// 汇总插入子商品[sub_products];
if(noSplitSubProductArry.size()){
noSplitMainProObj.insert("sub_products",noSplitSubProductArry);
} // end 整合子商品结束;
//products.insert(i, tObj); //防止default*的主商品码出现,上面代码出现continue;导致 i出现跳数,插入时出现崩溃;
products.push_back(noSplitMainProObj);
// ------> 不拆分主商品数量 --End ---->>>
} else {
// ------> 拆分主商品数量 --Begin ---->>>
for (int temp_qty = 0; temp_qty < dish->qty; temp_qty++) {
//声明临时栈对象: 单个主商品 + 子商品列表 + 子商品;
QJsonObject tObj;
......@@ -2669,7 +2754,10 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
} // end 整合子商品结束;
//products.insert(i, tObj); //防止default*的主商品码出现,上面代码出现continue;导致 i出现跳数,插入时出现崩溃;
products.push_back(tObj);
} // ------> 拆分主商品数量 --End ---->>>
}
}
//**********************************整合券信息-begin*****************************************//
......
......@@ -19,6 +19,7 @@ class dishesObject : public QObject
Q_PROPERTY (int packagePrice READ getpackagePrice WRITE setpackagePrice)
Q_PROPERTY (int sequence READ getSequence WRITE setSequence)
Q_PROPERTY (int qty READ getqty WRITE setqty)
Q_PROPERTY (int qtyNoSplit READ getQtyNoSplit WRITE setQtyNoSplit)
Q_PROPERTY (int price READ getprice WRITE setprice)
Q_PROPERTY (QString options READ getoptions WRITE setoptions)
......@@ -49,6 +50,7 @@ public:
QString defaultImage;
QString code;
int qty;
int qtyNoSplit;
int packagePrice;
int price;
int sequence;
......@@ -110,6 +112,8 @@ protected:
inline int getqty(){ return qty; }
inline void setqty(const int& v){ qty = v; }
inline int getQtyNoSplit(){ return qtyNoSplit; }
inline void setQtyNoSplit(const int& v){ qtyNoSplit = v; }
inline QString getpromotionSku(){ return promotionSku; }
inline void setpromotionSku(const QString& v){ promotionSku = v; }
......
......@@ -79,6 +79,7 @@ void OrderObject::FromJson(const QJsonObject &json)
dishesObject *proObject = new dishesObject(this);
//初始商品数据信息;
proObject->qty = 0;
proObject->qtyNoSplit = 0;
proObject->promotionQty = 0;
proObject->promotionPrice = 0;
proObject->starPromotionQty = 0;
......
......@@ -7,8 +7,8 @@ IDI_ICON ICON DISCARDABLE "logo.ico"
#endif
VS_VERSION_INFO VERSIONINFO
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
FILEVERSION 2,2020,9,28
PRODUCTVERSION 2,2020,9,28
FILEVERSION 2,2020,9,29
PRODUCTVERSION 2,2020,9,29
//*************************************************************************//
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.9.28"
VALUE "FileVersion", "2.2020.9.28"
VALUE "ProductVersion", "2.2020.9.29"
VALUE "FileVersion", "2.2020.9.29"
//*************************************************************************//
END
END
......
......@@ -29,7 +29,7 @@
//#define APP_VERSION "2.2020.5.26"
//#define APP_VERSION "2.2020.6.29"
//#define APP_VERSION "2.2020.8.10"
#define APP_VERSION "2.2020.9.28"
#define APP_VERSION "2.2020.9.29"
//修正版本号时,切记修正 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