Commit ceb97a3f by ss.dai

临时改动

parent 2a09b4c6
...@@ -51,8 +51,7 @@ bool FlowControl::_Login() ...@@ -51,8 +51,7 @@ bool FlowControl::_Login()
QJsonObject sendJson; QJsonObject sendJson;
QJsonObject recvJson; QJsonObject recvJson;
// TODO sendJson = DataManger::GetInstance().GetLoginData(m_storeId, SERVER_PASSWORD, m_posId, m_cashierId);
sendJson = DataManger::GetInstance().GetLoginData(/*m_storeId*//*"posoperator"*/"fm9999", SERVER_PASSWORD, m_posId, m_cashierId);
emit showAlert(AlertForm::LOADING, "正在登录......"); emit showAlert(AlertForm::LOADING, "正在登录......");
QLOG_INFO() << QString("[---login---][requestData:%1]").arg(_GetJsonStr(sendJson)); QLOG_INFO() << QString("[---login---][requestData:%1]").arg(_GetJsonStr(sendJson));
......
...@@ -15,12 +15,18 @@ void RefundControl::SetListenPort(int port) ...@@ -15,12 +15,18 @@ void RefundControl::SetListenPort(int port)
m_port = port; m_port = port;
} }
RefundControl::~RefundControl()
{
}
// 同步模式 // 同步模式
void RefundControl::run() void RefundControl::run()
{ {
m_procOrderSocket = new BillSocket(this); m_procOrderSocket = new BillSocket(this);
m_tcpServer = new QTcpServer(this); m_tcpServer = new QTcpServer(this);
qDebug() << 11 << m_tcpServer->serverError();
if(!m_tcpServer->listen(QHostAddress::LocalHost, m_port)) if(!m_tcpServer->listen(QHostAddress::LocalHost, m_port))
{ {
QLOG_WARN() << QString("tcp server listen failed on port[%1]").arg(m_port); QLOG_WARN() << QString("tcp server listen failed on port[%1]").arg(m_port);
...@@ -39,6 +45,12 @@ void RefundControl::run() ...@@ -39,6 +45,12 @@ void RefundControl::run()
{ {
continue; continue;
} }
if(QAbstractSocket::UnknownSocketError != m_tcpServer->serverError())
{
continue;
}
QLOG_INFO() << "onNewConnecion....."; QLOG_INFO() << "onNewConnecion.....";
QString error; QString error;
QString orderId, reason; int version, reqtype; QString orderId, reason; int version, reqtype;
......
...@@ -20,6 +20,7 @@ private: ...@@ -20,6 +20,7 @@ private:
RefundControl(){} RefundControl(){}
RefundControl(RefundControl const&); RefundControl(RefundControl const&);
RefundControl& operator=(RefundControl const&); RefundControl& operator=(RefundControl const&);
~RefundControl();
QTcpServer *m_tcpServer; QTcpServer *m_tcpServer;
QTcpSocket *m_tcpSocket; QTcpSocket *m_tcpSocket;
......
...@@ -22,7 +22,6 @@ ConfigManger::SqlConnectInfo ConfigManger::GetSqlConnectInfo() ...@@ -22,7 +22,6 @@ ConfigManger::SqlConnectInfo ConfigManger::GetSqlConnectInfo()
{ {
SqlConnectInfo info; SqlConnectInfo info;
info.host = m_userConfig->value(INI_HOST).toString(); info.host = m_userConfig->value(INI_HOST).toString();
qDebug()<<info.host;
info.username = m_userConfig->value(INI_USERNAME).toString(); info.username = m_userConfig->value(INI_USERNAME).toString();
info.password = m_userConfig->value(INI_PASSWORD).toString(); info.password = m_userConfig->value(INI_PASSWORD).toString();
info.database = m_userConfig->value(INI_DATABASE).toString(); info.database = m_userConfig->value(INI_DATABASE).toString();
......
...@@ -48,7 +48,6 @@ bool BillSocket::Request(const QJsonObject &requestJson, QJsonObject &recvJson, ...@@ -48,7 +48,6 @@ bool BillSocket::Request(const QJsonObject &requestJson, QJsonObject &recvJson,
return false; return false;
} }
recvJson = QJsonDocument::fromJson(recvArray).object(); recvJson = QJsonDocument::fromJson(recvArray).object();
qDebug() << recvJson;
reply->deleteLater(); reply->deleteLater();
return true; return true;
......
...@@ -27,6 +27,7 @@ DetailForm::~DetailForm() ...@@ -27,6 +27,7 @@ DetailForm::~DetailForm()
void DetailForm::InitData(OrderObject *orderObject) void DetailForm::InitData(OrderObject *orderObject)
{ {
m_orderObject = orderObject; m_orderObject = orderObject;
// 恢复界面 // 恢复界面
ui->detailTable0->clearContents(); ui->detailTable0->clearContents();
ui->detailTable0->setRowCount(0); ui->detailTable0->setRowCount(0);
...@@ -124,3 +125,8 @@ void DetailForm::on_detailBtn1_clicked() ...@@ -124,3 +125,8 @@ void DetailForm::on_detailBtn1_clicked()
{ {
FmPrinter::GetInstance().DoPrint(ConfigManger::GetInstance().GetPrinterName(), m_orderObject); FmPrinter::GetInstance().DoPrint(ConfigManger::GetInstance().GetPrinterName(), m_orderObject);
} }
void DetailForm::on_detailBtn2_clicked()
{
}
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <QTableWidget> #include <QTableWidget>
#include "Model/orderObject.h" #include "Model/orderObject.h"
#include "Model/deliverObject.h" #include "Model/deliverObject.h"
#include "refuseForm.h"
namespace Ui { namespace Ui {
class DetailForm; class DetailForm;
...@@ -63,6 +64,11 @@ private slots: ...@@ -63,6 +64,11 @@ private slots:
* 返回:NULL * 返回:NULL
* */ * */
void on_detailBtn1_clicked(); void on_detailBtn1_clicked();
/* 功能:处理拒绝按钮点击
* 参数:NULL
* 返回:NULL
* */
void on_detailBtn2_clicked();
}; };
#endif // DETAILFORM_H #endif // DETAILFORM_H
...@@ -1060,34 +1060,34 @@ ...@@ -1060,34 +1060,34 @@
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>detailBtn2</sender> <sender>detailBtn3</sender>
<signal>clicked()</signal> <signal>clicked()</signal>
<receiver>DetailForm</receiver> <receiver>DetailForm</receiver>
<slot>onOperaBtnClicked()</slot> <slot>onOperaBtnClicked()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>595</x> <x>683</x>
<y>552</y> <y>551</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>596</x> <x>683</x>
<y>601</y> <y>588</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection> <connection>
<sender>detailBtn3</sender> <sender>detailBtn2</sender>
<signal>clicked()</signal> <signal>clicked()</signal>
<receiver>DetailForm</receiver> <receiver>DetailForm</receiver>
<slot>onOperaBtnClicked()</slot> <slot>onOperaBtnClicked()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>683</x> <x>585</x>
<y>551</y> <y>556</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>683</x> <x>585</x>
<y>588</y> <y>604</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
......
...@@ -16,9 +16,6 @@ TEMPLATE = app ...@@ -16,9 +16,6 @@ TEMPLATE = app
INCLUDEPATH += ../fmPlugin INCLUDEPATH += ../fmPlugin
INCLUDEPATH += ../fmPrinter INCLUDEPATH += ../fmPrinter
#TODO
DEFINES += WITHOUT_DATABASE
SOURCES += main.cpp\ SOURCES += main.cpp\
mainForm.cpp \ mainForm.cpp \
alertForm.cpp \ alertForm.cpp \
...@@ -41,7 +38,8 @@ SOURCES += main.cpp\ ...@@ -41,7 +38,8 @@ SOURCES += main.cpp\
Model/stockObject.cpp \ Model/stockObject.cpp \
DTools/clickedLineEdit.cpp \ DTools/clickedLineEdit.cpp \
DTools/sysTray.cpp \ DTools/sysTray.cpp \
padForm.cpp padForm.cpp \
refuseForm.cpp
HEADERS += \ HEADERS += \
mainForm.h \ mainForm.h \
...@@ -66,7 +64,8 @@ HEADERS += \ ...@@ -66,7 +64,8 @@ HEADERS += \
Model/stockObject.h \ Model/stockObject.h \
DTools/clickedLineEdit.h \ DTools/clickedLineEdit.h \
DTools/sysTray.h \ DTools/sysTray.h \
padForm.h padForm.h \
refuseForm.h
FORMS += mainForm.ui \ FORMS += mainForm.ui \
alertForm.ui \ alertForm.ui \
...@@ -75,7 +74,8 @@ FORMS += mainForm.ui \ ...@@ -75,7 +74,8 @@ FORMS += mainForm.ui \
settingForm.ui \ settingForm.ui \
floatForm.ui \ floatForm.ui \
detailForm.ui \ detailForm.ui \
padForm.ui padForm.ui \
refuseForm.ui
RC_FILE += fmTakeaway.rc RC_FILE += fmTakeaway.rc
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
#define OPERATIONNAME_SENDOUT "送出" #define OPERATIONNAME_SENDOUT "送出"
#define OPERATIONNAME_COMPLETE "完成" #define OPERATIONNAME_COMPLETE "完成"
#define OPERATIONNAME_REFUSEREFUND "拒绝" #define OPERATIONNAME_REFUSEREFUND "拒绝"
#define OPERATIONNAME_REFUND "同意"
// 属性名称 // 属性名称
#define PROPERTY_ID "id" // 人员编号 #define PROPERTY_ID "id" // 人员编号
...@@ -92,7 +93,7 @@ ...@@ -92,7 +93,7 @@
// 默认重新尝试登录的时间 // 默认重新尝试登录的时间
#define VALUE_RELOGINTIME 20000 #define VALUE_RELOGINTIME 20000
// 新订单提示音音频时长 // 新订单提示音音频时长
#define VALUE_NEWORDERTIME 3000 //TODO #define VALUE_NEWORDERTIME 6000 //TODO
// 需退款提示音音频时长 // 需退款提示音音频时长
#define VALUE_REFUNDORDERTIME 5000 //TODO #define VALUE_REFUNDORDERTIME 5000 //TODO
// 同步库存默认时长 // 同步库存默认时长
......
#include "refuseForm.h"
#include "ui_refuseForm.h"
RefuseForm::RefuseForm(QWidget *parent) :
QDialog(parent),
ui(new Ui::RefuseForm)
{
ui->setupUi(this);
setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint);
}
RefuseForm::~RefuseForm()
{
delete ui;
}
void RefuseForm::SetFormInfo(QStringList reasons, QString orderId, QString operation)
{
}
void RefuseForm::on_refuseBtnCancle_clicked()
{
this->accept();
}
void RefuseForm::on_refuseBtnOk_clicked()
{
}
#ifndef REFUSEFORM_H
#define REFUSEFORM_H
#include <QDialog>
#include <QMap>
namespace Ui {
class RefuseForm;
}
class RefuseForm : public QDialog
{
Q_OBJECT
public:
explicit RefuseForm(QWidget *parent = 0);
~RefuseForm();
/* 功能:设置窗口信息
* 参数:[1]原因列表 [2]订单ID [3]操作名称
* 返回:NULL
* */
void SetFormInfo(QStringList reasons, QString orderId, QString operation);
private slots:
/* 功能:取消按钮对应的操作
* 参数:NULL
* 返回:NULL
* */
void on_refuseBtnCancle_clicked();
/* 功能:确定按钮对应的操作
* 参数:[bEnable]是否启用
* 返回:NULL
* */
void on_refuseBtnOk_clicked();
private:
Ui::RefuseForm *ui;
QString m_orderId;
QString m_operation;
QMap<QString, QString> m_reasonCode;
};
#endif // REFUSEFORM_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RefuseForm</class>
<widget class="QDialog" name="RefuseForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>230</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,3,1">
<property name="spacing">
<number>8</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>
<widget class="QLabel" name="refuseLab0">
<property name="minimumSize">
<size>
<width>0</width>
<height>34</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>34</height>
</size>
</property>
<property name="text">
<string>选择拒绝原因</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="vlBody"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="refuseBtnOk">
<property name="minimumSize">
<size>
<width>70</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>确 定</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="refuseBtnCancle">
<property name="minimumSize">
<size>
<width>70</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>70</width>
<height>30</height>
</size>
</property>
<property name="text">
<string>取 消</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
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