|
@@ -743,62 +743,73 @@ void CPosPrinter::PrintWaimaiOrderShouyin(CWaimaiOrder& order)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//商品内容
|
|
//商品内容
|
|
|
- for(std::vector<CWaimaiOrderItem>::iterator it = order.m_order_items.begin(); it != order.m_order_items.end(); it++)
|
|
|
|
|
- {
|
|
|
|
|
- std::string food_name = (*it).m_food_name;
|
|
|
|
|
- std::string food_price = (*it).m_item_price;
|
|
|
|
|
- std::string quantity = (*it).m_quantity;
|
|
|
|
|
|
|
+ for (std::map<std::string, std::vector<CWaimaiOrderItem>>::iterator itMap = order.m_order_koudai_items.begin(); itMap != order.m_order_koudai_items.end(); itMap++)
|
|
|
|
|
+ {
|
|
|
|
|
+ std::string koudai_id = itMap->first;
|
|
|
|
|
+
|
|
|
|
|
+ std::string koudai_content = "*口袋" + CLewaimaiString::UTF8ToANSI(koudai_id) + "";
|
|
|
|
|
+ POS_TextOut(koudai_content, true, true, 0);
|
|
|
|
|
+ POS_FeedLine();
|
|
|
|
|
|
|
|
- //计算总价
|
|
|
|
|
- double item_price = atof(food_price.c_str()) * atof(quantity.c_str());
|
|
|
|
|
- std::string food_total_price = CLewaimaiString::DoubleToString(item_price, 2);
|
|
|
|
|
|
|
+ std::vector<CWaimaiOrderItem> koudai_items = itMap->second;
|
|
|
|
|
|
|
|
- if (food_total_price == "0.00")
|
|
|
|
|
|
|
+ for (std::vector<CWaimaiOrderItem>::iterator it = koudai_items.begin(); it != koudai_items.end(); it++)
|
|
|
{
|
|
{
|
|
|
- //这里是特殊处理满赠的展示
|
|
|
|
|
- food_total_price = "";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ std::string food_name = (*it).m_food_name;
|
|
|
|
|
+ std::string food_price = (*it).m_item_price;
|
|
|
|
|
+ std::string quantity = (*it).m_quantity;
|
|
|
|
|
|
|
|
- food_name = CLewaimaiString::UTF8ToANSI(food_name);
|
|
|
|
|
|
|
+ //计算总价
|
|
|
|
|
+ double item_price = atof(food_price.c_str()) * atof(quantity.c_str());
|
|
|
|
|
+ std::string food_total_price = CLewaimaiString::DoubleToString(item_price, 2);
|
|
|
|
|
|
|
|
- //先输出商品名字
|
|
|
|
|
- std::vector<string> m_names;
|
|
|
|
|
|
|
+ if (food_total_price == "0.00")
|
|
|
|
|
+ {
|
|
|
|
|
+ //这里是特殊处理满赠的展示
|
|
|
|
|
+ food_total_price = "";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if(guige == "58")
|
|
|
|
|
- {
|
|
|
|
|
- m_names = HandleFoodname(food_name, 1);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- m_names = HandleFoodname(food_name, 2);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ food_name = CLewaimaiString::UTF8ToANSI(food_name);
|
|
|
|
|
|
|
|
- std::string firstLine = m_names[0];
|
|
|
|
|
- int nGuige;
|
|
|
|
|
|
|
+ //先输出商品名字
|
|
|
|
|
+ std::vector<string> m_names;
|
|
|
|
|
|
|
|
- if(guige == "58")
|
|
|
|
|
- {
|
|
|
|
|
- nGuige = 1;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- nGuige = 2;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (guige == "58")
|
|
|
|
|
+ {
|
|
|
|
|
+ m_names = HandleFoodname(food_name, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ m_names = HandleFoodname(food_name, 2);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- std::string priceShow = HandleFoodItemPrice(food_price, nGuige);
|
|
|
|
|
- std::string quantityShow = HandleFoodQuantity(quantity, nGuige);
|
|
|
|
|
- std::string priceTotalShow = HandleFoodTotalPrice(food_total_price, nGuige);
|
|
|
|
|
- std::string firstLineShow = firstLine + priceShow + quantityShow + priceTotalShow;
|
|
|
|
|
|
|
+ std::string firstLine = m_names[0];
|
|
|
|
|
+ int nGuige;
|
|
|
|
|
|
|
|
- POS_TextOut(firstLineShow, false, setting_printer_shangpin_big);
|
|
|
|
|
- POS_FeedLine();
|
|
|
|
|
|
|
+ if (guige == "58")
|
|
|
|
|
+ {
|
|
|
|
|
+ nGuige = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ nGuige = 2;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- for(std::vector<string>::iterator it = m_names.begin() + 1; it != m_names.end(); it++)
|
|
|
|
|
- {
|
|
|
|
|
- POS_TextOut((*it), false, setting_printer_shangpin_big);
|
|
|
|
|
- POS_FeedLine();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ std::string priceShow = HandleFoodItemPrice(food_price, nGuige);
|
|
|
|
|
+ std::string quantityShow = HandleFoodQuantity(quantity, nGuige);
|
|
|
|
|
+ std::string priceTotalShow = HandleFoodTotalPrice(food_total_price, nGuige);
|
|
|
|
|
+ std::string firstLineShow = firstLine + priceShow + quantityShow + priceTotalShow;
|
|
|
|
|
+
|
|
|
|
|
+ POS_TextOut(firstLineShow, false, setting_printer_shangpin_big);
|
|
|
|
|
+ POS_FeedLine();
|
|
|
|
|
+
|
|
|
|
|
+ for (std::vector<string>::iterator it = m_names.begin() + 1; it != m_names.end(); it++)
|
|
|
|
|
+ {
|
|
|
|
|
+ POS_TextOut((*it), false, setting_printer_shangpin_big);
|
|
|
|
|
+ POS_FeedLine();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
//判断是否有备注
|
|
//判断是否有备注
|
|
|
if(order.m_memo.length() > 0)
|
|
if(order.m_memo.length() > 0)
|
|
@@ -1412,53 +1423,65 @@ void CPosPrinter::PrintWaimaiOrderChufang(CWaimaiOrder& order)
|
|
|
|
|
|
|
|
POS_FeedLine();
|
|
POS_FeedLine();
|
|
|
|
|
|
|
|
- //商品内容
|
|
|
|
|
- for(std::vector<CWaimaiOrderItem>::iterator it = cur_printer_use.begin(); it != cur_printer_use.end(); it++)
|
|
|
|
|
- {
|
|
|
|
|
- std::string food_name = (*it).m_food_name;
|
|
|
|
|
- std::string food_price = (*it).m_item_price;
|
|
|
|
|
- std::string quantity = (*it).m_quantity;
|
|
|
|
|
- //计算总价
|
|
|
|
|
- double item_price = atof(food_price.c_str()) * atof(quantity.c_str());
|
|
|
|
|
- std::string food_total_price = CLewaimaiString::DoubleToString(item_price, 2);
|
|
|
|
|
- food_name = CLewaimaiString::UTF8ToANSI(food_name);
|
|
|
|
|
- //先输出商品名字
|
|
|
|
|
- std::vector<string> m_names;
|
|
|
|
|
|
|
+ //商品内容(厨房打印不分单的情况下,打印口袋信息)
|
|
|
|
|
+ std::map<std::string, std::vector<CWaimaiOrderItem>> cur_order_koudai_items = order.UpdateKoudaiItems(cur_printer_use);
|
|
|
|
|
+ for (std::map<std::string, std::vector<CWaimaiOrderItem>>::iterator itMap = cur_order_koudai_items.begin(); itMap != cur_order_koudai_items.end(); itMap++)
|
|
|
|
|
+ {
|
|
|
|
|
+ std::string koudai_id = itMap->first;
|
|
|
|
|
|
|
|
- if(guige == "58")
|
|
|
|
|
- {
|
|
|
|
|
- m_names = HandleFoodname(food_name, 1);
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- m_names = HandleFoodname(food_name, 2);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ std::string koudai_content = "*口袋" + CLewaimaiString::UTF8ToANSI(koudai_id) + "";
|
|
|
|
|
+ POS_TextOut(koudai_content, true, true, 0);
|
|
|
|
|
+ POS_FeedLine();
|
|
|
|
|
|
|
|
- std::string firstLine = m_names[0];
|
|
|
|
|
- int nGuige;
|
|
|
|
|
|
|
+ std::vector<CWaimaiOrderItem> koudai_items = itMap->second;
|
|
|
|
|
|
|
|
- if(guige == "58")
|
|
|
|
|
- {
|
|
|
|
|
- nGuige = 1;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- nGuige = 2;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ for (std::vector<CWaimaiOrderItem>::iterator it = koudai_items.begin(); it != koudai_items.end(); it++)
|
|
|
|
|
+ {
|
|
|
|
|
+ std::string food_name = (*it).m_food_name;
|
|
|
|
|
+ std::string food_price = (*it).m_item_price;
|
|
|
|
|
+ std::string quantity = (*it).m_quantity;
|
|
|
|
|
+ //计算总价
|
|
|
|
|
+ double item_price = atof(food_price.c_str()) * atof(quantity.c_str());
|
|
|
|
|
+ std::string food_total_price = CLewaimaiString::DoubleToString(item_price, 2);
|
|
|
|
|
+ food_name = CLewaimaiString::UTF8ToANSI(food_name);
|
|
|
|
|
+ //先输出商品名字
|
|
|
|
|
+ std::vector<string> m_names;
|
|
|
|
|
+
|
|
|
|
|
+ if (guige == "58")
|
|
|
|
|
+ {
|
|
|
|
|
+ m_names = HandleFoodname(food_name, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ m_names = HandleFoodname(food_name, 2);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- std::string priceShow = HandleFoodItemPrice(food_price, nGuige);
|
|
|
|
|
- std::string quantityShow = HandleFoodQuantity(quantity, nGuige);
|
|
|
|
|
- std::string priceTotalShow = HandleFoodTotalPrice(food_total_price, nGuige);
|
|
|
|
|
- std::string firstLineShow = firstLine + priceShow + quantityShow + priceTotalShow;
|
|
|
|
|
- POS_TextOut(firstLineShow, false, true, 0);
|
|
|
|
|
- POS_FeedLine();
|
|
|
|
|
|
|
+ std::string firstLine = m_names[0];
|
|
|
|
|
+ int nGuige;
|
|
|
|
|
|
|
|
- for(std::vector<string>::iterator it = m_names.begin() + 1; it != m_names.end(); it++)
|
|
|
|
|
- {
|
|
|
|
|
- POS_TextOut((*it), false, true, 0);
|
|
|
|
|
- POS_FeedLine();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (guige == "58")
|
|
|
|
|
+ {
|
|
|
|
|
+ nGuige = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ nGuige = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ std::string priceShow = HandleFoodItemPrice(food_price, nGuige);
|
|
|
|
|
+ std::string quantityShow = HandleFoodQuantity(quantity, nGuige);
|
|
|
|
|
+ std::string priceTotalShow = HandleFoodTotalPrice(food_total_price, nGuige);
|
|
|
|
|
+ std::string firstLineShow = firstLine + priceShow + quantityShow + priceTotalShow;
|
|
|
|
|
+ POS_TextOut(firstLineShow, false, true, 0);
|
|
|
|
|
+ POS_FeedLine();
|
|
|
|
|
+
|
|
|
|
|
+ for (std::vector<string>::iterator it = m_names.begin() + 1; it != m_names.end(); it++)
|
|
|
|
|
+ {
|
|
|
|
|
+ POS_TextOut((*it), false, true, 0);
|
|
|
|
|
+ POS_FeedLine();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
//判断是否有备注
|
|
//判断是否有备注
|
|
|
if(order.m_memo.length() > 0)
|
|
if(order.m_memo.length() > 0)
|