Commit 2fe411ec by guanghui.cui

更新pos打印计数

parent f64982da
...@@ -388,7 +388,21 @@ void WBillControl::PrintLable(const OrderObject *obj,const QString posOrderId) ...@@ -388,7 +388,21 @@ void WBillControl::PrintLable(const OrderObject *obj,const QString posOrderId)
printCook(obj,pid,num,posOrderId); printCook(obj,pid,num,posOrderId);
} }
} }
updatePosPrintCount(posOrderId);
}
void WBillControl::updatePosPrintCount(const QString &posOrderId)
{
QJsonObject rObj;
rObj.insert("fm_cmd", "update_count");
rObj.insert("order_id", posOrderId);
qDebug() << "更新Pos打印计数" << rObj;
QJsonDocument doc(rObj);
QByteArray strArray = doc.toJson( QJsonDocument::Compact);
QLOG_INFO() << "------ json string:"<<strArray;
sendToPrintServer(strArray);
} }
//厨房单打印 //厨房单打印
...@@ -398,6 +412,8 @@ void WBillControl::printCook(const OrderObject *obj,const QString& menuId,int nu ...@@ -398,6 +412,8 @@ void WBillControl::printCook(const OrderObject *obj,const QString& menuId,int nu
if(menu.strMenuId==menuId){ if(menu.strMenuId==menuId){
//print //print
QJsonObject rObj; QJsonObject rObj;
rObj.insert("fm_cmd", "print_lable");
rObj.insert("order_id", posOrderId);
//不是打印跳转 //不是打印跳转
if(!bJump){ if(!bJump){
...@@ -487,6 +503,8 @@ void WBillControl::printCook(const OrderObject *obj,const QString& menuId,int nu ...@@ -487,6 +503,8 @@ void WBillControl::printCook(const OrderObject *obj,const QString& menuId,int nu
QLOG_INFO() << "打印失败,开始跳转打印"; QLOG_INFO() << "打印失败,开始跳转打印";
if(!bJump){ if(!bJump){
QJsonObject rObjNew; QJsonObject rObjNew;
rObjNew.insert("fm_cmd", "print_lable");
rObjNew.insert("order_id", posOrderId);
rObjNew.insert("device", menu.strOrderDevice.toStdString().data()); rObjNew.insert("device", menu.strOrderDevice.toStdString().data());
rObjNew.insert("baud", menu.iOrderBaud); rObjNew.insert("baud", menu.iOrderBaud);
//rObjNew.insert("device", "/dev/ttyS1"); //rObjNew.insert("device", "/dev/ttyS1");
......
...@@ -115,6 +115,9 @@ private: ...@@ -115,6 +115,9 @@ private:
//收银账单打印 //收银账单打印
void printBill(const OrderObject *obj,const QString &posOrderId); void printBill(const OrderObject *obj,const QString &posOrderId);
//更新pos打印计数
void updatePosPrintCount(const QString &posOrderId);
//厨房小票信息发送到monitor //厨房小票信息发送到monitor
bool sendToPrintServer(QByteArray &JsonPrint); bool sendToPrintServer(QByteArray &JsonPrint);
......
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