Commit 348339ac by ss.dai

将合作商户ID由配置文件改到写死在程序里

parent 398024b8
......@@ -2,4 +2,4 @@
version 1.0.2
Fixes:
1:未杀完进程就替换文件导致升级失败的问题
1:未杀完进程就替换文件导致升级失败的问题
\ No newline at end of file
......@@ -239,9 +239,7 @@ void FmControl::onCheckUpdate()
_CheckFilesDiff(sFilesMap, dFilesMap);
if(dFilesMap.count() == 0)
{
reportError = QString("no diff file");
QLOG_ERROR() << reportError;
result = false;
goto end;
}
......
......@@ -8,6 +8,9 @@ QT -= gui
CONFIG += c++11
DEFINES += QUAZIP_STATIC
DEFINES += SHAN_LIN
#DEFINES += XIAN_FENG
#DEFINES += TODAY
TARGET = fmscupd
CONFIG += windows
......
......@@ -14,6 +14,26 @@ FmTools::FmTools()
{
QString iniPath = QString("%1/%2").arg(QCoreApplication::applicationDirPath(), INIFILE_NAME);
m_config = new QSettings(iniPath, QSettings::IniFormat);
#ifdef SHAN_LIN
m_partnerId = "1234";
m_siIniPath = "D:/hspos/PosCfg.ini";
m_keyStoreId = "POS/ORGCODE";
m_keyPosId = "POS/POSNO";
#endif
#ifdef XIAN_FENG
m_partnerId = "1418";
m_siIniPath = QString("%1/storeinfo.ini").arg(QCoreApplication::applicationDirPath());
m_keyStoreId = "info/store_id";
m_keyPosId = "info/pos_no";
#endif
#ifdef TODAY
m_partnerId = "1377";
m_siIniPath = QString("%1/todaypos.ini").arg(QCoreApplication::applicationDirPath());
m_keyStoreId = "store_id";
m_keyPosId = "pos_no";
#endif
}
FmTools::~FmTools()
......@@ -62,12 +82,11 @@ QString FmTools::GetReportUrl()
QByteArray FmTools::GetUpdateData()
{
QString iniPath = QString("%1/todaypos.ini").arg(QCoreApplication::applicationDirPath());
QSettings setting(iniPath, QSettings::IniFormat);
QSettings setting(m_siIniPath, QSettings::IniFormat);
QJsonObject rObj;
rObj.insert(JSON_PARTNERID, GetPartnerId());
rObj.insert(JSON_STOREID, setting.value("store_id").toString());
rObj.insert(JSON_POSNO, setting.value("pos_no").toString());
rObj.insert(JSON_PARTNERID, m_partnerId);
rObj.insert(JSON_STOREID, setting.value(m_keyStoreId).toString());
rObj.insert(JSON_POSNO, setting.value(m_keyPosId).toString());
rObj.insert(JSON_VERSION, GetVersion());
return QJsonDocument(rObj).toJson(QJsonDocument::Compact);
}
......@@ -91,12 +110,12 @@ QByteArray FmTools::GetReportData(QString planid, QString msg, QString updateSta
file1.close();
}
}
QString iniPath = QString("%1/todaypos.ini").arg(QCoreApplication::applicationDirPath());
QSettings setting(iniPath, QSettings::IniFormat);
QSettings setting(m_siIniPath, QSettings::IniFormat);
QJsonObject rObj;
rObj.insert(JSON_PARTNERID, GetPartnerId());
rObj.insert(JSON_STOREID, setting.value("store_id").toString());
rObj.insert(JSON_POSNO, setting.value("pos_no").toString());
rObj.insert(JSON_PARTNERID, m_partnerId);
rObj.insert(JSON_STOREID, setting.value(m_keyStoreId).toString());
rObj.insert(JSON_POSNO, setting.value(m_keyPosId).toString());
rObj.insert(JSON_PLANID, planid);
rObj.insert(JSON_UPDATESTATE, updateState);
rObj.insert(JSON_MSG, msg);
......
......@@ -65,6 +65,11 @@ private:
private:
QSettings *m_config;
QString m_partnerId; // 商户编号
QString m_siIniPath; // 门店信息配置文件路径
QString m_keyStoreId; // 门店编号key
QString m_keyPosId; // POS编号key
};
#endif // FMTOOLS_H
......@@ -10,7 +10,7 @@ report=http://115.159.33.143/api/fork/PosPlanState
;版本信息
version=1.0.1
;合作商户ID
partnerId=1224
partnerId=
;下载文件超时时间(秒)
timeout0=300
;请求数据超时时间(秒)
......
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