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
823f9503
Commit
823f9503
authored
May 14, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
31af8d85
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
5 deletions
+44
-5
xgg-saas-platform/app/base/controller/impl/saas/invoiceCtl.js
+19
-4
xgg-saas-platform/app/base/service/impl/saas/orderSve.js
+8
-0
xgg-saas-platform/app/base/service/impl/saas/saasinvoiceSve.js
+11
-0
xgg-saas-platform/app/base/service/impl/trade/tradeSve.js
+5
-0
xgg-saas-platform/app/base/system.js
+1
-1
No files found.
xgg-saas-platform/app/base/controller/impl/saas/invoiceCtl.js
View file @
823f9503
...
@@ -19,7 +19,9 @@ class InvoiceCtl extends CtlBase {
...
@@ -19,7 +19,9 @@ class InvoiceCtl extends CtlBase {
async
audit
(
params
,
pobj2
,
req
)
{
async
audit
(
params
,
pobj2
,
req
)
{
try
{
try
{
params
.
id
=
this
.
trim
(
params
.
id
);
params
.
id
=
this
.
trim
(
params
.
id
);
if
(
!
params
.
id
)
{
let
saasInvoiceApply
=
await
this
.
saasinvoiceSve
.
getSaasInvoiceById
({
id
:
params
.
id
,
attrs
:
"id,fee_type,data_ids"
});
saasInvoiceApply
=
saasInvoiceApply
.
status
==
0
?
saasInvoiceApply
.
data
:
null
;
if
(
!
params
.
id
||
!
saasInvoiceApply
||
!
saasInvoiceApply
.
id
)
{
return
system
.
getResult
(
null
,
"发票申请不存在"
);
return
system
.
getResult
(
null
,
"发票申请不存在"
);
}
}
params
.
remark
=
this
.
trim
(
params
.
remark
);
params
.
remark
=
this
.
trim
(
params
.
remark
);
...
@@ -27,9 +29,22 @@ class InvoiceCtl extends CtlBase {
...
@@ -27,9 +29,22 @@ class InvoiceCtl extends CtlBase {
return
system
.
getResult
(
null
,
"请填写审核备注"
);
return
system
.
getResult
(
null
,
"请填写审核备注"
);
}
}
params
.
status
=
Number
(
params
.
status
||
0
)
?
"1010"
:
"1020"
;
params
.
status
=
Number
(
params
.
status
||
0
)
?
"1010"
:
"1020"
;
let
rs
=
await
this
.
saasinvoiceSve
.
audit
(
params
)
if
(
rs
.
status
===
0
&&
!
params
.
status
)
{
let
rs
=
await
this
.
saasinvoiceSve
.
audit
(
params
);
await
this
.
tradeSve
.
cancelInvoice
({
saas_invoice_id
:
params
.
id
});
if
(
rs
.
status
===
0
&&
params
.
status
==
"1020"
)
{
let
data_ids
=
saasInvoiceApply
.
data_ids
;
if
(
!
data_ids
||
data_ids
.
split
(
','
).
length
==
0
){
return
rs
;
}
let
fee_type
=
saasInvoiceApply
.
fee_type
;
if
(
fee_type
==
"10"
||
fee_type
==
"20"
){
//交易流水
// await this.tradeSve.cancelInvoice({saas_invoice_id: params.id});
await
this
.
tradeSve
.
cancelInvoiceByDataIds
({
data_ids
:
data_ids
.
split
(
','
)});
}
else
if
(
fee_type
==
"00"
){
//注册订单
await
this
.
orderSve
.
cancelInvoiceByDataIds
({
data_ids
:
data_ids
.
split
(
','
)});
}
else
{
return
rs
;
}
}
}
return
rs
;
return
rs
;
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
xgg-saas-platform/app/base/service/impl/saas/orderSve.js
View file @
823f9503
...
@@ -111,5 +111,12 @@ class OrderService extends ServiceBase {
...
@@ -111,5 +111,12 @@ class OrderService extends ServiceBase {
row
.
price
=
system
.
f2y
(
row
.
price
);
row
.
price
=
system
.
f2y
(
row
.
price
);
}
}
}
}
async
cancelInvoiceByDataIds
(
params
)
{
let
rs
=
await
this
.
callms
(
"order"
,
"cancelInvoiceByDataIds"
,
params
);
return
rs
;
}
}
}
module
.
exports
=
OrderService
;
module
.
exports
=
OrderService
;
\ No newline at end of file
xgg-saas-platform/app/base/service/impl/saas/saasinvoiceSve.js
View file @
823f9503
...
@@ -254,5 +254,15 @@ class SaasinvoiceService extends ServiceBase {
...
@@ -254,5 +254,15 @@ class SaasinvoiceService extends ServiceBase {
return
system
.
getResult
(
null
,
`系统错误`
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
}
/**
* fn:根据ID 查询详情
* @param params
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}|any|undefined>}
*/
async
getSaasInvoiceById
(
params
){
let
rs
=
await
this
.
callms
(
"invoice"
,
"getSaasInvoiceById"
,
params
);
return
rs
;
}
}
}
module
.
exports
=
SaasinvoiceService
;
module
.
exports
=
SaasinvoiceService
;
\ No newline at end of file
xgg-saas-platform/app/base/service/impl/trade/tradeSve.js
View file @
823f9503
...
@@ -110,6 +110,11 @@ class TradeService extends ServiceBase {
...
@@ -110,6 +110,11 @@ class TradeService extends ServiceBase {
return
rs
;
return
rs
;
}
}
async
cancelInvoiceByDataIds
(
params
)
{
let
rs
=
await
this
.
callms
(
"trade"
,
"cancelInvoiceByDataIds"
,
params
);
return
rs
;
}
transFields
(
rows
)
{
transFields
(
rows
)
{
if
(
!
rows
||
rows
.
length
==
0
)
{
if
(
!
rows
||
rows
.
length
==
0
)
{
return
;
return
;
...
...
xgg-saas-platform/app/base/system.js
View file @
823f9503
...
@@ -197,7 +197,7 @@ class System {
...
@@ -197,7 +197,7 @@ class System {
merchant
:
dev
+
":3101"
+
path
,
merchant
:
dev
+
":3101"
+
path
,
// 订单服务
// 订单服务
order
:
dev
+
":3103"
+
path
,
order
:
local
+
":3103"
+
path
,
// 发票服务
// 发票服务
invoice
:
local
+
":3105"
+
path
,
invoice
:
local
+
":3105"
+
path
,
...
...
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