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
72b93f00
Commit
72b93f00
authored
Apr 14, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
2d72407f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
26 deletions
+42
-26
xggsve-invoice/app/base/service/impl/invoice/saasinvoiceapplySve.js
+42
-26
No files found.
xggsve-invoice/app/base/service/impl/invoice/saasinvoiceapplySve.js
View file @
72b93f00
...
...
@@ -16,7 +16,7 @@ class SaasinvoiceapplyService extends ServiceBase {
async
byId
(
params
)
{
let
apply
=
await
this
.
dao
.
getById
(
params
.
id
);
this
.
handleDate
(
apply
,
[
'updated_at'
,
'created_at'
],
'YYYY-MM-DD HH:mm:ss'
);
this
.
dictionary
.
setRowName
(
"SAAS_INVOICE_APPLY"
,
apply
,[
"owner_type"
,
"fee_type"
,
"invoice_type"
,
"invoice_join"
]);
this
.
dictionary
.
setRowName
(
"SAAS_INVOICE_APPLY"
,
apply
,
[
"owner_type"
,
"fee_type"
,
"invoice_type"
,
"invoice_join"
]);
return
system
.
getResult
(
apply
);
}
async
save
(
params
)
{
...
...
@@ -52,18 +52,24 @@ class SaasinvoiceapplyService extends ServiceBase {
let
total
=
await
this
.
dao
.
countByParams
(
params
);
if
(
total
==
0
)
{
return
system
.
getResult
({
count
:
0
,
rows
:
[]});
return
system
.
getResult
({
count
:
0
,
rows
:
[]
});
}
let
list
=
await
this
.
dao
.
pageByParams
(
params
);
if
(
list
)
{
for
(
var
item
of
list
)
{
this
.
handleDate
(
item
,
[
'updated_at'
,
'created_at'
],
'YYYY-MM-DD HH:mm:ss'
);
// this.handleDate(item, ['invoice_time'], 'YYYY-MM-DD');
this
.
dictionary
.
setRowName
(
"SAAS_INVOICE_APPLY"
,
item
,[
"owner_type"
,
"fee_type"
,
"invoice_type"
,
"invoice_join"
,
"status"
]);
// this.handleDate(item, ['invoice_time'], 'YYYY-MM-DD');
this
.
dictionary
.
setRowName
(
"SAAS_INVOICE_APPLY"
,
item
,
[
"owner_type"
,
"fee_type"
,
"invoice_type"
,
"invoice_join"
,
"status"
]);
}
}
return
system
.
getResultSuccess
({
count
:
total
,
rows
:
list
});
return
system
.
getResultSuccess
({
count
:
total
,
rows
:
list
});
}
async
platforminvoiceapplyPage
(
params
)
{
...
...
@@ -73,18 +79,24 @@ class SaasinvoiceapplyService extends ServiceBase {
let
total
=
await
this
.
dao
.
countByParams
(
params
);
if
(
total
==
0
)
{
return
system
.
getResult
({
count
:
0
,
rows
:
[]});
return
system
.
getResult
({
count
:
0
,
rows
:
[]
});
}
let
list
=
await
this
.
dao
.
pageByParams
(
params
);
if
(
list
)
{
for
(
var
item
of
list
)
{
this
.
handleDate
(
item
,
[
'updated_at'
,
'created_at'
],
'YYYY-MM-DD HH:mm:ss'
);
// this.handleDate(item, ['invoice_time'], 'YYYY-MM-DD');
this
.
dictionary
.
setRowName
(
"SAAS_INVOICE_APPLY"
,
item
,[
"owner_type"
,
"fee_type"
,
"invoice_type"
,
"invoice_join"
,
"status"
]);
// this.handleDate(item, ['invoice_time'], 'YYYY-MM-DD');
this
.
dictionary
.
setRowName
(
"SAAS_INVOICE_APPLY"
,
item
,
[
"owner_type"
,
"fee_type"
,
"invoice_type"
,
"invoice_join"
,
"status"
]);
}
}
return
system
.
getResultSuccess
({
count
:
total
,
rows
:
list
});
return
system
.
getResultSuccess
({
count
:
total
,
rows
:
list
});
}
async
audit
(
params
)
{
...
...
@@ -125,7 +137,10 @@ class SaasinvoiceapplyService extends ServiceBase {
invoice
.
invoice_img
=
this
.
trim
(
params
.
invoice_img
);
invoice
=
await
this
.
db
.
transaction
(
async
t
=>
{
invoice
=
await
this
.
saasinvoiceDao
.
create
(
invoice
,
t
);
await
this
.
dao
.
update
({
id
:
apply
.
id
,
status
:
"1040"
},
t
);
await
this
.
dao
.
update
({
id
:
apply
.
id
,
status
:
"1040"
},
t
);
return
invoice
;
});
return
system
.
getResultSuccess
(
invoice
);
...
...
@@ -135,41 +150,41 @@ class SaasinvoiceapplyService extends ServiceBase {
* fn:发票详情
* @param {*} params
*/
async
saasInvoiceInfo
(
params
){
if
(
!
params
.
id
)
{
return
system
.
getResult
(
null
,
`参数错误 发票
${
params
.
id
}
不存在`
);
async
saasInvoiceInfo
(
params
)
{
if
(
!
params
.
id
)
{
return
system
.
getResult
(
null
,
`参数错误 发票
${
params
.
id
}
不存在`
);
}
try
{
let
saasInvoiceApply
=
await
this
.
dao
.
getById
(
params
.
id
);
if
(
!
saasInvoiceApply
)
{
return
system
.
getResult
(
null
,
`参数错误 发票
${
params
.
id
}
不存在`
);
let
saasInvoiceApply
=
await
this
.
dao
.
getById
(
params
.
id
);
if
(
!
saasInvoiceApply
)
{
return
system
.
getResult
(
null
,
`参数错误 发票
${
params
.
id
}
不存在`
);
}
// 费用类型 00注册订单费用 10平台转账费用 20商户转账费用
if
(
saasInvoiceApply
.
fee_type
==
"00"
)
{
if
(
saasInvoiceApply
.
fee_type
==
"00"
)
{
saasInvoiceApply
.
fee_type_name
=
"注册订单费用"
;
}
else
if
(
saasInvoiceApply
.
fee_type
==
"10"
)
{
}
else
if
(
saasInvoiceApply
.
fee_type
==
"10"
)
{
saasInvoiceApply
.
fee_type_name
=
"平台转账费用"
;
}
else
if
(
this
.
saasinvoiceDao
.
fee_type
==
"20"
)
{
}
else
if
(
this
.
saasinvoiceDao
.
fee_type
==
"20"
)
{
saasInvoiceApply
.
fee_type_name
=
"商户转账费用"
;
}
// 发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票
if
(
saasInvoiceApply
.
invoice_type
==
"10"
)
{
if
(
saasInvoiceApply
.
invoice_type
==
"10"
)
{
saasInvoiceApply
.
invoice_type_name
=
"增值税专用发票"
;
}
else
if
(
saasInvoiceApply
.
invoice_type
==
"20"
)
{
}
else
if
(
saasInvoiceApply
.
invoice_type
==
"20"
)
{
saasInvoiceApply
.
invoice_type_name
=
"增值税普通发票"
;
}
else
if
(
this
.
saasinvoiceDao
.
invoice_type
==
"30"
)
{
}
else
if
(
this
.
saasinvoiceDao
.
invoice_type
==
"30"
)
{
saasInvoiceApply
.
invoice_type_name
=
"普通发票"
;
}
this
.
handleDate
(
saasInvoiceApply
,
[
'updated_at'
,
'created_at'
],
'YYYY-MM-DD HH:mm:ss'
);
let
saasInvoice
=
await
this
.
saasinvoiceDao
.
getById
(
params
.
id
)
||
null
;
let
saasInvoice
=
await
this
.
saasinvoiceDao
.
getById
(
params
.
id
)
||
null
;
saasInvoiceApply
.
saasInvoice
=
saasInvoice
;
return
system
.
getResult
(
saasInvoiceApply
);
return
system
.
getResult
(
saasInvoiceApply
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误`
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
module
.
exports
=
SaasinvoiceapplyService
;
module
.
exports
=
SaasinvoiceapplyService
;
\ 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