Commit fcd5b593 by wuyang.zou

New Feature: Support Scan EC-MOP Order, And Support Refund Order

Version: 2.21.7.15
parent 8b4e6060
Pipeline #35010 failed with stage
in 31 seconds
......@@ -1161,8 +1161,10 @@ bool FlowControl::_PullOrderDetail(const QString& orderId, const QString& channe
// 拉取订单详情接口: 新增 渠道 参数
url.append(QString("&")+JSON_CHANNEL+QString("=")+channel);
url.append(QString("&")+JSON_POSIPADDRESS+QString("=")+m_ipPortAddress);
url.append(QString("&")+JSON_STORE_ID+QString("=")+m_storeId);
QLOG_INFO() << QString("[<<<<---Pull Order Detail--->>>>][requestUrl:]")<<url;
m_pullOrderSocket->SetUrl(QUrl(url));
QUrl tmpUrl = QUrl(url);
m_pullOrderSocket->SetUrl( tmpUrl );
result = m_pullOrderSocket->GetRequest(recvJson, error);
QLOG_INFO() << QString("[<<<<---Pull Order Detail Finsh--->>>>][result:%1][msg:%2]")
.arg(result).arg(error)<<recvJson;
......@@ -3596,6 +3598,33 @@ void FlowControl::onGetOrderDetails(const QString& orderId)
}
void FlowControl::onGetEcMopOrderDetails(const QString& orderId, const QString& channel)
{
// 入参非法;
if ( orderId.isEmpty() || channel.isEmpty() || orderId.length() < 17 || orderId.length() > 25 ) {
QLOG_INFO() << QString("[<<<<---FlowControl::onGetEcMopOrderDetails: OrderId:%1 / channel:%2 Is Empty / Error --->>>>]").arg( orderId ).arg( channel );
emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("扫描订单号异常") );
return;
} else {
// 入参有效;
// 判断插件是否登录成功了,没有登录成功,弹框提示;
if ( !m_bLoginResult ) {
emit showAlert(AlertForm::MSGERROR, QString::fromLocal8Bit("插件程序还未成功登录") );
return;
}
// 组装请求报文 [ 含门店编号:便于 OMS 校验此订单是否属于本门店 ] , 获取订单详情数据 ;[ 失败则弹框提示]
bool pullOrderDetailRet = _PullOrderDetail( orderId, channel);
if ( pullOrderDetailRet ) {
// 展示跳转订单详情页面; // 同一线程, 理论无需 Sleep
Sleep(1000*3);
emit showOrderDetails(m_FmOrdersMap.value(orderId));
}
}
}
void FlowControl::onSerachOrder(const QString &text)
{
QLOG_INFO() << QString::fromLocal8Bit("[<<<<---FlowControl::onSerachOrder:输入的数字串:%1 --->>>>]").arg(text);
......
......@@ -462,6 +462,14 @@ public slots:
* 返回:NULL
* */
void onGetOrderDetails(const QString &orderId);
/* 功能:获取 EC-MOP 订单详情
* 参数: OrderId, Channel
* 返回:NULL
* */
void onGetEcMopOrderDetails(const QString &orderId, const QString &channel);
/* 功能:搜索订单
* 参数:[1]搜索内容
* 返回:NULL
......
......@@ -155,8 +155,6 @@ QJsonObject DataManger::GetCompleteOrderData(const QString &orderId)
QJsonObject DataManger::GetRefundOrderData(int reasonCode,const QString &reason, const QString &orderId,const QString& channel,const QString& dishesListString, const QString& cashierId, const QString& cashierName)
{
QJsonObject rObj;
Q_UNUSED(channel);
Q_UNUSED(reason);
QJsonArray productIds;
QString str = dishesListString;
if(str.length()){
......@@ -166,8 +164,10 @@ QJsonObject DataManger::GetRefundOrderData(int reasonCode,const QString &reason,
}
}
rObj.insert(JSON_ORDERID, orderId);
rObj.insert(JSON_CHANNEL, channel );
rObj.insert("productIds", productIds);
rObj.insert("canceledCause", QString::number(reasonCode, 10) );
rObj.insert("canceledDesc", reason );
rObj.insert("cashierNumber", cashierId);
rObj.insert("cashierName", cashierName);
rObj.insert(JSON_POSIPADDRESS,QString("http://") + m_posIpAddress);
......
......@@ -293,9 +293,12 @@ QString OrderObject::getChannelName()
}
}
}else{
} else if ( "EC-MOP" == channel ){
return QString::fromLocal8Bit("电商MOP");
} else{
return QString::fromLocal8Bit("未知");
}
}
QString OrderObject::getOrderStatusDec()
......
......@@ -42,6 +42,13 @@ void AlertForm::SetContent(AlertForm::Type type, const QString &msg)
ui->alertLabWarn->hide();
ui->alertLabError->hide();
break;
case BRIEF_TIPS:
ui->alertBtnOk->hide();
ui->alertLabOk->hide();
ui->alertLabIng->show();
ui->alertLabWarn->hide();
ui->alertLabError->hide();
break;
case SYNCDATA:
ui->alertBtnOk->hide();
ui->alertLabOk->hide();
......@@ -113,6 +120,9 @@ void AlertForm::SetContent(AlertForm::Type type, const QString &msg)
if ( type == WARNNING ) {
m_timer->stop();
} else if ( type == BRIEF_TIPS ) {
if(!m_timer->isActive() )
m_timer->start(3000);
} else {
if(!m_timer->isActive() )
m_timer->start(20000);
......
......@@ -23,6 +23,7 @@ public:
SUCCESS=0,
MSGERROR,
LOADING,
BRIEF_TIPS,
SYNCDATA,
WARNNING
}Type;
......
......@@ -317,6 +317,10 @@ void DetailForm::InitData(OrderObject *orderObject)
if(3 == orderObject->getOrderType() || "MOP" == orderObject->channel || "ORS" == orderObject->channel){
ui->detailBtn2->hide();
}
//星巴克:电商-MOP 需要显示退单按钮(便于 当日退 / 跨日退);
if( "EC-MOP" == orderObject->channel ){
ui->detailBtn2->show();
}
//订单入机失败 [销售单 / 退货单] 需要显示 重新录单 按钮 方便店员再次触发录单;
if(OrderObject::SimExceptSale == orderObject->orderStatus || OrderObject::SimExceptRefund == orderObject->orderStatus) {
......
......@@ -7,8 +7,8 @@ IDI_ICON ICON DISCARDABLE "logo.ico"
#endif
VS_VERSION_INFO VERSIONINFO
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
FILEVERSION 2,2021,6,28
PRODUCTVERSION 2,2021,6,28
FILEVERSION 2,2021,7,12
PRODUCTVERSION 2,2021,7,12
//*************************************************************************//
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
......@@ -31,8 +31,8 @@ VS_VERSION_INFO VERSIONINFO
VALUE "OriginalFilename", "fmTakeout.exe"
VALUE "ProductName", "Delivery Order Plugin"
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
VALUE "ProductVersion", "2.2021.6.28"
VALUE "FileVersion", "2.2021.6.28"
VALUE "ProductVersion", "2.2021.7.12"
VALUE "FileVersion", "2.2021.7.12"
//*************************************************************************//
END
END
......
......@@ -41,6 +41,7 @@ MainForm::MainForm(QWidget *parent) :
connect(&m_timeTimer, &QTimer::timeout, this, &MainForm::onSetCurrentTime);
connect(this, &MainForm::processOrder, &FlowControl::GetInstance(), &FlowControl::onProcessOrder);
connect(this, &MainForm::getOrderDetails, &FlowControl::GetInstance(), &FlowControl::onGetOrderDetails);
connect(this, &MainForm::getEcMopOrderDetails, &FlowControl::GetInstance(), &FlowControl::onGetEcMopOrderDetails);
connect(this, &MainForm::PullDishes, &FlowControl::GetInstance(), &FlowControl::onPullDishes);
connect(this, &MainForm::GetBusinessStatus, &FlowControl::GetInstance(), &FlowControl::onGetBusinessStatus);
connect(this, &MainForm::GetOMSAllOrders, &FlowControl::GetInstance(), &FlowControl::onGetOMSAllOrders);
......@@ -85,7 +86,6 @@ void MainForm::MyShow()
// 考虑到坐标问题放到这里构建
m_alertForm = new AlertForm(this);
m_settingForm = new SettingForm(this);
m_detailForm = new DetailForm(this);
......@@ -96,6 +96,7 @@ void MainForm::MyShow()
connect(m_padForm, &PadForm::numClicked, this, &MainForm::onNumClicked);
connect(m_padForm, &PadForm::numDelete, this, &MainForm::onNumDelete);
connect(m_padForm, &PadForm::numClear, ui->mainEdtSearch, &ClickedLineEdit::clear);
connect(m_padForm, &PadForm::getEcMopOrder, this, &MainForm::onDisplayEcMopOrder);
m_resultForm = new QListWidget(this);
m_resultForm->setObjectName("mainListWdg0");
......@@ -657,6 +658,15 @@ void MainForm::onNumDelete()
ui->mainEdtSearch->setText(text.left(text.length()-1));
}
void MainForm::onDisplayEcMopOrder()
{
QString orderId = ui->mainEdtSearch->text();
ui->mainEdtSearch->clear();
QLOG_INFO() << QString("[<<<<---MainForm::onDisplayEcMopOrder: orderId:%1--->>>>]").arg(orderId);
onShowAlert(AlertForm::BRIEF_TIPS, QString::fromLocal8Bit("获取 EC-MOP 订单数据......"));
emit getEcMopOrderDetails(orderId, "EC-MOP");
}
void MainForm::onSearchResultItemClicked(QListWidgetItem *item)
{
ui->mainEdtSearch->clear();
......
......@@ -126,6 +126,12 @@ signals:
* */
void getOrderDetails(const QString& orderId);
/* 功能:获取 EC-MOP 订单详情
* 参数:NULL
* 返回:NULL
* */
void getEcMopOrderDetails(const QString& orderId, const QString& channel);
/* 功能:开启流程
* 参数:NULL
* 返回:NULL
......@@ -181,16 +187,19 @@ private slots:
* 返回:NULL
* */
void onSetCurrentTime();
/* 功能:Tab页按钮点击对应动作
* 参数:NULL
* 返回:NULL
* */
void onMainTabBtnClicked();
/* 功能:Tab页按钮点击对应动作
* 参数:NULL
* 返回:NULL
* */
void onMainProcBtnClicked();
/* 功能:设置按钮对应动作
* 参数:NULL
* 返回:NULL
......@@ -208,31 +217,43 @@ private slots:
* 返回:NULL
* */
void on_mainBtnUp_clicked();
/* 功能:下翻按钮对应动作
* 参数:NULL
* 返回:NULL
* */
void on_mainBtnDown_clicked();
/* 功能:点击订单对应动作
* 参数:NULL
* 返回:NULL
* */
void onMainTableItemClicked(QTableWidgetItem *item);
/* 功能:点击搜索对应动作
* 参数:NULL
* 返回:NULL
* */
void on_mainEdtSearch_clicked();
/* 功能:键盘数字点击处理
* 参数:NULL
* 返回:NULL
* */
void onNumClicked(const QString& num);
/* 功能:键盘数字删除处理
* 参数:NULL
* 返回:NULL
* */
void onNumDelete();
/* 功能:键盘获取EC-MOP订单详情处理
* 参数:NULL
* 返回:NULL
* */
void onDisplayEcMopOrder();
/* 功能:点击搜索结果订单对应动作
* 参数:NULL
* 返回:NULL
......
......@@ -26,8 +26,15 @@ void PadForm::on_padBtnDel_clicked()
emit numDelete();
}
void PadForm::on_padBtnClearn_clicked()
void PadForm::on_padBtnClose_clicked()
{
emit numClear();
hide();
}
void PadForm::on_padBtnEcMop_clicked()
{
hide();
emit getEcMopOrder();
}
......@@ -29,16 +29,23 @@ private slots:
* 返回:NULL
* */
void on_padBtnDel_clicked();
/* 功能:清空按钮对应操作
/* 功能:清空/关闭 按钮对应操作
* 参数:NULL
* 返回:NULL
* */
void on_padBtnClearn_clicked();
void on_padBtnClose_clicked();
/* 功能: 电商-MOP 按钮 触发获取订单详情数据接口获取成功后,直接跳转到 订单详情界面; 获取失败后,直接弹窗提示;
* 参数:NULL
* 返回:NULL
* */
void on_padBtnEcMop_clicked();
signals:
void numClicked(const QString& num);
void numDelete();
void numClear();
void getEcMopOrder();
};
#endif // PADFORM_H
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>240</width>
<height>300</height>
<width>269</width>
<height>316</height>
</rect>
</property>
<property name="windowTitle">
......@@ -19,7 +19,7 @@
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<item row="1" column="0">
<widget class="QPushButton" name="padBtn1">
<property name="minimumSize">
<size>
......@@ -44,7 +44,7 @@
</property>
</widget>
</item>
<item row="0" column="1">
<item row="1" column="1">
<widget class="QPushButton" name="padBtn2">
<property name="minimumSize">
<size>
......@@ -69,7 +69,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QPushButton" name="padBtn4">
<property name="minimumSize">
<size>
......@@ -94,7 +94,7 @@
</property>
</widget>
</item>
<item row="0" column="2">
<item row="1" column="2">
<widget class="QPushButton" name="padBtn3">
<property name="minimumSize">
<size>
......@@ -119,8 +119,8 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="padBtn5">
<item row="3" column="1">
<widget class="QPushButton" name="padBtn8">
<property name="minimumSize">
<size>
<width>59</width>
......@@ -137,14 +137,14 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>5</string>
<string>8</string>
</property>
<property name="num" stdset="0">
<string>5</string>
<string>8</string>
</property>
</widget>
</item>
<item row="1" column="2">
<item row="2" column="2">
<widget class="QPushButton" name="padBtn6">
<property name="minimumSize">
<size>
......@@ -169,8 +169,8 @@
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="padBtn9">
<item row="3" column="0">
<widget class="QPushButton" name="padBtn7">
<property name="minimumSize">
<size>
<width>59</width>
......@@ -187,15 +187,15 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>9</string>
<string>7</string>
</property>
<property name="num" stdset="0">
<string>9</string>
<string>7</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="padBtn8">
<item row="4" column="2">
<widget class="QPushButton" name="padBtnClose">
<property name="minimumSize">
<size>
<width>59</width>
......@@ -212,15 +212,37 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>8</string>
<string>关闭</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="padBtn0">
<property name="minimumSize">
<size>
<width>59</width>
<height>51</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>59</width>
<height>51</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>0</string>
</property>
<property name="num" stdset="0">
<string>8</string>
<string>0</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="padBtn7">
<item row="2" column="1">
<widget class="QPushButton" name="padBtn5">
<property name="minimumSize">
<size>
<width>59</width>
......@@ -237,14 +259,14 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>7</string>
<string>5</string>
</property>
<property name="num" stdset="0">
<string>7</string>
<string>5</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QPushButton" name="padBtnDel">
<property name="minimumSize">
<size>
......@@ -266,8 +288,8 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="padBtn0">
<item row="3" column="2">
<widget class="QPushButton" name="padBtn9">
<property name="minimumSize">
<size>
<width>59</width>
......@@ -284,32 +306,38 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>0</string>
<string>9</string>
</property>
<property name="num" stdset="0">
<string>0</string>
<string>9</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="padBtnClearn">
<item row="0" column="0">
<widget class="QPushButton" name="padBtnEcMop">
<property name="minimumSize">
<size>
<width>59</width>
<height>51</height>
<width>70</width>
<height>60</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>59</width>
<height>51</height>
<width>64</width>
<height>60</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>关闭</string>
<string>电商MOP</string>
</property>
</widget>
</item>
......
......@@ -37,7 +37,7 @@
//#define APP_VERSION "2.2021.2.26"
//#define APP_VERSION "2.2021.4.19"
//#define APP_VERSION "2.2021.5.11"
#define APP_VERSION "2.2021.6.28"
#define APP_VERSION "2.2021.7.12"
//修正版本号时,切记修正 FmTakeout.rc 中的版本号
......@@ -144,6 +144,7 @@
#define JSON_REASONCODE "reason_code"
#define JSON_SYNCTIME "syncTime"
#define JSON_SHOPCODE "storeId"
#define JSON_STORE_ID "storeId"
#define JSON_POSIPADDRESS "posAddress"
#define JSON_CHANNEL "channel"
#define JSON_BUSINESSSTATUS "business_status"
......
......@@ -505,13 +505,13 @@ QTabBar QToolButton::left-arrow:disabled {
color: #ffffff;
border-image: url(:numBtn_press.png);
}
#padBtnClearn
#padBtnClose
{
font: 11pt "微软雅黑";
color: rgb(98, 98, 98);
border-image: url(:numBtn_normal.png);
}
#padBtnClearn:pressed
#padBtnClose:pressed
{
color: #ffffff;
border-image: url(:numBtn_press.png);
......@@ -526,6 +526,17 @@ QTabBar QToolButton::left-arrow:disabled {
border-image: url(:numBtn_press.png);
image: url(:delBtn_press.png);
}
#padBtnEcMop
{
font: 11pt "微软雅黑";
color: rgb(98, 98, 98);
border-image: url(:numBtn_normal.png);
}
#padBtnEcMop:pressed
{
color: #ffffff;
border-image: url(:numBtn_press.png);
}
/*---------------------------------padForm[ end ]---------------------------------*/
/*---------------------------------alertForm[begin]---------------------------------*/
......
No preview for this file type
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