Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FmTakeaway
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
shangshang.dai
FmTakeaway
Commits
aa0d27e8
Commit
aa0d27e8
authored
Mar 17, 2017
by
ss.dai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
入账问题修复
parent
edf54080
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
15 deletions
+61
-15
fmPlugin/fmPlugin.cpp
+20
-7
fmTakeaway/Control/flowControl.cpp
+38
-6
fmTakeaway/Model/productObject.h
+2
-1
takeaway.pro.user
+1
-1
No files found.
fmPlugin/fmPlugin.cpp
View file @
aa0d27e8
...
...
@@ -391,13 +391,12 @@ QByteArray FmPlugin::_GetOrderEntryData(const OrderObject *orderObject)
rObj
.
insert
(
"uuid"
,
orderObject
->
order_id
);
rObj
.
insert
(
"senderCode"
,
m_storeId
);
// rObj.insert("senderCode", "31310033");
rObj
.
insert
(
"senderWrh"
,
"-"
);
rObj
.
insert
(
"receiverCode"
,
m_recCodeMap
.
value
(
orderObject
->
channel
));
rObj
.
insert
(
"contactor"
,
orderObject
->
customer
);
rObj
.
insert
(
"phoneNumber"
,
orderObject
->
phone
);
rObj
.
insert
(
"deliverAddress"
,
orderObject
->
address
);
rObj
.
insert
(
"remark"
,
"非码外卖"
);
rObj
.
insert
(
"remark"
,
_Penny2Dollar
(
orderObject
->
service_fee
)
);
rObj
.
insert
(
"ocrDate"
,
QDateTime
::
fromTime_t
(
orderObject
->
create_time
).
toString
(
"yyyy-MM-ddThh:mm:ss.zzz+0800"
));
rObj
.
insert
(
"filler"
,
"*"
);
rObj
.
insert
(
"seller"
,
"*"
);
...
...
@@ -412,14 +411,19 @@ QByteArray FmPlugin::_GetOrderEntryData(const OrderObject *orderObject)
foreach
(
ProductObject
*
cpObj
,
pObj
->
sub_products
)
{
float
ratio
=
(
float
)
cpObj
->
unit_ratio
/
100
;
// 该商品应收的钱
float
ys_fee
=
_Penny2Dollar
(
cpObj
->
price
*
cpObj
->
productAmount
);
// 该商品实际收到的钱
float
ss_fee
=
ys_fee
*
(
1
-
(
float
)
orderObject
->
dis_shop_fee
/
orderObject
->
product_fee
);
QJsonObject
cObj
;
cObj
.
insert
(
"skuId"
,
cpObj
->
pid
);
cObj
.
insert
(
"qty"
,
cpObj
->
productAmount
*
ratio
);
cObj
.
insert
(
"price"
,
_Penny2Dollar
(
cpObj
->
price
)
);
cObj
.
insert
(
"price"
,
ss_fee
/
ratio
);
cObj
.
insert
(
"total"
,
""
);
cObj
.
insert
(
"freight"
,
""
);
cObj
.
insert
(
"payAmount"
,
""
);
cObj
.
insert
(
"unitPrice"
,
""
);
cObj
.
insert
(
"unitPrice"
,
_Penny2Dollar
(
pObj
->
price
)
/
ratio
);
cObj
.
insert
(
"priceAmount"
,
""
);
cObj
.
insert
(
"buyAmount"
,
""
);
cObj
.
insert
(
"businessDiscount"
,
""
);
...
...
@@ -433,13 +437,21 @@ QByteArray FmPlugin::_GetOrderEntryData(const OrderObject *orderObject)
{
float
ratio
=
(
float
)
pObj
->
unit_ratio
/
100
;
QJsonObject
cObj
;
// 该商品应收的钱
float
ys_fee
=
_Penny2Dollar
(
pObj
->
price
*
pObj
->
productAmount
);
// 该商品实际收到的钱
float
ss_fee
=
ys_fee
*
(
1
-
(
float
)
orderObject
->
dis_shop_fee
/
orderObject
->
product_fee
);
cObj
.
insert
(
"skuId"
,
pObj
->
pid
);
cObj
.
insert
(
"qty"
,
pObj
->
productAmount
*
ratio
);
cObj
.
insert
(
"price"
,
_Penny2Dollar
(
pObj
->
price
)
);
cObj
.
insert
(
"price"
,
ss_fee
/
ratio
);
cObj
.
insert
(
"total"
,
""
);
cObj
.
insert
(
"freight"
,
""
);
cObj
.
insert
(
"payAmount"
,
""
);
cObj
.
insert
(
"unitPrice"
,
""
);
cObj
.
insert
(
"unitPrice"
,
_Penny2Dollar
(
pObj
->
price
)
/
ratio
);
cObj
.
insert
(
"priceAmount"
,
""
);
cObj
.
insert
(
"buyAmount"
,
""
);
cObj
.
insert
(
"businessDiscount"
,
""
);
...
...
@@ -460,6 +472,7 @@ QByteArray FmPlugin::_GetOrderEntryData(const OrderObject *orderObject)
rObj
.
insert
(
"products"
,
products
);
rObj
.
insert
(
"pays"
,
pays
);
qDebug
()
<<
rObj
;
qDebug
()
<<
"销售单数据: "
<<
rObj
;
return
QJsonDocument
(
rObj
).
toJson
(
QJsonDocument
::
Compact
);
}
fmTakeaway/Control/flowControl.cpp
View file @
aa0d27e8
...
...
@@ -192,7 +192,7 @@ bool FlowControl::_PullOrder()
//int oldDeliveryStatus = orderObject->delivery_status;
int
oldStatus
=
orderObject
->
status
;
orderObject
->
FromJson
(
jsonObject
);
QLOG_INFO
()
<<
QString
(
"old order[%1:%2].[data:%3]"
)
QLOG_INFO
()
<<
QString
(
"
\r\n\r\n
old order[%1:%2].[data:%3]"
)
.
arg
(
orderObject
->
order_id
,
orderObject
->
status_desc
)
.
arg
(
_GetJsonStr
(
jsonObject
));
if
(
oldStatus
!=
orderObject
->
status
)
...
...
@@ -209,13 +209,45 @@ bool FlowControl::_PullOrder()
||
orderObject
->
status
==
6
||
orderObject
->
status
==
200
)
{
QString
error
;
if
(
FmPlugin
::
GetInstance
().
DoOrderEntry
(
orderObject
,
""
,
""
,
""
,
""
,
error
)
)
bool
bWrite
=
true
;
foreach
(
ProductObject
*
pro
,
orderObject
->
proList
)
{
QLOG_INFO
()
<<
QString
(
"_PullOrder DoOrderEntry successful"
)
<<
error
;
}
else
if
(
pro
->
sub_products
.
isEmpty
())
{
if
(
pro
->
unit_ratio
<
0
)
{
bWrite
=
false
;
break
;
}
}
else
{
foreach
(
ProductObject
*
cpro
,
pro
->
sub_products
)
{
if
(
cpro
->
unit_ratio
<
0
)
{
bWrite
=
false
;
break
;
}
}
}
}
QString
error
;
if
(
bWrite
&&
(
orderObject
->
channel
.
compare
(
"jdwm"
)))
{
QLOG_INFO
()
<<
QString
(
"_PullOrder DoOrderEntry failed %1"
).
arg
(
error
);
//FOR TEST
if
(
orderObject
->
order_id
==
"3543791065"
)
{
orderObject
->
order_id
=
"3543791066"
;
}
//FOR TEST
if
(
FmPlugin
::
GetInstance
().
DoOrderEntry
(
orderObject
,
""
,
""
,
""
,
""
,
error
))
{
QLOG_INFO
()
<<
QString
(
"_PullOrder DoOrderEntry successful"
)
<<
error
;
}
else
{
QLOG_INFO
()
<<
QString
(
"_PullOrder DoOrderEntry failed %1"
).
arg
(
error
);
}
}
}
m_timestamp
=
orderObject
->
timestamp
;
...
...
fmTakeaway/Model/productObject.h
View file @
aa0d27e8
...
...
@@ -8,7 +8,8 @@ class ProductObject : public BaseObject
Q_OBJECT
public
:
ProductObject
(
QObject
*
parent
=
0
)
:
BaseObject
(
parent
){}
:
BaseObject
(
parent
),
unit_ratio
(
-
1
){}
/* 功能:从Json对象初获取数据
* 参数:[1]JSon对象
...
...
takeaway.pro.user
View file @
aa0d27e8
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.0.0, 2017-03-1
4T17:30:08
. -->
<!-- Written by QtCreator 4.0.0, 2017-03-1
7T09:56:14
. -->
<qtcreator>
<data>
<variable>
EnvironmentId
</variable>
...
...
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