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
60cb6846
Commit
60cb6846
authored
Dec 10, 2019
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
ac52af9e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
14 deletions
+95
-14
xggpjb-admin/app/base/api/api.base.js
+2
-1
xggpjb-admin/app/base/api/impl/op/invoiceApi.js
+18
-13
xggpjb-admin/app/base/service/impl/invoice/invoiceSve.js
+75
-0
No files found.
xggpjb-admin/app/base/api/api.base.js
View file @
60cb6846
...
...
@@ -61,7 +61,8 @@ class APIBase extends DocBase {
var
lst
=
[
"test.testApi"
,
"test.test"
,
"op.invoiceApi"
,
"op.saveInvoiceApi"
,
"op.invoiceListApi"
,
];
var
x
=
lst
.
indexOf
(
fullname
);
return
x
>=
0
;
...
...
xggpjb-admin/app/base/api/impl/op/invoiceApi.js
View file @
60cb6846
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
class
TestAPI
extends
APIBase
{
class
InvoiceApi
extends
APIBase
{
constructor
()
{
super
();
// this.orderSve = system.getObject("service.order.orderSve");
...
...
@@ -9,17 +9,22 @@ class TestAPI extends APIBase {
this
.
invoiceSve
=
system
.
getObject
(
"service.invoice.invoiceSve"
);
}
async
test
(
pobj
,
query
,
req
)
{
// var tmp = await this.orderSve.createLicense(pobj.action_body);
//获取验证码
// await this.platformUtils.fetchVCode(pobj.action_body.mobile);
//创建用户
// var result = await this.platformUtils.createUserInfo("13075556691", "13075556693", "9366");
//创建用户
// var result = await this.platformUtils.login("13075556691", "9366");
var
result
=
{};
async
saveInvoiceApi
(
pobj
,
query
,
req
)
{
pobj
.
creditCode
=
"91110105589080831E"
;
try
{
await
this
.
invoiceSve
.
sendInvoiceToDz
({
id
:
"11665025426002758"
});
return
await
this
.
invoiceSve
.
apiSaveInvoiceCNB
(
pobj
);
}
catch
(
e
)
{
console
.
log
(
e
);
}
return
result
;
}
async
invoiceListApi
(
pobj
,
query
,
req
)
{
try
{
pobj
.
creditCode
=
"91110105589080831E"
;
// pobj.businessmenCreditCode = "111";
return
await
this
.
invoiceSve
.
apiInvoiceListCNB
(
pobj
);
}
catch
(
e
)
{
console
.
log
(
e
);
}
...
...
@@ -60,4 +65,4 @@ class TestAPI extends APIBase {
}
}
module
.
exports
=
TestAPI
;
\ No newline at end of file
module
.
exports
=
InvoiceApi
;
\ No newline at end of file
xggpjb-admin/app/base/service/impl/invoice/invoiceSve.js
View file @
60cb6846
...
...
@@ -333,6 +333,81 @@ class InvoiceService extends ServiceBase {
return
system
.
getResultSuccess
(
result
);
}
/**
* 保存发票申请(提供管理) 张威吹牛必专用
* @param {*} pobj
*/
async
apiSaveInvoiceCNB
(
pobj
)
{
var
mapRs
=
await
this
.
callms
(
"order"
,
"businessmenCompleteMapByCreditCodes"
,
{
creditCodes
:
pobj
.
creditCode
});
var
map
=
mapRs
.
data
;
var
signInfo
=
map
[
pobj
.
creditCode
];
if
(
!
pobj
.
invoiceTime
)
{
pobj
.
invoiceTime
=
moment
().
format
(
"YYYY-MM-DD"
);
}
pobj
.
merchantId
=
""
;
//个体户ID
pobj
.
invoiceAmount
=
system
.
y2f
(
pobj
.
invoiceAmount
);
pobj
.
serviceRate
=
system
.
f2y
(
signInfo
.
serviceRate
);
pobj
.
perCalWay
=
signInfo
.
taxUpType
;
pobj
.
valCalWay
=
signInfo
.
addValueUpType
;
pobj
.
applyNo
=
await
this
.
getBusUid
(
""
);
// 销售方信息
pobj
.
businessmenId
=
signInfo
.
id
;
pobj
.
isBank
=
signInfo
.
isBank
;
pobj
.
taxAuthorities
=
signInfo
.
taxOrg
;
pobj
.
taxCostPriRat
=
system
.
f2y
(
signInfo
.
costRate
);
pobj
.
taxIncPriRat
=
system
.
f2y
(
signInfo
.
taxRate
);
pobj
.
perIncTaxRange
=
JSON
.
parse
(
signInfo
.
specialTaxLadder
);
pobj
.
valAddTaxRange
=
JSON
.
parse
(
signInfo
.
specialOtherLadder
);
pobj
.
businessmenType
=
10
;
pobj
.
businessmenCreditCode
=
pobj
.
creditCode
;
pobj
.
businessName
=
signInfo
.
name
;
pobj
.
businessmenName
=
signInfo
.
name
;
pobj
.
businessmenAddr
=
"北京市海淀区西北旺东路10号院东区2号楼二层202"
,
pobj
.
businessmenMobile
=
"010-5236"
;
pobj
.
businessmenBank
=
"北京朝阳双秀支"
;
pobj
.
businessmenAccount
=
"8569659856"
;
pobj
.
isBank
=
1
;
pobj
.
taxAuthorities
=
"北京市工商行政管理局海淀分局"
;
pobj
.
type
=
"10"
;
pobj
.
status
=
"1000"
;
pobj
.
customerStatus
=
"1000"
;
pobj
.
payWay
=
"10"
;
pobj
.
businessmenType
=
"10"
;
pobj
.
ruleCode
=
"10"
;
// 开票内容
if
(
signInfo
.
invoicecontents
&&
signInfo
.
invoicecontents
.
length
>
0
)
{
pobj
.
invoiceContent
=
signInfo
.
invoicecontents
[
0
].
invoicecontentName
;
}
else
{
pobj
.
invoiceContent
=
"服务费"
;
}
var
rs
=
await
this
.
callms
(
"invoice"
,
"saveInvoice"
,
pobj
);
if
(
rs
.
status
==
0
)
{
return
rs
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
async
apiInvoiceListCNB
(
pobj
)
{
return
await
this
.
apiQueryApplyInvoices
(
pobj
);
}
async
apiCancelInvoice
(
pobj
)
{
var
params
=
{
applyNo
:
pobj
.
applyNo
,
...
...
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