Commit c9662818 by 李定达

1.支持bpla标签打印指令集;2.门店号读取位置分离便于升级;3.调整版本

parent c8879c49
...@@ -50,13 +50,14 @@ void PrintLib::_PrintLab( OrderObject* order) ...@@ -50,13 +50,14 @@ void PrintLib::_PrintLab( OrderObject* order)
deliveryTime = QDateTime::fromTime_t(order->delivery_time).toString("hh:mm"); deliveryTime = QDateTime::fromTime_t(order->delivery_time).toString("hh:mm");
datetime = QDateTime::currentDateTime().toString("MM/dd"); datetime = QDateTime::currentDateTime().toString("MM/dd");
} }
int index; int index = 0;
foreach(ProductObject* dish,order->proList) foreach(ProductObject* dish,order->proList)
{ {
f_TSCInit(); f_TSCInit();
QString title = QString("%1 %2 %3 %4/%5").arg(QString::number(order->order_index), datetime, deliveryTime, QString::number(++index),QString::number(order->proList.size())); //qDebug() << "f_TSCInit";
QString title = QString("%1 %2 %3 %4/%5").arg(QString::number(order->order_index), datetime, deliveryTime, QString::number(++index), QString::number(order->proList.size()));
f_TSCWinPrintln(10,0,25,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),title.toLocal8Bit().data(),0); f_TSCWinPrintln(10,0,25,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),title.toLocal8Bit().data(),0);
f_TSCWinPrintln(0,0,22,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),"--------------------------------",0); f_TSCWinPrintln(0,0,22,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),"-----------------------------------",0.0266666);
f_TSCWinPrintln(10,0,30,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),dish->name. f_TSCWinPrintln(10,0,30,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),dish->name.
append(" ¥"). append(" ¥").
append(QString::number(dish->price/100.0, 'f', 2)).toLocal8Bit().data(),0.0666665); append(QString::number(dish->price/100.0, 'f', 2)).toLocal8Bit().data(),0.0666665);
...@@ -77,9 +78,12 @@ void PrintLib::_PrintLab( OrderObject* order) ...@@ -77,9 +78,12 @@ void PrintLib::_PrintLab( OrderObject* order)
property_tags.remove(property_tags.length()-1,1); property_tags.remove(property_tags.length()-1,1);
f_TSCWinPrintln(10,0,24,0,2,2,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),property_tags.toLocal8Bit().data(),0.0666665); f_TSCWinPrintln(10,0,24,0,2,2,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),property_tags.toLocal8Bit().data(),0.0666665);
f_TSCWinPrintln(10,180,26,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),order->store_name.toLocal8Bit().data(),0.0666665); f_TSCWinPrintln(10,180,26,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),order->store_name.toLocal8Bit().data(),0.0666665);
f_TSCWinPrintPage("1","1");
//qDebug() << "up f_TSCWinPrintPage";
f_TSCWinPrintPage("1","1");
//qDebug() << "down f_TSCWinPrintPage";
} }
} }
...@@ -380,5 +384,39 @@ QString PrintLib::_GetPrintIni() ...@@ -380,5 +384,39 @@ QString PrintLib::_GetPrintIni()
ini.append( config.value("Printer/crow","1").toString()); ini.append( config.value("Printer/crow","1").toString());
ini.append("|"); ini.append("|");
//ini.append( config.value("Printer/crow").toString());
// ini.append("1");
// ini.append("|");
//ini.append( config.value("Printer/label_type").toString());
// ini.append("1");
// ini.append("|");
//ini.append( config.value("Printer/clabel_parallrow").toString());
// ini.append("1");
// ini.append("|");
//ini.append( config.value("Printer/label_usb").toString());
// ini.append("1");
// ini.append("|");
//ini.append( config.value("Printer/label_ip").toString());
// ini.append("1");
// ini.append("|");
//ini.append( config.value("Printer/label_ip").toString());
// ini.append("4");
// ini.append("|");
// strcpy(data, ini.c_str());
//指令集选项
//标签打印机指令集0是TSC 适用佳博等;1PBAL 使用新北洋等;
ini.append(config.value("Printer/labeltype","0").toString());
ini.append("|");
ini.append(config.value("Printer/labelparall","LPT1").toString());
ini.append("|");
ini.append( config.value("Printer/labelusb","USB-0").toString());
ini.append("|");
ini.append( config.value("Printer/labelip","127.0.0.1").toString());
ini.append("|");
//标签打印机端口打开方式 3:Ip 4:驱动;
ini.append( config.value("Printer/labelprttype","4").toString());
ini.append("|");
return ini; return ini;
} }
...@@ -380,7 +380,7 @@ bool OrderGetWork::bingToServer(QString &error) ...@@ -380,7 +380,7 @@ bool OrderGetWork::bingToServer(QString &error)
#else #else
void OrderGetWork::SetStoreInfoToConfig() void OrderGetWork::SetStoreInfoToConfig()
{ {
QString configfile = qApp->applicationDirPath() + "/" + CONFIG_NAME; QString configfile = qApp->applicationDirPath() + "/" + STOREINFO_NAME;
QSettings(configfile, QSettings::IniFormat).setValue(INI_BASE_PARNETID, _storeinfo[JSON_KEY_PARTNERID]); QSettings(configfile, QSettings::IniFormat).setValue(INI_BASE_PARNETID, _storeinfo[JSON_KEY_PARTNERID]);
QSettings(configfile, QSettings::IniFormat).setValue(INI_BASE_STOREID, _storeinfo[JSON_STOREID]); QSettings(configfile, QSettings::IniFormat).setValue(INI_BASE_STOREID, _storeinfo[JSON_STOREID]);
......
...@@ -183,27 +183,47 @@ int main(int argc, char *argv[]) ...@@ -183,27 +183,47 @@ int main(int argc, char *argv[])
QObject::connect(&mainform, &MainForm::showFloatForm, &floatform, &FloatForm::onShow); QObject::connect(&mainform, &MainForm::showFloatForm, &floatform, &FloatForm::onShow);
QObject::connect(&mainform, &MainForm::startRemind, &floatform, &FloatForm::onStartRemind); QObject::connect(&mainform, &MainForm::startRemind, &floatform, &FloatForm::onStartRemind);
QObject::connect(&mainform, &MainForm::stopRemind, &floatform, &FloatForm::onStopRemind); QObject::connect(&mainform, &MainForm::stopRemind, &floatform, &FloatForm::onStopRemind);
//QObject::connect(&floatform, &FloatForm::showMainForm, &mainform, &MainForm::show);
QObject::connect(&loginform, &LoginForm::showmainform, &mainform, &MainForm::showFullScreen); QObject::connect(&loginform, &LoginForm::showmainform, &mainform, &MainForm::showFullScreen);
//QObject::connect(&loginform, &LoginForm::showmainform, &mainform, &MainForm::show);
QObject::connect(&loginform, &LoginForm::showfloat, &floatform, &FloatForm::onShow); QObject::connect(&loginform, &LoginForm::showfloat, &floatform, &FloatForm::onShow);
QObject::connect(&floatform, &FloatForm::showMainForm, &loginform, &LoginForm::showfull); QObject::connect(&floatform, &FloatForm::showMainForm, &loginform, &LoginForm::showfull);
QString configfile = qApp->applicationDirPath() + "/" + CONFIG_NAME; QString configfile = qApp->applicationDirPath() + "/" + CONFIG_NAME;
QString storefile = qApp->applicationDirPath() + "/" + STOREINFO_NAME;
QLOG_INFO() << "config file name : " << configfile; QLOG_INFO() << "config file name : " << configfile;
QLOG_INFO() << "store file name : " << storefile;
QString storeid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_STOREID).toString(); QString tmpstoreid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_STOREID).toString();
QString partnerid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_PARNETID).toString(); QString tmppartnerid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_PARNETID).toString();
QString userid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_USERID).toString(); QString tmpuserid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_USERID).toString();
QString pwd = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_PWD).toString(); QString tmppwd = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_PWD).toString();
QString stationid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_STATIONIID).toString(); QString tmpstationid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_STATIONIID).toString();
QString autoconf = QSettings(configfile, QSettings::IniFormat).value(INI_AUTOCONFIRM).toString();
QFile file(storefile);
if(!file.exists())
{
QLOG_INFO() << "Not found " << storefile;
file.open(QFile::ReadWrite);
file.close();
if(!tmpstoreid.isEmpty() && !tmppartnerid.isEmpty() && !tmpuserid.isEmpty() && !tmppwd.isEmpty() && !tmpstationid.isEmpty())
{
QSettings(storefile, QSettings::IniFormat).setValue(INI_BASE_PARNETID, tmppartnerid);
QSettings(storefile, QSettings::IniFormat).setValue(INI_BASE_STOREID, tmpstoreid);
QSettings(storefile, QSettings::IniFormat).setValue(INI_BASE_STATIONIID, tmpstationid);
QSettings(storefile, QSettings::IniFormat).setValue(INI_BASE_USERID, tmpuserid);
QSettings(storefile, QSettings::IniFormat).setValue(INI_BASE_PWD, tmppwd);
}
}
QString storeid = QSettings(storefile, QSettings::IniFormat).value(INI_BASE_STOREID).toString();
QString partnerid = QSettings(storefile, QSettings::IniFormat).value(INI_BASE_PARNETID).toString();
QString userid = QSettings(storefile, QSettings::IniFormat).value(INI_BASE_USERID).toString();
QString pwd = QSettings(storefile, QSettings::IniFormat).value(INI_BASE_PWD).toString();
QString stationid = QSettings(storefile, QSettings::IniFormat).value(INI_BASE_STATIONIID).toString();
QString autoconf = QSettings(configfile, QSettings::IniFormat).value(INI_AUTOCONFIRM).toString();
QString pushurl = QSettings(configfile, QSettings::IniFormat).value(INI_PUSHSERVER).toString(); QString pushurl = QSettings(configfile, QSettings::IniFormat).value(INI_PUSHSERVER).toString();
QString geturl = QSettings(configfile, QSettings::IniFormat).value(INI_GETSERVER).toString(); QString geturl = QSettings(configfile, QSettings::IniFormat).value(INI_GETSERVER).toString();
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#define SERVER_PASSWORD "posoperator@freemud.cn" #define SERVER_PASSWORD "posoperator@freemud.cn"
#define CONFIG_NAME "config.ini" #define CONFIG_NAME "config.ini"
#define STOREINFO_NAME "store.ini"
#define USERCONFIG_NAME "userConfig.ini" #define USERCONFIG_NAME "userConfig.ini"
#define UI_CASHIER "<font color='#ff0000'>未选择</font>" #define UI_CASHIER "<font color='#ff0000'>未选择</font>"
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#include <winver.h> #include <winver.h>
#endif #endif
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,0,1 FILEVERSION 2,0,0,2
PRODUCTVERSION 2,0,0,1 PRODUCTVERSION 2,0,0,2
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG FILEFLAGS VS_FF_DEBUG
...@@ -22,12 +22,12 @@ VS_VERSION_INFO VERSIONINFO ...@@ -22,12 +22,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN BEGIN
VALUE "CompanyName", "ShangHai Freemud Co., Ltd." VALUE "CompanyName", "ShangHai Freemud Co., Ltd."
VALUE "FileDescription", "FREEMUD Manager System" VALUE "FileDescription", "FREEMUD Manager System"
VALUE "FileVersion", "2.0.0.1" VALUE "FileVersion", "2.0.0.2"
VALUE "InternalName", "FREEMUD" VALUE "InternalName", "FREEMUD"
VALUE "LegalCopyright", "Copyright (C)2017-2020" VALUE "LegalCopyright", "Copyright (C)2017-2020"
VALUE "OriginalFilename", "fmTakeout.exe" VALUE "OriginalFilename", "fmTakeout.exe"
VALUE "ProductName", "fmTakeout" VALUE "ProductName", "fmTakeout"
VALUE "ProductVersion", "2.0.0.1" VALUE "ProductVersion", "2.0.0.2"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"
......
...@@ -79,7 +79,7 @@ LoginForm::~LoginForm() ...@@ -79,7 +79,7 @@ LoginForm::~LoginForm()
void LoginForm::SetStoreInfo() void LoginForm::SetStoreInfo()
{ {
QString configfile = qApp->applicationDirPath() + "/" + CONFIG_NAME; QString configfile = qApp->applicationDirPath() + "/" + STOREINFO_NAME;
QString storeid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_STOREID).toString(); QString storeid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_STOREID).toString();
QString partnerid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_PARNETID).toString(); QString partnerid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_PARNETID).toString();
......
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