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
36cce5d8
Commit
36cce5d8
authored
Dec 10, 2019
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
85fa753b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
7 deletions
+67
-7
.gitignore
+3
-0
xggpjb-admin/app/base/api/api.base.js
+2
-1
xggpjb-admin/app/base/api/impl/test/testApi.js
+17
-3
xggpjb-admin/app/base/service/impl/invoice/invoiceSve.js
+44
-3
xggpjb-admin/app/base/service/svems.base.js
+1
-0
No files found.
.gitignore
0 → 100644
View file @
36cce5d8
xggpjb-admin/node_modules/
.idea/
\ No newline at end of file
xggpjb-admin/app/base/api/api.base.js
View file @
36cce5d8
...
...
@@ -59,7 +59,8 @@ class APIBase extends DocBase {
async
isCheckWhiteList
(
gname
,
methodname
)
{
var
fullname
=
gname
+
"."
+
methodname
;
var
lst
=
[
"test.testApi"
"test.testApi"
,
"test.test"
,
];
var
x
=
lst
.
indexOf
(
fullname
);
return
x
>=
0
;
...
...
xggpjb-admin/app/base/api/impl/test/testApi.js
View file @
36cce5d8
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
class
TestAPI
extends
APIBase
{
constructor
()
{
super
();
this
.
orderSve
=
system
.
getObject
(
"service.order.orderSve"
);
this
.
platformUtils
=
system
.
getObject
(
"util.businessManager.opPlatformUtils"
);
// this.orderSve = system.getObject("service.order.orderSve");
// this.platformUtils = system.getObject("util.businessManager.opPlatformUtils");
this
.
invoiceSve
=
system
.
getObject
(
"service.invoice.invoiceSve"
);
}
async
test
(
pobj
,
query
,
req
)
{
// var tmp = await this.orderSve.createLicense(pobj.action_body);
//获取验证码
...
...
@@ -13,12 +16,20 @@ class TestAPI extends APIBase {
//创建用户
// var result = await this.platformUtils.createUserInfo("13075556691", "13075556693", "9366");
//创建用户
var
result
=
await
this
.
platformUtils
.
login
(
"13075556691"
,
"9366"
);
// var result = await this.platformUtils.login("13075556691", "9366");
var
result
=
{};
try
{
await
this
.
invoiceSve
.
sendInvoiceToDz
({
id
:
"11665025426002758"
});
}
catch
(
e
)
{
console
.
log
(
e
);
}
return
result
;
}
exam
()
{
return
""
;
}
classDesc
()
{
return
{
groupName
:
""
,
...
...
@@ -28,6 +39,7 @@ class TestAPI extends APIBase {
exam
:
""
,
};
}
methodDescs
()
{
return
[
{
...
...
@@ -47,4 +59,5 @@ class TestAPI extends APIBase {
];
}
}
module
.
exports
=
TestAPI
;
\ No newline at end of file
xggpjb-admin/app/base/service/impl/invoice/invoiceSve.js
View file @
36cce5d8
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
const
settings
=
require
(
"../../../../config/settings"
)
class
InvoiceService
extends
ServiceBase
{
constructor
()
{
super
();
...
...
@@ -146,9 +147,9 @@ class InvoiceService extends ServiceBase {
invoice
.
invoiceAmount
=
Number
(
invoice
.
invoiceAmt
);
invoice
.
invoiceTime
=
this
.
trim
(
invoice
.
invoiceTime
);
invoice
.
businessmenCreditCode
=
this
.
trim
(
invoice
.
businessmenCreditCode
);
invoice
.
businessmenType
=
this
.
trim
(
invoice
.
businessmenType
)
||
"10"
;
invoice
.
businessmenType
=
this
.
trim
(
invoice
.
businessmenType
)
||
"10"
;
invoice
.
serviceRate
=
signInfo
.
serviceRate
;
invoice
.
ruleCode
=
this
.
trim
(
invoice
.
ruleCode
)
||
"10"
;
invoice
.
ruleCode
=
this
.
trim
(
invoice
.
ruleCode
)
||
"10"
;
invoice
.
perCalWay
=
signInfo
.
taxUpType
;
// TODO 确定值
invoice
.
valCalWay
=
signInfo
.
addValueUpType
;
// TODO 确定值
...
...
@@ -191,7 +192,7 @@ class InvoiceService extends ServiceBase {
return
system
.
getResultSuccess
(
result
);
}
async
apiVerificationAndCalculation
(
pobj
){
async
apiVerificationAndCalculation
(
pobj
)
{
pobj
.
serviceRate
=
Number
(
pobj
.
serviceRate
)
*
100
;
pobj
.
taxIncPriRat
=
Number
(
pobj
.
taxIncPriRat
)
*
100
;
pobj
.
taxCostPriRat
=
Number
(
pobj
.
taxCostPriRat
)
*
100
;
...
...
@@ -451,6 +452,7 @@ class InvoiceService extends ServiceBase {
this
.
handleDate
(
res
.
data
[
"invoice"
],
[
"updatedAt"
],
"YYYY-MM-DD"
,
-
8
);
return
res
;
}
/**
* 发票明细(交付商)
* @param {*} pobj
...
...
@@ -477,6 +479,7 @@ class InvoiceService extends ServiceBase {
return
rs
;
}
/**
* 校验审核
* @param {*} pobj
...
...
@@ -491,6 +494,7 @@ class InvoiceService extends ServiceBase {
}
return
rs
;
}
/**
* 试算
* @param {*} pobj
...
...
@@ -541,12 +545,41 @@ class InvoiceService extends ServiceBase {
var
rs
=
await
this
.
callms
(
"invoice"
,
"platformAssignment"
,
pobj
);
if
(
rs
.
status
==
0
)
{
this
.
pushDeliver
(
pobj
);
// 1090办理完成
if
(
pobj
.
nextStatus
==
"1090"
)
{
this
.
sendInvoiceToDz
(
pobj
);
}
return
rs
;
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
async
sendInvoiceToDz
(
obj
)
{
// 查发票
let
invoiceApply
=
await
this
.
callms
(
"invoice"
,
"queryInvoice"
,
{
id
:
obj
.
id
});
console
.
log
(
invoiceApply
,
"00000000000000000000000000000000000000000000000000000000000"
);
let
invoice
=
invoiceApply
.
data
.
invoice
||
{};
let
params
=
{
uploadPeriod
:
201912
,
companyId
:
10001
,
customerId
:
498590
,
userId
:
123456
,
file
:
[
invoice
.
invoiceImg
,
]
};
let
apiurl
=
"https://nga-api.gongsibao.com/nga-sass//billInfo/uploadFileForAliyun"
;
let
rs
=
await
this
.
restClient
.
execPost
(
params
,
apiurl
);
return
rs
;
}
/**
* 交付商审批
* @param {*} pobj
...
...
@@ -644,6 +677,7 @@ class InvoiceService extends ServiceBase {
return
system
.
getResult
(
null
,
res
.
msg
);
}
}
/**
* 发票列表(平台)
* @param {*} pobj
...
...
@@ -790,6 +824,7 @@ class InvoiceService extends ServiceBase {
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
//交易数据 平台
async
statManageData
(
params
)
{
try
{
...
...
@@ -798,6 +833,7 @@ class InvoiceService extends ServiceBase {
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//发票办理 平台
async
statBusinessData
(
params
)
{
try
{
...
...
@@ -806,6 +842,7 @@ class InvoiceService extends ServiceBase {
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
/**
* 交易数据(交付商)
* @param {*} params
...
...
@@ -817,6 +854,7 @@ class InvoiceService extends ServiceBase {
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//发票办理(交付商)
async
delStatBusinessData
(
params
)
{
try
{
...
...
@@ -825,6 +863,7 @@ class InvoiceService extends ServiceBase {
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//交付商列表(平台)
async
statDeliverData
(
params
)
{
try
{
...
...
@@ -835,4 +874,5 @@ class InvoiceService extends ServiceBase {
}
}
module
.
exports
=
InvoiceService
;
\ No newline at end of file
xggpjb-admin/app/base/service/svems.base.js
View file @
36cce5d8
...
...
@@ -213,6 +213,7 @@ class ServiceBase {
}
var
rs
=
await
this
.
restClient
.
execPost
(
params
,
reqUrl
);
console
.
log
(
rs
);
if
(
rs
&&
rs
.
stdout
)
{
return
JSON
.
parse
(
rs
.
stdout
);
}
...
...
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