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
31ddef8a
Commit
31ddef8a
authored
Apr 22, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
af823eb9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
15 deletions
+19
-15
xgg-saas-merchant/app/base/controller/impl/saas/invoiceCtl.js
+15
-15
xgg-saas-merchant/app/base/service/impl/saas/merchantSve.js
+4
-0
No files found.
xgg-saas-merchant/app/base/controller/impl/saas/invoiceCtl.js
View file @
31ddef8a
...
...
@@ -120,10 +120,10 @@ class InvoiceCtl extends CtlBase {
let
info
=
await
this
.
merchantSve
.
signInfo
({
id
:
params
.
saas_merchant_id
})
||
{};
info
=
info
.
data
||
{};
if
(
!
info
.
main_
trade
||
!
info
.
main_trad
e
.
id
)
{
return
system
.
getResult
(
null
,
"商户未设置
转账交易
主体,请联系平台进行设置、"
);
if
(
!
info
.
main_
invoice
||
!
info
.
main_invoic
e
.
id
)
{
return
system
.
getResult
(
null
,
"商户未设置
开票签约
主体,请联系平台进行设置、"
);
}
let
main
=
info
.
main_
trad
e
||
{};
let
main
=
info
.
main_
invoic
e
||
{};
let
batch_no
=
await
this
.
redisClient
.
genrateId
(
"invoice_batch_no"
);
let
apply_no
=
await
this
.
redisClient
.
genrateId
(
"invoice_apply_no"
);
let
data
=
{
...
...
@@ -194,10 +194,10 @@ class InvoiceCtl extends CtlBase {
let
info
=
await
this
.
merchantSve
.
signInfo
({
id
:
params
.
saas_merchant_id
})
||
{};
info
=
info
.
data
||
{};
// TODO WK
if
(
!
info
.
main_
trad
e
)
{
return
system
.
getResult
(
null
,
"商户未设置
转账交易
主体,请联系平台进行设置、"
);
if
(
!
info
.
main_
invoic
e
)
{
return
system
.
getResult
(
null
,
"商户未设置
开票签约
主体,请联系平台进行设置、"
);
}
let
main
=
info
.
main_
trad
e
;
let
main
=
info
.
main_
invoic
e
;
let
invoiceList
=
params
.
invoiceList
;
let
creditCodes
=
[];
...
...
@@ -218,7 +218,7 @@ class InvoiceCtl extends CtlBase {
let
batch_no
=
await
this
.
redisClient
.
genrateId
(
"invoice_batch_no"
);
for
(
let
invoice
of
invoiceList
)
{
if
(
!
invoice
.
data_ids
)
{
return
system
.
getResult
(
null
,
"数据
异常
,请刷新重试"
);
return
system
.
getResult
(
null
,
"数据
有变化
,请刷新重试"
);
}
let
bussinessmen
=
businessmenMap
[
invoice
.
credit_code
];
...
...
@@ -365,10 +365,10 @@ class InvoiceCtl extends CtlBase {
let
info
=
await
this
.
merchantSve
.
signInfo
({
id
:
params
.
saas_merchant_id
})
||
{};
// service_tax
info
=
info
.
data
||
{};
if
(
!
info
.
main
)
{
return
system
.
getResult
(
null
,
"商户未设置
转账交易
主体,请联系平台进行设置、"
);
if
(
!
info
.
main
_invoice
)
{
return
system
.
getResult
(
null
,
"商户未设置
开票签约
主体,请联系平台进行设置、"
);
}
let
main
=
info
.
main
||
{};
let
main
=
info
.
main
_invoice
||
{};
let
batch_no
=
await
this
.
redisClient
.
genrateId
(
"invoice_batch_no"
);
let
apply_no
=
batch_no
;
let
service_tax
=
parseFloat
((
Number
(
invoice_amount
)
*
Number
(
info
.
invoice_service_rate
)
/
100
).
toFixed
(
2
));
...
...
@@ -477,17 +477,17 @@ class InvoiceCtl extends CtlBase {
unInvoice
:
true
,
})
||
[];
items
=
items
.
data
;
if
(
!
items
||
items
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"交易信息有
误
,请刷新重新选择"
);
if
(
!
items
||
params
.
data_ids
.
length
!=
items
.
length
)
{
return
system
.
getResult
(
null
,
"交易信息有
变化
,请刷新重新选择"
);
}
let
signInfo
=
await
this
.
merchantSve
.
signInfo
({
id
:
params
.
saas_merchant_id
});
if
(
!
signInfo
||
!
signInfo
.
data
)
{
return
system
.
getResult
(
null
,
"商户签约信息不存在,请先做签约配置"
);
}
//
TODO WK 改成
开票签约主体
let
main
=
signInfo
.
data
.
main_
trad
e
;
if
(
!
main
)
{
// 开票签约主体
let
main
=
signInfo
.
data
.
main_
invoic
e
;
if
(
!
main
||
!
main
.
id
)
{
return
system
.
getResult
(
null
,
"开票签约主体未设置,请联系平台配置"
);
}
...
...
xgg-saas-merchant/app/base/service/impl/saas/merchantSve.js
View file @
31ddef8a
...
...
@@ -157,6 +157,9 @@ class MerchantService extends ServiceBase {
if
(
row
.
main_id_trade
)
{
mainIds
.
push
(
row
.
main_id_trade
);
}
if
(
row
.
main_id_invoice
)
{
mainIds
.
push
(
row
.
main_id_invoice
);
}
}
if
(
mainIds
.
length
==
0
)
{
return
;
...
...
@@ -166,6 +169,7 @@ class MerchantService extends ServiceBase {
for
(
let
row
of
rows
)
{
row
.
main
=
map
[
row
.
main_id
]
||
{};
row
.
main_trade
=
map
[
row
.
main_id_trade
]
||
{};
row
.
main_invoice
=
map
[
row
.
main_id_invoice
]
||
{};
}
}
...
...
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