Commit 6ea54e48 by 李定达

1.悬浮窗拖动范围限制;2.部分日志降级为debug;3.o2o打印模板丰富逻辑添加

parent 977e83b5
......@@ -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,7 +100,8 @@ void PrintLib::_PrintLab( OrderObject* order)
QString title = QString(" %2 %4/%5").arg(datetime, QString::number(++index), QString::number(allprod));
QString tmptitle;
if(QString("saas").compare(order->channel) == 0)
{
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);
......@@ -113,6 +114,12 @@ void PrintLib::_PrintLab( OrderObject* order)
{
tmptitle = QString("\xE9\x9D\x9E\xE7\xA0\x81\xE5\xA4\x96\xE5\x8D\x96").append(QString::number(order->order_index)).append(" ").append(title);
}
}
else
{
QString tmpstr = order->channel_name;
tmptitle = tmpstr.append(QString::number(order->order_index)).append(" ").append(title);;
}
QString prodname = dish->name;
......
......@@ -513,7 +513,7 @@ void OrderGetWork::optOrder(const QJsonArray &orders)
if(_storeinfo.contains(LOGIN_STORE_PHONE))
orderObject.setStore_phone(_storeinfo[LOGIN_STORE_PHONE].toString());
QLOG_INFO() << "----------------------------:" << orderObject.delivery_time;
QLOG_DEBUG() << "----------------------------:" << orderObject.delivery_time;
//PosOrderPool::TryInsertOrder(orderObject);
POSTEVENTTYPE(PosEvent::s_inset_orderpool,orderObject,OrderObject);
......
......@@ -204,6 +204,7 @@ private:
data.insert(JSON_KEY_TIMESTAMP, timestamp);
//data.insert(JSON_KEY_TIMESTAMP, 0);
data.insert(JSON_KEY_AUTOCONFIRM, autoconfirm);
data.insert(JSON_KEY_STOREUNIFYID, json[JSON_KEY_UNIFYID].toString());
return true;
}
......
......@@ -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 << ")";
}
}
......@@ -56,6 +56,8 @@ bool orderprintwork::event(QEvent *e)
int prtwi = QSettings(prtinifile, QSettings::IniFormat).value("Printer/PaperWidth", 0).toInt();
if(QString("saas").compare(order.channel, Qt::CaseInsensitive) == 0)
{
if(order.order_type == 1 || order.order_type == 2)
{
if(prtwi <= 56)
......@@ -77,6 +79,25 @@ bool orderprintwork::event(QEvent *e)
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINT80_TEMPLET);
}
}
else
{
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
{
if(prtwi <= 56)
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTO2OZZ_TEMPLET);
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINTO2OZZ80_TEMPLET);
}
}
qDebug() << "+++++++++++++++++++++++++++" << file.fileName();
......@@ -163,7 +184,8 @@ bool orderprintwork::event(QEvent *e)
QFile file;
int othprtw = QSettings(prtinifile, QSettings::IniFormat).value("OtherPrinter/PaperWidth", 0).toInt();
if(QString("saas").compare(order.channel, Qt::CaseInsensitive) == 0)
{
if(order.order_type == 1 || order.order_type == 2)
{
if(othprtw <= 56)
......@@ -185,6 +207,24 @@ bool orderprintwork::event(QEvent *e)
else
file.setFileName(qApp->applicationDirPath() + "/" + FILE_PRINT80_TEMPLET);
}
}
else
{
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
{
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)
{
......
......@@ -232,7 +232,7 @@ void InitLog()
QDir().mkdir(logDir);
QsLogging::Logger &logger = QsLogging::Logger::instance();
logger.setLoggingLevel(QsLogging::DebugLevel);
logger.setLoggingLevel(QsLogging::InfoLevel);
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)));
......
......@@ -406,7 +406,7 @@ 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);
......
......@@ -261,6 +261,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"
......
......@@ -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,0
PRODUCTVERSION 3,0,0,0
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.0"
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.0"
END
END
BLOCK "VarFileInfo"
......
......@@ -11,6 +11,8 @@
#include <QByteArray>
#include <QJsonObject>
#include <QJsonDocument>
#include <QDesktopWidget>
#include <QPoint>
#include "event/fmapplication.h"
#include "event/posevent.h"
......@@ -45,6 +47,8 @@ FloatForm::FloatForm(QWidget *parent) :
m_animation.setEasingCurve(QEasingCurve::InOutSine);
m_raiseTimer.setInterval(2000);
connect(&m_raiseTimer, &QTimer::timeout, this, &FloatForm::raise);
desktopSize= QApplication::desktop()->screenGeometry().size();
desktopSize-= QSize(242, 100);
_Init();
}
......@@ -165,7 +169,14 @@ void FloatForm::mouseMoveEvent(QMouseEvent *event)
{
QPoint moveAmount = event->globalPos() - m_lastMousePos;
m_absMove += moveAmount;
move(pos() + moveAmount);
int x=0,y=0;
x=pos().x()+moveAmount.x();
y=pos().y()+moveAmount.y();
if(x>desktopSize.width()){x=desktopSize.width();}
if(x<0){x=0;}
if(y>desktopSize.height()){y=desktopSize.height();}
if(y<0){y=0;}
move(x,y);
m_lastMousePos = event->globalPos();
m_bMouseMove = true;
}
......@@ -213,6 +224,26 @@ void FloatForm::_Init()
setStyleSheet("#floatWdg{ border-image: url(:float_normal.png); }");
move(ConfigManger::GetInstance().GetFloatInitPostion());
QPoint pos=ConfigManger::GetInstance().GetFloatInitPostion();
if(pos.x()<0)
{
pos.setX(0);
}
if(pos.y()<0)
{
pos.setY(0);
}
if(pos.x()>desktopSize.width())
{
pos.setX(desktopSize.width());
}
if(pos.y()>desktopSize.height())
{
pos.setY(desktopSize.height());
}
move(pos);
}
void FloatForm::_Blink()
......
......@@ -28,6 +28,7 @@ protected:
void mouseReleaseEvent(QMouseEvent * event);
private:
QSize desktopSize;
Ui::FloatForm *ui;
// 记录左键按下去后是否移动过
bool m_bMouseMove;
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>210</width>
<width>242</width>
<height>100</height>
</rect>
</property>
......@@ -18,7 +18,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>210</width>
<width>242</width>
<height>100</height>
</rect>
</property>
......@@ -158,7 +158,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>210</width>
<width>242</width>
<height>100</height>
</rect>
</property>
......
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