Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
takeout_sbk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yunpeng.song
takeout_sbk
Commits
450964c2
Commit
450964c2
authored
Jan 10, 2022
by
wuyang.zou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test Aliy Double Live, Push Order CallBackUrl Successed
Version: 2.2022.1.18
parent
d44b2416
Pipeline
#39025
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
11 deletions
+34
-11
fmTakeout/Control/flowControl.cpp
+34
-11
No files found.
fmTakeout/Control/flowControl.cpp
View file @
450964c2
...
...
@@ -327,9 +327,9 @@ void FlowControl::_ClickToNotifySimPullOrder()
{
m_notifySimPullTimer
->
start
(
1000
*
7
);
QLOG_INFO
()
<<
QString
::
fromLocal8Bit
(
"[<<<<---FM外卖插件通知 Simphony 获取订单数据--->>>>]"
);
// 录单防Block告警定时器开始计时( 阀值: 默认
8
分钟);
// 录单防Block告警定时器开始计时( 阀值: 默认
10
分钟);
if
(
!
m_blockInputPosWarnningTimer
->
isActive
()
)
{
m_blockInputPosWarnningTimer
->
start
(
1000
*
60
*
5
);
m_blockInputPosWarnningTimer
->
start
(
1000
*
60
*
10
);
}
QLOG_INFO
()
<<
QString
::
fromLocal8Bit
(
"[<<<<---触发按钮点击事件: Block Warnning Pending: %1--->>>>>]"
).
arg
(
m_blockInputPosWarnningTimer
->
remainingTime
()
/
1000
);
//定时器触发的点击事件,不可避免;
...
...
@@ -346,11 +346,11 @@ void FlowControl::_ClickToNotifySimPullOrder()
void
FlowControl
::
_BlockInputPosWarnning
()
{
int
blockInputSize
=
m_simValidOrdersList
.
size
();
QString
orderId
=
m_simValidOrdersList
.
first
();
QLOG_INFO
()
<<
QString
(
"[<<<<---_BlockInputPosWarnning: m_simValidOrdersList size: %1 And FirstOne: %2 --->>>>>]"
).
arg
(
blockInputSize
).
arg
(
orderId
);
QString
orderChannel
=
m_FmOrdersMap
.
value
(
orderId
)
?
m_FmOrdersMap
.
value
(
orderId
)
->
channel
:
""
;
QString
orderRequestType
=
"3"
;
QString
storeDatetimeOrderId
=
m_storeId
+
"_"
+
QDateTime
::
currentDateTime
().
toString
(
"MMddhhmmss"
);
if
(
m_FmOrdersMap
.
value
(
orderId
)
)
{
m_FmOrdersMap
.
value
(
orderId
)
->
orderStatus
!=
6
?
orderRequestType
=
"3"
:
orderRequestType
=
"6"
;
...
...
@@ -359,7 +359,7 @@ void FlowControl::_BlockInputPosWarnning() {
QString
errorStorageOrderMsg
=
QString
(
"BlockInputPosWarnning: StoreId: %1 Cashier: %2 BlockOrderId: %3 BlockSize: %4"
)
.
arg
(
m_storeId
).
arg
(
m_cashierName
).
arg
(
orderId
).
arg
(
blockInputSize
);
_AddOrUpdateReportOmsList
(
o
rderId
,
orderChannel
,
orderRequestType
,
"2"
,
""
,
errorStorageOrderMsg
,
QString
(
"1109"
)
);
_AddOrUpdateReportOmsList
(
storeDatetimeO
rderId
,
orderChannel
,
orderRequestType
,
"2"
,
""
,
errorStorageOrderMsg
,
QString
(
"1109"
)
);
}
...
...
@@ -800,6 +800,7 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
orderObject
->
deliveryProvider
=
0
;
orderObject
->
deliveryType
=
0
;
orderObject
->
isGiftitForward
=
0
;
orderObject
->
callBackUrl
=
""
;
orderObject
->
FromJson
(
jsonObject
);
orderObject
->
pushOrderType
=
0
;
...
...
@@ -816,7 +817,6 @@ void FlowControl::_OrderAnalysis(const QJsonObject& jsonObject)
orderObject
->
dataBaseIsORSPushInt
=
0
;
orderObject
->
dataBaseIsORSCancleInt
=
0
;
orderObject
->
dataBasePosOrderCheckNo
=
""
;
orderObject
->
callBackUrl
=
""
;
//插件程序内存中没有此订单时需要从数据库中获取该订单标志数据;同时在接受到退单情况时,也需要从数据库中重新获取(防止内存中标志数据未更新[入机后未更新]);
bool
retGetDbOrderAllFlag
=
SimProcOrderDB
::
getInstance
().
getDbOrderAllFlag
(
orderObject
->
id
,
orderObject
->
dataBaseIsOrderExistInt
,
orderObject
->
dataBaseIsPushInt
,
...
...
@@ -1348,8 +1348,8 @@ bool FlowControl::_PullOrderDetail(const QString& orderId, const QString& channe
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
;
QLOG_INFO
()
<<
QString
(
"[<<<<---Pull Order Detail Finsh--->>>>][result:%1][msg:%2]"
)
.
arg
(
result
).
arg
(
error
)
<<
recvJson
;
if
(
!
result
)
{
emit
setNetStatus
(
QString
::
fromLocal8Bit
(
"<font color='#ff0000'>网络不稳定,正在重试</font>"
));
}
else
{
...
...
@@ -1366,7 +1366,6 @@ bool FlowControl::_PullOrderDetail(const QString& orderId, const QString& channe
if
(
!
order
.
contains
(
"callBackUrl"
)
)
{
order
.
insert
(
"callBackUrl"
,
callBackUrl
);
}
_OrderAnalysis
(
order
);
}
}
...
...
@@ -1854,7 +1853,7 @@ void FlowControl::_AddOrUpdateReportOmsList(const QString &orderId, const QStri
repOMSRecordOrder
->
type
=
repType
;
repOMSRecordOrder
->
status
=
status
;
repOMSRecordOrder
->
opUser
=
m_cashierName
;
repOMSRecordOrder
->
recordDate
=
QDateTime
::
currentDateTime
().
toString
(
"yyyy-MM-dd hh:mm:ss"
);
;
repOMSRecordOrder
->
recordDate
=
QDateTime
::
currentDateTime
().
toString
(
"yyyy-MM-dd hh:mm:ss"
);
repOMSRecordOrder
->
storeId
=
m_storeId
;
repOMSRecordOrder
->
remark
=
error
;
repOMSRecordOrder
->
failCode
=
errorCode
;
...
...
@@ -2065,8 +2064,6 @@ void FlowControl::_CrondClearExpireOrder()
qint64
days
=
createDate
.
daysTo
(
currentDate
);
//QLOG_INFO()<<QString::fromLocal8Bit("[<<<<---_CrondClearExpireOrder: ClearExpireOrder: 相差多少秒:%1--->>>>]").arg(seconds); //--按秒数来验证ok--
QLOG_INFO
()
<<
QString
::
fromLocal8Bit
(
"[<<<<---_CrondClearExpireOrder: ClearExpireOrder: 相差多少天:%1--->>>>]"
).
arg
(
days
);
//创建订单时间,超过当前时间 三十分就进行清理;
//if(seconds>=60*5) //--按秒数来验证ok--
if
(
days
>=
1
)
{
QLOG_INFO
()
<<
QString
(
"[<<<<---_CrondClearExpireOrder: ClearExpireOrder: Emit Signal:Clear Order orderID:%1--->>>>]"
).
arg
(
order
->
id
);
...
...
@@ -2077,6 +2074,32 @@ void FlowControl::_CrondClearExpireOrder()
}
}
// 清理汇报入机结果的列表;
if
(
!
m_orderRecordRepOMSList
.
isEmpty
()
)
{
bool
btryLock
=
m_RepOMSRecordOrderMutex
.
tryLock
(
VALUE_TRYLOCKNETTIMEOUT
);
if
(
!
btryLock
)
{
//加锁失败后,直接return;
QLOG_INFO
()
<<
"[<<<<----FlowControl::_ReportOMSRecordOrderInfo tryLock Failed ---->>>>>]"
;
}
else
{
RepOMSRecordOrderInfo
*
RepOMSRecOrderIn
=
NULL
;
foreach
(
RepOMSRecOrderIn
,
m_orderRecordRepOMSList
)
{
if
(
RepOMSRecOrderIn
)
{
QDate
recordDate
=
QDate
::
fromString
(
(
RepOMSRecOrderIn
->
recordDate
).
mid
(
0
,
10
),
"yyyy-MM-dd"
);
qint64
recordDays
=
recordDate
.
daysTo
(
currentDate
);
QLOG_INFO
()
<<
QString
::
fromLocal8Bit
(
"[<<<<---_CrondClearExpireOrder: ClearExpireRecordOrderInfo: 相差多少天:%1--->>>>]"
).
arg
(
recordDays
);
if
(
recordDays
>=
1
)
{
m_orderRecordRepOMSList
.
removeOne
(
RepOMSRecOrderIn
);
delete
RepOMSRecOrderIn
;
RepOMSRecOrderIn
=
NULL
;
}
}
else
{
m_orderRecordRepOMSList
.
removeOne
(
RepOMSRecOrderIn
);
}
}
m_RepOMSRecordOrderMutex
.
unlock
();
}
}
SimProcOrderDB
::
getInstance
().
deleteOrderRecord
(
QDate
::
currentDate
().
addDays
(
-
45
).
toString
(
"yyyyMMdd"
));
PrintSumBillPosDB
::
getInstance
().
deleteSumBillRecord
(
QDate
::
currentDate
().
addDays
(
-
7
).
toString
(
"yyyy-MM-dd"
)
);
PrintCupStickPosDB
::
getInstance
().
deleteProductRecord
(
QDate
::
currentDate
().
addDays
(
-
7
).
toString
(
"yyyy-MM-dd"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment