Commit 5dea90d5 by 李定达

Merge branch 'release/SaaS-O2O'

parents 94ff05f2 fe831517
<RCC>
<qresource>
<file>deaufult.qss</file>
<file>tabBtn_normal.png</file>
<file>tabBtn_checked.png</file>
<file>magn.png</file>
<file>pickBtn_select.png</file>
<file>error.png</file>
<file>ok.png</file>
<file>loading.gif</file>
<file>alert_bg.png</file>
<file>btnUp_normal.png</file>
<file>btnUp_press.png</file>
<file>btnDown_normal.png</file>
<file>btnDown_press.png</file>
<file>cbxArrow.png</file>
<file>logo_0.png</file>
<file>float_normal.png</file>
<file>float_remind.png</file>
<file>detailBtn_close_normal.png</file>
<file>detailBtn_close_press.png</file>
<file>fm.ico</file>
<file>delBtn_normal.png</file>
<file>delBtn_press.png</file>
<file>numBtn_normal.png</file>
<file>numBtn_press.png</file>
<file>login_logo.png</file>
<file>base_logo.png</file>
<file>loginlogin.png</file>
</qresource>
</RCC>
\ No newline at end of file
rcc -binary deaufult.qrc -o deaufult.rcc
\ No newline at end of file
......@@ -68,7 +68,7 @@ QString GetOperNameByStatus(int status, bool bRefuse)
}
return QString::fromLocal8Bit(OPERATIONNAME_GETDELIVERS);
break;
case 2:
case 2:
if(bRefuse)
{
return QString::fromLocal8Bit(OPERATIONNAME_REFUNDORDER);
......
......@@ -47,7 +47,7 @@ bool FMDataBase::creat(QString sql, QString tablename)
bool flag = query.exec(sql);
if(!flag)
QLOG_INFO() << query.lastError();
QLOG_ERROR() << query.lastError();
return flag;
}
......@@ -64,7 +64,7 @@ bool FMDataBase::dlt(QString table, QString condition)
bool flag = query.exec(sql);
if(!flag)
QLOG_INFO() << query.lastError();
QLOG_ERROR() << query.lastError();
return flag;
}
......@@ -88,12 +88,12 @@ bool FMDataBase::insert(QString table, QVariantHash data)
sql = QString("insert into %1 (").arg(table) + columnnamelist.join(", ") + ") values (" + columnvaluelist.join(", ") + ")";
QLOG_INFO() << "inset sql : " << sql;
QLOG_DEBUG() << "inset sql : " << sql;
bool flag = query.exec(sql);
if(!flag)
QLOG_INFO() << query.lastError();
QLOG_ERROR() << query.lastError();
return flag;
}
......@@ -115,12 +115,12 @@ bool FMDataBase::update(QString table, QVariantHash data, QString condition)
sql = QString("update %1 set ").arg(table) + sql + " where " + condition;
QLOG_INFO() << "update sql : " << sql;
QLOG_DEBUG() << "update sql : " << sql;
bool flag = query.exec(sql);
if(!flag)
QLOG_INFO() << query.lastError();
QLOG_ERROR() << query.lastError();
return flag;
}
......@@ -143,12 +143,12 @@ bool FMDataBase::find(QString table, QSqlQuery &query, QStringList keylist, QStr
sql += QString(" from %1 where ").arg(table) + condition;
QLOG_INFO() << "find sql : " << sql;
QLOG_DEBUG() << "find sql : " << sql;
bool flag = tmpquery.exec(sql);
if(!flag)
QLOG_INFO() << tmpquery.lastError();
QLOG_ERROR() << tmpquery.lastError();
query = tmpquery;
......
......@@ -76,7 +76,7 @@ PrintDocument PrintDocument::ParseToDocument(const QString &content, bool &resul
{
result = false;
error = "lock of '<' or '>'";
qDebug()<<index<<"----------------------------------------";
//qDebug()<<index<<"----------------------------------------";
return PrintDocument();
}
}
......
......@@ -100,18 +100,25 @@ void PrintLib::_PrintLab( OrderObject* order)
QString title = QString(" %2 %4/%5").arg(datetime, QString::number(++index), QString::number(allprod));
QString tmptitle;
if(order->order_type == 3 || order->order_type == 4 || order->order_type == 5)
{
tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE8\x87\xAA\xE6\x8F\x90").append(order->code).append(" ").append(title);
}
else if(order->order_type == 6)
if(QString("saas").compare(order->channel) == 0)
{
tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE9\xA2\x84\xE7\xBA\xA6").append(order->code).append(" ").append(title);
if(order->order_type == 3 || order->order_type == 4 || order->order_type == 5)
{
tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE8\x87\xAA\xE6\x8F\x90").append(order->code).append(" ").append(title);
}
else if(order->order_type == 6)
{
tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE9\xA2\x84\xE7\xBA\xA6").append(order->code).append(" ").append(title);
}
else
{
tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE5\xA4\x96\xE5\x8D\x96").append(QString::number(order->order_index)).append(" ").append(title);
}
}
else
{
tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE5\xA4\x96\xE5\x8D\x96").append(QString::number(order->order_index)).append(" ").append(title);
QString tmpstr = order->channel_name;
tmptitle = tmpstr.append(QString::number(order->order_index)).append(" ").append(title);;
}
QString prodname = dish->name;
......
......@@ -9,6 +9,7 @@
#include <QVariantMap>
#include <QJsonDocument>
#include <QApplication>
#include <QSettings>
#include "base/Network/billSocket.h"
......@@ -73,6 +74,9 @@ signals:
void quit();
private:
//设置门店信息
void setLocalStoreInfo(const QJsonObject &recvjson);
void optOrder(const QJsonArray &orders);
bool PullOrder(unsigned int timeout, QString &error);
......@@ -200,7 +204,10 @@ private:
data.insert(JSON_KEY_PARTNERID, token);
data.insert(JSON_KEY_TIMESTAMP, timestamp);
//data.insert(JSON_KEY_TIMESTAMP, 0);
data.insert(JSON_KEY_AUTOCONFIRM, autoconfirm);
QString configfile = qApp->applicationDirPath() + "/" + CONFIG_NAME;
QString autoconf = QSettings(configfile, QSettings::IniFormat).value(INI_AUTOCONFIRM, "0").toString();
data.insert(JSON_KEY_AUTOCONFIRM, autoconf);
data.insert(JSON_KEY_STOREUNIFYID, json[JSON_KEY_STOREUNIFYID].toString());
return true;
}
......@@ -220,7 +227,7 @@ private:
return true;
}
static void getOptRequest(const QVariantMap &map, QJsonObject &json)
static void getOptRequest(const QVariantMap &storeinfo, const QVariantMap &map, QJsonObject &json)
{
json = QJsonObject::fromVariantMap(map);
if(map.contains(EVENT_KEY_STATUS))
......@@ -230,6 +237,18 @@ private:
json.remove(EVENT_KEY_MSG);
json.insert(JSON_KEY_REASON, map[EVENT_KEY_MSG].toString());
}
if(storeinfo.contains(JSON_KEY_STOREUNIFYID))
{
json.insert(JSON_KEY_STOREUNIFYID, storeinfo[JSON_KEY_STOREUNIFYID].toString());
}
if(storeinfo.contains(JSON_KEY_PARTNERID))
{
json.insert(JSON_KEY_PARTNERID, storeinfo[JSON_KEY_UNIFYID].toString());
}
if(storeinfo.contains(JSON_STOREID))
{
json.insert(JSON_STOREID, storeinfo[JSON_STOREID].toString());
}
}
static void getComplateJson(QString action, QString access_token, QString ver, const QJsonObject &json, QJsonObject &complatejson)
......@@ -261,17 +280,11 @@ private:
reqtype = FMH_CONFIRM;
if(status.compare(OPERATION_MAKEOVER, Qt::CaseInsensitive) == 0)
reqtype = FMH_MAKEOVER;
//非外卖订单的完成操作使用送出接口
if((order_type == 3 || order_type == 4 ||
order_type == 5 || order_type == 6) && reqtype == FMH_COMPLETE)
{
reqtype = FMH_SENDOUT;
}
}
static bool getAction(int REQ, QString &action)
{
#ifndef USE_QAACTION
switch (REQ)
{
case FMH_BIND:
......@@ -310,38 +323,48 @@ private:
default:
return false;
}
#else
switch (REQ)
{
case FMH_BIND:
action = QString("qasaas.posdevice.bind");
return true;
case FMH_LOGIN:
action = QString("qasaas.posdevice.login");
return true;
case FMH_GETORDER:
action = QString("qasaas.order.get");
return true;
case FMH_MAKEOVER:
action = QString("qasaas.order.doneNotify");
return true;
case FMH_CONFIRM:
action = QString("qasaas.order.confirmTake");
return true;
case FMH_REFUSE:
action = QString("qasaas.order.rejectTake");
return true;
case FMH_SENDOUT:
action = QString("qasaas.dispatch.create");
return true;
case FMH_COMPLETE:
action = QString("qasaas.dispatch.finish");
return true;
case FMH_REFUSEREFUND:
action = QString("qasaas.refund.reject");
return true;
case FMH_REFUNDORDER:
action = QString("qasaas.refund.agree");
return true;
case FMH_GETRORDER:
action = QString("qasaas.order.get");
return true;
default:
return false;
}
#endif
}
#ifdef FM_TEST
static bool requestGetRSASign(int reqtype, const QJsonObject &json, QString &sign, QString &action, QString &access_token, QString &ver)
{
QJsonObject tmpjson;
if(!OrderGetDataProcess::getAction(reqtype, action) ||
!OrderGetDataProcess::getAccess_Token(access_token) ||
!OrderGetDataProcess::getVer(ver))
return false;
OrderGetDataProcess::getComplateJson(action, access_token, ver, json, tmpjson);
sign = "abcdefghijklmnopqrstuvwxyz";
return true;
}
static bool getAccess_Token(QString &access_token)
{
access_token = "888888888888888888";
return true;
}
static bool getVer(QString &ver)
{
ver = "1";
return true;
}
#else
static bool requestGetRSASign(int reqtype, const QJsonObject &json, QString &sign, QString &action, QString &access_token, QString &ver)
{
QJsonObject tmpjson;
......@@ -366,7 +389,7 @@ private:
ver = "1";
return true;
}
#endif
static bool getRealUrl(int reqtype, const QJsonObject &json, const QString &url, QString &realurl)
{
......
......@@ -77,7 +77,7 @@ void OrderLocalizeWork::deleteOrder(QString orderid)
else
{
bool flag = db.dlt(DEFAULT_DBFORM, QString(DB_KEY_ORDERID).append("='%1'").arg(orderid));
QLOG_INFO() << "delete order : " << orderid << "(" << flag << ")";
QLOG_DEBUG() << "delete order : " << orderid << "(" << flag << ")";
}
}
......@@ -103,16 +103,16 @@ void OrderLocalizeWork::otpOrder(QString orderid)
if(!query.next())
{
QLOG_INFO() << "insert new order" << hash;
QLOG_DEBUG() << "insert new order" << hash;
bool flag = db.insert(DEFAULT_DBFORM, hash);
QLOG_WARN() << "insert new order : " << orderid << "(" << flag << ")";
QLOG_DEBUG() << "insert new order : " << orderid << "(" << flag << ")";
}
else
{
//订单最后改变时间要同步到db
QLOG_INFO() << "update order" << hash;
QLOG_DEBUG() << "update order" << hash;
bool flag = db.update(DEFAULT_DBFORM, hash, QString(DB_KEY_ORDERID).append("='%1'").arg(orderid));
QLOG_WARN() << "update order : " << orderid << "(" << flag << ")";
QLOG_DEBUG() << "update order : " << orderid << "(" << flag << ")";
}
}
......@@ -35,10 +35,10 @@ bool orderprintwork::event(QEvent *e)
map[EVENT_KEY_MSG].toInt() == DEFAULT_LOCATION_PRINT)
{
QVariantMap smap;
smap.insert(EVENT_KEY_ORDERSTATUS, 0);
smap.insert(EVENT_KEY_MSG, QString::fromLocal8Bit("打印中..."));
POSTEVENTTYPE(PosEvent::s_opt_status,smap,QVariantMap);
// QVariantMap smap;
// smap.insert(EVENT_KEY_ORDERSTATUS, 0);
// smap.insert(EVENT_KEY_MSG, QString::fromLocal8Bit("打印中..."));
// POSTEVENTTYPE(PosEvent::s_opt_status,smap,QVariantMap);
OrderObject order;
......@@ -56,28 +56,49 @@ bool orderprintwork::event(QEvent *e)
int prtwi = QSettings(prtinifile, QSettings::IniFormat).value("Printer/PaperWidth", 0).toInt();
if(order.order_type == 1 || order.order_type == 2)
if(QString("saas").compare(order.channel, Qt::CaseInsensitive) == 0)
{
if(prtwi <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTTAKE_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTTAKE80_TEMPLET);
}
else if(order.order_type == 6)
{
if(prtwi <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTYY_TEMPLET);
if(order.order_type == 1 || order.order_type == 2)
{
if(prtwi <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTTAKE_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTTAKE80_TEMPLET);
}
else if(order.order_type == 6)
{
if(prtwi <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTYY_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTYY80_TEMPLET);
}
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTYY80_TEMPLET);
{
if(prtwi <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINT_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINT80_TEMPLET);
}
}
else
{
if(prtwi <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINT_TEMPLET);
if(order.order_type == 1 || order.order_type == 2)
{
if(prtwi <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTO2O_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTO2O80_TEMPLET);
}
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINT80_TEMPLET);
{
if(prtwi <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTO2OZZ_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTO2OZZ80_TEMPLET);
}
}
qDebug() << "+++++++++++++++++++++++++++" << file.fileName();
if(!file.open(QFile::ReadOnly))
......@@ -163,27 +184,46 @@ bool orderprintwork::event(QEvent *e)
QFile file;
int othprtw = QSettings(prtinifile, QSettings::IniFormat).value("OtherPrinter/PaperWidth", 0).toInt();
if(order.order_type == 1 || order.order_type == 2)
if(QString("saas").compare(order.channel, Qt::CaseInsensitive) == 0)
{
if(othprtw <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTTAKE_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTTAKE80_TEMPLET);
}
else if(order.order_type == 6)
{
if(othprtw <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTYY_TEMPLET);
if(order.order_type == 1 || order.order_type == 2)
{
if(othprtw <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTTAKE_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTTAKE80_TEMPLET);
}
else if(order.order_type == 6)
{
if(othprtw <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTYY_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTYY80_TEMPLET);
}
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTYY80_TEMPLET);
{
if(othprtw <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINT_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINT80_TEMPLET);
}
}
else
{
if(othprtw <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINT_TEMPLET);
if(order.order_type == 1 || order.order_type == 2)
{
if(prtwi <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTO2O_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTO2O80_TEMPLET);
}
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINT80_TEMPLET);
{
if(prtwi <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTO2OZZ_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTO2OZZ80_TEMPLET);
}
}
qDebug() << "+++++++++++++++++++++++++++" << file.fileName();
......
......@@ -129,7 +129,7 @@ bool OrderPushWork::connectTcpServer()
_socket->addCaCertificates(qApp->applicationDirPath() + "/" + "microwstest.sandload.cn.pem");
QLOG_INFO() << _socket->errorString();
QLOG_WARN() << _socket->errorString();
_socket->ignoreSslErrors();
......@@ -138,7 +138,7 @@ bool OrderPushWork::connectTcpServer()
_socket->setSslConfiguration(config);
QLOG_INFO() << _socket->errorString();
QLOG_WARN() << _socket->errorString();
_istimeout = true;
......@@ -158,7 +158,7 @@ bool OrderPushWork::connectTcpServer()
loop.exec();
}
QLOG_INFO() << _socket->errorString() << _istimeout;
QLOG_WARN() << _socket->errorString() << _istimeout;
return !_istimeout;
}
......@@ -225,7 +225,7 @@ bool OrderPushWork::loginTcpServer()
QByteArray head = _socket->read(sizeof(Data_Head));
QLOG_INFO() << head.toHex();
QLOG_DEBUG() << head.toHex();
quint32 len = 0;
int cmd = -1;
......@@ -291,9 +291,9 @@ void OrderPushWork::heartBeatTcpService()
continue;
}
QLOG_INFO() << "tmplenandsynSeq : " << tmplenandsynSeq;
QLOG_DEBUG() << "tmplenandsynSeq : " << tmplenandsynSeq;
QLOG_INFO() << "cmd : " << cmd;
QLOG_DEBUG() << "cmd : " << cmd;
if(cmd == COMMAND_HEARDBEAT)
{
......@@ -386,7 +386,6 @@ bool OrderPushWork::checkMsgData(const QByteArray &msgdata)
//接口未能完善
//推送新订单事件
DEFAULTPOSTEVENT(PosEvent::s_need_get_order, QString::fromUtf8(msgdata));
return false;
}
......
......@@ -16,10 +16,14 @@ QEvent::Type PosEvent::s_inset_orderpool = static_cast<QEvent::Type>(QEvent::reg
QEvent::Type PosEvent::s_change_orderpool = static_cast<QEvent::Type>(QEvent::registerEventType());
QEvent::Type PosEvent::s_location_orderpool = static_cast<QEvent::Type>(QEvent::registerEventType());
QEvent::Type PosEvent::s_login_storeinfo = static_cast<QEvent::Type>(QEvent::registerEventType());
QEvent::Type PosEvent::s_show_float = static_cast<QEvent::Type>(QEvent::registerEventType());
QEvent::Type PosEvent::s_show_mainform = static_cast<QEvent::Type>(QEvent::registerEventType());
QEvent::Type PosEvent::s_show_prtform = static_cast<QEvent::Type>(QEvent::registerEventType());
QEvent::Type PosEvent::s_show_login = static_cast<QEvent::Type>(QEvent::registerEventType());
PosEvent::PosEvent(Type e):QEvent(e)
{
qDebug() << "------event : " << this;
//qDebug() << "------event : " << this;
_info = NULL;
_info_call_bk = NULL;
......@@ -28,13 +32,13 @@ PosEvent::PosEvent(Type e):QEvent(e)
PosEvent::~PosEvent()
{
if(_info != NULL && _info_call_bk != NULL)
_info_call_bk(_info);
if(_info != NULL && _info_call_bk != NULL)
_info_call_bk(_info);
_info = NULL;
_info_call_bk = NULL;
_info = NULL;
_info_call_bk = NULL;
qDebug() << "PosEvent Over" << this;
//qDebug() << "PosEvent Over" << this;
}
void *PosEvent::info() const
......@@ -65,7 +69,7 @@ PosEvent &PosEvent::operator =(PosEvent const& e)
if(_copy_info_call_bk != NULL)
this->_copy_info_call_bk(this->_info, e._info);
qDebug() << "operator =" << this << _info;
//qDebug() << "operator =" << this << _info;
return *this;
}
......
......@@ -88,6 +88,14 @@ public:
static Type s_location_orderpool;
//登陆并设置门店信息
static Type s_login_storeinfo;
//悬浮窗界面显示
static Type s_show_float;
//主界面显示
static Type s_show_mainform;
//打印设置界面显示
static Type s_show_prtform;
//登录界面显示
static Type s_show_login;
private:
//事件携带的信息,该内存你应当在堆中分配
......
......@@ -105,101 +105,89 @@ int main(int argc, char *argv[])
using namespace QsLogging;
void LoadTheme(const QString& theme)
{
QString rccPath = QString("%1/skin/%2.rcc").arg(qApp->applicationDirPath()).arg(theme);
if(!QFile(rccPath).exists())
{
return;
}
QResource::registerResource(rccPath);
QFile qssFile(QString(":/%1.qss").arg(theme));
if(!qssFile.open(QFile::ReadOnly))
{
return;
}
qApp->setStyleSheet(qssFile.readAll());
qssFile.close();
}
int CheckOnly();
void LoadTheme(const QString& theme);
void InitLog();
void InitCfgInfo(QString &geturl, QString &pushurl, QString &autoconf);
void InitPtr();
int main(int argc, char *argv[])
{
SetUnhandledExceptionFilter(FMExcpHandler);
HANDLE m_hMutex = CreateMutex(NULL, FALSE, L"Global\\fmtakeout");
if(m_hMutex != NULL)
{
if (GetLastError() == ERROR_ALREADY_EXISTS||GetLastError() == ERROR_ACCESS_DENIED) {
CloseHandle(m_hMutex);
m_hMutex = NULL;
return -1;
}
}
else{
if(CheckOnly() != 0)
return -1;
}
QApplication a(argc, argv);
InitLog();
LoadTheme(QString("deaufult"));
QString logDir = QString("%1/log").arg(QCoreApplication::applicationDirPath());
QDir().mkdir(logDir);
QsLogging::Logger &logger = QsLogging::Logger::instance();
logger.setLoggingLevel(QsLogging::DebugLevel);
QString logPath = QString("%1/%2").arg(logDir, "takeout.log");
QsLogging::DestinationPtr fileDst(QsLogging::DestinationFactory::MakeFileDestination(
logPath, QsLogging::EnableLogRotation, QsLogging::MaxSizeBytes(2*1024*1024), QsLogging::MaxOldLogCount(6)));
logger.addDestination(fileDst);
QsLogging::DestinationPtr consleDest(QsLogging::DestinationFactory::MakeDebugOutputDestination());
logger.addDestination(consleDest);
QLOG_INFO() << "--------------------------------takeout start------------------------------------";
QThread thread;
QThread threadt;
QThread prtthreadt;
QLOG_INFO() << "Thread List :" << &thread << &threadt << QThread::currentThread();
QFile tmpfile(qApp->applicationDirPath() + "/" + PREINTER_NEED);
if(!tmpfile.exists())
{
if(tmpfile.open(QFile::ReadWrite))
tmpfile.close();
}
//初始化打印文件
InitPtr();
//初始化全局订单池主线程中工作
PosOrderPool::InitOrderPool();
//读取配置文件
QString geturl;
QString pushurl;
QString autoconf;
InitCfgInfo(geturl, pushurl, autoconf);
//定义子工作流及工作流初始化
OrderGetWork work;
orderprintwork printwork;
OrderLocalizeWork loac;
OrderPushWork pwork;
work.setUrl(geturl);
work.setAutoconfirm(autoconf);
work.setTimeout(180000);
pwork.setSerurl(pushurl);
//移动子工作流到线程
loac.moveToThread(&thread);
work.moveToThread(&thread);
printwork.moveToThread(&prtthreadt);
pwork.moveToThread(&threadt);
//关联主动启动工作流和线程同时启动
QObject::connect(&thread, &QThread::started, &work, &OrderGetWork::workStart);
QObject::connect(&threadt, &QThread::started, &pwork, &OrderPushWork::workStart);
//启动tcp长链接和拉单工作流
thread.start();
threadt.start();
prtthreadt.start();
//界面类定义及初始化
MainForm mainform;
LoginForm loginform;
PosOrderPool::InitOrderPool();
QVariantMap map;
FloatForm floatform;
OrderLocalizeWork loac;
//开始展示界面
mainform.MyShow();
loginform.showfull();
//回归事件循环
return a.exec();
}
OrderPushWork pwork;
void InitPtr()
{
QFile tmpfile(qApp->applicationDirPath() + "/" + PREINTER_NEED);
QObject::connect(&mainform, &MainForm::showFloatForm, &floatform, &FloatForm::onShow);
QObject::connect(&mainform, &MainForm::startRemind, &floatform, &FloatForm::onStartRemind);
QObject::connect(&mainform, &MainForm::stopRemind, &floatform, &FloatForm::onStopRemind);
QObject::connect(&loginform, &LoginForm::showmainform, &mainform, &MainForm::showFullScreen);
QObject::connect(&loginform, &LoginForm::showfloat, &floatform, &FloatForm::onShow);
QObject::connect(&floatform, &FloatForm::showMainForm, &loginform, &LoginForm::showfull);
if(!tmpfile.exists())
{
if(tmpfile.open(QFile::ReadWrite))
tmpfile.close();
}
}
void InitCfgInfo(QString &geturl, QString &pushurl, QString &autoconf)
{
QString configfile = qApp->applicationDirPath() + "/" + CONFIG_NAME;
QString storefile = qApp->applicationDirPath() + "/" + STOREINFO_NAME;
QLOG_INFO() << "config file name : " << configfile;
QLOG_INFO() << "store file name : " << storefile;
QLOG_DEBUG() << "config file name : " << configfile;
QLOG_DEBUG() << "store file name : " << storefile;
QString tmpstoreid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_STOREID).toString();
QString tmppartnerid = QSettings(configfile, QSettings::IniFormat).value(INI_BASE_PARNETID).toString();
......@@ -231,61 +219,66 @@ int main(int argc, char *argv[])
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 geturl = QSettings(configfile, QSettings::IniFormat).value(INI_GETSERVER).toString();
QLOG_INFO() << "storeid" << storeid << "partnerid" << partnerid << "userid" << userid;
QLOG_INFO() << "pwd" << pwd << "stationid" << stationid << "autoconf" << autoconf;
QLOG_INFO() << "pushurl" << pushurl << "geturl" << geturl;
// map.insert(JSON_STOREID, "1036");
// map.insert(JSON_STATIONID, "saas_bf_pos");
// map.insert(JSON_KEY_USERID, "beiguo_saas");
// map.insert(JSON_KEY_PWD, "beiguo_saas");
// map.insert(JSON_KEY_PARTNERID, "1585");
// map.insert(JSON_STOREID, storeid);
// map.insert(JSON_STATIONID, stationid);
// map.insert(JSON_KEY_USERID, userid);
// map.insert(JSON_KEY_PWD, pwd);
// map.insert(JSON_KEY_PARTNERID, partnerid);
autoconf = QSettings(configfile, QSettings::IniFormat).value(INI_AUTOCONFIRM).toString();
pushurl = QSettings(configfile, QSettings::IniFormat).value(INI_PUSHSERVER).toString();
geturl = QSettings(configfile, QSettings::IniFormat).value(INI_GETSERVER).toString();
//mainform.setStoreinfo(map);
//work.setUrl(QString("http://118.89.167.51:9100//gateway?action=%1&access_token=%2&ver=%3&sign=%4"));
work.setUrl(geturl);
//work.setSerurl(pushurl);
work.setAutoconfirm(autoconf);
//work.setStoreinfo(map);
work.setTimeout(180000);
//QStringList list;
//list.append("118.89.167.51:9083");
//list.append(pushurl);
//pwork.setStoreinfo(map);
pwork.setSerurl(pushurl);
QLOG_DEBUG() << "storeid" << storeid << "partnerid" << partnerid << "userid" << userid;
QLOG_DEBUG() << "pwd" << pwd << "stationid" << stationid << "autoconf" << autoconf;
QLOG_DEBUG() << "pushurl" << pushurl << "geturl" << geturl;
}
loac.moveToThread(&thread);
work.moveToThread(&thread);
printwork.moveToThread(&thread);
void InitLog()
{
QString logDir = QString("%1/log").arg(QCoreApplication::applicationDirPath());
QDir().mkdir(logDir);
pwork.moveToThread(&threadt);
QsLogging::Logger &logger = QsLogging::Logger::instance();
logger.setLoggingLevel(QsLogging::DebugLevel);
QString logPath = QString("%1/%2").arg(logDir, "takeout.log");
QsLogging::DestinationPtr fileDst(QsLogging::DestinationFactory::MakeFileDestination(
logPath, QsLogging::EnableLogRotation, QsLogging::MaxSizeBytes(2*1024*1024), QsLogging::MaxOldLogCount(6)));
logger.addDestination(fileDst);
QsLogging::DestinationPtr consleDest(QsLogging::DestinationFactory::MakeDebugOutputDestination());
logger.addDestination(consleDest);
}
QObject::connect(&thread, &QThread::started, &work, &OrderGetWork::workStart);
QObject::connect(&threadt, &QThread::started, &pwork, &OrderPushWork::workStart);
void LoadTheme(const QString& theme)
{
QString rccPath = QString("%1/skin/%2.rcc").arg(qApp->applicationDirPath()).arg(theme);
if(!QFile(rccPath).exists())
{
return;
}
QResource::registerResource(rccPath);
thread.start();
threadt.start();
QFile qssFile(QString(":/%1.qss").arg(theme));
if(!qssFile.open(QFile::ReadOnly))
{
return;
}
qApp->setStyleSheet(qssFile.readAll());
qssFile.close();
}
mainform.MyShow();
loginform.showfull();
int CheckOnly()
{
HANDLE m_hMutex = CreateMutex(NULL, FALSE, L"Global\\fmtakeout");
if(m_hMutex != NULL)
{
if (GetLastError() == ERROR_ALREADY_EXISTS||GetLastError() == ERROR_ACCESS_DENIED) {
CloseHandle(m_hMutex);
m_hMutex = NULL;
return -1;
}
}
else{
return -1;
}
return a.exec();
return 0;
}
#endif
......@@ -10,6 +10,7 @@
#include <QThread>
#include <QSqlQuery>
#include <QVariantMap>
#include <QSettings>
#include "QsLog.h"
#include "base/DB/fm_database.h"
......@@ -21,6 +22,22 @@ QMap<QString, Order_Info> PosOrderPool::s_order_pool;
QMutex PosOrderPool::s_mutex;
//已有订单
QStringList PosOrderPool::s_order_list;
//外卖新单
int PosOrderPool::s_takeout_new = 0;
//外卖制作单
int PosOrderPool::s_takeout_make = 0;
//外卖退单
int PosOrderPool::s_takeout_refund;
//外卖票配送单
int PosOrderPool::s_takeout_send = 0;
//自提新订单
int PosOrderPool::s_self_new = 0;
//自提制作单
int PosOrderPool::s_self_make = 0;
//自提退单
int PosOrderPool::s_self_refund = 0;
//维护以上订单数量的锁
QMutex PosOrderPool::s_order_num_mutex;
PosOrderPool::PosOrderPool(QObject *parent) : QObject(parent)
{
......@@ -36,7 +53,11 @@ PosOrderPool::PosOrderPool(QObject *parent) : QObject(parent)
if(PosOrderPool::s_mutex.tryLock())
{
QString confilename = qApp->applicationDirPath() + "/" + CONFIG_NAME;
int tmptimeout = QSettings(confilename, QSettings::IniFormat).value(INI_DELEORDERTIMER, 12).toInt();
if(tmptimeout <= 12)
tmptimeout = 12;
if(!s_order_pool.empty())
{
......@@ -49,16 +70,20 @@ PosOrderPool::PosOrderPool(QObject *parent) : QObject(parent)
QVariantMap map;
map.insert(EVENT_KEY_ORDERID, it.key());
map.insert(EVENT_KEY_ORDERSTATUS, (int)(it.value().order_status));
OrderObject tmporder = it.value().order_data;
UpdateOrderNum(NULL, &tmporder);
POSTEVENTTYPE(PosEvent::s_delete_order, map, QVariantMap);
s_order_pool.erase(it ++);
continue;
}
if(it.value().order_change_time < nowtimer && nowtimer - it.value().order_change_time > ORDER_SAVE_DATE)
if(it.value().order_change_time < nowtimer && nowtimer - it.value().order_change_time > (tmptimeout*60*60))
{
QVariantMap map;
map.insert(EVENT_KEY_ORDERID, it.key());
map.insert(EVENT_KEY_ORDERSTATUS, it.value().order_status);
map.insert(EVENT_KEY_ORDERSTATUS, it.value().order_status);
OrderObject tmporder = it.value().order_data;
UpdateOrderNum(NULL, &tmporder);
POSTEVENTTYPE(PosEvent::s_delete_order, map, QVariantMap);
s_order_pool.erase(it ++);
continue;
......@@ -103,6 +128,8 @@ void PosOrderPool::loadOrders()
info.order_print_status = query.value(4).toInt();
info.order_status = DefaultOrder;
info.order_refund = DefaultOrder;
info.order_data.status = DefaultOrder;
info.order_data.refund_status = DefaultOrder;
s_mutex.lock();
s_order_pool.insert(info.order_id, info);
s_order_list.append(info.order_id);
......@@ -112,6 +139,7 @@ void PosOrderPool::loadOrders()
void PosOrderPool::removeOrderInfo(QString key)
{
QMutexLocker loker(&s_mutex);
s_order_pool.remove(key);
}
......@@ -139,6 +167,8 @@ bool PosOrderPool::TryInsertOrder(OrderObject order)
s_order_pool.insert(order.order_id,info);
UpdateOrderNum(&order);
DEFAULTPOSTEVENT(PosEvent::s_change_order, order.order_id);
if(order.status == FirmOrder && order.refund_status == DefaultOrder)
......@@ -173,6 +203,8 @@ bool PosOrderPool::TryInsertOrder(OrderObject order)
{
s_order_pool.insert(order.order_id, info);
UpdateOrderNum(&info.order_data, &oldinfo.order_data);
DEFAULTPOSTEVENT(PosEvent::s_change_order, order.order_id);
if(order.status == FirmOrder && order.refund_status == DefaultOrder && info.order_print_status == 0)
......@@ -187,6 +219,11 @@ bool PosOrderPool::TryInsertOrder(OrderObject order)
return true;
}
else
{
s_order_pool.insert(order.order_id, info);
return true;
}
return false;
}
......@@ -200,6 +237,7 @@ bool PosOrderPool::TryChangeOrderStatus(QString key, int order_status, int refun
if(!s_order_pool.contains(key))
return false;
Order_Info tmpinfo = s_order_pool[key];
Order_Info info = s_order_pool[key];
if(info.order_status != order_status || info.order_refund != refundstatus)
......@@ -224,6 +262,8 @@ bool PosOrderPool::TryChangeOrderStatus(QString key, int order_status, int refun
info.order_change_time = QDateTime::currentDateTime().toTime_t();
s_order_pool.insert(key, info);
UpdateOrderNum(&info.order_data, &tmpinfo.order_data);
DEFAULTPOSTEVENT(PosEvent::s_change_order, key);
if(info.order_status == FirmOrder && info.order_refund == DefaultOrder && info.order_print_status == 0)
......@@ -308,7 +348,9 @@ bool PosOrderPool::GetOrderStatus(QString key, int &status, int &refund_status,
Order_Info info = s_order_pool[key];
status = info.order_status;
refund_status = info.order_refund_status;
refund_status = info.order_refund;
QLOG_DEBUG() << "input0 : " << info.order_id << info.order_status << info.order_refund << info.order_data.refund_status;
if(s_order_list.contains(info.order_id, Qt::CaseInsensitive))
oldorder = true;
......@@ -360,12 +402,51 @@ bool PosOrderPool::GetOrderBaseInfo(QString key, QVariantHash &hash)
return true;
}
void PosOrderPool::GetOrderNum(int &tk_new, int &tk_make, int &tk_send, int &tk_refund, int &self_new, int &self_make, int &self_refund)
{
tk_new = s_takeout_new;
tk_make = s_takeout_make;
tk_send = s_takeout_send;
tk_refund = s_takeout_refund;
self_new = s_self_new;
self_make = s_self_make;
self_refund = s_self_refund;
}
bool PosOrderPool::GetSearchOrder(QString key, QMap<QString, QString> &map)
{
bool serachflag = false;
if(PosOrderPool::s_mutex.tryLock())
{
if(!s_order_pool.empty())
{
for (auto it = s_order_pool.begin(); it != s_order_pool.end(); ++ it)
{
if(it.value().order_status == DefaultOrder && it.value().order_refund == DefaultOrder)
continue;
QString phone = it.value().order_data.phone;
if(it.key().startsWith(key, Qt::CaseInsensitive)|| phone.startsWith(key, Qt::CaseInsensitive))
{
map.insert(it.key(), phone);
serachflag = true;
}
}
}
s_mutex.unlock();
return serachflag;
}
return false;
}
bool PosOrderPool::event(QEvent *e)
{
if(e->type() == PosEvent::s_inset_orderpool)
{
QLOG_INFO() << "PosEvent::s_inset_orderpool : " << QThread::currentThreadId();
QLOG_DEBUG() << "PosEvent::s_inset_orderpool : " << QThread::currentThreadId();
OrderObject order(this);
......@@ -426,5 +507,64 @@ bool PosOrderPool::event(QEvent *e)
return QObject::event(e);
}
void PosOrderPool::GetOrderStatus(const OrderObject *order, int &status)
{
if(order->refund_status == ApplicationRefundOrder ||
order->refund_status == ApplicationPartialRefundOrder ||
order->refund_status == CompleteRefundOrder)
status = order->refund_status;
else
status = order->status;
}
void PosOrderPool::UpdateOrderNum(const OrderObject *order, const OrderObject *orderold)
{
QMutexLocker loker(&s_order_num_mutex);
if(orderold != NULL)
{
int status = DefaultOrder;
GetOrderStatus(orderold, status);
QLOG_DEBUG() << "OLD UpdateOrderNum input 0 : " << orderold->order_id;
if(orderold->order_type == TimelyTakeout || orderold->order_type == AppointmentTakeout)
{
QLOG_DEBUG() << "OLD DECTAKEOUT UpdateOrderNum input 0 : " << orderold->order_id;
DECTAKEOUT(status, s_takeout_new, s_takeout_make, s_takeout_send, s_takeout_refund);
}
else if(orderold->order_type == TimelyInvite || orderold->order_type == AppointmentInvite)
{
QLOG_DEBUG() << "OLD DECTAKEOUT UpdateOrderNum input 0 : " << orderold->order_id;
DECSELF(status, s_self_new, s_self_make, s_self_refund);
}
}
if(order != NULL)
{
int status = DefaultOrder;
GetOrderStatus(order, status);
QLOG_DEBUG() << "NEW UpdateOrderNum input 0 : " << order->order_id;
if(order->order_type == TimelyTakeout || order->order_type == AppointmentTakeout)
{
QLOG_DEBUG() << "NEW INCTAKEOUT UpdateOrderNum input 0 : " << order->order_id;
QLOG_DEBUG() << "NEW INCTAKEOUT UpdateOrderNum input 3 : " << status;
INCTAKEOUT(status, s_takeout_new, s_takeout_make, s_takeout_send, s_takeout_refund);
QLOG_DEBUG() << "NEW INCTAKEOUT UpdateOrderNum input 4 : " << s_takeout_refund;
}
else if(order->order_type == TimelyInvite || order->order_type == AppointmentInvite)
{
QLOG_DEBUG() << "NEW INCSELF UpdateOrderNum input 0 : " << order->order_id;
INCSELF(status, s_self_new, s_self_make, s_self_refund);
}
}
}
......@@ -53,6 +53,46 @@
info.order_change_time = QDateTime::currentDateTime().toTime_t(); \
} while (0)
#define INCTAKEOUT(tmpstatus, tk_new, tk_make, tk_send, tk_refund) do { \
if(tmpstatus == NewOrder) \
++ tk_new; \
else if(tmpstatus == FirmOrder) \
++ tk_make; \
else if(tmpstatus == DispatchingOrder) \
++ tk_send; \
else if(tmpstatus == ApplicationRefundOrder || tmpstatus == ApplicationPartialRefundOrder) \
++ tk_refund; \
} while (0)
#define INCSELF(tmpstatus, self_new, self_make, self_refund) do { \
if(tmpstatus == NewOrder) \
++ self_new; \
else if(tmpstatus == FirmOrder) \
++ self_make; \
else if(tmpstatus == ApplicationRefundOrder || tmpstatus == ApplicationPartialRefundOrder) \
++ self_refund; \
} while (0)
#define DECTAKEOUT(tmpstatus, tk_new, tk_make, tk_send, tk_refund) do { \
if(tmpstatus == NewOrder) \
-- tk_new; \
else if(tmpstatus == FirmOrder) \
-- tk_make; \
else if(tmpstatus == DispatchingOrder) \
-- tk_send; \
else if(tmpstatus == ApplicationRefundOrder || tmpstatus == ApplicationPartialRefundOrder) \
-- tk_refund; \
} while (0)
#define DECSELF(tmpstatus, self_new, self_make, self_refund) do { \
if(tmpstatus == NewOrder) \
-- self_new; \
else if(tmpstatus == FirmOrder) \
-- self_make; \
else if(tmpstatus == ApplicationRefundOrder || tmpstatus == ApplicationPartialRefundOrder) \
-- self_refund; \
} while (0)
typedef enum
{
//订单原始状态(推了一个订单号时使用)
......@@ -67,7 +107,7 @@ typedef enum
CancelOrder=3,
//配送中
DispatchingOrder = 4,
//制作
//制作完成
InDevelopment = 5,
//已送达
ServiceOrder = 6,
......@@ -86,6 +126,24 @@ typedef enum
} Order_Status;
typedef enum
{
//订单原始状态(推了一个订单号时使用)
DefaultOrderType = -100,
//1=及时外卖
TimelyTakeout = 1,
//2=预约外卖
AppointmentTakeout = 2,
//3=及时堂食
TimelyDining = 3,
//4=预约堂食
AppointmentDining = 4,
//5=及时自提
TimelyInvite = 5,
//6=预约自提
AppointmentInvite = 6
} Order_Type;
typedef struct
{
//订单编号
......@@ -135,9 +193,15 @@ public:
static bool GetOrderBaseInfo(QString key, QVariantHash &hash);
static void GetOrderNum(int &tk_new, int &tk_make, int &tk_send, int &tk_refund, int &self_new, int &self_make, int &self_refund);
static bool GetSearchOrder(QString key, QMap<QString, QString> &map);
virtual bool event(QEvent *e);
private:
static void UpdateOrderNum(const OrderObject *order, const OrderObject *orderold = NULL);
static bool TryInsertOrder(OrderObject order);
static bool TryChangeOrderStatus(QString key, int order_status, int refundstatus = DefaultOrder);
......@@ -150,6 +214,8 @@ private:
static void removeOrderInfo(QString key);
static void GetOrderStatus(const OrderObject *order, int &status);
explicit PosOrderPool(QObject *parent = 0);
void loadOrders();
......@@ -158,10 +224,28 @@ private:
static QMap<QString, Order_Info> s_order_pool;
//写互斥锁
static QMutex s_mutex;
//外卖新单
static int s_takeout_new;
//外卖制作单
static int s_takeout_make;
//外卖票配送单
static int s_takeout_send;
//外卖退单
static int s_takeout_refund;
//自提新订单
static int s_self_new;
//自提制作单
static int s_self_make;
//自提退单
static int s_self_refund;
//维护以上订单数量的锁
static QMutex s_order_num_mutex;
//定时清理订单池
QTimer _timer;
//本地已有订单;
static QStringList s_order_list;
};
#endif // POSORDERPOOL_H
......@@ -14,12 +14,12 @@
#define DEFAULT_DBNAME "order.db"
#define DEFAULT_DBFORM "orderlist"
//#define SHA256RSA_PRIVATEKEY "MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAKbFeAqipCea1OXTR6wmz2D7XKUJ6ffRl/VRgF23kbxhhUseJ1jWJW9n7bJ1DyJsMzNgLzpi5jwCasZlvMAS+TdRYQtlvdHV8EDH8JKVaCn1O+emoN/Tbp+ngZLkZNqu3bWTQ6fBgbun4gyeFC1cXb87kn0dnBdkjnGZ/MuDu9oPAgMBAAECgYEAip3t1iEzgnvOY60GkM+9ZWXoroEcCNEcllqE8OCo8MS6LyLEH7H3ca8XwlJMHxeCQzy6ZLRZnB2CNJ/RkHD01S12JH3NPoeuY04/zhpl1BRq5Zm9iuIMkg5LP1cNjRnB5v8/ENZdLTXYEcrz4d3UDXZXvD2ywqoNNGqMqqp/U1ECQQDma32C2t3LV3lS9QeLejGXwDTeksJ53NzsUoGUOIQNkIC7f66tQfYG6wVWBfGoZTpxcLWweC+jPQ+75knWdmLHAkEAuUkYGKtzIeNmKJ0siew/dY31+Rb/pVHYj7TnZDx3dIYly0mwigQGCU7uVzkADXqyEqU+AQWU+RagQWwmjlWGeQJBALdYiMJ6zUlkDVIJTzuYu6V4d5kzRjQZnmEdNaZvYgQ5G3YWnzOV7OKMV+6fRC8ufVaOzMPinmVRzRdCozZXdTkCQQCapPo6pOasMyqx3TUuTINOr1TMOLjYl65Diz7Rt3IQTGLBAFkbaG5NWJavMADuPyjfTRGqMql7GLpawFSR2aopAkEAmKme0TgKB4EpdxS7xV4/XEm+MuZXE/dAfnN5fNOVueWw+23gDYvLXZAoAZNdpdaWw/CZl66XL6M1RMiDYllNvw=="
//#define DEFAULT_ACCESS_TOKEN "3e0e8e1b-ad85-4ec0-a0ec-ad92bb5ae043"
#define SHA256RSA_PRIVATEKEY "MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAKbFeAqipCea1OXTR6wmz2D7XKUJ6ffRl/VRgF23kbxhhUseJ1jWJW9n7bJ1DyJsMzNgLzpi5jwCasZlvMAS+TdRYQtlvdHV8EDH8JKVaCn1O+emoN/Tbp+ngZLkZNqu3bWTQ6fBgbun4gyeFC1cXb87kn0dnBdkjnGZ/MuDu9oPAgMBAAECgYEAip3t1iEzgnvOY60GkM+9ZWXoroEcCNEcllqE8OCo8MS6LyLEH7H3ca8XwlJMHxeCQzy6ZLRZnB2CNJ/RkHD01S12JH3NPoeuY04/zhpl1BRq5Zm9iuIMkg5LP1cNjRnB5v8/ENZdLTXYEcrz4d3UDXZXvD2ywqoNNGqMqqp/U1ECQQDma32C2t3LV3lS9QeLejGXwDTeksJ53NzsUoGUOIQNkIC7f66tQfYG6wVWBfGoZTpxcLWweC+jPQ+75knWdmLHAkEAuUkYGKtzIeNmKJ0siew/dY31+Rb/pVHYj7TnZDx3dIYly0mwigQGCU7uVzkADXqyEqU+AQWU+RagQWwmjlWGeQJBALdYiMJ6zUlkDVIJTzuYu6V4d5kzRjQZnmEdNaZvYgQ5G3YWnzOV7OKMV+6fRC8ufVaOzMPinmVRzRdCozZXdTkCQQCapPo6pOasMyqx3TUuTINOr1TMOLjYl65Diz7Rt3IQTGLBAFkbaG5NWJavMADuPyjfTRGqMql7GLpawFSR2aopAkEAmKme0TgKB4EpdxS7xV4/XEm+MuZXE/dAfnN5fNOVueWw+23gDYvLXZAoAZNdpdaWw/CZl66XL6M1RMiDYllNvw=="
#define DEFAULT_ACCESS_TOKEN "3e0e8e1b-ad85-4ec0-a0ec-ad92bb5ae043"
//正式环境
#define SHA256RSA_PRIVATEKEY "MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAKbFeAqipCea1OXTR6wmz2D7XKUJ6ffRl/VRgF23kbxhhUseJ1jWJW9n7bJ1DyJsMzNgLzpi5jwCasZlvMAS+TdRYQtlvdHV8EDH8JKVaCn1O+emoN/Tbp+ngZLkZNqu3bWTQ6fBgbun4gyeFC1cXb87kn0dnBdkjnGZ/MuDu9oPAgMBAAECgYEAip3t1iEzgnvOY60GkM+9ZWXoroEcCNEcllqE8OCo8MS6LyLEH7H3ca8XwlJMHxeCQzy6ZLRZnB2CNJ/RkHD01S12JH3NPoeuY04/zhpl1BRq5Zm9iuIMkg5LP1cNjRnB5v8/ENZdLTXYEcrz4d3UDXZXvD2ywqoNNGqMqqp/U1ECQQDma32C2t3LV3lS9QeLejGXwDTeksJ53NzsUoGUOIQNkIC7f66tQfYG6wVWBfGoZTpxcLWweC+jPQ+75knWdmLHAkEAuUkYGKtzIeNmKJ0siew/dY31+Rb/pVHYj7TnZDx3dIYly0mwigQGCU7uVzkADXqyEqU+AQWU+RagQWwmjlWGeQJBALdYiMJ6zUlkDVIJTzuYu6V4d5kzRjQZnmEdNaZvYgQ5G3YWnzOV7OKMV+6fRC8ufVaOzMPinmVRzRdCozZXdTkCQQCapPo6pOasMyqx3TUuTINOr1TMOLjYl65Diz7Rt3IQTGLBAFkbaG5NWJavMADuPyjfTRGqMql7GLpawFSR2aopAkEAmKme0TgKB4EpdxS7xV4/XEm+MuZXE/dAfnN5fNOVueWw+23gDYvLXZAoAZNdpdaWw/CZl66XL6M1RMiDYllNvw=="
#define DEFAULT_ACCESS_TOKEN "5c1bf782-a117-4aed-8ddc-66a415820d34"
//#define SHA256RSA_PRIVATEKEY "MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAKbFeAqipCea1OXTR6wmz2D7XKUJ6ffRl/VRgF23kbxhhUseJ1jWJW9n7bJ1DyJsMzNgLzpi5jwCasZlvMAS+TdRYQtlvdHV8EDH8JKVaCn1O+emoN/Tbp+ngZLkZNqu3bWTQ6fBgbun4gyeFC1cXb87kn0dnBdkjnGZ/MuDu9oPAgMBAAECgYEAip3t1iEzgnvOY60GkM+9ZWXoroEcCNEcllqE8OCo8MS6LyLEH7H3ca8XwlJMHxeCQzy6ZLRZnB2CNJ/RkHD01S12JH3NPoeuY04/zhpl1BRq5Zm9iuIMkg5LP1cNjRnB5v8/ENZdLTXYEcrz4d3UDXZXvD2ywqoNNGqMqqp/U1ECQQDma32C2t3LV3lS9QeLejGXwDTeksJ53NzsUoGUOIQNkIC7f66tQfYG6wVWBfGoZTpxcLWweC+jPQ+75knWdmLHAkEAuUkYGKtzIeNmKJ0siew/dY31+Rb/pVHYj7TnZDx3dIYly0mwigQGCU7uVzkADXqyEqU+AQWU+RagQWwmjlWGeQJBALdYiMJ6zUlkDVIJTzuYu6V4d5kzRjQZnmEdNaZvYgQ5G3YWnzOV7OKMV+6fRC8ufVaOzMPinmVRzRdCozZXdTkCQQCapPo6pOasMyqx3TUuTINOr1TMOLjYl65Diz7Rt3IQTGLBAFkbaG5NWJavMADuPyjfTRGqMql7GLpawFSR2aopAkEAmKme0TgKB4EpdxS7xV4/XEm+MuZXE/dAfnN5fNOVueWw+23gDYvLXZAoAZNdpdaWw/CZl66XL6M1RMiDYllNvw=="
//#define DEFAULT_ACCESS_TOKEN "5c1bf782-a117-4aed-8ddc-66a415820d34"
#define TIMEOUT_TRY_LOGING 20000
......@@ -62,6 +62,8 @@
#define INI_AUTOCONFIRM "info/autoconfirm"
#define INI_UIVISIBLE "Ui/visible"
#define INI_DELEORDERTIMER "all/dltordertimer"
#define INI_NEEDPTR "all/needotherprt"
#define INI_NEEDLABEL "all/needlabel"
......@@ -121,6 +123,7 @@
#define JSON_FAILEDNUM "fail_number"
#define JSON_SUCCESSSUM "success_total_fee"
#define JSON_FAILEDSUM "fail_total_fee"
//#define JSON_KEY_UNIFY_ID "unify_id"
#define DB_KEY_ORDERID "order_id"
#define DB_KEY_ORDETRCAHNGETIME "order_change_time"
......@@ -170,6 +173,7 @@
#define JSON_KEY_REASON "reason"
#define JSON_KEY_LISTDATA "listData"
#define JSON_KEY_STOREUNIFYID "store_unify_id"
#define JSON_KEY_ORDERID "order_id"
#define JSON_KEY_REASONCODE "reason_code"
......@@ -206,6 +210,8 @@
#define OPERATIONNAME_COMPLETE "完成"
#define OPERATIONNAME_REFUSEREFUND "拒绝"
#define OPERATIONNAME_REFUNDORDER "退单"
#define OPERATIONNAME_AGREE "同意"
#define OPERATIONNAME_REFUNDNEWORDER "拒绝接单"
#define REJECTUITYPE_REFUSEREFUND 0
#define REJECTUITYPE_AGREEREFUND 1
......@@ -244,9 +250,9 @@
// 默认重新尝试登录的时间
#define VALUE_RELOGINTIME 20000
// 新订单提示音音频时长
#define VALUE_NEWORDERTIME 6000 //TODO
#define VALUE_NEWORDERTIME 3000 //TODO
// 需退款提示音音频时长
#define VALUE_REFUNDORDERTIME 5000 //TODO
#define VALUE_REFUNDORDERTIME 3000 //TODO
// 拒绝退款理由
#define VALUE_REFUSEREFUND_REASON "拒绝退款"
//
......@@ -256,6 +262,10 @@
#define FILE_PRINTTAKE80_TEMPLET "printtemplettake80.txt"
#define FILE_PRINTYY_TEMPLET "printtempletyy.txt"
#define FILE_PRINTYY80_TEMPLET "printtempletyy80.txt"
#define FILE_PRINTO2O_TEMPLET "printtempleto2o.txt"
#define FILE_PRINTO2O80_TEMPLET "printtempleto2o80.txt"
#define FILE_PRINTO2OZZ_TEMPLET "printtempleto2ozz.txt"
#define FILE_PRINTO2OZZ80_TEMPLET "printtempleto2ozz80.txt"
#define DEFAULT_PRINTF_MAIN_SESSION "Printer"
......
......@@ -21,6 +21,8 @@ LIBS += -L$$PWD/lib -llibeay32 -lssleay32 -lwinspool
LIBS += -lWs2_32
LIBS += -lDbghelp
#DEFINES += USE_QAACTION
#DEFINES += FM_TEST
#DEFINES += FM_MAIN_TEST
RC_FILE += takeout.rc
......
......@@ -4,8 +4,8 @@
#include <winver.h>
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,0,9
PRODUCTVERSION 2,0,0,9
FILEVERSION 3,0,0,6
PRODUCTVERSION 3,0,0,6
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
......@@ -22,12 +22,12 @@ VS_VERSION_INFO VERSIONINFO
BEGIN
VALUE "CompanyName", "ShangHai Freemud Co., Ltd."
VALUE "FileDescription", "FREEMUD Manager System"
VALUE "FileVersion", "2.0.0.9"
VALUE "FileVersion", "3.0.0.6"
VALUE "InternalName", "FREEMUD"
VALUE "LegalCopyright", "Copyright (C)2017-2020"
VALUE "OriginalFilename", "fmTakeout.exe"
VALUE "ProductName", "fmTakeout"
VALUE "ProductVersion", "2.0.0.9"
VALUE "ProductVersion", "3.0.0.6"
END
END
BLOCK "VarFileInfo"
......
......@@ -25,7 +25,6 @@ public:
* 返回:NULL
* */
void InitData(OrderObject* orderObject);
private:
Ui::DetailForm *ui;
......@@ -74,6 +73,16 @@ private slots:
* 返回:NULL
* */
void on_detailBtn0_clicked();
/* 功能:获取订单操作和操作名称
* 参数:[1]订单[2]操作名称[3]按钮名称
* 返回:
* */
bool getOrderOptAndName(OrderObject *order, QString &optname, QString &name);
/* 功能:获取订单其他操作和操作名称
* 参数:[1]订单[2]操作名称[3]按钮名称
* 返回:
* */
bool getOtherOrderOptAndName(OrderObject *order, QString &optname, QString &name);
};
#endif // DETAILFORM_H
......@@ -21,13 +21,13 @@ public:
~FloatForm();
virtual bool event(QEvent *e);
protected:
void mouseMoveEvent(QMouseEvent * event);
void mousePressEvent(QMouseEvent * event);
void mouseReleaseEvent(QMouseEvent * event);
private:
QSize desktopSize;
Ui::FloatForm *ui;
// 记录左键按下去后是否移动过
bool m_bMouseMove;
......@@ -52,12 +52,18 @@ private:
// 置顶定时器
QTimer m_raiseTimer;
QTimer m_remindTimer;
// 是否登录成功
bool m_is_login;
/* 功能:初始化
* 参数:NULL
* 返回:NULL
* */
void _Init();
/* 功能:界面展示
* 参数:[1] -1界面展示; 0新订单; 1新退单
* 返回:NULL
* */
void InitWidget(int flag = -1);
private slots:
/* 功能:闪烁
* 参数:NULL
......
......@@ -6,33 +6,153 @@
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<width>242</width>
<height>100</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
<widget class="QWidget" name="widget_synshow" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>242</width>
<height>100</height>
</rect>
</property>
<property name="topMargin">
<number>0</number>
<widget class="QLabel" name="label_new">
<property name="geometry">
<rect>
<x>127</x>
<y>20</y>
<width>20</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string></string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_refund">
<property name="geometry">
<rect>
<x>177</x>
<y>20</y>
<width>20</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>退</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_newnum">
<property name="geometry">
<rect>
<x>118</x>
<y>54</y>
<width>36</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>9999</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_refundnum">
<property name="geometry">
<rect>
<x>170</x>
<y>54</y>
<width>36</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>9999</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget>
<widget class="QWidget" name="widget_login" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>242</width>
<height>100</height>
</rect>
</property>
<property name="rightMargin">
<number>0</number>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>101</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_newmsg">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="widget_base" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>100</height>
</rect>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QWidget" name="floatWdg" native="true"/>
</item>
</layout>
</widget>
<zorder>widget_base</zorder>
<zorder>widget_login</zorder>
<zorder>widget_synshow</zorder>
</widget>
<resources/>
<connections/>
......
......@@ -52,6 +52,7 @@ LoginForm::LoginForm(QWidget *parent) :
FMApplication::subscibeEvent(this, PosEvent::s_login_status);
FMApplication::subscibeEvent(this, PosEvent::s_opt_status);
FMApplication::subscibeEvent(this, PosEvent::s_show_login);
}
......@@ -107,7 +108,8 @@ void LoginForm::showfull()
}
this->hide();
emit showmainform();
//emit showmainform();
DEFAULTPOSTEVENT(PosEvent::s_show_mainform, "");
}
bool LoginForm::event(QEvent *e)
......@@ -140,6 +142,12 @@ bool LoginForm::event(QEvent *e)
return true;
}
if(e->type() == PosEvent::s_show_login)
{
this->showfull();
return true;
}
if(e->type() == PosEvent::s_login_status)
{
QVariantMap value;
......@@ -157,7 +165,8 @@ bool LoginForm::event(QEvent *e)
this->hide();
onHideAlert();
is_login -= true;
emit showmainform();
//emit showmainform();
DEFAULTPOSTEVENT(PosEvent::s_show_mainform, "");
}
return true;
}
......@@ -184,17 +193,6 @@ void LoginForm::on_pushButton_login_clicked()
return ;
}
//可能调整
// map.insert(JSON_STOREID, "1036");
// map.insert(JSON_STATIONID, "saas_bf_pos");
//map.insert(JSON_STOREID, "fm10001");
//map.insert(JSON_STATIONID, "1001");
//map.insert(JSON_STOREID, "FM00001");
//map.insert(JSON_STATIONID, "saas_pos");
//map.insert(JSON_STATIONID, "FM00001");
map.insert(JSON_STOREID, ui->lineEdit_storeid->text());
map.insert(JSON_STATIONID, ui->lineEdit_posno->text());
map.insert(JSON_KEY_USERID, ui->lineEdit_account->text());
......@@ -228,5 +226,6 @@ void LoginForm::number_btn_click()
void LoginForm::on_pushButton_close_clicked()
{
this->hide();
emit showfloat();
//emit showfloat();
DEFAULTPOSTEVENT(PosEvent::s_show_float, "");
}
......@@ -35,8 +35,6 @@ public:
void MyShow();
virtual bool event(QEvent *e);
void setStoreinfo(const QVariantMap &storeinfo);
private:
Ui::MainForm *ui;
// 时间定时器
......@@ -96,15 +94,27 @@ private:
* 参数:[1]订单状态
* 返回:对应的Tab按钮
* */
QPushButton *_GetTabBtnByOrderStatus(int orderStatus);
QPushButton *_GetTabBtn(QTableWidget *view);
/* 功能:删除订单数据
* 参数:[1]订单编号
* 返回:
* */
void deleteOrderItem(QString orderid);
/* 功能:获取订单操作和操作名称
* 参数:[1]订单[2]操作名称[3]按钮名称
* 返回:
* */
bool getOrderOptAndName(OrderObject *order, QString &optname, QString &name);
/* 功能:获取订单渠道名称
* 参数:[1]订单[2]渠道名称
* 返回:
* */
void getOrderChannelName(OrderObject *order, QString &channelname);
/* 功能:获取订单所在table页和按钮
* 参数:[1]订单[2]table页[3]按钮
* 返回:
* */
void getTableAndBtn(OrderObject *order, QTableWidget *&tab, QPushButton *&btn);
signals:
/* 功能:处理订单
* 参数:[1]操作动作名[2]订单编号[3]配送员信息
......@@ -141,11 +151,6 @@ signals:
* 返回:NULL
* */
void processRejectOrder(const QString& orderId,const int& reasonCode,const QString& reason,const int& reasontype);
/* 功能:获取日结数据
* 参数:NULL
* 返回:NULL
* */
void getDayReport();
private slots:
/* 功能:初始化
* 参数:NULL
......@@ -212,14 +217,22 @@ private slots:
* 返回:NULL
* */
void onSearchResultItemClicked(QListWidgetItem * item);
void on_mainBtnDayReport_clicked();
/* 功能:打印的相关功能设置
* 参数:NULL
* 返回:NULL
* */
void on_mainBtnPrt_clicked();
public slots:
/* 功能:隐藏通知窗口
* 参数:NULL
* 返回:NULL
* */
void onSerachOrder(const QString &key);
/* 功能:隐藏通知窗口
* 参数:NULL
* 返回:NULL
* */
void onHideAlert();
/* 功能:显示通知窗口
* 参数:[1]窗口类型[2]显示信息
......@@ -266,9 +279,14 @@ public slots:
* 返回:NULL
* */
void onShowSearchOrderResult(const QMap<QString, QString> &orderIdList);
void onOrderClear(const QString& orderId,const int& oldstatus);
// /* 功能:订单状态改变尝试删除订单
// * 参数:[1]订单编号
// * 返回:NULL
// * */
// void tryDeleteOrder(QString orderid);
//void onOrderClear(const QString& orderId,const int& oldstatus);
void onEntryResult(OrderObject* orderObject,int type);
void onSetDailyReportData(QJsonObject json);
};
#endif // MAINFORM_H
......@@ -49,22 +49,7 @@
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_12" stretch="1,0,0,0,1,0,1">
<property name="spacing">
<number>5</number>
</property>
<property name="leftMargin">
<number>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>20</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_21">
<item>
<widget class="QLabel" name="mainSlabLogo0">
<property name="minimumSize">
......@@ -85,7 +70,7 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
......@@ -98,13 +83,10 @@
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_18">
<layout class="QHBoxLayout" name="horizontalLayout_20">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="spacing">
......@@ -283,6 +265,65 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_15">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="verticalSpacer_11">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_19">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="mainBtnMakeOver">
<property name="minimumSize">
<size>
<width>97</width>
<height>53</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>97</width>
<height>53</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>0
制作完成</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="tableName" stdset="0">
<string>mainTableMakeOver</string>
</property>
<property name="name" stdset="0">
<string>制作完成</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="spacing">
<number>0</number>
......@@ -475,7 +516,7 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="mainBtnDayReport">
<widget class="QPushButton" name="mainBtnPrt">
<property name="minimumSize">
<size>
<width>50</width>
......@@ -567,13 +608,13 @@
<number>0</number>
</property>
<property name="leftMargin">
<number>3</number>
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>3</number>
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
......@@ -979,6 +1020,90 @@
</widget>
</item>
<item>
<widget class="QTableWidget" name="mainTableMakeOver">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="showGrid">
<bool>false</bool>
</property>
<property name="columnCount">
<number>7</number>
</property>
<property name="operationName" stdset="0">
<string>完成</string>
</property>
<property name="operation" stdset="0">
<string>complete</string>
</property>
<attribute name="horizontalHeaderCascadingSectionResizes">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>40</number>
</attribute>
<column>
<property name="text">
<string>渠道</string>
</property>
</column>
<column>
<property name="text">
<string>订单编号</string>
</property>
</column>
<column>
<property name="text">
<string>金额</string>
</property>
</column>
<column>
<property name="text">
<string>姓名</string>
</property>
</column>
<column>
<property name="text">
<string>联系方式</string>
</property>
</column>
<column>
<property name="text">
<string>下单时间</string>
</property>
</column>
<column>
<property name="text">
<string>操作</string>
</property>
</column>
</widget>
</item>
<item>
<widget class="QTableWidget" name="mainTableOther">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
......@@ -1665,6 +1790,38 @@
</hint>
</hints>
</connection>
<connection>
<sender>mainBtnMakeOver</sender>
<signal>clicked()</signal>
<receiver>MainForm</receiver>
<slot>onMainTabBtnClicked()</slot>
<hints>
<hint type="sourcelabel">
<x>377</x>
<y>39</y>
</hint>
<hint type="destinationlabel">
<x>417</x>
<y>299</y>
</hint>
</hints>
</connection>
<connection>
<sender>mainTableMakeOver</sender>
<signal>itemClicked(QTableWidgetItem*)</signal>
<receiver>MainForm</receiver>
<slot>onMainTableItemClicked(QTableWidgetItem*)</slot>
<hints>
<hint type="sourcelabel">
<x>629</x>
<y>266</y>
</hint>
<hint type="destinationlabel">
<x>417</x>
<y>299</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>onMainTabBtnClicked()</slot>
......
......@@ -373,9 +373,12 @@ void PrtSettingForm::on_pushButton_save_clicked()
QLOG_DEBUG() << "printf file name : " << filename;
if(Wigth.isEmpty() || name.isEmpty())
if(Wigth.isEmpty())
return ;
if(name.isEmpty())
name = "test01" ;
QString confilename = qApp->applicationDirPath() + "/" + CONFIG_NAME;
QString tmpconfilename = qApp->applicationDirPath() + "/" + PREINTER_NEED;
......
......@@ -60,3 +60,24 @@ void SettingForm::on_settingCbxPrinter_activated(const QString &text)
{
ConfigManger::GetInstance().SetPrinterName(text);
}
void SettingForm::on_pushButton_save_clicked()
{
QString confilename = qApp->applicationDirPath() + "/" + CONFIG_NAME;
if(ui->radioButton_auto->isChecked())
QSettings(confilename, QSettings::IniFormat).setValue(INI_AUTOCONFIRM, 1);
else
QSettings(confilename, QSettings::IniFormat).setValue(INI_AUTOCONFIRM, 0);
qDebug() << "input : " << (ui->comboBox_time->currentIndex() + 1) * 12;
QSettings(confilename, QSettings::IniFormat).setValue(INI_DELEORDERTIMER, (ui->comboBox_time->currentIndex() + 1) * 12);
this->hide();
}
void SettingForm::on_pushButton_quit_clicked()
{
this->hide();
}
......@@ -41,6 +41,8 @@ private slots:
* */
void on_settingBtnSoundTest_clicked();
void on_settingCbxPrinter_activated(const QString &text);
void on_pushButton_save_clicked();
void on_pushButton_quit_clicked();
};
#endif // SETTINGFORM_H
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