Commit 0fa7e499 by wuyang.zou

Fix Support wsg 改价功能

Version 2.2022.1.18
parent fb254ed8
...@@ -3166,10 +3166,12 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso ...@@ -3166,10 +3166,12 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
QJsonObject tCoupProductObj; QJsonObject tCoupProductObj;
tCoupProductObj.insert("couponSeq", QString::number(i+1) ); tCoupProductObj.insert("couponSeq", QString::number(i+1) );
tCoupProductObj.insert("consume_num", coupon->skus[tempSkuSeq]->qty ); tCoupProductObj.insert("consume_num", coupon->skus[tempSkuSeq]->qty );
tCoupProductObj.insert("pid", coupon->skus[tempSkuSeq]->code); // tCoupProductObj.insert("pid", coupon->skus[tempSkuSeq]->code); // 支持 WSG券改价模式入机;
tCoupProductObj.insert("pid", coupon->skus[tempSkuSeq]->chgPrcFlgCode);
//需要考虑 门店券 蛋糕的Combo头开始会限定后续蛋糕子项的价格后面的价格是否会都是0; //需要考虑 门店券 蛋糕的Combo头开始会限定后续蛋糕子项的价格后面的价格是否会都是0;
if (coupon->skus[tempSkuSeq]->isCoupon) { if (coupon->skus[tempSkuSeq]->isCoupon) {
tCoupProductObj.insert("original_price", coupon->skus[tempSkuSeq]->price ); tCoupProductObj.insert("original_price", coupon->skus[tempSkuSeq]->price );
}else{ }else{
tCoupProductObj.insert("original_price",0); tCoupProductObj.insert("original_price",0);
} }
......
...@@ -210,7 +210,7 @@ bool PrintCupStickPosDB::insertCouponProd(OrderObject* orderObj, const QString& ...@@ -210,7 +210,7 @@ bool PrintCupStickPosDB::insertCouponProd(OrderObject* orderObj, const QString&
query.addBindValue(i+1); // --主商品序号; query.addBindValue(i+1); // --主商品序号;
query.addBindValue(coupon->skus[0]->code); // --主商品 SKU query.addBindValue(coupon->skus[0]->code); // --主商品 SKU
query.addBindValue(coupon->skus[0]->name); // --主商品名称 query.addBindValue(coupon->skus[0]->name); // --主商品名称
query.addBindValue( 0 ); // --主商品 改价标志 query.addBindValue(coupon->skus[0]->changePriceFlag); // --主商品 改价标志
query.addBindValue(coupon->skus[0]->nickname); // --主商品昵称 query.addBindValue(coupon->skus[0]->nickname); // --主商品昵称
query.addBindValue(coupon->skus[0]->enProductName); // --主商品英文名 query.addBindValue(coupon->skus[0]->enProductName); // --主商品英文名
if ( OrderObject::Refunded == orderObj->orderStatus ) { if ( OrderObject::Refunded == orderObj->orderStatus ) {
...@@ -247,8 +247,8 @@ bool PrintCupStickPosDB::insertCouponProd(OrderObject* orderObj, const QString& ...@@ -247,8 +247,8 @@ bool PrintCupStickPosDB::insertCouponProd(OrderObject* orderObj, const QString&
"VALUES(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15, %16, %17, %18, %19, %20, " "VALUES(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15, %16, %17, %18, %19, %20, "
" %21, %22, %23, %24, %25, %26, %27) select @@identity ").arg(posCheckNo.toInt()) " %21, %22, %23, %24, %25, %26, %27) select @@identity ").arg(posCheckNo.toInt())
.arg(orderObj->id).arg(orderObj->orderStatus).arg(qdaTi.addSecs(60*60*8).toString("yyyy-MM-dd hh:mm:ss")) .arg(orderObj->id).arg(orderObj->orderStatus).arg(qdaTi.addSecs(60*60*8).toString("yyyy-MM-dd hh:mm:ss"))
.arg(i+1).arg(coupon->skus[0]->code).arg(coupon->skus[0]->name).arg(0).arg(coupon->skus[0]->nickname).arg(coupon->skus[0]->enProductName) .arg(i+1).arg(coupon->skus[0]->code).arg(coupon->skus[0]->name).arg(coupon->skus[0]->changePriceFlag).arg(coupon->skus[0]->nickname)
.arg(coupon->skus[0]->qty).arg(coupon->skus[0]->price) .arg(coupon->skus[0]->enProductName).arg(coupon->skus[0]->qty).arg(coupon->skus[0]->price)
.arg(i+1).arg(coupon->code).arg(coupon->couponName).arg(1).arg(coupon->consumeFactAmount).arg(coupon->consumeDiscountAmount) .arg(i+1).arg(coupon->code).arg(coupon->couponName).arg(1).arg(coupon->consumeFactAmount).arg(coupon->consumeDiscountAmount)
.arg(coupon->discount).arg(coupon->discountName).arg(coupon->storeChannel).arg(coupon->skus[0]->isCoupon) .arg(coupon->discount).arg(coupon->discountName).arg(coupon->storeChannel).arg(coupon->skus[0]->isCoupon)
.arg(coupon->payMethodId).arg(coupon->payMethodName).arg(coupon->isShowGiver).arg(coupon->giverName).arg(coupon->blessingWords); .arg(coupon->payMethodId).arg(coupon->payMethodName).arg(coupon->isShowGiver).arg(coupon->giverName).arg(coupon->blessingWords);
......
...@@ -75,6 +75,14 @@ void CouponsObject::FetchDataFromJson(const QJsonObject &json) ...@@ -75,6 +75,14 @@ void CouponsObject::FetchDataFromJson(const QJsonObject &json)
qDeleteAll(itemsDiscount); qDeleteAll(itemsDiscount);
itemsDiscount.clear(); itemsDiscount.clear();
// 组装改价标识Code;使用 QTextStream 流操作;
// 目前Pos-Key最长9位,Simphony-sku程序容量长度28(右对齐,左补空格),第14位存储 改价标识(从右至左第15位);
QString tempChgPrcFlgCode;
QTextStream ss( &tempChgPrcFlgCode );
ss.setFieldWidth(14);
ss.setFieldAlignment(QTextStream::AlignRight);
ss.setPadChar(' ');
QJsonArray singleProductsArray = json[JSON_COUPONPRODUCTS].toArray(); QJsonArray singleProductsArray = json[JSON_COUPONPRODUCTS].toArray();
foreach(QJsonValue singleProduct, singleProductsArray) foreach(QJsonValue singleProduct, singleProductsArray)
{ {
...@@ -84,7 +92,15 @@ void CouponsObject::FetchDataFromJson(const QJsonObject &json) ...@@ -84,7 +92,15 @@ void CouponsObject::FetchDataFromJson(const QJsonObject &json)
item->code=""; item->code="";
item->qty=0; item->qty=0;
item->price=0; item->price=0;
item->changePriceFlag = 0;
item->chgPrcFlgCode = QString("");
item->FetchDataFromJson(singleProduct.toObject()); item->FetchDataFromJson(singleProduct.toObject());
// 券数据赋值后, 组装改价标识Code;便于传递给POS;
ss << item->code;
item->chgPrcFlgCode.append( QString::number(item->changePriceFlag) );
item->chgPrcFlgCode.append( tempChgPrcFlgCode );
// 清空缓存数据,防止重叠脏数据;
tempChgPrcFlgCode = QString("");
this->skus.append(item); this->skus.append(item);
} }
......
...@@ -16,6 +16,7 @@ class SingleProductObject : public QObject ...@@ -16,6 +16,7 @@ class SingleProductObject : public QObject
Q_PROPERTY (bool isCoupon READ getIsCoupon WRITE setIsCoupon) Q_PROPERTY (bool isCoupon READ getIsCoupon WRITE setIsCoupon)
Q_PROPERTY (QString nickname READ getNickname WRITE setNickname) Q_PROPERTY (QString nickname READ getNickname WRITE setNickname)
Q_PROPERTY (QString enProductName READ getEnProductName WRITE setEnProductName) Q_PROPERTY (QString enProductName READ getEnProductName WRITE setEnProductName)
Q_PROPERTY (int changePriceFlag READ getChangePriceFlag WRITE setChangePriceFlag)
public: public:
explicit SingleProductObject(QObject *parent = 0):QObject(parent){} explicit SingleProductObject(QObject *parent = 0):QObject(parent){}
...@@ -29,6 +30,9 @@ public: ...@@ -29,6 +30,9 @@ public:
bool isCoupon; //此单品是否是券; bool isCoupon; //此单品是否是券;
QString nickname; //券商品昵称 QString nickname; //券商品昵称
QString enProductName; //券商品英文名 QString enProductName; //券商品英文名
int changePriceFlag; // 改价标识
QString chgPrcFlgCode; // 组合改价标识的sku;
protected: protected:
inline QString getCode(){ return code; } inline QString getCode(){ return code; }
...@@ -52,6 +56,9 @@ protected: ...@@ -52,6 +56,9 @@ protected:
inline QString getEnProductName(){ return enProductName; } inline QString getEnProductName(){ return enProductName; }
inline void setEnProductName(const QString& v){ enProductName = v; } inline void setEnProductName(const QString& v){ enProductName = v; }
inline int getChangePriceFlag(){ return changePriceFlag; }
inline void setChangePriceFlag(const int& v){ changePriceFlag = v; }
}; };
#endif // SINGLEPRODUCTOBJECT_H #endif // SINGLEPRODUCTOBJECT_H
...@@ -7,8 +7,8 @@ IDI_ICON ICON DISCARDABLE "logo.ico" ...@@ -7,8 +7,8 @@ IDI_ICON ICON DISCARDABLE "logo.ico"
#endif #endif
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***// //***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
FILEVERSION 2,2021,12,20 FILEVERSION 2,2022,1,18
PRODUCTVERSION 2,2021,12,20 PRODUCTVERSION 2,2022,1,18
//*************************************************************************// //*************************************************************************//
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
...@@ -27,12 +27,12 @@ VS_VERSION_INFO VERSIONINFO ...@@ -27,12 +27,12 @@ VS_VERSION_INFO VERSIONINFO
VALUE "CompanyName", "ShangHai.Freemud Co., Ltd." VALUE "CompanyName", "ShangHai.Freemud Co., Ltd."
VALUE "FileDescription", "Delivery Order Plugin Application" VALUE "FileDescription", "Delivery Order Plugin Application"
VALUE "InternalName", "fmTakeout.exe" VALUE "InternalName", "fmTakeout.exe"
VALUE "LegalCopyright", "Copyright (C)2014-2021" VALUE "LegalCopyright", "Copyright (C)2014-2022"
VALUE "OriginalFilename", "fmTakeout.exe" VALUE "OriginalFilename", "fmTakeout.exe"
VALUE "ProductName", "Delivery Order Plugin" VALUE "ProductName", "Delivery Order Plugin"
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***// //***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
VALUE "ProductVersion", "2.2021.12.20" VALUE "ProductVersion", "2.2022.1.18"
VALUE "FileVersion", "2.2021.12.20" VALUE "FileVersion", "2.2022.1.18"
//*************************************************************************// //*************************************************************************//
END END
END END
......
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
//#define APP_VERSION "2.2021.8.12" //#define APP_VERSION "2.2021.8.12"
//#define APP_VERSION "2.2021.9.7" //#define APP_VERSION "2.2021.9.7"
//#define APP_VERSION "2.2021.9.24" //#define APP_VERSION "2.2021.9.24"
#define APP_VERSION "2.2021.12.20" //#define APP_VERSION "2.2021.12.20"
#define APP_VERSION "2.2022.1.18"
//修正版本号时,切记修正 FmTakeout.rc 中的版本号 //修正版本号时,切记修正 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