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
9b74bb2d
Commit
9b74bb2d
authored
Apr 11, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
0edf5b3f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
15 deletions
+48
-15
xgg-saas-merchant/app/base/controller/impl/saas/invoiceCtl.js
+47
-14
xgg-saas-merchant/app/base/service/impl/trade/tradeSve.js
+1
-1
No files found.
xgg-saas-merchant/app/base/controller/impl/saas/invoiceCtl.js
View file @
9b74bb2d
...
@@ -9,6 +9,8 @@ class InvoiceCtl extends CtlBase {
...
@@ -9,6 +9,8 @@ class InvoiceCtl extends CtlBase {
this
.
tradeSve
=
system
.
getObject
(
"service.trade.tradeSve"
);
this
.
tradeSve
=
system
.
getObject
(
"service.trade.tradeSve"
);
this
.
invoiceSve
=
system
.
getObject
(
"service.saas.invoiceSve"
);
this
.
invoiceSve
=
system
.
getObject
(
"service.saas.invoiceSve"
);
this
.
merchantSve
=
system
.
getObject
(
"service.saas.merchantSve"
);
this
.
merchantSve
=
system
.
getObject
(
"service.saas.merchantSve"
);
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
}
}
// 注册订单列表
// 注册订单列表
...
@@ -48,6 +50,7 @@ class InvoiceCtl extends CtlBase {
...
@@ -48,6 +50,7 @@ class InvoiceCtl extends CtlBase {
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
}
//发票列表
//发票列表
async
merchantinvoicePage
(
params
,
pobj2
,
req
)
{
async
merchantinvoicePage
(
params
,
pobj2
,
req
)
{
try
{
try
{
...
@@ -76,7 +79,7 @@ class InvoiceCtl extends CtlBase {
...
@@ -76,7 +79,7 @@ class InvoiceCtl extends CtlBase {
return
await
this
.
orderSve
.
page
(
params
);
return
await
this
.
orderSve
.
page
(
params
);
}
catch
(
error
)
{
}
catch
(
error
)
{
let
msg
=
error
.
message
;
let
msg
=
error
.
message
;
if
(
msg
.
startsWith
(
"bpo-validation-error:"
))
{
if
(
msg
.
startsWith
(
"bpo-validation-error:"
))
{
return
system
.
getResult
(
null
,
msg
.
replace
(
"bpo-validation-error:"
,
""
));
return
system
.
getResult
(
null
,
msg
.
replace
(
"bpo-validation-error:"
,
""
));
}
}
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
...
@@ -87,7 +90,7 @@ class InvoiceCtl extends CtlBase {
...
@@ -87,7 +90,7 @@ class InvoiceCtl extends CtlBase {
// 功能2开票
// 功能2开票
async
apply10
(
params
,
pobj2
,
req
)
{
async
apply10
(
params
,
pobj2
,
req
)
{
validation
.
check
(
params
,
'data_ids'
,
{
name
:
"交易信息"
,
arr_require
:
true
});
validation
.
check
(
params
,
'data_ids'
,
{
name
:
"交易信息"
,
arr_require
:
true
});
let
title
=
await
this
.
merchantSve
.
title
(
params
)
||
{};
let
title
=
await
this
.
merchantSve
.
title
(
params
)
||
{};
title
=
title
.
data
||
{};
title
=
title
.
data
||
{};
...
@@ -102,23 +105,53 @@ class InvoiceCtl extends CtlBase {
...
@@ -102,23 +105,53 @@ class InvoiceCtl extends CtlBase {
return
system
.
getResult
(
null
,
"开票邮寄不完整"
);
return
system
.
getResult
(
null
,
"开票邮寄不完整"
);
}
}
let
data
=
{
let
trades
=
await
this
.
tradeSve
.
byIds
({
ids
:
params
.
data_ids
,
saas_merchant_id
:
params
.
saas_merchant_id
,
attrs
:
"id"
,
trade_statuses
:
[
'00'
],
unInvoice
:
true
,
})
||
[];
if
(
trades
.
data
.
length
!=
params
.
data_ids
.
length
)
{
return
system
.
getResult
(
null
,
"交易数据选择有误,请重新搜索后选择"
);
}
let
info
=
await
this
.
merchantSve
.
signInfo
({
id
:
params
.
saas_merchant_id
})
||
{};
info
=
info
.
data
||
{};
if
(
!
info
.
main_trade
||
!
info
.
main_trade
.
id
)
{
return
system
.
getResult
(
null
,
"商户未设置转账交易主体,请联系平台进行设置、"
);
}
let
main
=
info
.
main_trade
||
{};
let
batch_no
=
await
this
.
redisClient
.
genrateId
(
"invoice_batch_no"
);
let
apply_no
=
await
this
.
redisClient
.
genrateId
(
"invoice_apply_no"
);
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
,
data_ids
:
params
.
data_ids
,
parent_id
:
""
,
owner_type
:
"00"
,
status
:
"1000"
,
batch_no
:
batch_no
,
apply_no
:
apply_no
,
fee_type
:
this
.
trim
(
params
.
fee_type
),
fee_type
:
this
.
trim
(
params
.
fee_type
),
invoice_type
:
this
.
trim
(
params
.
invoice_type
),
invoice_type
:
this
.
trim
(
params
.
invoice_type
),
to_name
:
this
.
trim
(
title
.
merchant_name
),
from_name
:
main
.
name
,
to_credit_code
:
this
.
trim
(
title
.
merchant_credit_code
),
from_credit_code
:
main
.
credit_code
,
to_addr
:
this
.
trim
(
title
.
merchant_addr
),
from_mobile
:
main
.
mobile
,
to_mobile
:
this
.
trim
(
title
.
merchant_mobile
),
from_addr
:
main
.
addr
,
to_bank
:
this
.
trim
(
title
.
merchant_bank
),
from_bank
:
main
.
bank_name
,
to_account
:
this
.
trim
(
title
.
merchant_account
),
from_account
:
main
.
bank_account
,
mail_addr
:
this
.
trim
(
addr
.
mail_addr
),
to_name
:
this
.
trim
(
title
.
merchant_name
),
mail_mobile
:
this
.
trim
(
addr
.
mail_mobile
),
to_credit_code
:
this
.
trim
(
title
.
merchant_credit_code
),
mail_to
:
this
.
trim
(
addr
.
mail_to
),
to_addr
:
this
.
trim
(
title
.
merchant_addr
),
to_mobile
:
this
.
trim
(
title
.
merchant_mobile
),
to_bank
:
this
.
trim
(
title
.
merchant_bank
),
to_account
:
this
.
trim
(
title
.
merchant_account
),
mail_addr
:
this
.
trim
(
addr
.
mail_addr
),
mail_mobile
:
this
.
trim
(
addr
.
mail_mobile
),
mail_to
:
this
.
trim
(
addr
.
mail_to
),
};
};
console
.
log
(
data
);
console
.
log
(
data
);
return
system
.
getResultSuccess
(
data
);
return
system
.
getResultSuccess
(
data
);
...
...
xgg-saas-merchant/app/base/service/impl/trade/tradeSve.js
View file @
9b74bb2d
...
@@ -247,7 +247,7 @@ class TradeService extends ServiceBase {
...
@@ -247,7 +247,7 @@ class TradeService extends ServiceBase {
}
}
async
byIds
(
params
)
{
async
byIds
(
params
)
{
let
rs
=
await
this
.
callms
(
"trade"
,
"
orderPay
"
,
params
);
let
rs
=
await
this
.
callms
(
"trade"
,
"
itemByIds
"
,
params
);
return
rs
;
return
rs
;
}
}
...
...
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