Commit a2341a01 by wuyang.zou

1、新增 Curbside 近距离点餐,为POS存储 Block Flag,实现阻塞打印杯贴、汇总单

2、为了提高插件处理效能,合并推拉两次请求为一次请求功能模式;

V2.2023.10.12
parent 3be388e4
Pipeline #43583 failed with stage
in 0 seconds
...@@ -201,6 +201,7 @@ bool SocketCommunicate::connectTcpSvr() ...@@ -201,6 +201,7 @@ bool SocketCommunicate::connectTcpSvr()
tmpMap.insert(JSON_TCP_DEVICE_TYPE , "posPlugin"); tmpMap.insert(JSON_TCP_DEVICE_TYPE , "posPlugin");
tmpMap.insert(JSON_TCP_DEVICE_VER , _posPluginVersion); tmpMap.insert(JSON_TCP_DEVICE_VER , _posPluginVersion);
tmpMap.insert(JSON_STOREID , _storeId); tmpMap.insert(JSON_STOREID , _storeId);
tmpMap.insert(JSON_LOGIN_WITH_CONTAINS_ORDER_DETAIL, true);
setPosMetaData(tmpMap); setPosMetaData(tmpMap);
} }
...@@ -796,7 +797,7 @@ void SocketCommunicate::threadStart() ...@@ -796,7 +797,7 @@ void SocketCommunicate::threadStart()
QLOG_INFO() << QString("threadStart() This Thread Had Been Set Need Quit Flag, Now Return. "); QLOG_INFO() << QString("threadStart() This Thread Had Been Set Need Quit Flag, Now Return. ");
return; return;
} }
QLOG_INFO() << QString("Waitting HttpLogin / openTcpChannel / GetSvrIpPort Failed, Wait 30 Seconds, _httpLoginResult:%1, _openTcpChannel:%2, _stopFlag:%3") QLOG_INFO() << QString("Waitting HttpLogin / openTcpChannel / GetSvrIpPort Failed, Wait 10 Seconds, _httpLoginResult:%1, _openTcpChannel:%2, _stopFlag:%3")
.arg( _httpLoginResult?1:0 ).arg(_openTcpChannel?1:0).arg(_stopFlag?1:0); .arg( _httpLoginResult?1:0 ).arg(_openTcpChannel?1:0).arg(_stopFlag?1:0);
Sleep( SOCKET_START_TIMEOUT_INTERVAL ); Sleep( SOCKET_START_TIMEOUT_INTERVAL );
FlowControl::GetInstance()._GetFcMajorInfo(_httpLoginResult, _openTcpChannel, _storeId, _localIp, _hostName,_workStationNum,_backupPos); FlowControl::GetInstance()._GetFcMajorInfo(_httpLoginResult, _openTcpChannel, _storeId, _localIp, _hostName,_workStationNum,_backupPos);
......
...@@ -198,6 +198,47 @@ class SocketCommuProcess { ...@@ -198,6 +198,47 @@ class SocketCommuProcess {
public: public:
friend class SocketCommunicate; friend class SocketCommunicate;
//获取 Login Mock请求数据
static bool getMockByteFormatLoginReq()
{
Data_Head head = {0};
//需要将 json 先进行自然序 进行排序, 加签, 然后在进行 新数据组装与拷贝;
QByteArray outData;
QJsonObject realReqJson;
realReqJson.insert("A",100);
realReqJson.insert("B",200);
realReqJson.insert("C",300);
QLOG_INFO() << "Get RSA Sign, Real Mock Request Msg : " << realReqJson;
QByteArray tmpInputData = QString(QJsonDocument( realReqJson ).toJson(QJsonDocument::Compact)).toUtf8();
quint32 lenMsg = tmpInputData.size();
quint32 memBuffLen = sizeof(Data_Head) + lenMsg + 1;
char *buf = (char *)calloc(1, memBuffLen);
int bl = strlen(buf);
int dhsize = sizeof(Data_Head);
if ( ! buf ) {
QLOG_ERROR() << "getMockByteFormatLoginReq:: calloc Memory Space Failed " << ( sizeof(Data_Head) + lenMsg + 1 );
return false;
}
DATAHEAD_INIT( head, DEFT_MAGIC , DEFT_VERSION, 0, CMD_AUTH_LOGIN_REQ, 1, lenMsg );
// Copy Data Head;
memset(buf, 0, memBuffLen );
*(buf+memBuffLen-1) = '\0';
bl = strlen(buf);
memcpy(buf, (void *)&head, sizeof(Data_Head));
bl = strlen(buf);
dhsize = sizeof(Data_Head);
QLOG_INFO() << "Get RSA Sign, Mock lenMsg : " << lenMsg << " memBuffLen: "<< memBuffLen;
QLOG_INFO() << "Get RSA Sign, Mock buf strlen : " << strlen(buf );
// Copy Data Body;
memcpy(buf + sizeof(Data_Head), tmpInputData.data(), lenMsg );
outData = QByteArray(buf, sizeof(Data_Head) + lenMsg );
QLOG_INFO() << "Get RSA Sign, outData: " << outData.toHex();
free(buf);
return true;
}
private: private:
static bool getRealLen(QByteArray array, quint32 &len) { static bool getRealLen(QByteArray array, quint32 &len) {
......
...@@ -86,6 +86,15 @@ private: ...@@ -86,6 +86,15 @@ private:
} DelayPullOrderInfo; } DelayPullOrderInfo;
typedef struct TOANALYSIS_ORDER
{
QString orderId;
QString callBackUrl;
QJsonObject orderDetailJson;
QJsonObject pushOptions;
} AnalysisOrderInfo;
typedef struct QUERY_ORDER_INPUT_POS_RECORD typedef struct QUERY_ORDER_INPUT_POS_RECORD
{ {
...@@ -161,11 +170,11 @@ private: ...@@ -161,11 +170,11 @@ private:
QTimer *m_heartTimer; QTimer *m_heartTimer;
QTimer *m_queryStoreStatusTimer; QTimer *m_queryStoreStatusTimer;
QTimer *m_pullTimer; QTimer *m_pullTimer;
QTimer *m_analysisTimer;
QTimer *m_reportOMSReocrdOrderTimer; QTimer *m_reportOMSReocrdOrderTimer;
QTimer *m_presistInputPosSuccessReocrdTimer; QTimer *m_presistInputPosSuccessReocrdTimer;
QTimer *m_loginTimer; QTimer *m_loginTimer;
QTimer *m_queryAllNoticeTimer; QTimer *m_queryAllNoticeTimer;
QTimer *m_notifySimPullTimer;
QTimer *m_storageOrderTimer; QTimer *m_storageOrderTimer;
QTimer *m_delayGetRefundDetailTimer; QTimer *m_delayGetRefundDetailTimer;
QTimer *m_remindCasherBlinkFloatTimer; //插件程序收到外卖订单后,需要一致提醒店员[直到此外卖订单被全部录入到POS系统] QTimer *m_remindCasherBlinkFloatTimer; //插件程序收到外卖订单后,需要一致提醒店员[直到此外卖订单被全部录入到POS系统]
...@@ -218,10 +227,14 @@ private: ...@@ -218,10 +227,14 @@ private:
//订单号与pos短号映射:[可能同时存在两种状态:1:新单记录;2:退单记录;但是小票号就存一个;] //订单号与pos短号映射:[可能同时存在两种状态:1:新单记录;2:退单记录;但是小票号就存一个;]
QMap<QString,QString> m_orderIdToPosCheckNoMap; QMap<QString,QString> m_orderIdToPosCheckNoMap;
//订单拉取记录 //订单拉取订单详情 / 订单列表 记录
QList<PullOrderInfo*> m_orderPullList; QList<PullOrderInfo*> m_orderPullList;
QMutex m_PullOrderDataMutex; QMutex m_PullOrderDataMutex;
//解析订单详情数据 / 记录
QList<AnalysisOrderInfo*> m_orderAnalysisList;
QMutex m_analysisOrderDataMutex;
//向OMS汇报订单的POS入机情况 队列; //向OMS汇报订单的POS入机情况 队列;
QList<RepOMSRecordOrderInfo*> m_orderRecordRepOMSList; QList<RepOMSRecordOrderInfo*> m_orderRecordRepOMSList;
QMutex m_RepOMSRecordOrderMutex; QMutex m_RepOMSRecordOrderMutex;
...@@ -399,6 +412,13 @@ private slots: ...@@ -399,6 +412,13 @@ private slots:
* */ * */
bool _PullOrderList( const int &pageSize, const int &pageNo, const QString &callBackUrl ); bool _PullOrderList( const int &pageSize, const int &pageNo, const QString &callBackUrl );
/* 功能:解析订单详情数据;
* 参数:NULL
* 返回:是否成功
* */
void _AnalysisOrderDetailData();
/* 功能:发送心跳 /* 功能:发送心跳
* 参数:NULL * 参数:NULL
* 返回:是否成功 * 返回:是否成功
...@@ -473,6 +493,9 @@ private slots: ...@@ -473,6 +493,9 @@ private slots:
bool _TryAddOrderPull ( const QString& orderId=0, const QString& channel=0, const QString& callBackUrl="", const bool& skipPrint=false, const QJsonObject& pushOption = QJsonObject(), bool _TryAddOrderPull ( const QString& orderId=0, const QString& channel=0, const QString& callBackUrl="", const bool& skipPrint=false, const QJsonObject& pushOption = QJsonObject(),
const int& pageNumber=1, const int& pageSize=30); const int& pageNumber=1, const int& pageSize=30);
// 支持上游推送订单消息时,包含订单详情数据模式, 这种情况就可以提高插件处理订单速度;
bool _TryAddOrderQueueAnalysis (const QString& orderId, const QJsonObject& orderDetailJson, const QString& callBackUrl, const QJsonObject& pushOptions);
//点击屏幕指定区域 //点击屏幕指定区域
void _ClickOMSAssignArea(); void _ClickOMSAssignArea();
...@@ -482,8 +505,6 @@ private slots: ...@@ -482,8 +505,6 @@ private slots:
void _QueryAllNoticeMsg(); void _QueryAllNoticeMsg();
void _ClickToNotifySimPullOrder();
void _BlockInputPosWarnning(); void _BlockInputPosWarnning();
// 功能:将队列 m_storagePosOrdersList 中的订单数据 持久化存储到POS本地数据库; // 功能:将队列 m_storagePosOrdersList 中的订单数据 持久化存储到POS本地数据库;
......
...@@ -14,8 +14,6 @@ PrintCupStickPosDB::PrintCupStickPosDB() ...@@ -14,8 +14,6 @@ PrintCupStickPosDB::PrintCupStickPosDB()
// 为了发出告警消息; 注册信号槽参数 // 为了发出告警消息; 注册信号槽参数
qRegisterMetaType<AlertForm::Type>("AlertForm::Type"); qRegisterMetaType<AlertForm::Type>("AlertForm::Type");
connect(this, &PrintCupStickPosDB::triggerFlowContrlAlert, &FlowControl::GetInstance(), &FlowControl::onTriggerFlowContrlAlert);
} }
bool PrintCupStickPosDB::initPrintCupStickPosDB(){ bool PrintCupStickPosDB::initPrintCupStickPosDB(){
......
...@@ -103,11 +103,11 @@ public: ...@@ -103,11 +103,11 @@ public:
/** /**
*功能: 根据订单对象 更新 pos数据库中汇总单中的手机号信息; *功能: 根据订单对象 更新 pos数据库中汇总单中的手机号信息, block打印街送小票 和 杯贴 信息;
*参数:[1]订单对象 *参数:[1]订单对象
*返回:0: 更新失败;1: 无需更新;2: 更新成功; *返回:0: 更新失败;1: 无需更新;2: 更新成功;
**/ **/
int updateOrderPhoneInfo(OrderObject* orderObj); int updateOrderPhoneAndBlockPrintFlagInfo(OrderObject* orderObj);
/** /**
*功能: 根据订单ID 更新 pos本地数据库中汇总单状态信息; *功能: 根据订单ID 更新 pos本地数据库中汇总单状态信息;
......
#include "jqdeclare.hpp"
#include "jqhttpserver.h"
/*
This file is part of JQLibrary
Copyright: Jason and others
Contact email: 188080501@qq.com
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef JQLIBRARY_INCLUDE_JQDECLARE_HPP_
#define JQLIBRARY_INCLUDE_JQDECLARE_HPP_
// Macro define
#define JQPROPERTYDECLARE( Type, name, setName, ... ) \
private: \
Type name##_ __VA_ARGS__; \
\
public: \
inline const Type &name() const { return name##_; } \
inline void setName( const Type &name ) { name##_ = name; } \
\
private:
#define JQPROPERTYDECLAREWITHSLOT( Type, name, setName, ... ) \
private: \
Type name##_ __VA_ARGS__; \
public Q_SLOTS: \
Type name() const { return name##_; } \
void setName( const Type &name ) { name##_ = name; } \
\
private:
#define JQPTRPROPERTYDECLARE( Type, name, setName, ... ) \
private: \
Type *name##_ __VA_ARGS__; \
\
public: \
inline const Type *name() const { return name##_; } \
inline void setName( const Type &name ) \
{ \
if ( name##_ ) \
{ \
delete name##_; \
} \
name##_ = new Type( name ); \
} \
\
private:
#define JQ_READ_AND_SET_PROPERTY( Type, name, setName ) \
public: \
inline const Type &name() const { return name##_; } \
inline void setName( const Type &name ) { name##_ = name; } \
\
private:
#define JQ_STATIC_READ_AND_SET_PROPERTY( Type, name, setName ) \
public: \
static inline const Type &name() { return name##_; } \
static inline void setName( const Type &name ) { name##_ = name; } \
\
private:
#define JQ_STATIC_SET_PROPERTY( Type, name, setName ) \
public: \
static inline void setName( const Type &name ) { name##_ = name; } \
\
private:
#define RUNONOUTRANGEHELPER2( x, y ) x##y
#define RUNONOUTRANGEHELPER( x, y ) RUNONOUTRANGEHELPER2( x, y )
#define RUNONOUTRANGE( ... ) \
auto RUNONOUTRANGEHELPER( runOnOutRangeCallback, __LINE__ ) = __VA_ARGS__; \
QSharedPointer< int > RUNONOUTRANGEHELPER( runOnOutRange, __LINE__ )( \
new int, \
[ RUNONOUTRANGEHELPER( runOnOutRangeCallback, __LINE__ ) ]( int *data ) { \
RUNONOUTRANGEHELPER( runOnOutRangeCallback, __LINE__ ) \
(); \
delete data; \
} ); \
if ( RUNONOUTRANGEHELPER( runOnOutRange, __LINE__ ).data() == nullptr ) \
{ \
exit( -1 ); \
}
#define RUNONOUTRANGETIMER( message ) \
const auto &&runOnOutRangeTimerTime = QDateTime::currentMSecsSinceEpoch(); \
RUNONOUTRANGE( [ = ]() { \
qDebug() << message << ( QDateTime::currentMSecsSinceEpoch() - runOnOutRangeTimerTime ); \
} )
#define JQCONST( property ) static_cast< const decltype( property ) >( property )
#define JQTICKCOUNTERMESSAGE( message ) \
{ \
static JQTickCounter tickCounter; \
tickCounter.tick(); \
qDebug() << message << tickCounter.tickPerSecond(); \
}
#define JQBUILDDATETIMESTRING \
( QDateTime( \
QLocale( QLocale::English ).toDate( QString( __DATE__ ).replace( " ", " 0" ), "MMM dd yyyy" ), \
QTime::fromString( __TIME__, "hh:mm:ss" ) ) \
.toString( "yyyy-MM-dd hh:mm:ss" ) \
.toLatin1() \
.data() )
#define JQONLYONCE \
if ( []() { \
static auto flag = true; \
if ( flag ) \
{ \
flag = false; \
return true; \
} \
return false; \
}() )
#define JQSKIPFIRST \
if ( []() { \
static auto flag = true; \
if ( flag ) \
{ \
flag = false; \
return false; \
} \
return true; \
}() )
#define JQINTERVAL( timeInterval ) \
if ( []() { \
static qint64 lastTime = 0; \
const auto && currentTime = QDateTime::currentMSecsSinceEpoch(); \
if ( qAbs( currentTime - lastTime ) > timeInterval ) \
{ \
lastTime = currentTime; \
return true; \
} \
return false; \
}() )
// Export
#ifdef JQLIBRARY_EXPORT_ENABLE
# ifdef JQLIBRARY_EXPORT_MODE
# define JQLIBRARY_EXPORT Q_DECL_EXPORT
# else
# define JQLIBRARY_EXPORT Q_DECL_IMPORT
# endif
#else
# define JQLIBRARY_EXPORT
#endif
#endif // JQLIBRARY_INCLUDE_JQDECLARE_HPP_
...@@ -21,7 +21,8 @@ void LoaclHttpServer::run() ...@@ -21,7 +21,8 @@ void LoaclHttpServer::run()
/***解析FM外卖插件HTTP服务与Http请求的会话连接是否断开: 会话连接未断开***/ /***解析FM外卖插件HTTP服务与Http请求的会话连接是否断开: 会话连接未断开***/
if(!session.isNull()) if(!session.isNull())
{ {
QString recvData = QString::fromUtf8(session->requestRawData()); // QString recvData = QString::fromUtf8(session->requestRawData());
QString recvData = QString::fromUtf8(session->requestBody());
QLOG_INFO() << QString::fromLocal8Bit("[<<<<---Receive Http Request recvData: %1--->>>>]").arg(recvData); QLOG_INFO() << QString::fromLocal8Bit("[<<<<---Receive Http Request recvData: %1--->>>>]").arg(recvData);
QJsonParseError jsonError; QJsonParseError jsonError;
QJsonObject recvObject; QJsonObject recvObject;
...@@ -32,6 +33,7 @@ void LoaclHttpServer::run() ...@@ -32,6 +33,7 @@ void LoaclHttpServer::run()
QJsonObject data; //回复的内容json QJsonObject data; //回复的内容json
int iscontinue =0; int iscontinue =0;
recvObject = QJsonDocument::fromJson(recvData.toUtf8(), &jsonError).object(); recvObject = QJsonDocument::fromJson(recvData.toUtf8(), &jsonError).object();
/***解析Http Request json格式: 解析失败***/ /***解析Http Request json格式: 解析失败***/
if(jsonError.error != QJsonParseError::NoError) if(jsonError.error != QJsonParseError::NoError)
{ {
......
...@@ -252,6 +252,14 @@ void OrderObject::FetchDataFromJson(const QJsonObject &json) ...@@ -252,6 +252,14 @@ void OrderObject::FetchDataFromJson(const QJsonObject &json)
if ( !keys.contains("totalPriceForPos") && keys.contains("totalPrice") ) if ( !keys.contains("totalPriceForPos") && keys.contains("totalPrice") )
setProperty("totalPriceForPos", json["totalPrice"].toVariant()); setProperty("totalPriceForPos", json["totalPrice"].toVariant());
// printTask 是否创建打印杯贴任务 0 创建 1 不创建
if ( keys.contains("printTask") )
setProperty("blockPrintCupTicketTask", json["printTask"].toVariant());
// remindTicketFlag 是否打印送餐小票 0 打印 1 不打印
if ( keys.contains("remindTicketFlag") )
setProperty("blockPrintRemindTicketTask", json["remindTicketFlag"].toVariant());
return; return;
} }
......
...@@ -115,10 +115,11 @@ class OrderObject : public QObject ...@@ -115,10 +115,11 @@ class OrderObject : public QObject
Q_PROPERTY (bool skipPrint READ getSkipPrint WRITE setSkipPrint) Q_PROPERTY (bool skipPrint READ getSkipPrint WRITE setSkipPrint)
Q_PROPERTY (QJsonObject pluginOptions READ getPluginOptions WRITE setPluginOptions) Q_PROPERTY (QJsonObject pluginOptions READ getPluginOptions WRITE setPluginOptions)
Q_PROPERTY (int totalPriceForPos READ getTotalPriceForPos WRITE setTotalPriceForPos ) Q_PROPERTY (int totalPriceForPos READ getTotalPriceForPos WRITE setTotalPriceForPos )
Q_PROPERTY (int blockPrintCupTicketTask READ getBlockPrintCupTicketTask WRITE setBlockPrintCupTicketTasks )
Q_PROPERTY (int blockPrintRemindTicketTask READ getBlockPrintRemindTicketTask WRITE setBlockPrintRemindTicketTask )
Q_PROPERTY (bool packageFeeAtProduct READ getPackageFeeAtProduct WRITE setPackageFeeAtProduct) Q_PROPERTY (bool packageFeeAtProduct READ getPackageFeeAtProduct WRITE setPackageFeeAtProduct)
public: public:
OrderObject(QObject *parent=0) OrderObject(QObject *parent=0)
:QObject(parent){} :QObject(parent){}
...@@ -274,6 +275,11 @@ public: ...@@ -274,6 +275,11 @@ public:
QJsonObject pluginOptions; // pluginOptions ==> o2o-fulfillment 触发重打指令; options{ ....... } QJsonObject pluginOptions; // pluginOptions ==> o2o-fulfillment 触发重打指令; options{ ....... }
QJsonObject printOpt; // pluginOptions -> printOpt ==> o2o-fulfillment 触发重打指令; options{ "printOpt":{} , ....... } QJsonObject printOpt; // pluginOptions -> printOpt ==> o2o-fulfillment 触发重打指令; options{ "printOpt":{} , ....... }
// block按时打印杯贴(汇总单立即出票) 0:不block 1:block [reserve26] 对应OMS接口:printTask 是否创建打印杯贴任务 0:创建 1:不创建
int blockPrintCupTicketTask = 0;
// block按时打印送餐提醒小票 0:不block; 1:block [reserve27] 对应OMS接口:remindTicketFlag 是否打印送餐小票 0 打印 1 不打印
int blockPrintRemindTicketTask = 0;
int forwardPosStatus; // 正向单入机状态: 0:未知 1: 成功 2:失败; int forwardPosStatus; // 正向单入机状态: 0:未知 1: 成功 2:失败;
int negativePosStatus; // 负向单同上; int negativePosStatus; // 负向单同上;
int deliveryStatus; int deliveryStatus;
...@@ -597,6 +603,12 @@ public: ...@@ -597,6 +603,12 @@ public:
inline int getTotalPriceForPos()const{return totalPriceForPos;} inline int getTotalPriceForPos()const{return totalPriceForPos;}
inline void setTotalPriceForPos(const int& v){totalPriceForPos = v;} inline void setTotalPriceForPos(const int& v){totalPriceForPos = v;}
inline int getBlockPrintCupTicketTask()const{return blockPrintCupTicketTask;}
inline void setBlockPrintCupTicketTasks(const int& v){blockPrintCupTicketTask = v;}
inline int getBlockPrintRemindTicketTask()const{return blockPrintRemindTicketTask;}
inline void setBlockPrintRemindTicketTask(const int& v){blockPrintRemindTicketTask = v;}
}; };
#endif // ORDEROBJECT_H #endif // ORDEROBJECT_H
...@@ -7,8 +7,8 @@ IDI_ICON ICON DISCARDABLE "logo.ico" ...@@ -7,8 +7,8 @@ IDI_ICON ICON DISCARDABLE "logo.ico"
#endif #endif
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***// //***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
FILEVERSION 2,2023,7,24 FILEVERSION 2,2023,10,12
PRODUCTVERSION 2,2023,7,24 PRODUCTVERSION 2,2023,10,12
//*************************************************************************// //*************************************************************************//
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
...@@ -31,8 +31,8 @@ VS_VERSION_INFO VERSIONINFO ...@@ -31,8 +31,8 @@ VS_VERSION_INFO VERSIONINFO
VALUE "OriginalFilename", "fmTakeout.exe" VALUE "OriginalFilename", "fmTakeout.exe"
VALUE "ProductName", "Delivery Order Plugin" VALUE "ProductName", "Delivery Order Plugin"
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***// //***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
VALUE "ProductVersion", "2.2023.7.24" VALUE "ProductVersion", "2.2023.10.12"
VALUE "FileVersion", "2.2023.7.24" VALUE "FileVersion", "2.2023.10.12"
//*************************************************************************// //*************************************************************************//
END END
END END
......
...@@ -17,25 +17,9 @@ ...@@ -17,25 +17,9 @@
using namespace QsLogging; using namespace QsLogging;
QString g_appDir; QString g_appDir;
QThread tcpThread; QThread tcpThread;
QThread workThread; QThread workThread;
/*
void InitLogger()
{
QString logDir = QString("%1/log").arg(g_appDir);
Logger& logger = Logger::instance();
logger.setLoggingLevel(TraceLevel);
QDir().mkdir(logDir);
QString logPath = QString("%1/%2").arg(logDir).arg("log");
DestinationPtr fileDst(DestinationFactory::MakeFileDestination(
logPath, EnableLogRotation, MaxSizeBytes(10*1024*1024), MaxOldLogCount(40)));
logger.addDestination(fileDst);
DestinationPtr consoleDst(DestinationFactory::MakeDebugOutputDestination());
logger.addDestination(consoleDst);
}
*/
void InitLogger(){ void InitLogger(){
QString logDir = QString("%1/log").arg(g_appDir); QString logDir = QString("%1/log").arg(g_appDir);
...@@ -69,6 +53,59 @@ void LoadTheme(const QString& theme) ...@@ -69,6 +53,59 @@ void LoadTheme(const QString& theme)
qssFile.close(); qssFile.close();
} }
// config.ini (子门店号配置) + userConfig.ini (悬浮框位置坐标)
void CopyOriginConfigResetSelf(const QString& g_appDir){
QString configFileFullName = "C:\\Freemud\\fmPlugin\\config.ini";
QString newConfigFileFullName = g_appDir + "//" + "config.ini";
QString newBakConfigFileFullName = g_appDir + "//" + "config.ini_bak";
QString userConfigFileFullName = "C:\\Freemud\\fmPlugin\\userConfig.ini";
QString newUserConfigFileFullName = g_appDir + "//" + "userConfig.ini";
QString newBakUserConfigFileFullName = g_appDir + "//" + "userConfig.ini_bak";
QFileInfo configFileInfo(configFileFullName);
if ( configFileInfo.isFile() )
{
QFile::rename(newConfigFileFullName ,newBakConfigFileFullName);
QFile::copy(configFileFullName, newConfigFileFullName);
QLOG_INFO() << QString(" Copy config.ini File:: %1 To %2 Success !!!").arg(configFileFullName).arg(newConfigFileFullName);
}
QFileInfo userConfigFileInfo(userConfigFileFullName);
if ( userConfigFileInfo.isFile() )
{
QFile::rename(newUserConfigFileFullName ,newBakUserConfigFileFullName);
QFile::copy(userConfigFileFullName, newUserConfigFileFullName);
QLOG_INFO() << QString(" Copy userConfig.ini File:: %1 To %2 Success !!!").arg(userConfigFileFullName).arg(newUserConfigFileFullName);
}
}
// One Pos 守护程序: 守护插件的路径的修改;【启动项路径有待测试】
void ModifyDaemonExeConfigPath(){
// 等待下一个版本测试,再进行修改 守护程序路径;
// C:\Freemud\daemonService\fmproxy_service.config
/*
[FMKeeper]
Heartbeat={"fm_cmd":4}
HeartbeatPeer=24409
ServiceName=PosPluginDaemon
HeartbeatTryCnt=5
CheckInterval=180
PersistLaunch=0
KillElapse=0
DefaultExe=C:\\freemud\\fmPlugin\\fmTakeout.exe //<<---------------------//
ServiceStartMode=2
ServiceStartDelayInterval=330
DaemonMultiProcessMode=1
MultiProcessPortExeMap=24409@C:\\freemud\\fmPlugin\\fmTakeout.exe;8080@C:\\Micros\\Simphony\\WebServer\\ServiceHost.exe //<<---------------------//
ExtraDaemonServiceNameList=SbuxCapsServices;
*/
QLOG_INFO() << QString(" Wait Next Version , Change fmproxy_service.config File'DefaultExe And MultiProcessPortExeMap !!!");
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
...@@ -97,9 +134,16 @@ int main(int argc, char *argv[]) ...@@ -97,9 +134,16 @@ int main(int argc, char *argv[])
LoadTheme(APP_THEME); LoadTheme(APP_THEME);
QLOG_INFO() << QString("[<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]"); QLOG_INFO() << QString("[<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]");
QLOG_INFO() << QString("[<<<<<<<<<<<<<<<<<<-- fmTakeaway Start Version:%1 -->>>>>>>>>>>>>>>>>>>>>>]").arg(APP_VERSION); QLOG_INFO() << QString("[<<<<<<<<<<<<<-- fmTakeout Start Version: %1 -->>>>>>>>>>>>>>]").arg(APP_VERSION);
QLOG_INFO() << QString("[<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]"); QLOG_INFO() << QString("[<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<---->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]");
// SocketCommuProcess::getMockByteFormatLoginReq();
// return a.exec();
// 兼容之前老版本(Qt5.5 & VS2010)的配置文件 与 守护程序的配置文件:
CopyOriginConfigResetSelf(g_appDir);
ModifyDaemonExeConfigPath();
// 将控制器移到工作线程 // 将控制器移到工作线程
FlowControl::GetInstance().moveToThread(&workThread); FlowControl::GetInstance().moveToThread(&workThread);
workThread.start(); workThread.start();
......
...@@ -49,7 +49,9 @@ ...@@ -49,7 +49,9 @@
//#define APP_VERSION "2.2023.2.23" //#define APP_VERSION "2.2023.2.23"
//#define APP_VERSION "2.2023.4.12" //#define APP_VERSION "2.2023.4.12"
//#define APP_VERSION "2.2023.6.29" //#define APP_VERSION "2.2023.6.29"
#define APP_VERSION "2.2023.7.24" //#define APP_VERSION "2.2023.7.24"
// Qt 5.9.1 & VS2015 [2023-09-13] 开始启用新的大版本;
#define APP_VERSION "2.2023.10.12"
//修正版本号时,切记修正 FmTakeout.rc 中的版本号 //修正版本号时,切记修正 FmTakeout.rc 中的版本号
#define SERVER_PASSWORD "posoperator@freemud.cn" #define SERVER_PASSWORD "posoperator@freemud.cn"
...@@ -132,6 +134,7 @@ ...@@ -132,6 +134,7 @@
#define JSON_ERRCODE "code" #define JSON_ERRCODE "code"
#define JSON_STATUS "status" #define JSON_STATUS "status"
#define JSON_ORDERSTATUS "orderStatus" #define JSON_ORDERSTATUS "orderStatus"
#define JSON_LOGIN_WITH_CONTAINS_ORDER_DETAIL "containsOrderDetail"
#define JSON_REFUNDFMID "refundFmId" #define JSON_REFUNDFMID "refundFmId"
#define JSON_GLOBALORDERTYPE "globalOrderType" #define JSON_GLOBALORDERTYPE "globalOrderType"
#define JSON_GLOBALSERVICETYPE "globalServiceType" #define JSON_GLOBALSERVICETYPE "globalServiceType"
...@@ -173,6 +176,7 @@ ...@@ -173,6 +176,7 @@
#define JSON_CALL_BACK_URL "callBackUrl" #define JSON_CALL_BACK_URL "callBackUrl"
#define JSON_SKIP_PRINT "skipPrint" #define JSON_SKIP_PRINT "skipPrint"
#define JSON_PUSH_OPTIONS "options" #define JSON_PUSH_OPTIONS "options"
#define JSON_PUSH_ORDER_DETAIL "orderDetail"
#define JSON_PUSH_PLUGIN_OPTIONS "pluginOptions" #define JSON_PUSH_PLUGIN_OPTIONS "pluginOptions"
#define JSON_PRINT_OPT "printOpt" #define JSON_PRINT_OPT "printOpt"
#define JSON_PRINT_OPT_ALL "all" #define JSON_PRINT_OPT_ALL "all"
...@@ -235,7 +239,7 @@ ...@@ -235,7 +239,7 @@
// 写报文超时时间(单位: 毫秒); // 写报文超时时间(单位: 毫秒);
#define SOCKET_WRITE_TIMEOUT_INTERVAL 15*1000 #define SOCKET_WRITE_TIMEOUT_INTERVAL 15*1000
// 启动超时时间(单位: 毫秒); // 启动超时时间(单位: 毫秒);
#define SOCKET_START_TIMEOUT_INTERVAL 1*30*1000 #define SOCKET_START_TIMEOUT_INTERVAL 1*10*1000
// 短超时时间(单位: 毫秒); // 短超时时间(单位: 毫秒);
#define SOCKET_SHORT_TIMEOUT_INTERVAL 2*30*1000 #define SOCKET_SHORT_TIMEOUT_INTERVAL 2*30*1000
// 长超时时间(单位: 毫秒); // 长超时时间(单位: 毫秒);
......
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