Commit 5565ea3f by yunpeng.song

改成msvc版本

parent c3ce0fa4
...@@ -97,7 +97,7 @@ FlowControl::FlowControl():semaphore(0) ...@@ -97,7 +97,7 @@ FlowControl::FlowControl():semaphore(0)
} }
else else
{ {
QLOG_INFO() << QString("链接已断开"); QLOG_INFO() << QString::fromLocal8Bit("链接已断开");
} }
} ); } );
int port = ConfigManger::GetInstance().GetHttpServerPort(); int port = ConfigManger::GetInstance().GetHttpServerPort();
...@@ -156,7 +156,7 @@ void FlowControl::_ClickOMSAssignArea() ...@@ -156,7 +156,7 @@ void FlowControl::_ClickOMSAssignArea()
SetCursorPos(point.x(),point.y()); SetCursorPos(point.x(),point.y());
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0); mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0); mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
QLOG_INFO()<<QString("点击目标坐标x%1:,y:%2").arg(point.x()).arg(point.y()); QLOG_INFO()<<QString::fromLocal8Bit("点击目标坐标x%1:,y:%2").arg(point.x()).arg(point.y());
} }
void FlowControl::_ClickToLogin() void FlowControl::_ClickToLogin()
...@@ -193,7 +193,7 @@ bool FlowControl::_GetStoreInfo() ...@@ -193,7 +193,7 @@ bool FlowControl::_GetStoreInfo()
{ {
bool result=true; bool result=true;
emit showAlert(AlertForm::LOADING, "正在获取门店信息......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在获取门店信息......"));
QLOG_INFO() << QString("[---get storeInfo---]"); QLOG_INFO() << QString("[---get storeInfo---]");
QString tmp; QString tmp;
ConfigManger::GetInstance().GetStoreInfo(tmp/*, m_posId, m_cashierId*/, m_password); ConfigManger::GetInstance().GetStoreInfo(tmp/*, m_posId, m_cashierId*/, m_password);
...@@ -209,7 +209,7 @@ bool FlowControl::_Login() ...@@ -209,7 +209,7 @@ bool FlowControl::_Login()
sendJson = DataManger::GetInstance().GetLoginData(ConfigManger::GetInstance().GetPartnerId(),m_storeId, sendJson = DataManger::GetInstance().GetLoginData(ConfigManger::GetInstance().GetPartnerId(),m_storeId,
m_password, m_posId, m_cashierId,_GetIpAddress()); m_password, m_posId, m_cashierId,_GetIpAddress());
emit showAlert(AlertForm::LOADING, "正在登录......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在登录......"));
QLOG_INFO() << QString("[---login---][requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---login---][requestData:%1]")<<sendJson;
if(ConfigManger::GetInstance().GetLoginSslConfig()) if(ConfigManger::GetInstance().GetLoginSslConfig())
{ {
...@@ -222,13 +222,13 @@ bool FlowControl::_Login() ...@@ -222,13 +222,13 @@ bool FlowControl::_Login()
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "登录失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("登录失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
result = false; result = false;
emit showAlert(AlertForm::MSGERROR, QString("登录失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("登录失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
m_storeName = recvJson[JSON_STORENAME].toString(); m_storeName = recvJson[JSON_STORENAME].toString();
...@@ -285,16 +285,16 @@ bool FlowControl::_PullOrder() ...@@ -285,16 +285,16 @@ bool FlowControl::_PullOrder()
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit setNetStatus("<font color='#ff0000'>异常</font>"); emit setNetStatus(QString::fromLocal8Bit("<font color='#ff0000'>异常</font>"));
}else }else
{ {
qDebug()<<recvJson; qDebug()<<recvJson;
emit setNetStatus("正常"); emit setNetStatus(QString::fromLocal8Bit("正常"));
if(JSON_STATUSCODE_OK != recvJson[JSON_ERRCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_ERRCODE].toInt())
{ {
QString error = recvJson[JSON_ERRMSG].toString(); QString error = recvJson[JSON_ERRMSG].toString();
QLOG_ERROR() << QString("pull orders error.[msg->%1]").arg(error); QLOG_ERROR() << QString("pull orders error.[msg->%1]").arg(error);
emit showAlert(AlertForm::MSGERROR, QString("获取订单失败![%1]").arg(error)); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("获取订单失败![%1]").arg(error));
result=false; result=false;
}else }else
{ {
...@@ -454,13 +454,13 @@ bool FlowControl::_SendHeart() ...@@ -454,13 +454,13 @@ bool FlowControl::_SendHeart()
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "发送心跳失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("发送心跳失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
result = false; result = false;
emit showAlert(AlertForm::MSGERROR, QString("发送心跳失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("发送心跳失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
} }
} }
return result; return result;
...@@ -475,7 +475,7 @@ bool FlowControl::_ConfirmOrder(const QString &orderId) ...@@ -475,7 +475,7 @@ bool FlowControl::_ConfirmOrder(const QString &orderId)
sendJson = DataManger::GetInstance().GetConfirmOrderData(orderId,m_ordersMap[orderId]->channel); sendJson = DataManger::GetInstance().GetConfirmOrderData(orderId,m_ordersMap[orderId]->channel);
emit showAlert(AlertForm::LOADING, "正在通信......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在通信......"));
QLOG_INFO() << QString("[---confirm order---]. [requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---confirm order---]. [requestData:%1]")<<sendJson;
if(ConfigManger::GetInstance().GetOrderSslConfig()) if(ConfigManger::GetInstance().GetOrderSslConfig())
{ {
...@@ -492,13 +492,13 @@ bool FlowControl::_ConfirmOrder(const QString &orderId) ...@@ -492,13 +492,13 @@ bool FlowControl::_ConfirmOrder(const QString &orderId)
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "接单失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("接单失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_ERRCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_ERRCODE].toInt())
{ {
result = false; result = false;
emit showAlert(AlertForm::MSGERROR, QString("接单失败![%1]").arg(recvJson[JSON_ERRMSG].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("接单失败![%1]").arg(recvJson[JSON_ERRMSG].toString()));
}else }else
{ {
m_orderOperatePair.insert(orderId,1); m_orderOperatePair.insert(orderId,1);
...@@ -516,23 +516,23 @@ bool FlowControl::_RefuseOrder(const QString &orderId, int refuseCode,const QStr ...@@ -516,23 +516,23 @@ bool FlowControl::_RefuseOrder(const QString &orderId, int refuseCode,const QStr
sendJson = DataManger::GetInstance().GetRefuseOrderData(refuseCode, orderId); sendJson = DataManger::GetInstance().GetRefuseOrderData(refuseCode, orderId);
emit showAlert(AlertForm::LOADING, "正在通信......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在通信......"));
QLOG_INFO() << QString("[---refuse order---]. [requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---refuse order---]. [requestData:%1]")<<sendJson;
result = m_procOrderSocket->Request(sendJson, recvJson, error); result = m_procOrderSocket->Request(sendJson, recvJson, error);
QLOG_INFO() << QString("refuse order finsh. [result:%1][msg:%2][recvData:%3]") QLOG_INFO() << QString("refuse order finsh. [result:%1][msg:%2][recvData:%3]")
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "拒单失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("拒单失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
result = false; result = false;
emit showAlert(AlertForm::MSGERROR, QString("拒单失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("拒单失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
emit showAlert(AlertForm::SUCCESS, "拒单成功!"); emit showAlert(AlertForm::SUCCESS, QString::fromLocal8Bit("拒单成功!"));
// 通知主界面移动订单 // 通知主界面移动订单
OrderObject *orderObject = m_ordersMap.value(orderId); OrderObject *orderObject = m_ordersMap.value(orderId);
int oldStatus = orderObject->status; int oldStatus = orderObject->status;
...@@ -548,7 +548,7 @@ bool FlowControl::_SendOrder(const QString& orderId) ...@@ -548,7 +548,7 @@ bool FlowControl::_SendOrder(const QString& orderId)
{ {
if(m_ordersMap.value(orderId)->courier_name.isEmpty()&&m_ordersMap.value(orderId)->delivery_type==1) if(m_ordersMap.value(orderId)->courier_name.isEmpty()&&m_ordersMap.value(orderId)->delivery_type==1)
{ {
emit showAlert(AlertForm::MSGERROR,QString("配送员暂未接单,请等待")); emit showAlert(AlertForm::MSGERROR,QString::fromLocal8Bit("配送员暂未接单,请等待"));
return true; return true;
} }
QString error; QString error;
...@@ -558,23 +558,23 @@ bool FlowControl::_SendOrder(const QString& orderId) ...@@ -558,23 +558,23 @@ bool FlowControl::_SendOrder(const QString& orderId)
sendJson = DataManger::GetInstance().GetSendOrderData(orderId); sendJson = DataManger::GetInstance().GetSendOrderData(orderId);
emit showAlert(AlertForm::LOADING, "正在通信......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在通信......"));
QLOG_INFO() << QString("[---sendout order---]. [requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---sendout order---]. [requestData:%1]")<<sendJson;
result = m_procOrderSocket->Request(sendJson, recvJson, error); result = m_procOrderSocket->Request(sendJson, recvJson, error);
QLOG_INFO() << QString("sendout order finsh. [result:%1][msg:%2][recvData:%3]") QLOG_INFO() << QString("sendout order finsh. [result:%1][msg:%2][recvData:%3]")
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "送出失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("送出失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
result = false; result = false;
emit showAlert(AlertForm::MSGERROR, QString("送出失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("送出失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
emit showAlert(AlertForm::SUCCESS, "送出成功!"); emit showAlert(AlertForm::SUCCESS, QString::fromLocal8Bit("送出成功!"));
// 通知主界面移动订单 // 通知主界面移动订单
OrderObject *orderObject = m_ordersMap.value(orderId); OrderObject *orderObject = m_ordersMap.value(orderId);
...@@ -598,23 +598,23 @@ bool FlowControl::_CompleteOrder(const QString& orderId) ...@@ -598,23 +598,23 @@ bool FlowControl::_CompleteOrder(const QString& orderId)
sendJson = DataManger::GetInstance().GetCompleteOrderData(orderId); sendJson = DataManger::GetInstance().GetCompleteOrderData(orderId);
emit showAlert(AlertForm::LOADING, "正在通信......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在通信......"));
QLOG_INFO() << QString("[---complete order---]. [requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---complete order---]. [requestData:%1]")<<sendJson;
result = m_procOrderSocket->Request(sendJson, recvJson, error); result = m_procOrderSocket->Request(sendJson, recvJson, error);
QLOG_INFO() << QString("complete order finsh. [result:%1][msg:%2][recvData:%3]") QLOG_INFO() << QString("complete order finsh. [result:%1][msg:%2][recvData:%3]")
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "完成失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("完成失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
result = false; result = false;
emit showAlert(AlertForm::MSGERROR, QString("完成失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("完成失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
emit showAlert(AlertForm::SUCCESS, "完成成功!"); emit showAlert(AlertForm::SUCCESS, QString::fromLocal8Bit("完成成功!"));
// 通知主界面移动订单 // 通知主界面移动订单
OrderObject *orderObject = m_ordersMap.value(orderId); OrderObject *orderObject = m_ordersMap.value(orderId);
...@@ -636,7 +636,7 @@ bool FlowControl::_RefuseRefund(const QString& orderId) ...@@ -636,7 +636,7 @@ bool FlowControl::_RefuseRefund(const QString& orderId)
sendJson = DataManger::GetInstance().GetRefuseRefundData(VALUE_REFUSEREFUND_REASON,orderId); sendJson = DataManger::GetInstance().GetRefuseRefundData(VALUE_REFUSEREFUND_REASON,orderId);
emit showAlert(AlertForm::LOADING, "正在通信......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在通信......"));
QLOG_INFO() << QString("[---refuseRefund order---]. [requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---refuseRefund order---]. [requestData:%1]")<<sendJson;
result = m_procOrderSocket->Request(sendJson, recvJson, error); result = m_procOrderSocket->Request(sendJson, recvJson, error);
...@@ -644,16 +644,16 @@ bool FlowControl::_RefuseRefund(const QString& orderId) ...@@ -644,16 +644,16 @@ bool FlowControl::_RefuseRefund(const QString& orderId)
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "拒绝退单失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("拒绝退单失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
result = false; result = false;
emit showAlert(AlertForm::MSGERROR, QString("拒绝退单失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("拒绝退单失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
emit showAlert(AlertForm::SUCCESS, "拒绝退单成功!"); emit showAlert(AlertForm::SUCCESS, QString::fromLocal8Bit("拒绝退单成功!"));
// 通知主界面移动订单 // 通知主界面移动订单
OrderObject *orderObject = m_ordersMap.value(orderId); OrderObject *orderObject = m_ordersMap.value(orderId);
...@@ -677,7 +677,7 @@ bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QStri ...@@ -677,7 +677,7 @@ bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QStri
sendJson = DataManger::GetInstance().GetRefundOrderData(reasonCode,reason,orderId,m_ordersMap.value(orderId)->channel); sendJson = DataManger::GetInstance().GetRefundOrderData(reasonCode,reason,orderId,m_ordersMap.value(orderId)->channel);
emit showAlert(AlertForm::LOADING, "正在通信......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在通信......"));
QLOG_INFO() << QString("[---Refund order---]. [requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---Refund order---]. [requestData:%1]")<<sendJson;
if(ConfigManger::GetInstance().GetOrderSslConfig()) if(ConfigManger::GetInstance().GetOrderSslConfig())
...@@ -695,13 +695,13 @@ bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QStri ...@@ -695,13 +695,13 @@ bool FlowControl::_RefundOrder(const QString &orderId,int reasonCode,const QStri
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "退单失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("退单失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_ERRCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_ERRCODE].toInt())
{ {
result = false; result = false;
emit showAlert(AlertForm::MSGERROR, QString("退单失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("退单失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
m_orderOperatePair.insert(orderId,0); m_orderOperatePair.insert(orderId,0);
...@@ -732,7 +732,7 @@ void FlowControl::onPullDishes() ...@@ -732,7 +732,7 @@ void FlowControl::onPullDishes()
{ {
if(!m_bLoginResult) if(!m_bLoginResult)
{ {
emit showAlert(AlertForm::MSGERROR, QString("门店还未登录")); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("门店还未登录"));
return ; return ;
} }
QString error; QString error;
...@@ -743,14 +743,14 @@ void FlowControl::onPullDishes() ...@@ -743,14 +743,14 @@ void FlowControl::onPullDishes()
m_dishesMap.clear(); m_dishesMap.clear();
sendJson = DataManger::GetInstance().GetStoreChannelInfoData(); sendJson = DataManger::GetInstance().GetStoreChannelInfoData();
emit showAlert(AlertForm::LOADING, "正在获取平台列表......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在获取平台列表......"));
QLOG_INFO() << QString("[---GetStoreChannelInfo---]. [requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---GetStoreChannelInfo---]. [requestData:%1]")<<sendJson;
result = m_pullDishesSocket->Request(sendJson, recvJson, error); result = m_pullDishesSocket->Request(sendJson, recvJson, error);
QLOG_INFO() << QString("GetStoreChannelInfo finsh. [result:%1][msg:%2][recvData:%3]") QLOG_INFO() << QString("GetStoreChannelInfo finsh. [result:%1][msg:%2][recvData:%3]")
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "获取平台列表失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("获取平台列表失败![网络错误]"));
}else }else
{ {
//recvJson = QJsonDocument::fromJson("{\"statusCode\":100,\"msg\":\"s\",\"channels\":[ {\"code\":\"bdwm\",\"name\":\"百度外卖\",\"status\":1},{\"code\":\"mtwm\",\"name\":\"美团外卖\",\"status\":0},{\"code\":\"eleme2\",\"name\":\"饿了么\",\"status\":1}]}").object(); //recvJson = QJsonDocument::fromJson("{\"statusCode\":100,\"msg\":\"s\",\"channels\":[ {\"code\":\"bdwm\",\"name\":\"百度外卖\",\"status\":1},{\"code\":\"mtwm\",\"name\":\"美团外卖\",\"status\":0},{\"code\":\"eleme2\",\"name\":\"饿了么\",\"status\":1}]}").object();
...@@ -758,7 +758,7 @@ void FlowControl::onPullDishes() ...@@ -758,7 +758,7 @@ void FlowControl::onPullDishes()
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
emit showAlert(AlertForm::MSGERROR, QString("获取平台列表失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("获取平台列表失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
// 分别获取每个平台的菜品信息 // 分别获取每个平台的菜品信息
...@@ -770,14 +770,14 @@ void FlowControl::onPullDishes() ...@@ -770,14 +770,14 @@ void FlowControl::onPullDishes()
QString channelCode = channel["code"].toString(); QString channelCode = channel["code"].toString();
sendJson = DataManger::GetInstance().GetPullDishesData(channelCode); sendJson = DataManger::GetInstance().GetPullDishesData(channelCode);
emit showAlert(AlertForm::LOADING, QString("正在获取[%1]菜品信息......").arg(channelName)); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在获取[%1]菜品信息......").arg(channelName));
QLOG_INFO() << QString("[---pullDishes %1---]. [requestData:%2]").arg(channelName)<<sendJson; QLOG_INFO() << QString("[---pullDishes %1---]. [requestData:%2]").arg(channelName)<<sendJson;
result = m_pullDishesSocket->Request(sendJson, recvJson, error); result = m_pullDishesSocket->Request(sendJson, recvJson, error);
QLOG_INFO() << QString("pullDishes finsh. [result:%1][msg:%2][recvData:%3]") QLOG_INFO() << QString("pullDishes finsh. [result:%1][msg:%2][recvData:%3]")
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, QString("获取[%1]菜品信息失败![网络超时]").arg(channelName)); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("获取[%1]菜品信息失败![网络超时]").arg(channelName));
break; break;
}else }else
{ {
...@@ -814,7 +814,7 @@ void FlowControl::onPullDishes() ...@@ -814,7 +814,7 @@ void FlowControl::onPullDishes()
emit iniDishesData(m_dishesMap); emit iniDishesData(m_dishesMap);
}else }else
{ {
emit showAlert(AlertForm::MSGERROR, QString("未获取到菜品信息!")); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("未获取到菜品信息!"));
} }
} }
} }
...@@ -829,7 +829,7 @@ void FlowControl::onUpdDishes(QString channelCode, QMap<QString, int> dishes) ...@@ -829,7 +829,7 @@ void FlowControl::onUpdDishes(QString channelCode, QMap<QString, int> dishes)
sendJson = DataManger::GetInstance().GetUpdDishesData(channelCode, dishes); sendJson = DataManger::GetInstance().GetUpdDishesData(channelCode, dishes);
emit showAlert(AlertForm::LOADING, "正在同步菜品销售状态......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在同步菜品销售状态......"));
QLOG_INFO() << QString("[---update dishes---]. [requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---update dishes---]. [requestData:%1]")<<sendJson;
result = m_pullDishesSocket->Request(sendJson, recvJson, error); result = m_pullDishesSocket->Request(sendJson, recvJson, error);
...@@ -837,13 +837,13 @@ void FlowControl::onUpdDishes(QString channelCode, QMap<QString, int> dishes) ...@@ -837,13 +837,13 @@ void FlowControl::onUpdDishes(QString channelCode, QMap<QString, int> dishes)
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "同步菜品销售状态失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("同步菜品销售状态失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
result = false; result = false;
emit showAlert(AlertForm::MSGERROR, QString("同步菜品销售状态失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("同步菜品销售状态失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
emit hideAlert(); emit hideAlert();
...@@ -877,7 +877,7 @@ void FlowControl::onSetStoreOperatingStatus(const QString &channelCode, const QS ...@@ -877,7 +877,7 @@ void FlowControl::onSetStoreOperatingStatus(const QString &channelCode, const QS
QJsonObject recvJson; QJsonObject recvJson;
sendJson = DataManger::GetInstance().GetOperatingStatusData(channelCode, business_status); sendJson = DataManger::GetInstance().GetOperatingStatusData(channelCode, business_status);
emit showAlert(AlertForm::LOADING, "正在设置门店营业状态......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在设置门店营业状态......"));
QLOG_INFO() << QString("[---SetStoreOperatingStatus---]. [requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---SetStoreOperatingStatus---]. [requestData:%1]")<<sendJson;
m_pullDishesSocket->SetUrl(QUrl(ConfigManger::GetInstance().GetStoreServerUrl()+ m_pullDishesSocket->SetUrl(QUrl(ConfigManger::GetInstance().GetStoreServerUrl()+
ConfigManger::GetInstance().GetInterfaceName(INI_INTERFACE_UPDATESTATE))); ConfigManger::GetInstance().GetInterfaceName(INI_INTERFACE_UPDATESTATE)));
...@@ -888,12 +888,12 @@ void FlowControl::onSetStoreOperatingStatus(const QString &channelCode, const QS ...@@ -888,12 +888,12 @@ void FlowControl::onSetStoreOperatingStatus(const QString &channelCode, const QS
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "设置门店营业状态失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("设置门店营业状态失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
emit showAlert(AlertForm::MSGERROR, QString("设置门店营业状态失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("设置门店营业状态失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
emit hideAlert(); emit hideAlert();
...@@ -906,7 +906,7 @@ void FlowControl::onDailyReport() ...@@ -906,7 +906,7 @@ void FlowControl::onDailyReport()
{ {
if(!m_bLoginResult) if(!m_bLoginResult)
{ {
emit showAlert(AlertForm::MSGERROR, QString("门店未登录")); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("门店未登录"));
return; return;
} }
QString error; QString error;
...@@ -917,7 +917,7 @@ void FlowControl::onDailyReport() ...@@ -917,7 +917,7 @@ void FlowControl::onDailyReport()
sendJson = DataManger::GetInstance().GetDayReportData(m_business); sendJson = DataManger::GetInstance().GetDayReportData(m_business);
emit showAlert(AlertForm::LOADING, "正在通信......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在通信......"));
QLOG_INFO() << QString("[---Get daily report---]. [requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---Get daily report---]. [requestData:%1]")<<sendJson;
result = m_procOrderSocket->Request(sendJson, recvJson, error); result = m_procOrderSocket->Request(sendJson, recvJson, error);
...@@ -925,13 +925,13 @@ void FlowControl::onDailyReport() ...@@ -925,13 +925,13 @@ void FlowControl::onDailyReport()
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "获取入账日结失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("获取入账日结失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
result = false; result = false;
emit showAlert(AlertForm::MSGERROR, QString("获取入账日结失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("获取入账日结失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
recvJson.insert(JSON_STORENAME,m_storeName); recvJson.insert(JSON_STORENAME,m_storeName);
...@@ -973,7 +973,7 @@ bool FlowControl::_GetReplyJson(const QJsonObject &content,QJsonObject &data, QS ...@@ -973,7 +973,7 @@ bool FlowControl::_GetReplyJson(const QJsonObject &content,QJsonObject &data, QS
bool result = true; bool result = true;
if(!content.contains("actionId")) if(!content.contains("actionId"))
{ {
error =QString("未知的请求"); error =QString::fromLocal8Bit("未知的请求");
result = false; result = false;
} }
else{ else{
...@@ -1005,7 +1005,7 @@ bool FlowControl::_GetReplyJson(const QJsonObject &content,QJsonObject &data, QS ...@@ -1005,7 +1005,7 @@ bool FlowControl::_GetReplyJson(const QJsonObject &content,QJsonObject &data, QS
result=_Get12ReplyJson(content,data,error); result=_Get12ReplyJson(content,data,error);
break; break;
default: default:
error =QString("未知的请求"); error =QString::fromLocal8Bit("未知的请求");
result = false; result = false;
break; break;
} }
...@@ -1028,7 +1028,7 @@ bool FlowControl::_Get01ReplyJson(const QJsonObject &content, QJsonObject &data, ...@@ -1028,7 +1028,7 @@ bool FlowControl::_Get01ReplyJson(const QJsonObject &content, QJsonObject &data,
result = false; result = false;
if(error.isEmpty()) if(error.isEmpty())
{ {
error=QString("请求参数错误"); error=QString::fromLocal8Bit("请求参数错误");
} }
} }
return result; return result;
...@@ -1048,22 +1048,22 @@ bool FlowControl::_Get02ReplyJson(const QJsonObject &content, QJsonObject &data, ...@@ -1048,22 +1048,22 @@ bool FlowControl::_Get02ReplyJson(const QJsonObject &content, QJsonObject &data,
semaphore.acquire(1); semaphore.acquire(1);
if(m_bOperateResult) if(m_bOperateResult)
{ {
error=QString("接单成功"); error=QString::fromLocal8Bit("接单成功");
} }
else{ else{
error=QString("响应超时"); error=QString::fromLocal8Bit("响应超时");
} }
result=m_bOperateResult; result=m_bOperateResult;
semaphore.release(1); semaphore.release(1);
} }
else{ else{
result=false; result=false;
error=QString("订单不存在"); error=QString::fromLocal8Bit("订单不存在");
} }
} }
else{ else{
result=false; result=false;
error=QString("请求参数错误"); error=QString::fromLocal8Bit("请求参数错误");
} }
return result; return result;
} }
...@@ -1076,16 +1076,16 @@ bool FlowControl::_Get03ReplyJson(const QJsonObject &content, QJsonObject &data, ...@@ -1076,16 +1076,16 @@ bool FlowControl::_Get03ReplyJson(const QJsonObject &content, QJsonObject &data,
if(m_ordersMap.contains(orderId)) if(m_ordersMap.contains(orderId))
{ {
emit doStartOperateTimer(); emit doStartOperateTimer();
emit doRefundOrder(orderId,-1,QString("同意退款")); emit doRefundOrder(orderId,-1,QString::fromLocal8Bit("同意退款"));
orderOperation.orderId=orderId; orderOperation.orderId=orderId;
orderOperation.operation=0; orderOperation.operation=0;
semaphore.acquire(1); semaphore.acquire(1);
if(m_bOperateResult) if(m_bOperateResult)
{ {
error=QString("取消成功"); error=QString::fromLocal8Bit("取消成功");
} }
else{ else{
error=QString("响应超时"); error=QString::fromLocal8Bit("响应超时");
} }
result=m_bOperateResult; result=m_bOperateResult;
memset(&orderOperation,0, sizeof(orderOperation)); memset(&orderOperation,0, sizeof(orderOperation));
...@@ -1094,12 +1094,12 @@ bool FlowControl::_Get03ReplyJson(const QJsonObject &content, QJsonObject &data, ...@@ -1094,12 +1094,12 @@ bool FlowControl::_Get03ReplyJson(const QJsonObject &content, QJsonObject &data,
} }
else{ else{
result=false; result=false;
error=QString("订单不存在"); error=QString::fromLocal8Bit("订单不存在");
} }
} }
else{ else{
result=false; result=false;
error=QString("请求参数错误"); error=QString::fromLocal8Bit("请求参数错误");
} }
return result; return result;
} }
...@@ -1118,7 +1118,7 @@ bool FlowControl::_Get04ReplyJson(const QJsonObject &content, QJsonObject &data, ...@@ -1118,7 +1118,7 @@ bool FlowControl::_Get04ReplyJson(const QJsonObject &content, QJsonObject &data,
{ {
if(!m_orderIdToPosSalesIdMap.contains(orderId)) if(!m_orderIdToPosSalesIdMap.contains(orderId))
{ {
QLOG_INFO()<<QString("%1订单已经成功推送给simphony").arg(orderId); QLOG_INFO()<<QString::fromLocal8Bit("%1订单已经成功推送给simphony").arg(orderId);
m_orderIdToPosSalesIdMap.insert(orderId,posSaleId); m_orderIdToPosSalesIdMap.insert(orderId,posSaleId);
} }
OrderObject* order_p = m_ordersMap.value(orderId); OrderObject* order_p = m_ordersMap.value(orderId);
...@@ -1153,12 +1153,12 @@ bool FlowControl::_Get04ReplyJson(const QJsonObject &content, QJsonObject &data, ...@@ -1153,12 +1153,12 @@ bool FlowControl::_Get04ReplyJson(const QJsonObject &content, QJsonObject &data,
} }
else{ else{
result=false; result=false;
error=QString("订单号或者短号不能为空"); error=QString::fromLocal8Bit("订单号或者短号不能为空");
} }
} }
else{ else{
result=false; result=false;
error=QString("请求参数错误"); error=QString::fromLocal8Bit("请求参数错误");
} }
return result; return result;
} }
...@@ -1173,7 +1173,7 @@ bool FlowControl::_Get11ReplyJson(const QJsonObject &content, QJsonObject &data, ...@@ -1173,7 +1173,7 @@ bool FlowControl::_Get11ReplyJson(const QJsonObject &content, QJsonObject &data,
else{ else{
if(content[JSON_ORDERID].toString().isEmpty()) if(content[JSON_ORDERID].toString().isEmpty())
{ {
error =QString("订单号不能为空"); error =QString::fromLocal8Bit("订单号不能为空");
return false; return false;
} }
emit doPullOrder(content[JSON_ORDERID].toString(),content[JSON_CHANNEL].toString()); emit doPullOrder(content[JSON_ORDERID].toString(),content[JSON_CHANNEL].toString());
...@@ -1192,7 +1192,7 @@ bool FlowControl::_Get12ReplyJson(const QJsonObject &content, QJsonObject &data, ...@@ -1192,7 +1192,7 @@ bool FlowControl::_Get12ReplyJson(const QJsonObject &content, QJsonObject &data,
return true; return true;
} }
else{ else{
error=QString("门店信息不匹配"); error=QString::fromLocal8Bit("门店信息不匹配");
} }
return false; return false;
} }
...@@ -1205,7 +1205,7 @@ bool FlowControl::_GetLoginReplyJson(const QJsonObject &content,QString &error) ...@@ -1205,7 +1205,7 @@ bool FlowControl::_GetLoginReplyJson(const QJsonObject &content,QString &error)
m_cashierId=content["operatorId"].toString(); m_cashierId=content["operatorId"].toString();
if(m_bFirstRecvInfo) if(m_bFirstRecvInfo)
{ {
error = QString("FMOMS正在登录"); error = QString::fromLocal8Bit("FMOMS正在登录");
emit doLogin(); emit doLogin();
} }
return true; return true;
...@@ -1217,12 +1217,12 @@ bool FlowControl::_GetQueryReplyJson(QJsonObject &data, QString &error, const QS ...@@ -1217,12 +1217,12 @@ bool FlowControl::_GetQueryReplyJson(QJsonObject &data, QString &error, const QS
bool result=true; bool result=true;
if(!m_bLoginResult) if(!m_bLoginResult)
{ {
error = QString("FMOMS 未登录"); error = QString::fromLocal8Bit("FMOMS 未登录");
return false; return false;
} }
if(m_ordersEntryList.isEmpty()) if(m_ordersEntryList.isEmpty())
{ {
error = QString("没有新订单待拉取"); error = QString::fromLocal8Bit("没有新订单待拉取");
result = true; result = true;
} }
else else
...@@ -1253,7 +1253,7 @@ bool FlowControl::_GetQueryReplyJson(QJsonObject &data, QString &error, const QS ...@@ -1253,7 +1253,7 @@ bool FlowControl::_GetQueryReplyJson(QJsonObject &data, QString &error, const QS
} }
rObj.insert("fm_ver", "1.0"); rObj.insert("fm_ver", "1.0");
cObj.insert("pay_id", "002"); cObj.insert("pay_id", "002");
cObj.insert("pay_str", "非码外卖"); cObj.insert("pay_str", QString::fromLocal8Bit("非码外卖"));
cObj.insert("pos_sale_id", orderObject->possale_id); cObj.insert("pos_sale_id", orderObject->possale_id);
cObj.insert("order_status",orderObject->status);//订单的状态 cObj.insert("order_status",orderObject->status);//订单的状态
cObj.insert("pay_ebcode", orderObject->channel); cObj.insert("pay_ebcode", orderObject->channel);
...@@ -1325,18 +1325,18 @@ void FlowControl::_HandleOrderOperation(const QString &orderId) ...@@ -1325,18 +1325,18 @@ void FlowControl::_HandleOrderOperation(const QString &orderId)
case 100: case 100:
if(0==operation) if(0==operation)
{ {
emit showAlert(AlertForm::SUCCESS, QString("%1%2号单取消成功!").arg(channel).arg(index)); emit showAlert(AlertForm::SUCCESS, QString::fromLocal8Bit("%1%2号单取消成功!").arg(channel).arg(index));
QLOG_INFO()<<orderId<<QString("取消订单成功!"); QLOG_INFO()<<orderId<<QString::fromLocal8Bit("取消订单成功!");
} }
break; break;
default: default:
if(1==operation) if(1==operation)
{ {
QString remark(orderObject->remark), deliveryTime; QString remark(orderObject->remark), deliveryTime;
remark = remark.isEmpty()? "" : QString("\r\n[备注: %1]").arg(remark); remark = remark.isEmpty()? "" : QString::fromLocal8Bit("\r\n[备注: %1]").arg(remark);
deliveryTime = QString("\r\n[期望送达时间: %1]").arg(QDateTime::fromTime_t(orderObject->delivery_time).toString("MM/dd hh:mm")); deliveryTime = QString::fromLocal8Bit("\r\n[期望送达时间: %1]").arg(QDateTime::fromTime_t(orderObject->delivery_time).toString("MM/dd hh:mm"));
emit showAlert(AlertForm::SUCCESS, QString("%1%2号单接单成功!%3%4").arg(channel).arg(index).arg(remark).arg(deliveryTime)); emit showAlert(AlertForm::SUCCESS, QString::fromLocal8Bit("%1%2号单接单成功!%3%4").arg(channel).arg(index).arg(remark).arg(deliveryTime));
QLOG_INFO()<<orderId<<QString("接单成功!%1%2").arg(remark).arg(deliveryTime); QLOG_INFO()<<orderId<<QString::fromLocal8Bit("接单成功!%1%2").arg(remark).arg(deliveryTime);
} }
break; break;
} }
...@@ -1379,7 +1379,7 @@ void FlowControl::onGetBusinessStatus() ...@@ -1379,7 +1379,7 @@ void FlowControl::onGetBusinessStatus()
QLOG_INFO()<<__FUNCTION__; QLOG_INFO()<<__FUNCTION__;
if(!m_bLoginResult) if(!m_bLoginResult)
{ {
emit showAlert(AlertForm::MSGERROR, QString("门店还未登录")); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("门店还未登录"));
return ; return ;
} }
QString error; QString error;
...@@ -1391,19 +1391,19 @@ void FlowControl::onGetBusinessStatus() ...@@ -1391,19 +1391,19 @@ void FlowControl::onGetBusinessStatus()
m_pullDishesSocket->SetUrl(QUrl(ConfigManger::GetInstance().GetStoreServerUrl()+ m_pullDishesSocket->SetUrl(QUrl(ConfigManger::GetInstance().GetStoreServerUrl()+
ConfigManger::GetInstance().GetInterfaceName(INI_INTERFACE_GETSTORESTATE))); ConfigManger::GetInstance().GetInterfaceName(INI_INTERFACE_GETSTORESTATE)));
qDebug()<<ConfigManger::GetInstance().GetStoreServerUrl()+ ConfigManger::GetInstance().GetInterfaceName(INI_INTERFACE_GETSTORESTATE); qDebug()<<ConfigManger::GetInstance().GetStoreServerUrl()+ ConfigManger::GetInstance().GetInterfaceName(INI_INTERFACE_GETSTORESTATE);
emit showAlert(AlertForm::LOADING, "正在获取平台营业状态......"); emit showAlert(AlertForm::LOADING, QString::fromLocal8Bit("正在获取平台营业状态......"));
QLOG_INFO() << QString("[---GetStoreChannelInfo---]. [requestData:%1]")<<sendJson; QLOG_INFO() << QString("[---GetStoreChannelInfo---]. [requestData:%1]")<<sendJson;
result = m_pullDishesSocket->Request(sendJson, recvJson, error); result = m_pullDishesSocket->Request(sendJson, recvJson, error);
QLOG_INFO() << QString("GetStoreChannelInfo finsh. [result:%1][msg:%2][recvData:%3]") QLOG_INFO() << QString("GetStoreChannelInfo finsh. [result:%1][msg:%2][recvData:%3]")
.arg(result).arg(error)<<recvJson; .arg(result).arg(error)<<recvJson;
if(!result) if(!result)
{ {
emit showAlert(AlertForm::MSGERROR, "获取平台营业状态失败![网络错误]"); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("获取平台营业状态失败![网络错误]"));
}else }else
{ {
if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt()) if(JSON_STATUSCODE_OK != recvJson[JSON_STATUSCODE].toInt())
{ {
emit showAlert(AlertForm::MSGERROR, QString("获取平台营业状态失败![%1]").arg(recvJson[JSON_MESSAGE].toString())); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("获取平台营业状态失败![%1]").arg(recvJson[JSON_MESSAGE].toString()));
}else }else
{ {
QJsonArray array=recvJson[JSON_DATA].toArray(); QJsonArray array=recvJson[JSON_DATA].toArray();
...@@ -1425,7 +1425,7 @@ void FlowControl::onGetBusinessStatus() ...@@ -1425,7 +1425,7 @@ void FlowControl::onGetBusinessStatus()
emit initChannelsData(strListChannels); emit initChannelsData(strListChannels);
}else }else
{ {
emit showAlert(AlertForm::MSGERROR, QString("未获取到平台信息!")); emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("未获取到平台信息!"));
} }
} }
} }
...@@ -1452,7 +1452,7 @@ void FlowControl::onProcessOrder(const QString &operation, const QString &orderI ...@@ -1452,7 +1452,7 @@ void FlowControl::onProcessOrder(const QString &operation, const QString &orderI
_RefuseRefund(orderId); _RefuseRefund(orderId);
}else if(!operation.compare(OPERATION_REFUNDORDER)) }else if(!operation.compare(OPERATION_REFUNDORDER))
{ {
_RefundOrder(orderId,-1,"同意退款"); _RefundOrder(orderId,-1,QString::fromLocal8Bit("同意退款"));
} }
} }
...@@ -1479,11 +1479,11 @@ void FlowControl::onSerachOrder(const QString &text) ...@@ -1479,11 +1479,11 @@ void FlowControl::onSerachOrder(const QString &text)
} }
if(orderId.startsWith(text)) if(orderId.startsWith(text))
{ {
orderMap.insert("订单号:"+orderId,"手机号:"+phoneId); orderMap.insert(QString::fromLocal8Bit("订单号:")+orderId,QString::fromLocal8Bit("手机号:")+phoneId);
} }
if(phoneId.startsWith(text)) if(phoneId.startsWith(text))
{ {
orderMap.insert("订单号:"+orderId,"手机号:"+phoneId); orderMap.insert(QString::fromLocal8Bit("订单号:")+orderId,QString::fromLocal8Bit("手机号:")+phoneId);
} }
} }
} }
......
#include "ClickedLineEdit.h" #include "ClickedLineEdit.h"
#ifndef CLICKEDLINEEDIT_H #ifndef CLICKEDLINEEDIT_H
#define CLICKEDLINEEDIT_H #define CLICKEDLINEEDIT_H
#include <QMouseEvent> #include <QMouseEvent>
......
#include "dataManger.h" #include "dataManger.h"
#include "preDefine.h" #include "preDefine.h"
#include <QJsonArray> #include <QJsonArray>
......
#ifndef DATAMANGER_H #ifndef DATAMANGER_H
#define DATAMANGER_H #define DATAMANGER_H
#include <QJsonObject> #include <QJsonObject>
......
#ifndef FM_DUMP_H
#define FM_DUMP_H
#include <windows.h>
#include <DbgHelp.h>
#include <schannel.h>
void CreateMiniDump(char *file, EXCEPTION_POINTERS* pep)
{
// Open the file
HANDLE hFile = CreateFileA(file, GENERIC_READ | GENERIC_WRITE,
0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
if( ( hFile != NULL ) && ( hFile != INVALID_HANDLE_VALUE ) )
{
// Create the minidump
BOOL rv = 0;
MINIDUMP_EXCEPTION_INFORMATION mdei;
MINIDUMP_TYPE mdt;
mdei.ThreadId = GetCurrentThreadId();
mdei.ExceptionPointers = pep;
mdei.ClientPointers = TRUE;
mdt = MiniDumpWithFullMemory;
rv = MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(),
hFile, mdt, (pep != 0) ? &mdei : 0, 0, 0 );
// Close the file
CloseHandle( hFile );
}
}
long __stdcall FMExcpHandler(PEXCEPTION_POINTERS excp)
{
char mod[MAX_PATH] = { 0 };
FILE* ferr = NULL;
GetModuleFileNameA(NULL, mod, MAX_PATH);
strcat(mod, ".err");
ferr = fopen(mod, "w");
fprintf(ferr, "Error address %x\n",excp->ExceptionRecord->ExceptionAddress);
fprintf(ferr, "CPU register:\n");
fprintf(ferr, "eax %x ebx %x ecx %x edx %x\n",excp->ContextRecord->Eax,
excp->ContextRecord->Ebx,excp->ContextRecord->Ecx,
excp->ContextRecord->Edx);
fclose(ferr);
strcat(mod, ".dmp");
CreateMiniDump(mod, excp);
return EXCEPTION_EXECUTE_HANDLER;
}
#endif // DUMP
#include "headframe.h" #include "headframe.h"
void HeadFrame::mouseMoveEvent(QMouseEvent *event) void HeadFrame::mouseMoveEvent(QMouseEvent *event)
{ {
......
#ifndef HEADFRAME_H #ifndef HEADFRAME_H
#define HEADFRAME_H #define HEADFRAME_H
#include <QMouseEvent> #include <QMouseEvent>
#include <QFrame> #include <QFrame>
......
#ifndef SYSTRAY_H #ifndef SYSTRAY_H
#define SYSTRAY_H #define SYSTRAY_H
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
......
#include "util.h" #include "util.h"
#include "preDefine.h" #include "preDefine.h"
QString Penny2Dollar(int penny) QString Penny2Dollar(int penny)
......
#ifndef UTIL_H #ifndef UTIL_H
#define UTIL_H #define UTIL_H
#include <QString> #include <QString>
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
# http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. # http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
# #
QT *= core gui QT += core gui
CONFIG *= c++11 CONFIG += c++11
INCLUDEPATH *= \ INCLUDEPATH *= \
$$PWD/include/ $$PWD/include/
......
...@@ -100,12 +100,12 @@ private: ...@@ -100,12 +100,12 @@ private:
QString requestCrlf_; QString requestCrlf_;
QMap< QString, QString > headersData_; QMap< QString, QString > headersData_;
bool headerAcceptedFinish_ = false; bool headerAcceptedFinish_;
bool alreadyReply_ = false; bool alreadyReply_;
QByteArray requestRawData_; QByteArray requestRawData_;
qint64 waitWrittenByteCount_ = 0; qint64 waitWrittenByteCount_;
QSharedPointer< QIODevice > ioDeviceForReply_; QSharedPointer< QIODevice > ioDeviceForReply_;
}; };
......
...@@ -67,7 +67,10 @@ static QString replyImageFormat( ...@@ -67,7 +67,10 @@ static QString replyImageFormat(
// Session // Session
Session::Session(const QPointer<QIODevice> &tcpSocket): Session::Session(const QPointer<QIODevice> &tcpSocket):
ioDevice_( tcpSocket ), ioDevice_( tcpSocket ),
timerForClose_( new QTimer ) timerForClose_( new QTimer ),
headerAcceptedFinish_(false),
alreadyReply_ (false),
waitWrittenByteCount_(0)
{ {
qDebug() << __FUNCTION__ << QThread::currentThreadId(); qDebug() << __FUNCTION__ << QThread::currentThreadId();
timerForClose_->setInterval( 30 * 1000 ); timerForClose_->setInterval( 30 * 1000 );
......
...@@ -32,7 +32,7 @@ QNetworkAddressEntry JQNet::getNetworkAddressEntry() ...@@ -32,7 +32,7 @@ QNetworkAddressEntry JQNet::getNetworkAddressEntry()
QPair< QNetworkAddressEntry, QNetworkInterface > JQNet::getNetworkAddressEntryWithNetworkInterface(const bool &ridVm) QPair< QNetworkAddressEntry, QNetworkInterface > JQNet::getNetworkAddressEntryWithNetworkInterface(const bool &ridVm)
{ {
for (const auto &interface: QNetworkInterface::allInterfaces()) foreach (const auto &interface, QNetworkInterface::allInterfaces())
{ {
if ( interface.flags() != (QNetworkInterface::IsUp if ( interface.flags() != (QNetworkInterface::IsUp
| QNetworkInterface::IsRunning | QNetworkInterface::IsRunning
...@@ -41,16 +41,16 @@ QPair< QNetworkAddressEntry, QNetworkInterface > JQNet::getNetworkAddressEntryWi ...@@ -41,16 +41,16 @@ QPair< QNetworkAddressEntry, QNetworkInterface > JQNet::getNetworkAddressEntryWi
if ( ridVm && interface.humanReadableName().startsWith( "vm" ) ) { continue; } if ( ridVm && interface.humanReadableName().startsWith( "vm" ) ) { continue; }
for ( const auto &entry: interface.addressEntries() ) foreach ( const auto &entry, interface.addressEntries() )
{ {
if ( entry.ip().toIPv4Address() ) if ( entry.ip().toIPv4Address() )
{ {
return { entry, interface }; return QPair<QNetworkAddressEntry, QNetworkInterface>(entry,interface);
} }
} }
} }
return { }; return QPair<QNetworkAddressEntry, QNetworkInterface>();
} }
QString JQNet::getHostName() QString JQNet::getHostName()
...@@ -168,7 +168,7 @@ QPair< bool, QByteArray > HTTP::get(const QString &url, const int &timeout) ...@@ -168,7 +168,7 @@ QPair< bool, QByteArray > HTTP::get(const QString &url, const int &timeout)
const auto &&flag = HTTP().get( networkRequest, buf, timeout ); const auto &&flag = HTTP().get( networkRequest, buf, timeout );
return { flag, buf }; return QPair< bool, QByteArray >(flag, buf);
} }
QPair< bool, QByteArray > HTTP::get(const QNetworkRequest &request, const int &timeout) QPair< bool, QByteArray > HTTP::get(const QNetworkRequest &request, const int &timeout)
...@@ -178,7 +178,7 @@ QPair< bool, QByteArray > HTTP::get(const QNetworkRequest &request, const int &t ...@@ -178,7 +178,7 @@ QPair< bool, QByteArray > HTTP::get(const QNetworkRequest &request, const int &t
const auto &&flag = http.get( request, buf, timeout ); const auto &&flag = http.get( request, buf, timeout );
return { flag, buf }; return QPair< bool, QByteArray > ( flag, buf );
} }
QPair< bool, QByteArray > HTTP::post(const QString &url, const QByteArray &appendData, const int &timeout) QPair< bool, QByteArray > HTTP::post(const QString &url, const QByteArray &appendData, const int &timeout)
...@@ -190,7 +190,7 @@ QPair< bool, QByteArray > HTTP::post(const QString &url, const QByteArray &appen ...@@ -190,7 +190,7 @@ QPair< bool, QByteArray > HTTP::post(const QString &url, const QByteArray &appen
const auto &&flag = HTTP().post( networkRequest, appendData, buf, timeout ); const auto &&flag = HTTP().post( networkRequest, appendData, buf, timeout );
return { flag, buf }; return QPair< bool, QByteArray >(flag, buf );
} }
QPair< bool, QByteArray > HTTP::post(const QNetworkRequest &request, const QByteArray &appendData, const int &timeout) QPair< bool, QByteArray > HTTP::post(const QNetworkRequest &request, const QByteArray &appendData, const int &timeout)
...@@ -200,7 +200,7 @@ QPair< bool, QByteArray > HTTP::post(const QNetworkRequest &request, const QByte ...@@ -200,7 +200,7 @@ QPair< bool, QByteArray > HTTP::post(const QNetworkRequest &request, const QByte
const auto &&flag = http.post( request, appendData, buf, timeout ); const auto &&flag = http.post( request, appendData, buf, timeout );
return { flag, buf }; return QPair< bool, QByteArray >(flag, buf );
} }
void HTTP::handle(QNetworkReply *reply, const int &timeout, void HTTP::handle(QNetworkReply *reply, const int &timeout,
......
#include "baseObject.h" #include "baseObject.h"
#include <QStringList> #include <QStringList>
#include <QVariant> #include <QVariant>
#include "preDefine.h" #include "preDefine.h"
BaseObject::BaseObject(const BaseObject &p, QObject *parent):QObject{parent} BaseObject::BaseObject(const BaseObject &p, QObject *parent)
{ {
const QMetaObject *m = p.metaObject(); const QMetaObject *m = p.metaObject();
for( int i=m->propertyOffset(); i<m->propertyCount(); i++) for( int i=m->propertyOffset(); i<m->propertyCount(); i++)
......
#ifndef BASEOBJECT_H #ifndef BASEOBJECT_H
#define BASEOBJECT_H #define BASEOBJECT_H
#include <QObject> #include <QObject>
......
#include "cashierObject.h" #include "cashierObject.h"
#ifndef CASHIEROBJECT_H #ifndef CASHIEROBJECT_H
#define CASHIEROBJECT_H #define CASHIEROBJECT_H
#include <QString> #include <QString>
......
#include "dailyObject.h" #include "dailyObject.h"
QString DailyObject::getChannel() const QString DailyObject::getChannel() const
{ {
......
#ifndef DAILYOBJECT_H #ifndef DAILYOBJECT_H
#define DAILYOBJECT_H #define DAILYOBJECT_H
#include "baseObject.h" #include "baseObject.h"
......
#include "deliverObject.h" #include "deliverObject.h"
QString DeliverObject::getId() const QString DeliverObject::getId() const
{ {
......
#ifndef DELIVEROBJECT_H #ifndef DELIVEROBJECT_H
#define DELIVEROBJECT_H #define DELIVEROBJECT_H
#include "baseObject.h" #include "baseObject.h"
......
#include "dishesObject.h" #include "dishesObject.h"
#ifndef DISHESOBJECT_H #ifndef DISHESOBJECT_H
#define DISHESOBJECT_H #define DISHESOBJECT_H
#include <QObject> #include <QObject>
......
#include "orderObject.h" #include "orderObject.h"
#include "preDefine.h" #include "preDefine.h"
#include <QJsonArray> #include <QJsonArray>
......
#include "productObject.h" #include "productObject.h"
#include <QJsonArray> #include <QJsonArray>
void ProductObject::FromJson(const QJsonObject &json) void ProductObject::FromJson(const QJsonObject &json)
......
#ifndef PRODUCTOBJECT_H #ifndef PRODUCTOBJECT_H
#define PRODUCTOBJECT_H #define PRODUCTOBJECT_H
#include "baseObject.h" #include "baseObject.h"
......
#include "billSocket.h" #include "billSocket.h"
#include <QtNetwork/QNetworkReply> #include <QtNetwork/QNetworkReply>
#include "preDefine.h" #include "preDefine.h"
......
#ifndef BILLSOCKET_H #ifndef BILLSOCKET_H
#define BILLSOCKET_H #define BILLSOCKET_H
#include <QJsonObject> #include <QJsonObject>
......
INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD
#DEFINES += QS_LOG_LINE_NUMBERS # automatically writes the file and line for each log message DEFINES += QS_LOG_LINE_NUMBERS # automatically writes the file and line for each log message
#DEFINES += QS_LOG_DISABLE # logging code is replaced with a no-op #DEFINES += QS_LOG_DISABLE # logging code is replaced with a no-op
DEFINES += QS_LOG_SEPARATE_THREAD # messages are queued and written from a separate thread DEFINES += QS_LOG_SEPARATE_THREAD # messages are queued and written from a separate thread
#DEFINES += QS_LOG_WIN_PRINTF_CONSOLE # Use fprintf instead of OutputDebugString on Windows #DEFINES += QS_LOG_WIN_PRINTF_CONSOLE # Use fprintf instead of OutputDebugString on Windows
......
#include "RejectForm.h" #include "RejectForm.h"
#include "ui_RejectForm.h" #include "ui_RejectForm.h"
RejectForm::RejectForm(QWidget *parent) : RejectForm::RejectForm(QWidget *parent) :
......
#ifndef REJECTFORM_H #ifndef REJECTFORM_H
#define REJECTFORM_H #define REJECTFORM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>RejectForm</class> <class>RejectForm</class>
<widget class="QDialog" name="RejectForm"> <widget class="QDialog" name="RejectForm">
......
#include "alertForm.h" #include "alertForm.h"
#include "ui_alertForm.h" #include "ui_alertForm.h"
AlertForm::AlertForm(QWidget *parent) : AlertForm::AlertForm(QWidget *parent) :
......
#ifndef ALERTFORM_H #ifndef ALERTFORM_H
#define ALERTFORM_H #define ALERTFORM_H
// 通知窗口 // 通知窗口
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>AlertForm</class> <class>AlertForm</class>
<widget class="QDialog" name="AlertForm"> <widget class="QDialog" name="AlertForm">
......
#include "bstatusForm.h" #include "bstatusForm.h"
#include "ui_bstatusForm.h" #include "ui_bstatusForm.h"
#include "Control/flowControl.h" #include "Control/flowControl.h"
#include "bstatusItem.h" #include "bstatusItem.h"
......
#ifndef BSTATUSFORM_H #ifndef BSTATUSFORM_H
#define BSTATUSFORM_H #define BSTATUSFORM_H
#include <QDialog> #include <QDialog>
#include "bstatusItem.h" #include "bstatusItem.h"
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>BStatusForm</class> <class>BStatusForm</class>
<widget class="QDialog" name="BStatusForm"> <widget class="QDialog" name="BStatusForm">
......
#include "bstatusItem.h" #include "bstatusItem.h"
#include "ui_bstatusItem.h" #include "ui_bstatusItem.h"
#include <QStringList> #include <QStringList>
#include "Control/flowControl.h" #include "Control/flowControl.h"
......
#ifndef BSTATUSITEM_H #ifndef BSTATUSITEM_H
#define BSTATUSITEM_H #define BSTATUSITEM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>BStatusItem</class> <class>BStatusItem</class>
<widget class="QDialog" name="BStatusItem"> <widget class="QDialog" name="BStatusItem">
......
#include "dailyreportForm.h" #include "dailyreportForm.h"
#include "ui_dailyreportForm.h" #include "ui_dailyreportForm.h"
#include <QPainter> #include <QPainter>
#include "preDefine.h" #include "preDefine.h"
......
#ifndef DAYREPORTFORM_H #ifndef DAYREPORTFORM_H
#define DAYREPORTFORM_H #define DAYREPORTFORM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>DailyReportForm</class> <class>DailyReportForm</class>
<widget class="QDialog" name="DailyReportForm"> <widget class="QDialog" name="DailyReportForm">
......
...@@ -41,8 +41,8 @@ void DetailForm::InitData(OrderObject *orderObject) ...@@ -41,8 +41,8 @@ void DetailForm::InitData(OrderObject *orderObject)
ui->detailLab1->setText(QString("%1:%2").arg(orderObject->customer,orderObject->phone)); ui->detailLab1->setText(QString("%1:%2").arg(orderObject->customer,orderObject->phone));
//ui->detailLab3->setText(orderObject->address); //ui->detailLab3->setText(orderObject->address);
//ui->detailLab4->setText(QString("[配送方式]%1 [配送费]%2").arg(orderObject->delivery_party,Penny2Dollar(orderObject->send_fee))); //ui->detailLab4->setText(QString("[配送方式]%1 [配送费]%2").arg(orderObject->delivery_party,Penny2Dollar(orderObject->send_fee)));
ui->detailLab2->setText(orderObject->delivery_time==0? "立即送出" : QDateTime::fromTime_t(orderObject->delivery_time).toString("MM/dd hh:mm")); ui->detailLab2->setText(orderObject->delivery_time==0? QString::fromLocal8Bit("立即送出") : QDateTime::fromTime_t(orderObject->delivery_time).toString("MM/dd hh:mm"));
ui->detailLab3->setText(orderObject->courier_name.isEmpty() ? "暂未指定" : QString("[姓名]%1 [电话]%2") ui->detailLab3->setText(orderObject->courier_name.isEmpty() ? QString::fromLocal8Bit("暂未指定") : QString::fromLocal8Bit("[姓名]%1 [电话]%2")
.arg(orderObject->courier_name, orderObject->courier_phone)); .arg(orderObject->courier_name, orderObject->courier_phone));
ui->detailLab4->setText(Penny2Dollar(orderObject->product_fee)); ui->detailLab4->setText(Penny2Dollar(orderObject->product_fee));
//ui->detailLab8->setText(orderObject->has_invoiced? QString("发票抬头:%1").arg(orderObject->invoice_title) : "不需要发票"); //ui->detailLab8->setText(orderObject->has_invoiced? QString("发票抬头:%1").arg(orderObject->invoice_title) : "不需要发票");
...@@ -135,7 +135,7 @@ void DetailForm::onOperaBtnClicked() ...@@ -135,7 +135,7 @@ void DetailForm::onOperaBtnClicked()
{ {
hide(); hide();
QPushButton *pBtn = (QPushButton*)sender(); QPushButton *pBtn = (QPushButton*)sender();
if(pBtn->text()=="拒单"||pBtn->text()=="退单") if(pBtn->text()==QString::fromLocal8Bit("拒单")||pBtn->text()==QString::fromLocal8Bit("退单"))
{ {
// m_rejectForm->show(); // m_rejectForm->show();
// if(m_rejectForm->exec()==QDialog::Accepted) // if(m_rejectForm->exec()==QDialog::Accepted)
......
#ifndef DETAILFORM_H #ifndef DETAILFORM_H
#define DETAILFORM_H #define DETAILFORM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>DetailForm</class> <class>DetailForm</class>
<widget class="QDialog" name="DetailForm"> <widget class="QDialog" name="DetailForm">
......
#include "disTabWdg.h" #include "disTabWdg.h"
#include "ui_disTabWdg.h" #include "ui_disTabWdg.h"
#include "Control/flowControl.h" #include "Control/flowControl.h"
#include <QScrollBar> #include <QScrollBar>
......
#ifndef DISTABWDG_H #ifndef DISTABWDG_H
#define DISTABWDG_H #define DISTABWDG_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>disTabWdg</class> <class>disTabWdg</class>
<widget class="QDialog" name="disTabWdg"> <widget class="QDialog" name="disTabWdg">
......
#include "dishesForm.h" #include "dishesForm.h"
#include "ui_dishesForm.h" #include "ui_dishesForm.h"
#include <QPushButton> #include <QPushButton>
#include "Control/flowControl.h" #include "Control/flowControl.h"
......
#ifndef DISHESFORM_H #ifndef DISHESFORM_H
#define DISHESFORM_H #define DISHESFORM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>dishesForm</class> <class>dishesForm</class>
<widget class="QDialog" name="dishesForm"> <widget class="QDialog" name="dishesForm">
......
#include "dishesItem.h" #include "dishesItem.h"
#include "ui_dishesItem.h" #include "ui_dishesItem.h"
#include <QDebug> #include <QDebug>
#include "Control/flowControl.h" #include "Control/flowControl.h"
......
#ifndef DISHESITEM_H #ifndef DISHESITEM_H
#define DISHESITEM_H #define DISHESITEM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>dishesItem</class> <class>dishesItem</class>
<widget class="QDialog" name="dishesItem"> <widget class="QDialog" name="dishesItem">
......
#ifndef FLOATFORM_H #ifndef FLOATFORM_H
#define FLOATFORM_H #define FLOATFORM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>FloatForm</class> <class>FloatForm</class>
<widget class="QDialog" name="FloatForm"> <widget class="QDialog" name="FloatForm">
......
...@@ -18,6 +18,9 @@ CONFIG +=c++11 ...@@ -18,6 +18,9 @@ CONFIG +=c++11
INCLUDEPATH += DTools INCLUDEPATH += DTools
LIBS += -luser32
LIBS += -lUserenv -ldbghelp
DEFINES += TEST TODO DEFINES += TEST TODO
SOURCES += main.cpp\ SOURCES += main.cpp\
...@@ -81,7 +84,8 @@ HEADERS += \ ...@@ -81,7 +84,8 @@ HEADERS += \
refuseForm.h \ refuseForm.h \
Model/dishesObject.h \ Model/dishesObject.h \
dailyreportForm.h \ dailyreportForm.h \
Model/dailyObject.h Model/dailyObject.h \
DTools/dump.h
FORMS += mainForm.ui \ FORMS += mainForm.ui \
alertForm.ui \ alertForm.ui \
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <windows.h> #include <windows.h>
#include <QProcess> #include <QProcess>
#include <QSqlDatabase> #include <QSqlDatabase>
#include "DTools/dump.h"
using namespace QsLogging; using namespace QsLogging;
...@@ -53,10 +54,12 @@ void LoadTheme(const QString& theme) ...@@ -53,10 +54,12 @@ void LoadTheme(const QString& theme)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#ifdef Q_OS_WIN
SetUnhandledExceptionFilter(FMExcpHandler);
#endif
HANDLE m_hMutex = CreateMutex(NULL, FALSE, L"Global\\fmTakeaway" ); HANDLE m_hMutex = CreateMutex(NULL, FALSE, L"Global\\fmTakeaway" );
if(NULL!=m_hMutex){ if(NULL!=m_hMutex){
if (GetLastError() == ERROR_ALREADY_EXISTS) { if (GetLastError() == ERROR_ALREADY_EXISTS||GetLastError() == ERROR_ACCESS_DENIED) {
CloseHandle(m_hMutex); CloseHandle(m_hMutex);
m_hMutex = NULL; m_hMutex = NULL;
return -1; return -1;
......
...@@ -126,14 +126,14 @@ void MainForm::_Init() ...@@ -126,14 +126,14 @@ void MainForm::_Init()
setWindowIcon(QIcon(":fm.ico")); setWindowIcon(QIcon(":fm.ico"));
// 初始化文字 // 初始化文字
ui->mainLabStoreid->setText(UI_STOREID); ui->mainLabStoreid->setText(QString::fromLocal8Bit(UI_STOREID));
ui->mainLabVersion->setText(APP_VERSION); ui->mainLabVersion->setText(APP_VERSION);
// 初始化表 // 初始化表
int scales6[] = {3, 4, 2, 3, 3, 3}; int scales6[] = {3, 4, 2, 3, 3, 3};
int scales5[] = {3, 6, 2, 3, 3}; int scales5[] = {3, 6, 2, 3, 3};
int tableWidth = this->width() - 75; int tableWidth = this->width() - 75;
qDebug() << "宽度" << this->width(); qDebug() << "width" << this->width();
foreach(QTableWidget *table, m_tableList) foreach(QTableWidget *table, m_tableList)
{ {
table->hide(); table->hide();
...@@ -172,7 +172,7 @@ void MainForm::onSetCurrentTime() ...@@ -172,7 +172,7 @@ void MainForm::onSetCurrentTime()
m_raiseIndex=0; m_raiseIndex=0;
raise(); raise();
} }
ui->mainSlabTime->setText(QDateTime::currentDateTime().toString("yyyy年MM月dd日 hh:mm:ss")); ui->mainSlabTime->setText(QDateTime::currentDateTime().toString(QString::fromLocal8Bit("yyyy年MM月dd日 hh:mm:ss")));
} }
void MainForm::onMainTabBtnClicked() void MainForm::onMainTabBtnClicked()
......
#ifndef MAINFORM_H #ifndef MAINFORM_H
#define MAINFORM_H #define MAINFORM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>MainForm</class> <class>MainForm</class>
<widget class="QWidget" name="MainForm"> <widget class="QWidget" name="MainForm">
......
#include "padForm.h" #include "padForm.h"
#include "ui_padForm.h" #include "ui_padForm.h"
PadForm::PadForm(QWidget *parent) : PadForm::PadForm(QWidget *parent) :
......
#ifndef PADFORM_H #ifndef PADFORM_H
#define PADFORM_H #define PADFORM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>PadForm</class> <class>PadForm</class>
<widget class="QDialog" name="PadForm"> <widget class="QDialog" name="PadForm">
......
#include "pickForm.h" #include "pickForm.h"
#include "ui_pickForm.h" #include "ui_pickForm.h"
#include "preDefine.h" #include "preDefine.h"
#include "Control/flowControl.h" #include "Control/flowControl.h"
......
#ifndef PICKFORM_H #ifndef PICKFORM_H
#define PICKFORM_H #define PICKFORM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>PickForm</class> <class>PickForm</class>
<widget class="QDialog" name="PickForm"> <widget class="QDialog" name="PickForm">
......
#include "refdishesForm.h" #include "refdishesForm.h"
#include "ui_refdishesForm.h" #include "ui_refdishesForm.h"
#include "Control/flowControl.h" #include "Control/flowControl.h"
......
#ifndef REFDISHESFORM_H #ifndef REFDISHESFORM_H
#define REFDISHESFORM_H #define REFDISHESFORM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>refDishesForm</class> <class>refDishesForm</class>
<widget class="QDialog" name="refDishesForm"> <widget class="QDialog" name="refDishesForm">
......
#include "refuseForm.h" #include "refuseForm.h"
#include "ui_refuseForm.h" #include "ui_refuseForm.h"
#include <QDebug> #include <QDebug>
...@@ -44,7 +44,7 @@ void RefuseForm::on_reason1_toggled(bool checked) ...@@ -44,7 +44,7 @@ void RefuseForm::on_reason1_toggled(bool checked)
if(checked) if(checked)
{ {
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr="餐厅已打烊"; m_reasonStr=QString::fromLocal8Bit("餐厅已打烊");
m_reasonCode=2; m_reasonCode=2;
} }
} }
...@@ -68,7 +68,7 @@ void RefuseForm::on_reason2_toggled(bool checked) ...@@ -68,7 +68,7 @@ void RefuseForm::on_reason2_toggled(bool checked)
if(checked) if(checked)
{ {
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr="菜品已售完"; m_reasonStr=QString::fromLocal8Bit("菜品已售完");
m_reasonCode=3; m_reasonCode=3;
} }
} }
...@@ -78,7 +78,7 @@ void RefuseForm::on_reason3_toggled(bool checked) ...@@ -78,7 +78,7 @@ void RefuseForm::on_reason3_toggled(bool checked)
if(checked) if(checked)
{ {
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr="餐厅太忙"; m_reasonStr=QString::fromLocal8Bit("餐厅太忙");
m_reasonCode=5; m_reasonCode=5;
} }
} }
...@@ -88,7 +88,7 @@ void RefuseForm::on_reason4_toggled(bool checked) ...@@ -88,7 +88,7 @@ void RefuseForm::on_reason4_toggled(bool checked)
if(checked) if(checked)
{ {
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr="联系不上客户"; m_reasonStr=QString::fromLocal8Bit("联系不上客户");
m_reasonCode=6; m_reasonCode=6;
} }
} }
...@@ -98,7 +98,7 @@ void RefuseForm::on_reason5_toggled(bool checked) ...@@ -98,7 +98,7 @@ void RefuseForm::on_reason5_toggled(bool checked)
if(checked) if(checked)
{ {
ui->refuseBtnOk->setEnabled(true); ui->refuseBtnOk->setEnabled(true);
m_reasonStr="无人配送"; m_reasonStr=QString::fromLocal8Bit("无人配送");
m_reasonCode=-1; m_reasonCode=-1;
} }
} }
......
#ifndef REFUSEFORM_H #ifndef REFUSEFORM_H
#define REFUSEFORM_H #define REFUSEFORM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>RefuseForm</class> <class>RefuseForm</class>
<widget class="QDialog" name="RefuseForm"> <widget class="QDialog" name="RefuseForm">
......
#ifndef SETTINGFORM_H #ifndef SETTINGFORM_H
#define SETTINGFORM_H #define SETTINGFORM_H
#include <QDialog> #include <QDialog>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>SettingForm</class> <class>SettingForm</class>
<widget class="QDialog" name="SettingForm"> <widget class="QDialog" name="SettingForm">
......
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