Commit 525ea836 by wuyang.zou

fix Some New Feature and Add Some DB Field Column

parent ced0f218
Pipeline #25508 failed with stage
in 0 seconds
...@@ -314,7 +314,10 @@ void FlowControl::_StoragePosOrderData() { ...@@ -314,7 +314,10 @@ void FlowControl::_StoragePosOrderData() {
//无法加锁,避免丢单 导致订单没有录入POS [新增一个补救添加队列也可解决此类场景]; //无法加锁,避免丢单 导致订单没有录入POS [新增一个补救添加队列也可解决此类场景];
if (!m_skipRecordPos) { if (!m_skipRecordPos) {
m_simValidOrdersList.append(order_p->id); m_simValidOrdersList.append(order_p->id);
_ClickOMSAssignArea(); // 默认都是着急向POS录单; 除非特别配置 noHurryRecordPos;
if ( !ConfigManger::GetInstance().GetNoHurryRecordPos() ) {
_ClickOMSAssignArea();
}
} }
/***** 更新 POS本地数据库的商品数据是否成功;end:********/ /***** 更新 POS本地数据库的商品数据是否成功;end:********/
...@@ -2358,9 +2361,11 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso ...@@ -2358,9 +2361,11 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
else if ( "MOP" == orderObject->channel ){ else if ( "MOP" == orderObject->channel ){
if ( 7 == orderObject->orderType ) { if ( 7 == orderObject->orderType ) {
tempServiceType = 14; tempServiceType = 14;
} else if (10 == orderObject->orderType) {
tempServiceType = 21;
} else { } else {
// 区别:口碑-MOP / App-MOP; // 区别:口碑-MOP / App-MOP;
if ( "5" == orderObject->platformSource ){ if ( "5" == orderObject->platformSource ) {
tempServiceType = 29; tempServiceType = 29;
} else { } else {
tempServiceType = 18; tempServiceType = 18;
...@@ -2456,6 +2461,8 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso ...@@ -2456,6 +2461,8 @@ bool FlowControl::_ResponseSimReqFristOrderData(const QJsonObject &content, QJso
else if ( "MOP" == orderObject->channel ) { else if ( "MOP" == orderObject->channel ) {
if ( 7 == orderObject->orderType ) { if ( 7 == orderObject->orderType ) {
tempServiceType = 15; tempServiceType = 15;
} else if (10 == orderObject->orderType) {
tempServiceType = 22;
} else { } else {
// 区分: 口碑-MOP / App-MOP; // 区分: 口碑-MOP / App-MOP;
if ( "5" == orderObject->platformSource ) { if ( "5" == orderObject->platformSource ) {
......
...@@ -185,6 +185,13 @@ int ConfigManger::GetSkipRecordPos() ...@@ -185,6 +185,13 @@ int ConfigManger::GetSkipRecordPos()
return m_config->value(INI_SKIPRECORDPOS).toInt(); return m_config->value(INI_SKIPRECORDPOS).toInt();
} }
int ConfigManger::GetNoHurryRecordPos()
{
return m_config->value(INI_NOHURRYRECORDPOS).toInt();
}
......
...@@ -142,6 +142,7 @@ public: ...@@ -142,6 +142,7 @@ public:
int GetSubStoreSkipVerify(); int GetSubStoreSkipVerify();
int GetSkipRecordPos(); int GetSkipRecordPos();
int GetNoHurryRecordPos();
private: private:
ConfigManger(); ConfigManger();
......
...@@ -185,7 +185,7 @@ bool PrintCupStickPosDB::insertCouponProd(OrderObject* orderObj, const QString& ...@@ -185,7 +185,7 @@ bool PrintCupStickPosDB::insertCouponProd(OrderObject* orderObj, const QString&
if(!query.exec()) { if(!query.exec()) {
QLOG_ERROR()<<"[<<<<---SqlServer Database: Insert tb_main_prod_refinfo Error--->>>>]"<<query.lastError().text()<<QString::number(query.lastError().type()); QLOG_ERROR()<<"[<<<<---SqlServer Database: Insert tb_main_prod_refinfo Error--->>>>]"<<query.lastError().text()<<QString::number(query.lastError().type());
QLOG_INFO()<<QString("INSERT INTO tb_main_prod_refinfo(chk_num, order_id, order_status, create_datetime, " QLOG_ERROR()<<QString("INSERT INTO tb_main_prod_refinfo(chk_num, order_id, order_status, create_datetime, "
" prod_seq, prod_code, prod_name, prod_resv3, prod_qty, prod_price, " " prod_seq, prod_code, prod_name, prod_resv3, prod_qty, prod_price, "
" coupon_seq, coupon_code, coupon_name, coupon_qty," " coupon_seq, coupon_code, coupon_name, coupon_qty,"
" coupon_factPrice, coupon_discountPrice, coupon_discountCode, coupon_discountName ," " coupon_factPrice, coupon_discountPrice, coupon_discountCode, coupon_discountName ,"
...@@ -198,6 +198,8 @@ bool PrintCupStickPosDB::insertCouponProd(OrderObject* orderObj, const QString& ...@@ -198,6 +198,8 @@ bool PrintCupStickPosDB::insertCouponProd(OrderObject* orderObj, const QString&
.arg(i+1).arg(coupon->code).arg(coupon->name).arg(1).arg(coupon->consumeFactAmount).arg(coupon->consumeDiscountAmount) .arg(i+1).arg(coupon->code).arg(coupon->name).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);
break;
} else { } else {
if ( query.first() ) { if ( query.first() ) {
insertMainProdIndex = query.value(0).toInt(); insertMainProdIndex = query.value(0).toInt();
...@@ -262,13 +264,15 @@ bool PrintCupStickPosDB::insertCouponSubProd(OrderObject* orderObj, const int ma ...@@ -262,13 +264,15 @@ bool PrintCupStickPosDB::insertCouponSubProd(OrderObject* orderObj, const int ma
if(!query.exec()) { if(!query.exec()) {
QLOG_ERROR()<<"[<<<<---SqlServer Database: Insert tb_main_prod_refinfo Error--->>>>]"<<query.lastError().text()<<QString::number(query.lastError().type()); QLOG_ERROR()<<"[<<<<---SqlServer Database: Insert tb_main_prod_refinfo Error--->>>>]"<<query.lastError().text()<<QString::number(query.lastError().type());
QLOG_INFO()<<QString("INSERT INTO tb_main_prod_refinfo(chk_num, order_id, order_status, create_datetime, " QLOG_ERROR()<<QString("INSERT INTO tb_main_prod_refinfo(chk_num, order_id, order_status, create_datetime, "
" prod_seq, prod_code, prod_name, prod_resv3, prod_qty, prod_price, " " prod_seq, prod_code, prod_name, prod_resv3, prod_qty, prod_price, "
" coupon_storeChannel, coupon_isCoupon, parent_id) " " coupon_storeChannel, coupon_isCoupon, parent_id) "
"VALUES(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13) select @@identity ").arg(posCheckNo.toInt()) "VALUES(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13) 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(0).arg(couponSubProd->code).arg(couponSubProd->name).arg(couponSubProd->nickname).arg(couponSubProd->qty).arg(couponSubProd->price) .arg(0).arg(couponSubProd->code).arg(couponSubProd->name).arg(couponSubProd->nickname).arg(couponSubProd->qty).arg(couponSubProd->price)
.arg(0).arg(couponSubProd->isCoupon).arg(mainProdIndex); .arg(0).arg(couponSubProd->isCoupon).arg(mainProdIndex);
break;
} else { } else {
if ( query.first() ) { if ( query.first() ) {
insertSubProdIndex = query.value(0).toInt(); insertSubProdIndex = query.value(0).toInt();
...@@ -321,7 +325,7 @@ bool PrintCupStickPosDB::insertNormalProd(OrderObject* orderObj, const QString& ...@@ -321,7 +325,7 @@ bool PrintCupStickPosDB::insertNormalProd(OrderObject* orderObj, const QString&
if(!query.exec()) { if(!query.exec()) {
QLOG_ERROR()<<"[<<<<---SqlServer Database: Insert tb_main_prod_refinfo Error--->>>>]"<<query.lastError().text()<<QString::number(query.lastError().type()); QLOG_ERROR()<<"[<<<<---SqlServer Database: Insert tb_main_prod_refinfo Error--->>>>]"<<query.lastError().text()<<QString::number(query.lastError().type());
QLOG_INFO()<<QString("INSERT INTO tb_main_prod_refinfo(chk_num, order_id, order_status, create_datetime, " QLOG_ERROR()<<QString("INSERT INTO tb_main_prod_refinfo(chk_num, order_id, order_status, create_datetime, "
" prod_seq, prod_code, prod_name, prod_price, prod_qty, prod_optionsCode, prod_discount, prod_discountName," " prod_seq, prod_code, prod_name, prod_price, prod_qty, prod_optionsCode, prod_discount, prod_discountName,"
" prod_starDiscount, prod_starDiscountName, prod_owner) " " prod_starDiscount, prod_starDiscountName, prod_owner) "
"VALUES(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15) select @@identity ").arg(posCheckNo.toInt()) "VALUES(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15) select @@identity ").arg(posCheckNo.toInt())
...@@ -329,6 +333,8 @@ bool PrintCupStickPosDB::insertNormalProd(OrderObject* orderObj, const QString& ...@@ -329,6 +333,8 @@ bool PrintCupStickPosDB::insertNormalProd(OrderObject* orderObj, const QString&
.arg(i+1).arg(dish->code).arg(dish->name).arg(dish->price).arg(dish->qty).arg(dish->options) .arg(i+1).arg(dish->code).arg(dish->name).arg(dish->price).arg(dish->qty).arg(dish->options)
.arg(dish->promotionPrice * dish->promotionQty).arg(dish->promotionName).arg(dish->starPromotionPrice * dish->starPromotionQty) .arg(dish->promotionPrice * dish->promotionQty).arg(dish->promotionName).arg(dish->starPromotionPrice * dish->starPromotionQty)
.arg(dish->starPromotionName).arg(dish->userName); .arg(dish->starPromotionName).arg(dish->userName);
break;
} else { } else {
if ( query.first() ) { if ( query.first() ) {
insertMainProdIndex = query.value(0).toInt(); insertMainProdIndex = query.value(0).toInt();
...@@ -371,6 +377,12 @@ bool PrintCupStickPosDB::insertNormalSubProd(OrderObject* orderObj, const int ma ...@@ -371,6 +377,12 @@ bool PrintCupStickPosDB::insertNormalSubProd(OrderObject* orderObj, const int ma
for (int i=0; i < subProdList.count(); i++) { for (int i=0; i < subProdList.count(); i++) {
dishesObject* subdish=subProdList.at(i); dishesObject* subdish=subProdList.at(i);
if ( subdish->code.contains("Default",Qt::CaseInsensitive) ) {
++inSubPordSucNum;
continue;
}
query.prepare("INSERT INTO tb_main_prod_refinfo(chk_num, order_id, order_status, create_datetime, " query.prepare("INSERT INTO tb_main_prod_refinfo(chk_num, order_id, order_status, create_datetime, "
" prod_seq, prod_code, prod_name, prod_price, prod_qty, prod_optionsCode, parent_id ) " " prod_seq, prod_code, prod_name, prod_price, prod_qty, prod_optionsCode, parent_id ) "
"VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) select @@identity "); "VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) select @@identity ");
...@@ -388,12 +400,14 @@ bool PrintCupStickPosDB::insertNormalSubProd(OrderObject* orderObj, const int ma ...@@ -388,12 +400,14 @@ bool PrintCupStickPosDB::insertNormalSubProd(OrderObject* orderObj, const int ma
if(!query.exec()) { if(!query.exec()) {
QLOG_ERROR()<<"[<<<<---SqlServer Database: Insert tb_main_prod_refinfo Error--->>>>]"<<query.lastError().text()<<QString::number(query.lastError().type()); QLOG_ERROR()<<"[<<<<---SqlServer Database: Insert tb_main_prod_refinfo Error--->>>>]"<<query.lastError().text()<<QString::number(query.lastError().type());
QLOG_INFO()<<QString("INSERT INTO tb_main_prod_refinfo(chk_num, order_id, order_status, create_datetime, " QLOG_ERROR()<<QString("INSERT INTO tb_main_prod_refinfo(chk_num, order_id, order_status, create_datetime, "
" prod_seq, prod_code, prod_name, prod_price, prod_qty, prod_optionsCode, parent_id) " " prod_seq, prod_code, prod_name, prod_price, prod_qty, prod_optionsCode, parent_id) "
"VALUES(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11) select @@identity ").arg(posCheckNo.toInt()) "VALUES(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11) 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(0).arg(subdish->code).arg(subdish->name).arg(subdish->price).arg(subdish->qty).arg(subdish->options) .arg(0).arg(subdish->code).arg(subdish->name).arg(subdish->price).arg(subdish->qty).arg(subdish->options)
.arg(mainProdIndex); .arg(mainProdIndex);
break;
} else { } else {
if ( query.first() ) { if ( query.first() ) {
insertSubProdIndex = query.value(0).toInt(); insertSubProdIndex = query.value(0).toInt();
......
...@@ -50,7 +50,7 @@ bool PrintSumBillPosDB::initPrintSumBillPosDB(){ ...@@ -50,7 +50,7 @@ bool PrintSumBillPosDB::initPrintSumBillPosDB(){
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FM TakeOut Plugin Version:2.2020.5.12 Begin Add New Column Result: %1--->>>>]").arg(bRet20?1:0); QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FM TakeOut Plugin Version:2.2020.5.12 Begin Add New Column Result: %1--->>>>]").arg(bRet20?1:0);
bRetChangeLength = alterTablePrintSumBillPosDBLength(); bRetChangeLength = alterTablePrintSumBillPosDBLength();
QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FM TakeOut Plugin Version:2.2020.9.16 Begin Change Store Column Result: %1--->>>>]") QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---FM TakeOut Plugin Version:2.2020.9.28 Begin Change Store Column Result: %1--->>>>]")
.arg(bRetChangeLength?1:0); .arg(bRetChangeLength?1:0);
return (bRet && bRetCheckColumn && bRet20 && bRetChangeLength); return (bRet && bRetCheckColumn && bRet20 && bRetChangeLength);
...@@ -534,6 +534,7 @@ bool PrintSumBillPosDB::alterTablePrintSumBillPosDB20() { ...@@ -534,6 +534,7 @@ bool PrintSumBillPosDB::alterTablePrintSumBillPosDB20() {
bool PrintSumBillPosDB::alterTablePrintSumBillPosDBLength(){ bool PrintSumBillPosDB::alterTablePrintSumBillPosDBLength(){
QMutexLocker mutex(&m_mutex); QMutexLocker mutex(&m_mutex);
int changeSuccessNum = 0; int changeSuccessNum = 0;
int addSuccessNum = 0;
QSqlQuery query(m_sqlDb); QSqlQuery query(m_sqlDb);
QString selectsql; QString selectsql;
if(!m_sqlDb.open()) { if(!m_sqlDb.open()) {
...@@ -574,12 +575,155 @@ bool PrintSumBillPosDB::alterTablePrintSumBillPosDBLength(){ ...@@ -574,12 +575,155 @@ bool PrintSumBillPosDB::alterTablePrintSumBillPosDBLength(){
} else { changeSuccessNum++; } } else { changeSuccessNum++; }
} }
// Alter Table orderPayType;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='orderPayType'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add orderPayType int default 0 ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info orderPayType Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table sbkAppPayType;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='sbkAppPayType'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add sbkAppPayType int default 0 ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info sbkAppPayType Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table sbkAppPayValue;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='sbkAppPayValue'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add sbkAppPayValue varchar(60) null ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info sbkAppPayValue Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table sbkAppRefundPayValue;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='sbkAppRefundPayValue'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add sbkAppRefundPayValue varchar(60) null ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info sbkAppRefundPayValue Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table orderTransFlowNo;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='orderTransFlowNo'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add orderTransFlowNo varchar(60) null ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info orderTransFlowNo Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table orderRefundTransFlowNo;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='orderRefundTransFlowNo'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add orderRefundTransFlowNo varchar(60) null ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info orderRefundTransFlowNo Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table pluginVersion;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='pluginVersion'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add pluginVersion varchar(20) null ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info pluginVersion Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table packageSku;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='packageSku'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add packageSku varchar(20) null ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info packageSku Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table thirdPartyOrderId;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='thirdPartyOrderId'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add thirdPartyOrderId varchar(60) null ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info thirdPartyOrderId Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table packFee;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='packFee'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add packFee int default 0 ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info packFee Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table packDiscount;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='packDiscount'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add packDiscount int default 0 ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info packDiscount Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table deliveryFee;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='deliveryFee'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add deliveryFee int default 0 ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info deliveryFee Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table deliveryDiscount;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='deliveryDiscount'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add deliveryDiscount int default 0 ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info deliveryDiscount Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
// Alter Table discountShopFee;
selectsql = "select * from syscolumns where id=object_id('tb_msr_customer_info') and name='discountShopFee'";
query.exec(selectsql);
if(!query.next()){
selectsql = "alter table tb_msr_customer_info add discountShopFee int default 0 ";
if(!query.exec(selectsql)){
QLOG_ERROR()<< "[<<<<---alter table tb_msr_customer_info discountShopFee Faild--->>>>]" <<query.lastError().text()<<QString::number(query.lastError().type());
} else { addSuccessNum++; }
} else { addSuccessNum++;}
m_sqlDb.close(); m_sqlDb.close();
if (2 == changeSuccessNum) { if (2 == changeSuccessNum && 14 == addSuccessNum) {
QLOG_INFO()<<"[<<<<---alterTablePrintSumBillPosDBLength:: changeSuccessNum = 2 --->>>>]"; QLOG_INFO()<<"[<<<<---alterTablePrintSumBillPosDBLength:: changeSuccessNum = 2 && addSuccessNum = 14 --->>>>]";
return true; return true;
} else { } else {
QLOG_ERROR()<<"[<<<<---alterTablePrintSumBillPosDBLength:: changeSuccessNum < 2 = --->>>>]"<<changeSuccessNum; QLOG_ERROR()<<"[<<<<---alterTablePrintSumBillPosDBLength:: changeSuccessNum < 2 or addSuccessNum < 14 --->>>>]"
<<changeSuccessNum;
return false; return false;
} }
} }
......
...@@ -163,6 +163,8 @@ QString OrderObject::getChannelName() ...@@ -163,6 +163,8 @@ QString OrderObject::getChannelName()
return QString::fromLocal8Bit("预-MOP"); return QString::fromLocal8Bit("预-MOP");
} else if ( 8 == orderType ) { } else if ( 8 == orderType ) {
return QString::fromLocal8Bit("拼-MOP"); return QString::fromLocal8Bit("拼-MOP");
} else if (10 == orderType) {
return QString::fromLocal8Bit("星时刻");
} else { } else {
if ( "5" == platformSource ) { if ( "5" == platformSource ) {
return QString::fromLocal8Bit("口碑-MOP"); return QString::fromLocal8Bit("口碑-MOP");
......
...@@ -60,7 +60,7 @@ void AlertForm::SetContent(AlertForm::Type type, const QString &msg) ...@@ -60,7 +60,7 @@ void AlertForm::SetContent(AlertForm::Type type, const QString &msg)
break; break;
} }
if ( type == WARNNING ) { if ( type == WARNNING ) {
ui->alertLabMsg->hide(); ui->alertLabMsg->hide();
QStringList mopExceptInfoList = msg.split(';'); QStringList mopExceptInfoList = msg.split(';');
...@@ -112,7 +112,7 @@ void AlertForm::SetContent(AlertForm::Type type, const QString &msg) ...@@ -112,7 +112,7 @@ void AlertForm::SetContent(AlertForm::Type type, const QString &msg)
} }
if ( type == WARNNING ) { if ( type == WARNNING ) {
m_timer->start(30000); m_timer->stop();
} else { } else {
if(!m_timer->isActive() ) if(!m_timer->isActive() )
m_timer->start(20000); m_timer->start(20000);
......
...@@ -271,10 +271,15 @@ void DetailForm::InitData(OrderObject *orderObject) ...@@ -271,10 +271,15 @@ void DetailForm::InitData(OrderObject *orderObject)
{ {
ui->detailBtn3->hide(); ui->detailBtn3->hide();
} }
if(m_rejectForm==NULL) if(m_rejectForm==NULL) {
m_rejectForm = new RejectForm(this); m_rejectForm = new RejectForm(this);
if(m_refuseForm==NULL) } else {
// 未使用此退单模块;
}
if(m_refuseForm==NULL) {
m_refuseForm = new RefuseForm(this); m_refuseForm = new RefuseForm(this);
}
#ifdef TODO #ifdef TODO
ui->detailBtn3->hide(); ui->detailBtn3->hide();
#endif #endif
...@@ -341,6 +346,7 @@ void DetailForm::onOperaBtnClicked() ...@@ -341,6 +346,7 @@ void DetailForm::onOperaBtnClicked()
emit processRepealOrder( pBtn->property("orderId").toString(),m_refuseForm->m_reasonCode,m_refuseForm->m_reasonStr,m_refuseForm->m_refundDishesListString); emit processRepealOrder( pBtn->property("orderId").toString(),m_refuseForm->m_reasonCode,m_refuseForm->m_reasonStr,m_refuseForm->m_refundDishesListString);
hide(); //为了友好用户的使用体验感,hide() 还是需要在接受完取消订单原因后,再隐藏; hide(); //为了友好用户的使用体验感,hide() 还是需要在接受完取消订单原因后,再隐藏;
} }
m_refuseForm->clearAllRadioBtnCheck();
} else { } else {
emit processOrder(pBtn->property("operation").toString(), pBtn->property("orderId").toString()); emit processOrder(pBtn->property("operation").toString(), pBtn->property("orderId").toString());
} }
...@@ -361,3 +367,20 @@ void DetailForm::on_detailBtn0_clicked() ...@@ -361,3 +367,20 @@ void DetailForm::on_detailBtn0_clicked()
QLOG_ERROR()<<QString("[<<<<---DetailForm::on_detailBtn0_clicked: m_orderObject point is NULL--->>>>]"); QLOG_ERROR()<<QString("[<<<<---DetailForm::on_detailBtn0_clicked: m_orderObject point is NULL--->>>>]");
} }
} }
void DetailForm::hideDetailAllFrom()
{
this->hide();
if ( m_rejectForm ) {
m_rejectForm->hide();
delete m_rejectForm;
m_rejectForm = NULL;
}
if ( m_refuseForm ) {
m_refuseForm->hide();
delete m_refuseForm;
m_refuseForm = NULL;
}
}
...@@ -81,6 +81,13 @@ private slots: ...@@ -81,6 +81,13 @@ private slots:
* */ * */
void on_detailBtn0_clicked(); void on_detailBtn0_clicked();
public slots:
/* 功能:退单和录单同时进行时,优先录单,在 mainFrom 最小化时,会调用 DetailForm 最小化,其内部的子对象需要释放,否则会引发程序崩溃退出;
* 参数:NULL
* 返回:NULL
* */
void hideDetailAllFrom();
}; };
#endif // DETAILFORM_H #endif // DETAILFORM_H
...@@ -228,9 +228,13 @@ void MainForm::on_mainBtnHide_clicked() ...@@ -228,9 +228,13 @@ void MainForm::on_mainBtnHide_clicked()
hide(); hide();
ui->mainEdtSearch->clear(); ui->mainEdtSearch->clear();
m_padForm->hide(); m_padForm->hide();
if(m_detailForm){ if (m_detailForm) {
m_detailForm->hide(); m_detailForm->hideDetailAllFrom();
} }
if (m_alertForm) {
m_alertForm->hide();
}
emit showFloatForm(); emit showFloatForm();
} }
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#define INI_SUBSTOREID "Software/substoreid" #define INI_SUBSTOREID "Software/substoreid"
#define INI_SUBSTORESKIPVERIFY "Software/substoreSkipVerify" #define INI_SUBSTORESKIPVERIFY "Software/substoreSkipVerify"
#define INI_SKIPRECORDPOS "Software/skipRecordPos" #define INI_SKIPRECORDPOS "Software/skipRecordPos"
#define INI_NOHURRYRECORDPOS "Software/noHurryRecordPos"
#define INI_PASSWORD "Software/password" #define INI_PASSWORD "Software/password"
#define INI_AUTOCONFIRM "Software/autoconfirm" #define INI_AUTOCONFIRM "Software/autoconfirm"
......
...@@ -124,8 +124,37 @@ void RefuseForm::on_reason6_toggled(bool checked) ...@@ -124,8 +124,37 @@ void RefuseForm::on_reason6_toggled(bool checked)
void RefuseForm::_Init() void RefuseForm::_Init()
{ {
qDebug() << __FUNCTION__; qDebug() << __FUNCTION__;
clearAllRadioBtnCheck();
m_refundDishesList.clear(); m_refundDishesList.clear();
m_refundDishesListString.clear(); m_refundDishesListString.clear();
ui->reason_empty->toggle();
ui->refuseBtnOk->setEnabled(false); 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);
}
...@@ -53,6 +53,9 @@ private slots: ...@@ -53,6 +53,9 @@ private slots:
void on_reason6_toggled(bool checked); void on_reason6_toggled(bool checked);
public slots:
void clearAllRadioBtnCheck();
private: private:
Ui::RefuseForm *ui; Ui::RefuseForm *ui;
......
...@@ -192,25 +192,6 @@ ...@@ -192,25 +192,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QRadioButton" name="reason_empty">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
......
...@@ -744,7 +744,7 @@ QTabBar QToolButton::left-arrow:disabled { ...@@ -744,7 +744,7 @@ QTabBar QToolButton::left-arrow:disabled {
background-color: rgb(222,184,135); background-color: rgb(222,184,135);
border-radius: 3px; border-radius: 3px;
} }
#reason1,#reason2,#reason3,#reason4,#reason5 #reason1,#reason2,#reason3,#reason4,#reason5,#reason6
{ {
font: 14pt "微软雅黑"; font: 14pt "微软雅黑";
} }
......
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