Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
蒋勇
zhichan
Commits
2f806950
Commit
2f806950
authored
Apr 21, 2020
by
王昆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xgg-saas-merchant' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-saas-merchant
parents
98ffcca1
39d502fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
xgg-saas-merchant/app/base/controller/impl/saas/invoiceCtl.js
+13
-3
xgg-saas-merchant/app/base/service/impl/saas/orderSve.js
+10
-0
No files found.
xgg-saas-merchant/app/base/controller/impl/saas/invoiceCtl.js
View file @
2f806950
...
@@ -294,22 +294,28 @@ class InvoiceCtl extends CtlBase {
...
@@ -294,22 +294,28 @@ class InvoiceCtl extends CtlBase {
let
orders
=
await
this
.
orderSve
.
byIds
({
let
orders
=
await
this
.
orderSve
.
byIds
({
ids
:
params
.
data_ids
,
ids
:
params
.
data_ids
,
saas_merchant_id
:
params
.
saas_merchant_id
,
saas_merchant_id
:
params
.
saas_merchant_id
,
attrs
:
"id"
,
attrs
:
"id
,price
"
,
handle_status
:
[
'20'
,
'30'
],
handle_status
:
[
'20'
,
'30'
],
unInvoice
:
true
,
unInvoice
:
true
,
})
||
[];
})
||
[];
if
(
orders
.
data
.
length
!=
params
.
data_ids
.
length
)
{
if
(
orders
.
data
.
length
!=
params
.
data_ids
.
length
)
{
return
system
.
getResult
(
null
,
"订单数据选择有误,请重新搜索后选择"
);
return
system
.
getResult
(
null
,
"订单数据选择有误,请重新搜索后选择"
);
}
}
let
invoice_amount
=
0
;
for
(
let
item
of
orders
.
data
){
invoice_amount
=
invoice_amount
+
Number
(
item
.
price
||
0
);
}
let
info
=
await
this
.
merchantSve
.
signInfo
({
id
:
params
.
saas_merchant_id
})
||
{};
let
info
=
await
this
.
merchantSve
.
signInfo
({
id
:
params
.
saas_merchant_id
})
||
{};
// service_tax
info
=
info
.
data
||
{};
info
=
info
.
data
||
{};
if
(
!
info
.
main
_trade
)
{
if
(
!
info
.
main
)
{
return
system
.
getResult
(
null
,
"商户未设置转账交易主体,请联系平台进行设置、"
);
return
system
.
getResult
(
null
,
"商户未设置转账交易主体,请联系平台进行设置、"
);
}
}
let
main
=
info
.
main
_trade
||
{};
let
main
=
info
.
main
||
{};
let
batch_no
=
await
this
.
redisClient
.
genrateId
(
"invoice_batch_no"
);
let
batch_no
=
await
this
.
redisClient
.
genrateId
(
"invoice_batch_no"
);
let
apply_no
=
batch_no
;
let
apply_no
=
batch_no
;
let
service_tax
=
parseFloat
((
Number
(
invoice_amount
)
*
Number
(
info
.
invoice_service_rate
)
/
100
).
toFixed
(
2
));
let
data
=
{
let
data
=
{
saas_id
:
params
.
saas_id
,
saas_id
:
params
.
saas_id
,
saas_merchant_id
:
params
.
saas_merchant_id
,
saas_merchant_id
:
params
.
saas_merchant_id
,
...
@@ -338,6 +344,10 @@ class InvoiceCtl extends CtlBase {
...
@@ -338,6 +344,10 @@ class InvoiceCtl extends CtlBase {
mail_addr
:
this
.
trim
(
addr
.
mail_addr
),
mail_addr
:
this
.
trim
(
addr
.
mail_addr
),
mail_mobile
:
this
.
trim
(
addr
.
mail_mobile
),
mail_mobile
:
this
.
trim
(
addr
.
mail_mobile
),
mail_to
:
this
.
trim
(
addr
.
mail_to
),
mail_to
:
this
.
trim
(
addr
.
mail_to
),
invoice_amount
:
invoice_amount
,
service_tax
:
service_tax
,
};
};
data
=
await
this
.
invoiceSve
.
applySave
(
data
);
data
=
await
this
.
invoiceSve
.
applySave
(
data
);
...
...
xgg-saas-merchant/app/base/service/impl/saas/orderSve.js
View file @
2f806950
...
@@ -61,6 +61,15 @@ class OrderService extends ServiceBase {
...
@@ -61,6 +61,15 @@ class OrderService extends ServiceBase {
row
.
price
=
system
.
f2y
(
row
.
price
);
row
.
price
=
system
.
f2y
(
row
.
price
);
}
}
}
}
async
byIds
(
params
)
{
let
rs
=
await
this
.
callms
(
"order"
,
"itemByIds"
,
params
);
return
rs
;
}
async
updateInvoice
(
params
)
{
let
rs
=
await
this
.
callms
(
"order"
,
"updateItemInvoice"
,
params
);
return
rs
;
}
}
}
module
.
exports
=
OrderService
;
module
.
exports
=
OrderService
;
\ No newline at end of file
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