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
3c222875
Commit
3c222875
authored
Mar 08, 2017
by
ss.dai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
a07fe37d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
8 deletions
+26
-8
fmPlugin/fmPlugin.cpp
+11
-8
fmTakeaway/Model/orderObject.cpp
+10
-0
fmTakeaway/Model/orderObject.h
+5
-0
No files found.
fmPlugin/fmPlugin.cpp
View file @
3c222875
...
...
@@ -107,6 +107,7 @@ bool FmPlugin::GetOnDutyCashiers(QList<CashierObject> &cashiersList, QString &er
bool
FmPlugin
::
DoOrderEntry
(
const
OrderObject
*
orderObject
,
QString
&
error
)
{
_GetOrderStr
(
orderObject
);
QString
dirPath
=
QString
(
"%1/orders"
).
arg
(
QCoreApplication
::
applicationDirPath
());
QDir
dir
;
dir
.
mkdir
(
dirPath
);
...
...
@@ -347,9 +348,10 @@ QString FmPlugin::_GetOrderStr( const OrderObject *orderObject)
rObj
.
insert
(
"XsDate"
,
QDateTime
::
fromTime_t
(
orderObject
->
create_time
).
toString
(
"yyyy-MM-dd hh:mm:ss"
));
rObj
.
insert
(
"OprtID"
,
1
);
rObj
.
insert
(
"OprtCode"
,
"001"
);
rObj
.
insert
(
"YsTotal"
,
YsTotal
);
rObj
.
insert
(
"YsTotal"
,
QString
::
number
(
YsTotal
,
'f'
,
2
)
);
float
sca
=
(
orderObject
->
total_fee
-
orderObject
->
send_fee
-
orderObject
->
service_fee
-
orderObject
->
dis_shop_fee
)
/
orderObject
->
total_fee
;
float
sca
=
(
float
)(
orderObject
->
total_fee
-
orderObject
->
send_fee
-
orderObject
->
service_fee
-
orderObject
->
dis_shop_fee
)
/
orderObject
->
product_fee
;
float
SsTotal
=
0
;
QJsonArray
products
;
for
(
int
i
=
0
;
i
<
orderObject
->
proList
.
count
();
i
++
)
...
...
@@ -358,16 +360,17 @@ QString FmPlugin::_GetOrderStr( const OrderObject *orderObject)
tObj
.
insert
(
"LnNo"
,
i
+
1
);
tObj
.
insert
(
"PluCode"
,
orderObject
->
proList
.
at
(
i
)
->
pid
);
tObj
.
insert
(
"PluName"
,
orderObject
->
proList
.
at
(
i
)
->
name
);
tObj
.
insert
(
"Price"
,
_Penny2Dollar
(
orderObject
->
proList
.
at
(
i
)
->
price
)
.
toFloat
()
);
tObj
.
insert
(
"XsCount"
,
orderObject
->
proList
.
at
(
i
)
->
productAmount
);
tObj
.
insert
(
"Price"
,
_Penny2Dollar
(
orderObject
->
proList
.
at
(
i
)
->
price
));
tObj
.
insert
(
"XsCount"
,
QString
::
number
(
orderObject
->
proList
.
at
(
i
)
->
productAmount
,
'f'
,
2
)
);
if
((
i
+
1
)
==
orderObject
->
proList
.
count
())
{
tObj
.
insert
(
"YsTotal"
,
YsTotal
-
SsTotal
);
tObj
.
insert
(
"YsTotal"
,
QString
::
number
(
YsTotal
-
SsTotal
,
'f'
,
2
)
);
}
else
{
float
Ys
=
_Penny2Dollar
(
orderObject
->
proList
.
at
(
i
)
->
price
*
orderObject
->
proList
.
at
(
i
)
->
productAmount
).
toFloat
()
*
sca
;
tObj
.
insert
(
"YsTotal"
,
Ys
);
float
Ys
=
_Penny2Dollar
((
orderObject
->
proList
.
at
(
i
)
->
price
*
orderObject
->
proList
.
at
(
i
)
->
productAmount
)
*
sca
).
toFloat
();
tObj
.
insert
(
"YsTotal"
,
QString
::
number
(
Ys
,
'f'
,
2
));
SsTotal
+=
Ys
;
}
...
...
@@ -381,7 +384,7 @@ QString FmPlugin::_GetOrderStr( const OrderObject *orderObject)
tObj
.
insert
(
"SerialNo"
,
1
);
tObj
.
insert
(
"ZfCode"
,
"001"
);
tObj
.
insert
(
"ZfName"
,
"非码外卖"
);
tObj
.
insert
(
"ZfTotal"
,
YsTotal
);
tObj
.
insert
(
"ZfTotal"
,
QString
::
number
(
YsTotal
,
'f'
,
2
)
);
tObj
.
insert
(
"TradeNo"
,
""
);
payDetails
.
insert
(
0
,
tObj
);
rObj
.
insert
(
"PayDetails"
,
payDetails
);
...
...
fmTakeaway/Model/orderObject.cpp
View file @
3c222875
...
...
@@ -19,6 +19,16 @@ void OrderObject::FromJson(const QJsonObject &json)
return
;
}
int
OrderObject
::
getproduct_fee
()
const
{
return
product_fee
;
}
void
OrderObject
::
setproduct_fee
(
const
int
&
v
)
{
product_fee
=
v
;
}
int
OrderObject
::
getdis_shop_fee
()
const
{
return
dis_shop_fee
;
...
...
fmTakeaway/Model/orderObject.h
View file @
3c222875
...
...
@@ -55,6 +55,8 @@ public:
Q_PROPERTY
(
int
dis_shop_fee
READ
getdis_shop_fee
WRITE
setdis_shop_fee
)
Q_PROPERTY
(
int
service_fee
READ
getservice_fee
WRITE
setservice_fee
)
Q_PROPERTY
(
int
product_fee
READ
getproduct_fee
WRITE
setproduct_fee
)
QString
address
;
//地址
QString
channel
;
//渠道
QString
channelName
;
//渠道名称
...
...
@@ -94,8 +96,11 @@ public:
int
dis_shop_fee
;
//商户承担的优惠金额
int
service_fee
;
//外卖平台服务费
int
product_fee
;
//商品总价
protected
:
int
getproduct_fee
()
const
;
void
setproduct_fee
(
const
int
&
v
);
int
getdis_shop_fee
()
const
;
void
setdis_shop_fee
(
const
int
&
v
);
int
getservice_fee
()
const
;
...
...
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