Commit d0ebe816 by 刘帅

1. 优化流程

2. 整理文件和代码
parent e391071b
...@@ -2,4 +2,5 @@ ...@@ -2,4 +2,5 @@
/bin/* /bin/*
!/bin/*.dll !/bin/*.dll
!/bin/*.ini
...@@ -2,7 +2,7 @@ INCLUDEPATH += $$PWD ...@@ -2,7 +2,7 @@ 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
SOURCES += $$PWD/QsLogDest.cpp \ SOURCES += $$PWD/QsLogDest.cpp \
$$PWD/QsLog.cpp \ $$PWD/QsLog.cpp \
$$PWD/QsLogDestConsole.cpp \ $$PWD/QsLogDestConsole.cpp \
......
[store]
partner_id=1371
store_id=fm99999
pos_id=1
operator_id=001
business_date=20171016
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <QJsonArray> #include <QJsonArray>
#include <QJsonDocument> #include <QJsonDocument>
#include <QDebug> #include <QDebug>
#include "QsLog/QsLog.h"
Convert::Convert() Convert::Convert()
{ {
...@@ -70,7 +71,7 @@ bool Convert::QueryPay(QJsonObject &object, STORE_INFO store_info) ...@@ -70,7 +71,7 @@ bool Convert::QueryPay(QJsonObject &object, STORE_INFO store_info)
} }
else else
{ {
qDebug()<<"can not find trans_id in json request!"; QLOG_ERROR()<<"can not find trans_id in json request!";
return false; return false;
} }
if(object.contains("fm_order_id")) if(object.contains("fm_order_id"))
......
...@@ -30,8 +30,8 @@ static void InitLogger() ...@@ -30,8 +30,8 @@ static void InitLogger()
QsLogging::MaxOldLogCount(logCount))); QsLogging::MaxOldLogCount(logCount)));
logger.addDestination(fileDestination); logger.addDestination(fileDestination);
/* 输出到控制台 */ /* 输出到控制台 */
// QsLogging::DestinationPtr consleDest(QsLogging::DestinationFactory::MakeDebugOutputDestination()); QsLogging::DestinationPtr consleDest(QsLogging::DestinationFactory::MakeDebugOutputDestination());
// logger.addDestination(consleDest); logger.addDestination(consleDest);
} }
#endif // LOG #endif // LOG
......
...@@ -9,7 +9,7 @@ int main(int argc, char *argv[]) ...@@ -9,7 +9,7 @@ int main(int argc, char *argv[])
{ {
QCoreApplication a(argc, argv); QCoreApplication a(argc, argv);
InitLogger(); InitLogger();
QLOG_INFO()<<"start"; QLOG_INFO()<<"start client...";
QFmClient client; QFmClient client;
client.start(); client.start();
return a.exec(); return a.exec();
......
...@@ -54,7 +54,8 @@ private: ...@@ -54,7 +54,8 @@ private:
int CheckReqFromPos(char *pJsonData, int dLength, int chkValue); int CheckReqFromPos(char *pJsonData, int dLength, int chkValue);
int SendSocketData(int sock, char *buf, int length, int flag); int SendSocketData(int sock, char *buf, int length, int flag);
char *EncodeSendData(char *buf, int length, int *eLength); char *EncodeSendData(char *buf, int length, int *eLength);
int SendData2ZhProxyAndWaitRspData(); int SendData2ZhProxy();
int ProcessZhProxyRspData(int nType);
int RecvAndCheckDataFromSock(int sock, int flag, int type); int RecvAndCheckDataFromSock(int sock, int flag, int type);
int ProcessZhProxyRspDataAndSend2Pos(int nType); int ProcessZhProxyRspDataAndSend2Pos(int nType);
int CheckRecvedData(); int CheckRecvedData();
......
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