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
b7e8e132
Commit
b7e8e132
authored
Mar 12, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
e727d608
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
2999 additions
and
2737 deletions
+2999
-2737
xgg-deliver/app/base/controller/impl/invoice/invoiceCtl.js
+15
-235
xgg-deliver/app/base/controller/impl/invoice/invoiceCtlbak.js
+284
-0
xgg-deliver/app/base/controller/impl/uc/userCtl.js
+4
-0
xgg-deliver/app/base/service/impl/invoice/invoiceSve.js
+15
-852
xgg-deliver/app/base/service/impl/invoice/invoiceSvebak.js
+873
-0
xgg-deliver/app/base/system.js
+1
-1
xgg-deliver/app/front/entry/public/apidoc/invoice/invoice.md
+117
-1649
xgg-deliver/app/front/entry/public/apidoc/invoice/invoicebak.md
+1690
-0
No files found.
xgg-deliver/app/base/controller/impl/invoice/invoiceCtl.js
View file @
b7e8e132
...
@@ -7,12 +7,12 @@ class InvoiceCtl extends CtlBase {
...
@@ -7,12 +7,12 @@ class InvoiceCtl extends CtlBase {
}
}
/**
/**
*
申请发票校验
*
业务进度字典
* @param {*} pobj
* @param {*} pobj
*/
*/
async
verification
(
pobj
)
{
async
processDics
(
pobj
,
pobj2
,
req
)
{
try
{
try
{
return
await
this
.
invoiceSve
.
apiVerification
(
pobj
);
return
await
this
.
invoiceSve
.
processDics
(
pobj
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
...
@@ -20,12 +20,13 @@ class InvoiceCtl extends CtlBase {
...
@@ -20,12 +20,13 @@ class InvoiceCtl extends CtlBase {
}
}
/**
/**
*
申请发票校验试算
*
发票申请列表-管理员
* @param {*} pobj
* @param {*} pobj
*/
*/
async
verificationAndCalculation
(
pobj
)
{
async
invoicePage
(
pobj
,
pobj2
,
req
)
{
try
{
try
{
return
await
this
.
invoiceSve
.
apiVerificationAndCalculation
(
pobj
);
this
.
doTimeCondition
(
pobj
,
[
"createTimeBegin"
,
"createTimeEnd"
]);
return
await
this
.
invoiceSve
.
invoicePage
(
pobj
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
...
@@ -33,37 +34,14 @@ class InvoiceCtl extends CtlBase {
...
@@ -33,37 +34,14 @@ class InvoiceCtl extends CtlBase {
}
}
/**
/**
*
查询明细(平台)
*
发票申请列表-业务员
* @param {*} pobj
* @param {*} pobj
*/
*/
async
queryInvoice
(
pobj
)
{
async
myInvoicePage
(
pobj
,
pobj2
,
req
)
{
try
{
try
{
return
await
this
.
invoiceSve
.
apiQueryInvoiceAdmin
(
pobj
);
pobj
.
operator_id
=
req
.
loginUser
.
id
;
}
catch
(
error
)
{
this
.
doTimeCondition
(
pobj
,
[
"createTimeBegin"
,
"createTimeEnd"
]);
console
.
log
(
error
);
return
await
this
.
invoiceSve
.
invoicePage
(
pobj
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票明细(交付商)
* @param {*} pobj
*/
async
queryInvoiceDeliverer
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
apiQueryInvoiceDeliverer
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票试算接口
* @param {*} pobj
*/
async
calcInvoice
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
apiCalcInvoice
(
pobj
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
...
@@ -71,213 +49,16 @@ class InvoiceCtl extends CtlBase {
...
@@ -71,213 +49,16 @@ class InvoiceCtl extends CtlBase {
}
}
/**
/**
*
计算发票增值税
*
进度处理
* @param {*} pobj
* @param {*} pobj
*/
*/
async
calculationValueAddedTax
(
pobj
)
{
async
handleStatus
(
pobj
)
{
try
{
try
{
return
await
this
.
invoiceSve
.
calculationValueAddedTax
(
pobj
);
return
await
this
.
invoiceSve
.
handleStatus
(
pobj
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
}
}
/**
* 计算发票附加税
* @param {*} pobj
*/
async
calculationAdditionalTax
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
calculationAdditionalTax
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票申请保存
* @param {*} pobj
*/
async
saveInvoice
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
apiSaveInvoiceAdm
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 平台审批
* @param {*} pobj
*/
async
platformAssignment
(
pobj
){
try
{
let
nextStatus
=
this
.
trim
(
pobj
.
nextStatus
);
if
(
nextStatus
==
"1030"
){
//平台交付商分配
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
pobj
.
delivererAmount
=
system
.
y2f
(
pobj
.
delivererAmount
);
pobj
.
merchantId
=
this
.
trim
(
pobj
.
merchantId
);
pobj
.
delivererId
=
this
.
trim
(
pobj
.
delivererId
);
pobj
.
delivererName
=
this
.
trim
(
pobj
.
delivererName
);
}
else
if
(
nextStatus
==
"1070"
){
//平台提交审批
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
pobj
.
auditContent
=
this
.
trim
(
pobj
.
auditContent
);
pobj
.
delivererContent
=
this
.
trim
(
pobj
.
delivererContent
);
pobj
.
mailAddr
=
this
.
trim
(
pobj
.
mailAddr
);
pobj
.
mailMobile
=
this
.
trim
(
pobj
.
mailMobile
);
pobj
.
mailTo
=
this
.
trim
(
pobj
.
mailTo
);
}
else
if
(
nextStatus
==
"1090"
){
//平台完成
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
pobj
.
auditContent
=
this
.
trim
(
pobj
.
auditContent
);
pobj
.
delivererContent
=
this
.
trim
(
pobj
.
delivererContent
);
pobj
.
mailAddr
=
this
.
trim
(
pobj
.
mailAddr
);
pobj
.
mailMobile
=
this
.
trim
(
pobj
.
mailMobile
);
pobj
.
mailTo
=
this
.
trim
(
pobj
.
mailTo
);
}
else
if
(
nextStatus
==
"1300"
){
//平台第二次审核不通过
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
}
return
await
this
.
invoiceSve
.
apiPlatformAssignment
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 交付商审批
* @param {*} pobj
*/
async
delivererAssignment
(
pobj
){
try
{
let
nextStatus
=
this
.
trim
(
pobj
.
nextStatus
);
if
(
nextStatus
==
"1050"
){
//交付商审批
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
pobj
.
invoiceNo
=
this
.
trim
(
pobj
.
invoiceNo
);
pobj
.
invoiceImg
=
this
.
trim
(
pobj
.
invoiceImg
);
}
else
if
(
nextStatus
==
"1060"
){
//交付商提交审批
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
}
else
if
(
nextStatus
==
"1080"
){
//交付商邮寄
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
pobj
.
mailNo
=
this
.
trim
(
pobj
.
mailNo
);
}
else
if
(
nextStatus
==
"1040"
){
//交付商拒绝处理
pobj
.
breakReason
=
this
.
trim
(
pobj
.
breakReason
);
}
return
await
this
.
invoiceSve
.
apiDelivererAssignment
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 完税证明
* @param {*} pobj
*/
async
txPayment
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiTxPayment
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 查看完税证明
* @param {*} pobj
*/
async
queryTxPayment
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiQueryTxPayment
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票列表(交付商)
* @param {*} pobj
*/
async
delivererInvoices
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiDelivererInvoices
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票审核列表(交付商)
* @param {*} pobj
*/
async
delivererApplyInvoices
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiDelivererApplyInvoices
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票列表(平台)
* @param {*} pobj
*/
async
queryInvoices
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiQueryInvoices
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票申请列表(平台)
* @param {*} pobj
*/
async
queryApplyInvoices
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiQueryApplyInvoices
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 平台更新邮寄号(平台)
* @param {*} pobj
*/
async
upEmNo
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiUpEmNo
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
async
redrush
(
pobj
,
pobj2
,
req
,
res
)
{
try
{
return
await
this
.
invoiceSve
.
apiRedrush
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票红冲列表
* @param {*} pobj
* @param {*} pobj2
* @param {*} req
* @param {*} res
*/
async
redRushList
(
pobj
,
pobj2
,
req
,
res
){
try
{
return
await
this
.
invoiceSve
.
apiRedrushList
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
}
}
module
.
exports
=
InvoiceCtl
;
module
.
exports
=
InvoiceCtl
;
\ No newline at end of file
xgg-deliver/app/base/controller/impl/invoice/invoiceCtlbak.js
0 → 100644
View file @
b7e8e132
var
system
=
require
(
"../../../system"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
class
InvoiceCtl
extends
CtlBase
{
constructor
()
{
super
();
this
.
invoiceSve
=
system
.
getObject
(
"service.invoice.invoiceSve"
);
}
/**
* 申请发票校验
* @param {*} pobj
*/
async
verification
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
apiVerification
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 申请发票校验试算
* @param {*} pobj
*/
async
verificationAndCalculation
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
apiVerificationAndCalculation
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 查询明细(平台)
* @param {*} pobj
*/
async
queryInvoice
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
apiQueryInvoiceAdmin
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票明细(交付商)
* @param {*} pobj
*/
async
queryInvoiceDeliverer
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
apiQueryInvoiceDeliverer
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票试算接口
* @param {*} pobj
*/
async
calcInvoice
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
apiCalcInvoice
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 计算发票增值税
* @param {*} pobj
*/
async
calculationValueAddedTax
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
calculationValueAddedTax
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 计算发票附加税
* @param {*} pobj
*/
async
calculationAdditionalTax
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
calculationAdditionalTax
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票申请保存
* @param {*} pobj
*/
async
saveInvoice
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
apiSaveInvoiceAdm
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 平台审批
* @param {*} pobj
*/
async
platformAssignment
(
pobj
){
try
{
let
nextStatus
=
this
.
trim
(
pobj
.
nextStatus
);
if
(
nextStatus
==
"1030"
){
//平台交付商分配
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
pobj
.
delivererAmount
=
system
.
y2f
(
pobj
.
delivererAmount
);
pobj
.
merchantId
=
this
.
trim
(
pobj
.
merchantId
);
pobj
.
delivererId
=
this
.
trim
(
pobj
.
delivererId
);
pobj
.
delivererName
=
this
.
trim
(
pobj
.
delivererName
);
}
else
if
(
nextStatus
==
"1070"
){
//平台提交审批
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
pobj
.
auditContent
=
this
.
trim
(
pobj
.
auditContent
);
pobj
.
delivererContent
=
this
.
trim
(
pobj
.
delivererContent
);
pobj
.
mailAddr
=
this
.
trim
(
pobj
.
mailAddr
);
pobj
.
mailMobile
=
this
.
trim
(
pobj
.
mailMobile
);
pobj
.
mailTo
=
this
.
trim
(
pobj
.
mailTo
);
}
else
if
(
nextStatus
==
"1090"
){
//平台完成
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
pobj
.
auditContent
=
this
.
trim
(
pobj
.
auditContent
);
pobj
.
delivererContent
=
this
.
trim
(
pobj
.
delivererContent
);
pobj
.
mailAddr
=
this
.
trim
(
pobj
.
mailAddr
);
pobj
.
mailMobile
=
this
.
trim
(
pobj
.
mailMobile
);
pobj
.
mailTo
=
this
.
trim
(
pobj
.
mailTo
);
}
else
if
(
nextStatus
==
"1300"
){
//平台第二次审核不通过
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
}
return
await
this
.
invoiceSve
.
apiPlatformAssignment
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 交付商审批
* @param {*} pobj
*/
async
delivererAssignment
(
pobj
){
try
{
let
nextStatus
=
this
.
trim
(
pobj
.
nextStatus
);
if
(
nextStatus
==
"1050"
){
//交付商审批
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
pobj
.
invoiceNo
=
this
.
trim
(
pobj
.
invoiceNo
);
pobj
.
invoiceImg
=
this
.
trim
(
pobj
.
invoiceImg
);
}
else
if
(
nextStatus
==
"1060"
){
//交付商提交审批
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
}
else
if
(
nextStatus
==
"1080"
){
//交付商邮寄
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
pobj
.
mailNo
=
this
.
trim
(
pobj
.
mailNo
);
}
else
if
(
nextStatus
==
"1040"
){
//交付商拒绝处理
pobj
.
breakReason
=
this
.
trim
(
pobj
.
breakReason
);
}
return
await
this
.
invoiceSve
.
apiDelivererAssignment
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 完税证明
* @param {*} pobj
*/
async
txPayment
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiTxPayment
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 查看完税证明
* @param {*} pobj
*/
async
queryTxPayment
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiQueryTxPayment
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票列表(交付商)
* @param {*} pobj
*/
async
delivererInvoices
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiDelivererInvoices
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票审核列表(交付商)
* @param {*} pobj
*/
async
delivererApplyInvoices
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiDelivererApplyInvoices
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票列表(平台)
* @param {*} pobj
*/
async
queryInvoices
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiQueryInvoices
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票申请列表(平台)
* @param {*} pobj
*/
async
queryApplyInvoices
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiQueryApplyInvoices
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 平台更新邮寄号(平台)
* @param {*} pobj
*/
async
upEmNo
(
pobj
){
try
{
return
await
this
.
invoiceSve
.
apiUpEmNo
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
async
redrush
(
pobj
,
pobj2
,
req
,
res
)
{
try
{
return
await
this
.
invoiceSve
.
apiRedrush
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/**
* 发票红冲列表
* @param {*} pobj
* @param {*} pobj2
* @param {*} req
* @param {*} res
*/
async
redRushList
(
pobj
,
pobj2
,
req
,
res
){
try
{
return
await
this
.
invoiceSve
.
apiRedrushList
(
pobj
);
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
InvoiceCtl
;
\ No newline at end of file
xgg-deliver/app/base/controller/impl/uc/userCtl.js
View file @
b7e8e132
...
@@ -63,6 +63,10 @@ class UserCtl extends CtlBase {
...
@@ -63,6 +63,10 @@ class UserCtl extends CtlBase {
async
setLogin
(
user
)
{
async
setLogin
(
user
)
{
user
.
loginsid
=
"jfs_"
+
uuidv4
();
user
.
loginsid
=
"jfs_"
+
uuidv4
();
user
.
subsid
=
"sub_"
+
uuidv4
();
user
.
subsid
=
"sub_"
+
uuidv4
();
if
(
settings
.
env
==
'dev'
)
{
user
.
loginsid
=
"jfs_"
+
"3cb49932-fa02-44f0-90db-9f06fe02e5c7"
;
user
.
subsid
=
"sub_"
+
"3cb49932-fa02-44f0-90db-9f06fe02e5c7"
;
}
// xggadminsid = "jfs_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
// xggadminsid = "jfs_" + "3cb49932-fa02-44f0-90db-9f06fe02e5c7";
await
this
.
redisClient
.
setWithEx
(
user
.
loginsid
,
JSON
.
stringify
(
user
),
60
*
60
*
5
);
await
this
.
redisClient
.
setWithEx
(
user
.
loginsid
,
JSON
.
stringify
(
user
),
60
*
60
*
5
);
await
this
.
redisClientTax
.
setWithEx
(
user
.
subsid
,
(
user
.
nt_user_id
||
""
).
toString
(),
60
*
60
*
5
);
await
this
.
redisClientTax
.
setWithEx
(
user
.
subsid
,
(
user
.
nt_user_id
||
""
).
toString
(),
60
*
60
*
5
);
...
...
xgg-deliver/app/base/service/impl/invoice/invoiceSve.js
View file @
b7e8e132
...
@@ -4,869 +4,33 @@ const settings = require("../../../../config/settings")
...
@@ -4,869 +4,33 @@ const settings = require("../../../../config/settings")
class
InvoiceService
extends
ServiceBase
{
class
InvoiceService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
status
=
{
"0090"
:
{
"status"
:
"0090"
,
"name"
:
"未付款"
,
"next"
:
"1000"
,
"cstatus"
:
"0090"
,
//客户
"dstatus"
:
""
,
//交付商
},
"1000"
:
{
"status"
:
"1000"
,
"name"
:
"待审核"
,
"next"
:
"1020"
,
"cstatus"
:
"0090"
,
//客户
"dstatus"
:
""
,
//交付商
},
"1010"
:
{
"status"
:
"1010"
,
"name"
:
"审核不通过"
,
"next"
:
""
,
"cstatus"
:
"1010"
,
"dstatus"
:
""
,
},
"1020"
:
{
"status"
:
"1020"
,
"name"
:
"待分配"
,
"next"
:
"1030"
,
"cstatus"
:
"1030"
,
"dstatus"
:
""
,
},
"1030"
:
{
"status"
:
"1030"
,
"name"
:
"待处理"
,
"next"
:
"1050"
,
"cstatus"
:
"1030"
,
"dstatus"
:
"1030"
,
},
"1040"
:
{
"status"
:
"1040"
,
"name"
:
"交付商关闭"
,
"next"
:
"1020"
,
"cstatus"
:
"1030"
,
"dstatus"
:
"1040"
,
},
"1050"
:
{
"status"
:
"1050"
,
"name"
:
"已开具"
,
"next"
:
"1060"
,
"cstatus"
:
"1050"
,
"dstatus"
:
"1050"
,
},
"1060"
:
{
"status"
:
"1060"
,
"name"
:
"待审核"
,
"next"
:
"1070"
,
"cstatus"
:
"1050"
,
"dstatus"
:
"1070"
,
},
"1070"
:
{
"status"
:
"1070"
,
"name"
:
"审核通过"
,
"next"
:
"1080"
,
"cstatus"
:
"1050"
,
"dstatus"
:
"1070"
,
},
"1080"
:
{
"status"
:
"1080"
,
"name"
:
"已邮寄"
,
"next"
:
"1090"
,
"cstatus"
:
"1050"
,
"dstatus"
:
"1080"
,
},
"1090"
:
{
"status"
:
"1090"
,
"name"
:
"完成"
,
"next"
:
"1100"
,
"cstatus"
:
"1090"
,
"dstatus"
:
"1080"
,
},
"1100"
:
{
"status"
:
"1090"
,
"name"
:
"发票撤回"
,
"next"
:
"1100"
,
"cstatus"
:
"1090"
,
"dstatus"
:
"1080"
,
},
"1200"
:
{
"status"
:
"1200"
,
"name"
:
"红冲"
,
"next"
:
""
,
"cstatus"
:
"1200"
,
"dstatus"
:
""
,
},
"1300"
:
{
"status"
:
"1300"
,
"name"
:
"审核失败(平台第二次审核)"
,
"next"
:
"1060"
,
"cstatus"
:
"1050"
,
"dstatus"
:
"1060"
,
}
};
}
}
async
processDics
(
params
)
{
async
apiCalcInvoice
(
pobj
)
{
var
rs
=
await
this
.
callms
(
"invoice"
,
"processDics"
,
params
);
var
merchantId
=
pobj
.
merchant_id
||
pobj
.
merchantId
;
return
rs
;
var
invoiceList
=
pobj
.
invoiceList
;
if
(
!
invoiceList
||
invoiceList
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"请传入试算开票信息"
);
}
var
creditCodes
=
[];
for
(
var
invoice
of
invoiceList
)
{
creditCodes
.
push
(
invoice
.
businessmenCreditCode
);
}
// 查询个体户签约信息
var
mapRs
=
await
this
.
callms
(
"order"
,
"businessmenCompleteMapByCreditCodes"
,
{
creditCodes
:
creditCodes
});
var
map
=
mapRs
.
data
;
var
result
=
[];
for
(
var
invoice
of
invoiceList
)
{
var
calc
=
{
creditCode
:
invoice
.
businessmenCreditCode
,
incomeTax
:
0
,
addedValueTax
:
0
,
serviceTax
:
0
,
specialTax
:
0
,
warning
:
""
,
monthAmt
:
0
,
};
var
signInfo
=
map
[
invoice
.
businessmenCreditCode
];
if
(
!
signInfo
)
{
calc
.
code
=
-
1
;
calc
.
msg
=
"个体工商户【"
+
invoice
.
businessmenCreditCode
+
"】不存在"
;
result
.
push
(
calc
);
continue
;
}
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
.
ruleCode
=
this
.
trim
(
invoice
.
ruleCode
)
||
"10"
;
invoice
.
perCalWay
=
signInfo
.
taxUpType
;
// TODO 确定值
invoice
.
valCalWay
=
signInfo
.
addValueUpType
;
// TODO 确定值
invoice
.
businessmenId
=
signInfo
.
id
;
invoice
.
serviceRate
=
system
.
f2y
(
signInfo
.
serviceRate
);
invoice
.
taxCostPriRat
=
system
.
f2y
(
signInfo
.
costRate
);
invoice
.
taxIncPriRat
=
system
.
f2y
(
signInfo
.
taxRate
);
if
(
invoice
.
type
==
1
)
{
invoice
.
perIncTaxRange
=
JSON
.
parse
(
signInfo
.
specialTaxLadder
);
invoice
.
valAddTaxRange
=
JSON
.
parse
(
signInfo
.
specialOtherLadder
);
}
else
{
invoice
.
perIncTaxRange
=
JSON
.
parse
(
signInfo
.
commonTaxLadder
);
invoice
.
valAddTaxRange
=
JSON
.
parse
(
signInfo
.
commonOtherLadder
);
}
try
{
console
.
log
(
JSON
.
stringify
(
invoice
));
var
rs
=
await
this
.
callms
(
"invoice"
,
"verificationAndCalculation"
,
invoice
);
if
(
rs
.
status
==
0
&&
rs
.
data
)
{
var
calcRs
=
rs
.
data
;
calc
.
code
=
1
;
calc
.
incomeTax
=
Number
(
calcRs
.
personalIncomeTax
||
0
).
toFixed
(
0
);
calc
.
addedValueTax
=
Number
(
calcRs
.
valueAddedTax
||
0
).
toFixed
(
0
);
calc
.
serviceTax
=
Number
(
calcRs
.
serviceCharge
||
0
).
toFixed
(
0
);
calc
.
specialTax
=
Number
(
calcRs
.
additionalTax
||
0
).
toFixed
(
0
);
calc
.
warning
=
this
.
trim
(
calcRs
.
warning
);
calc
.
monthAmt
=
0
;
calc
.
msg
=
"success"
;
}
else
{
calc
.
code
=
-
1
;
calc
.
msg
=
rs
.
msg
||
"发票服务异常"
;
}
console
.
log
(
rs
);
}
catch
(
error
)
{
calc
.
code
=
-
1
;
calc
.
msg
=
"发票服务异常,请联系公司宝"
;
console
.
log
(
error
);
}
result
.
push
(
calc
);
}
return
system
.
getResultSuccess
(
result
);
}
}
async
apiVerificationAndCalculation
(
pobj
)
{
async
invoiceApply
(
params
)
{
pobj
.
serviceRate
=
Number
(
pobj
.
serviceRate
)
*
100
;
var
rs
=
await
this
.
callms
(
"invoice"
,
"invoiceApply"
,
params
);
pobj
.
taxIncPriRat
=
Number
(
pobj
.
taxIncPriRat
)
*
100
;
return
rs
;
pobj
.
taxCostPriRat
=
Number
(
pobj
.
taxCostPriRat
)
*
100
;
pobj
.
invoiceAmount
=
system
.
y2f
(
pobj
.
invoiceAmount
);
var
rs
=
await
this
.
callms
(
"invoice"
,
"verificationAndCalculation"
,
pobj
);
if
(
rs
.
status
==
0
)
{
return
rs
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
}
async
apiSaveInvoice
(
pobj
)
{
async
invoicePage
(
params
)
{
var
merchantId
=
pobj
.
merchant_id
||
pobj
.
merchantId
;
params
.
currentPage
=
Number
(
params
.
currentPage
||
1
);
var
invoiceList
=
pobj
.
invoiceList
;
params
.
pageSize
=
Number
(
params
.
pageSize
||
10
);
if
(
!
invoiceList
||
invoiceList
.
length
==
0
)
{
var
rs
=
await
this
.
callms
(
"invoice"
,
"deliverInvoicePage"
,
params
);
return
system
.
getResult
(
null
,
"请传入试算开票信息"
);
if
(
rs
.
data
&&
rs
.
data
.
rows
)
{
}
for
(
let
item
of
rs
.
data
.
rows
)
{
var
creditCodes
=
[];
item
.
invoice_amount
=
system
.
f2y
(
item
.
invoice_amount
);
for
(
var
invoice
of
invoiceList
)
{
creditCodes
.
push
(
invoice
.
businessmenCreditCode
);
}
// 查商户titile
var
merchantRs
=
await
this
.
callms
(
"merchant"
,
"getById"
,
{
id
:
merchantId
});
var
merchant
=
merchantRs
.
data
||
{};
var
title
=
await
this
.
callms
(
"merchant"
,
"getMerchantTitleDefault"
,
{
merchantId
:
merchantId
});
title
=
title
.
data
;
var
address
=
await
this
.
callms
(
"merchant"
,
"getMerchantAddressDefault"
,
{
merchantId
:
merchantId
});
var
address
=
address
.
data
||
{};
// 查询个体户签约信息
var
mapRs
=
await
this
.
callms
(
"order"
,
"businessmenCompleteMapByCreditCodes"
,
{
creditCodes
:
creditCodes
});
var
map
=
mapRs
.
data
;
var
result
=
[];
for
(
var
invoice
of
invoiceList
)
{
var
data
=
{
creditCode
:
invoice
.
businessmenCreditCode
,
code
:
1
,
msg
:
"success"
,
applyNo
:
invoice
.
applyNo
,
};
var
signInfo
=
map
[
invoice
.
businessmenCreditCode
];
if
(
!
signInfo
)
{
data
.
code
=
-
1
;
data
.
msg
=
"个体工商户【"
+
invoice
.
businessmenCreditCode
+
"】不存在"
;
result
.
push
(
data
);
continue
;
}
// 发票类型:10 普通发票 20 增值税专用发票 30 电子发票
if
(
invoice
.
type
===
0
)
{
invoice
.
type
==
"10"
;
}
else
if
(
invoice
.
type
===
1
)
{
invoice
.
type
==
"20"
;
}
else
{
invoice
.
type
==
"30"
;
}
// 购买方
invoice
.
merchantId
=
merchantId
;
invoice
.
merchantName
=
merchant
.
name
;
invoice
.
merchantCreditCode
=
title
.
taxNo
;
invoice
.
merchantAddr
=
title
.
invoiceAddr
;
invoice
.
merchantMobile
=
title
.
invoiceMobile
;
invoice
.
merchantBank
=
title
.
accountName
;
invoice
.
merchantAccount
=
title
.
accountPublic
;
// 申请方联系电话
invoice
.
applyPhone
=
merchant
.
contactMobile
;
// 邮寄地址
invoice
.
mailAddr
=
address
.
mailAddr
;
invoice
.
mailMobile
=
address
.
mailMobile
;
invoice
.
mailTo
=
address
.
mailTo
;
invoice
.
invoiceAmount
=
Number
(
invoice
.
invoiceAmt
);
invoice
.
invoiceTime
=
this
.
trim
(
invoice
.
invoiceTime
);
invoice
.
businessmenCreditCode
=
this
.
trim
(
invoice
.
businessmenCreditCode
);
// 开票内容
if
(
signInfo
.
invoicecontents
&&
signInfo
.
invoicecontents
.
length
>
0
)
{
invoice
.
invoiceContent
=
signInfo
.
invoicecontents
[
0
].
invoicecontentName
;
}
else
{
invoice
.
invoiceContent
=
"服务费"
;
}
invoice
.
settleImg
=
""
;
invoice
.
statements
=
invoice
.
settleImg
;
invoice
.
contract
=
""
;
invoice
.
applyNo
=
invoice
.
applyNo
;
invoice
.
perCalWay
=
signInfo
.
taxUpType
;
invoice
.
valCalWay
=
signInfo
.
addValueUpType
;
// 销售方信息
invoice
.
businessmenType
=
this
.
trim
(
invoice
.
businessmenType
)
||
"10"
;
invoice
.
ruleCode
=
this
.
trim
(
invoice
.
ruleCode
)
||
"10"
;
invoice
.
businessmenId
=
signInfo
.
id
;
invoice
.
businessName
=
signInfo
.
name
;
invoice
.
isBank
=
signInfo
.
isBank
;
invoice
.
taxAuthorities
=
signInfo
.
taxOrg
;
// invoice.taxCostPriRat = signInfo.costRate;
// invoice.taxIncPriRat = signInfo.taxRate;
invoice
.
serviceRate
=
system
.
f2y
(
signInfo
.
serviceRate
);
invoice
.
taxCostPriRat
=
system
.
f2y
(
signInfo
.
costRate
);
invoice
.
taxIncPriRat
=
system
.
f2y
(
signInfo
.
taxRate
);
if
(
invoice
.
type
==
1
)
{
invoice
.
perIncTaxRange
=
JSON
.
parse
(
signInfo
.
specialTaxLadder
);
invoice
.
valAddTaxRange
=
JSON
.
parse
(
signInfo
.
specialOtherLadder
);
}
else
{
invoice
.
perIncTaxRange
=
JSON
.
parse
(
signInfo
.
commonTaxLadder
);
invoice
.
valAddTaxRange
=
JSON
.
parse
(
signInfo
.
commonOtherLadder
);
}
try
{
var
rs
=
await
this
.
callms
(
"invoice"
,
"saveInvoice"
,
invoice
);
if
(
rs
.
status
!=
0
)
{
data
.
code
=
-
1
;
data
.
msg
=
rs
.
msg
||
"发票服务异常"
;
}
console
.
log
(
rs
);
}
catch
(
error
)
{
data
.
code
=
-
1
;
data
.
msg
=
"发票服务异常,请联系公司宝"
;
console
.
log
(
error
);
}
}
result
.
push
(
data
);
}
return
system
.
getResultSuccess
(
result
);
}
async
apiCancelInvoice
(
pobj
)
{
var
params
=
{
applyNo
:
pobj
.
applyNo
,
merchantId
:
pobj
.
merchantId
||
pobj
.
merchant_id
}
var
rs
=
await
this
.
callms
(
"invoice"
,
"apiCancelInvoice"
,
params
);
if
(
rs
.
data
)
{
rs
.
data
=
null
;
}
}
return
rs
;
return
rs
;
}
}
async
apiQueryInvoice
(
pobj
)
{
async
handleStatus
(
params
)
{
var
params
=
{
var
rs
=
await
this
.
callms
(
"invoice"
,
"handleStatus"
,
params
);
applyNo
:
pobj
.
applyNo
,
merchantId
:
pobj
.
merchantId
||
pobj
.
merchant_id
}
// queryInvoices
var
rs
=
await
this
.
callms
(
"invoice"
,
"queryInvoice"
,
params
);
if
(
rs
.
status
!=
0
||
!
rs
.
data
)
{
return
system
.
getResult
(
null
,
"发票不存在"
);
}
var
invoiceApply
=
rs
.
data
||
{};
var
invoice
=
invoiceApply
.
invoice
||
{};
var
result
=
{
"merchantId"
:
this
.
trim
(
invoiceApply
.
merchantId
),
"applyNo"
:
this
.
trim
(
invoiceApply
.
applyNo
),
"status"
:
this
.
trim
(
invoiceApply
.
customerStatus
),
"auditRemark"
:
this
.
trim
(
invoiceApply
.
remark
),
"invoiceNo"
:
this
.
trim
(
invoiceApply
.
id
),
"payVoucher"
:
this
.
trim
(
invoiceApply
.
statements
),
"courierImg"
:
""
,
"courierNo"
:
this
.
trim
(
invoice
.
mailNo
),
"invoiceTime"
:
this
.
trim
(
invoice
.
invoiceTime
),
"invoiceImg"
:
this
.
trim
(
invoice
.
invoiceImg
),
"complateTax"
:
this
.
trim
(
invoice
.
complateTax
),
"taxNo"
:
this
.
trim
(
invoice
.
taxNo
),
"taxTime"
:
this
.
trim
(
invoice
.
taxTime
),
"taxVoucher"
:
this
.
trim
(
invoice
.
taxVoucher
),
}
return
system
.
getResultSuccess
(
result
);
}
async
apiQueryTaxInvoice
(
pobj
)
{
var
params
=
{
applyNo
:
pobj
.
applyNo
,
merchantId
:
pobj
.
merchantId
||
pobj
.
merchant_id
,
id
:
pobj
.
id
}
// queryInvoices
var
rs
=
await
this
.
callms
(
"invoice"
,
"getByApplyNo"
,
params
);
if
(
rs
.
status
!=
0
||
!
rs
.
data
)
{
return
system
.
getResult
(
null
,
"发票不存在"
);
}
var
invoice
=
rs
.
data
||
{};
var
paytaxes
=
invoice
.
paytaxes
||
{};
this
.
handleDate
(
paytaxes
,
[
"payTaxesTime"
],
"YYYY-MM-DD"
,
-
8
);
var
result
=
{
"merchantId"
:
this
.
trim
(
invoice
.
merchantId
),
"applyNo"
:
this
.
trim
(
invoice
.
applyNo
),
"taxNo"
:
this
.
trim
(
paytaxes
.
payTaxesNo
),
"taxTime"
:
this
.
trim
(
paytaxes
.
payTaxesTime
),
"taxVoucher"
:
this
.
trim
(
paytaxes
.
payTaxesImg
),
}
return
system
.
getResultSuccess
(
result
);
}
/**
* 发票明细(平台)
* @param {*} pobj
* @param {string} id
* @param {string} applyNo
* @param {string} merchant_id
*/
async
apiQueryInvoiceAdmin
(
pobj
)
{
var
params
=
{
applyNo
:
pobj
.
applyNo
,
merchantId
:
pobj
.
merchantId
||
pobj
.
merchant_id
,
id
:
pobj
.
id
||
null
}
var
res
=
await
this
.
callms
(
"invoice"
,
"queryInvoice"
,
params
);
if
(
res
.
status
!=
0
||
!
res
.
data
)
{
return
system
.
getResult
(
null
,
"发票不存在"
);
}
res
.
data
.
invoiceAmount
=
system
.
f2y
(
res
.
data
.
invoiceAmount
);
res
.
data
.
personalIncomeTax
=
system
.
f2y
(
res
.
data
.
personalIncomeTax
);
res
.
data
.
additionalTax
=
system
.
f2y
(
res
.
data
.
additionalTax
);
res
.
data
.
valueAddedTax
=
system
.
f2y
(
res
.
data
.
valueAddedTax
);
res
.
data
.
serviceCharge
=
system
.
f2y
(
res
.
data
.
serviceCharge
);
res
.
data
.
isBank
=
res
.
data
.
isBank
==
1
?
"已开户"
:
"未开户"
;
if
(
res
.
data
.
type
==
10
)
{
res
.
data
.
type
=
"普通发票"
;
}
else
if
(
res
.
data
.
type
==
20
)
{
res
.
data
.
type
=
"增值税专用发票"
;
}
else
{
res
.
data
.
type
=
"电子发票"
}
res
.
data
.
payWay
=
res
.
data
.
payWay
==
"20"
?
"线上支付"
:
"系统账户扣款"
;
res
.
data
.
isPay
=
res
.
data
.
isPay
==
1
?
"已支付"
:
"未付款"
;
res
.
data
.
isInvalid
=
res
.
data
.
isInvalid
===
2
?
'未红冲'
:
'已红冲'
;
res
.
data
.
deliverer
.
delivererAmount
=
system
.
f2y
(
res
.
data
.
deliverer
.
delivererAmount
);
res
.
data
.
invoice
.
complateTax
=
res
.
data
.
invoice
.
complateTax
==
"1"
?
"已完税"
:
"未完税"
;
this
.
handleDate
(
res
.
data
,
[
"invoiceTime"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
,
[
"createdAt"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
'deliverer'
],
[
"createdAt"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
'deliverer'
],
[
"updatedAt"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
'invoice'
],
[
"invoiceTime"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
'invoice'
],
[
"taxTime"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
"invoice"
],
[
"createdAt"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
"invoice"
],
[
"updatedAt"
],
"YYYY-MM-DD"
,
-
8
);
return
res
;
}
/**
* 发票明细(交付商)
* @param {*} pobj
* @param {string} id
* @param {string} applyNo
* @param {string} merchant_id
*/
async
apiQueryInvoiceDeliverer
(
pobj
)
{
var
params
=
{
applyNo
:
pobj
.
applyNo
,
merchantId
:
pobj
.
merchantId
||
pobj
.
merchant_id
,
id
:
pobj
.
id
||
null
}
var
rs
=
await
this
.
callms
(
"invoice"
,
"queryInvoiceDeliverer"
,
params
);
if
(
rs
.
status
!=
0
||
!
rs
.
data
)
{
return
system
.
getResult
(
null
,
"发票不存在"
);
}
rs
.
data
.
invoiceAmount
=
system
.
f2y
(
rs
.
data
.
invoiceAmount
);
rs
.
data
.
personalIncomeTax
=
system
.
f2y
(
rs
.
data
.
personalIncomeTax
);
rs
.
data
.
additionalTax
=
system
.
f2y
(
rs
.
data
.
additionalTax
);
rs
.
data
.
valueAddedTax
=
system
.
f2y
(
rs
.
data
.
valueAddedTax
);
rs
.
data
.
serviceCharge
=
system
.
f2y
(
rs
.
data
.
serviceCharge
);
return
rs
;
}
/**
* 校验审核
* @param {*} pobj
*/
async
apiVerification
(
pobj
)
{
var
params
=
{
businessmenCreditCode
:
pobj
.
businessmenCreditCode
}
var
rs
=
await
this
.
callms
(
"invoice"
,
"verification"
,
params
);
if
(
rs
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
"发票不存在"
);
}
return
rs
;
return
rs
;
}
}
/**
* 试算
* @param {*} pobj
*/
async
apiCalcInvoice2
(
pobj
)
{
pobj
.
serviceRate
=
Number
(
pobj
.
serviceRate
||
0
)
*
100
;
pobj
.
taxIncPriRat
=
Number
(
pobj
.
taxIncPriRat
||
0
)
*
100
;
pobj
.
taxCostPriRat
=
Number
(
pobj
.
taxCostPriRat
||
0
)
*
100
;
pobj
.
invoiceAmount
=
system
.
y2f
(
pobj
.
invoiceAmount
||
0
);
var
rs
=
await
this
.
callms
(
"invoice"
,
"verificationAndCalculation"
,
pobj
);
if
(
rs
.
status
==
0
)
{
return
rs
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 保存发票申请(提供管理)
* @param {*} pobj
*/
async
apiSaveInvoiceAdm
(
pobj
)
{
pobj
.
serviceRate
=
Number
(
pobj
.
serviceRate
)
*
100
;
pobj
.
taxIncPriRat
=
Number
(
pobj
.
taxIncPriRat
)
*
100
;
pobj
.
taxCostPriRat
=
Number
(
pobj
.
taxCostPriRat
)
*
100
;
pobj
.
invoiceAmount
=
system
.
y2f
(
pobj
.
invoiceAmount
);
var
rs
=
await
this
.
callms
(
"invoice"
,
"saveInvoice"
,
pobj
);
if
(
rs
.
status
==
0
)
{
return
rs
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 平台审批
* @param {*} pobj
*/
async
apiPlatformAssignment
(
pobj
)
{
if
(
!
pobj
.
nextStatus
)
{
return
system
.
getResult
(
null
,
`参数错误`
);
}
var
rs
=
await
this
.
callms
(
"invoice"
,
"platformAssignment"
,
pobj
);
if
(
rs
.
status
==
0
)
{
this
.
pushDeliver
(
pobj
);
return
rs
;
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 交付商审批
* @param {*} pobj
*/
async
apiDelivererAssignment
(
pobj
)
{
if
(
!
pobj
.
nextStatus
)
{
return
system
.
getResult
(
null
,
`参数错误`
);
}
var
rs
=
await
this
.
callms
(
"invoice"
,
"delivererAssignment"
,
pobj
);
if
(
rs
.
status
==
0
)
{
this
.
pushDeliver
(
pobj
);
return
rs
;
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 完税证明
* @param {*} pobj
*/
async
apiTxPayment
(
pobj
)
{
let
params
=
{};
params
.
id
=
this
.
trim
(
pobj
.
id
);
params
.
taxNo
=
this
.
trim
(
pobj
.
taxNo
);
params
.
complateTax
=
this
.
trim
(
pobj
.
complateTax
);
params
.
taxTime
=
this
.
trim
(
pobj
.
taxTime
);
params
.
taxVoucher
=
this
.
trim
(
pobj
.
taxVoucher
);
var
rs
=
await
this
.
callms
(
"invoice"
,
"txPayment"
,
params
);
if
(
rs
.
status
==
0
)
{
return
rs
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 查看完税证明
* @param {*} pobj
*/
async
apiQueryTxPayment
(
pobj
)
{
let
params
=
{};
params
.
id
=
this
.
trim
(
pobj
.
id
);
var
rs
=
await
this
.
callms
(
"invoice"
,
"queryTxPayment"
,
params
);
if
(
rs
.
status
==
0
)
{
return
rs
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 发票列表(交付商)
* @param {*} pobj
*/
async
apiDelivererInvoices
(
pobj
)
{
if
(
pobj
.
pageIndex
)
{
pobj
.
pageIndex
=
Number
(
pobj
.
pageIndex
)
||
1
;
}
if
(
pobj
.
pageSize
)
{
pobj
.
pageSize
=
Number
(
pobj
.
pageSize
)
||
10
;
}
let
res
=
await
this
.
callms
(
"invoice"
,
"delivererInvoices"
,
pobj
);
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
invoice_amount
=
system
.
f2y
(
item
.
invoice_amount
);
}
if
(
res
.
status
==
0
)
{
return
res
;
}
else
{
return
system
.
getResult
(
null
,
res
.
msg
);
}
}
/**
* 发票申请列表(交付商)
* @param {*} pobj
*/
async
apiDelivererApplyInvoices
(
pobj
)
{
if
(
pobj
.
pageIndex
)
{
pobj
.
pageIndex
=
Number
(
pobj
.
pageIndex
)
||
1
;
}
if
(
pobj
.
pageSize
)
{
pobj
.
pageSize
=
Number
(
pobj
.
pageSize
)
||
10
;
}
let
res
=
await
this
.
callms
(
"invoice"
,
"delivererApplyInvoices"
,
pobj
);
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
invoice_amount
=
system
.
f2y
(
item
.
invoice_amount
);
}
if
(
res
.
status
==
0
)
{
return
res
;
}
else
{
return
system
.
getResult
(
null
,
res
.
msg
);
}
}
/**
* 发票列表(平台)
* @param {*} pobj
*/
async
apiQueryInvoices
(
pobj
)
{
pobj
.
pageIndex
=
Number
(
pobj
.
pageIndex
||
1
);
pobj
.
pageSize
=
Number
(
pobj
.
pageSize
||
10
);
var
complateTax
=
this
.
trim
(
pobj
.
complateTax
);
if
(
complateTax
===
""
)
{
complateTax
=
"-1"
;
}
pobj
.
complateTax
=
complateTax
;
pobj
.
statuses
=
[
'1070'
,
'1080'
,
'1090'
];
let
res
=
await
this
.
callms
(
"invoice"
,
"queryInvoices"
,
pobj
);
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
apply
.
invoice_amount
=
system
.
f2y
(
item
.
apply
.
invoice_amount
);
}
if
(
res
.
status
==
0
)
{
return
res
;
}
else
{
return
system
.
getResult
(
null
,
res
.
msg
);
}
}
/**
* 发票申请列表(平台)
* @param {*} pobj
*/
async
apiQueryApplyInvoices
(
pobj
)
{
pobj
.
pageIndex
=
Number
(
pobj
.
pageIndex
||
1
);
pobj
.
pageSize
=
Number
(
pobj
.
pageSize
||
10
);
let
res
=
await
this
.
callms
(
"invoice"
,
"queryApplyInvoices"
,
pobj
);
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
invoiceAmount
=
system
.
f2y
(
item
.
invoiceAmount
);
item
.
personalIncomeTax
=
system
.
f2y
(
item
.
personalIncomeTax
);
item
.
valueAddedTax
=
system
.
f2y
(
item
.
valueAddedTax
);
item
.
serviceCharge
=
system
.
f2y
(
item
.
serviceCharge
);
item
.
additionalTax
=
system
.
f2y
(
item
.
additionalTax
);
}
if
(
res
.
status
==
0
)
{
return
res
;
}
else
{
return
system
.
getResult
(
null
,
res
.
msg
);
}
}
/**
* 更新邮寄单号(平台)
* @param {*} pobj
*/
async
apiUpEmNo
(
pobj
)
{
if
(
pobj
.
id
)
{
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
}
if
(
pobj
.
platformMailNo
)
{
pobj
.
platformMailNo
=
this
.
trim
(
pobj
.
platformMailNo
);
}
let
res
=
await
this
.
callms
(
"invoice"
,
"updateEmail"
,
pobj
);
if
(
res
.
status
==
0
)
{
return
res
;
}
else
{
return
system
.
getResult
(
null
,
res
.
msg
);
}
}
async
pushDeliver
(
obj
)
{
var
status
=
obj
.
nextStatus
;
if
(
!
status
)
{
return
;
}
var
pushStatus
=
[
"1010"
,
"1030"
,
"1050"
,
"1090"
];
// 0090开票申请 1010审核驳回 1030审核通过 1050已开票 1090已完成
if
(
pushStatus
.
indexOf
(
status
)
==
-
1
)
{
return
;
}
// 查发票
var
invoiceApply
=
await
this
.
callms
(
"invoice"
,
"queryInvoice"
,
{
id
:
obj
.
id
});
invoiceApply
=
invoiceApply
.
data
;
if
(
!
invoice
)
{
console
.
log
(
"推送信息失败["
+
JSON
.
stringify
(
obj
)
+
"],发票不存在 ------------------------"
);
return
;
}
var
invoice
=
invoiceApply
.
invoice
||
{};
var
merchant
=
await
this
.
callms
(
"merchant"
,
"secretById"
,
{
id
:
order
.
merchant_id
});
merchant
=
merchant
.
data
;
if
(
!
merchant
)
{
console
.
log
(
"推送信息失败["
+
JSON
.
stringify
(
obj
)
+
"],商户不存在 ------------------------"
);
return
;
}
var
options
=
{
merchantId
:
merchant
.
id
,
appKey
:
merchant
.
appSecret
,
dataType
:
3
,
dataId
:
invoiceApply
.
id
,
field
:
"invoiceStatus"
,
};
var
params
=
{
merchantId
:
merchant
.
id
,
status
:
status
,
applyNo
:
invoiceApply
.
applyNo
,
}
// 0090开票申请 1030审核通过 1050已开票 1090已完成
if
(
status
==
"1010"
)
{
// 1010审核驳回
params
.
auditRemark
=
this
.
trim
(
invoiceApply
.
remark
);
}
else
if
(
status
==
"1030"
)
{
// 1030审核通过
params
.
auditRemark
=
this
.
trim
(
invoiceApply
.
remark
);
}
else
if
(
status
==
"1050"
)
{
// invoiceNo : String :发票编号
params
.
invoiceNo
=
this
.
trim
(
invoiceApply
.
id
);
// invoiceTime : String :开票时间
params
.
invoiceTime
=
this
.
trim
(
invoice
.
invoiceTime
);
// invoiceImg : String :发票照片
params
.
invoiceImg
=
this
.
trim
(
invoice
.
invoiceImg
);
// payVoucher : String :支付凭证
params
.
payVoucher
=
this
.
trim
(
invoiceApply
.
statements
);
}
else
if
(
status
==
"1090"
)
{
// courierNo : String :快递单号
params
.
courierNo
=
this
.
trim
(
invoice
.
mailNo
);
// courierImg : String :快递交接单图片
params
.
courierImg
=
""
;
}
else
{
return
;
}
options
.
params
=
params
;
await
this
.
pushapiSve
.
push
(
options
);
}
async
redrush
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"redRushInvoice"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
//交易数据 平台
async
statManageData
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"statTransData"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//发票办理 平台
async
statBusinessData
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"statBusinessData"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
/**
* 交易数据(交付商)
* @param {*} params
*/
async
delStatManageData
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"delStatTransData"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//发票办理(交付商)
async
delStatBusinessData
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"delStatBusinessData"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//交付商列表(平台)
async
statDeliverData
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"statDeliverData"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//计算发票增值税
async
calculationValueAddedTax
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"calculationValueAddedTax"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//计算发票附加税
async
calculationAdditionalTax
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"calculationAdditionalTax"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
apiRedrushList
(
params
){
try
{
return
await
this
.
callms
(
"invoice"
,
"redrushList"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
}
module
.
exports
=
InvoiceService
;
module
.
exports
=
InvoiceService
;
\ No newline at end of file
xgg-deliver/app/base/service/impl/invoice/invoiceSvebak.js
0 → 100644
View file @
b7e8e132
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
const
settings
=
require
(
"../../../../config/settings"
)
class
InvoiceService
extends
ServiceBase
{
constructor
()
{
super
();
this
.
status
=
{
"0090"
:
{
"status"
:
"0090"
,
"name"
:
"未付款"
,
"next"
:
"1000"
,
"cstatus"
:
"0090"
,
//客户
"dstatus"
:
""
,
//交付商
},
"1000"
:
{
"status"
:
"1000"
,
"name"
:
"待审核"
,
"next"
:
"1020"
,
"cstatus"
:
"0090"
,
//客户
"dstatus"
:
""
,
//交付商
},
"1010"
:
{
"status"
:
"1010"
,
"name"
:
"审核不通过"
,
"next"
:
""
,
"cstatus"
:
"1010"
,
"dstatus"
:
""
,
},
"1020"
:
{
"status"
:
"1020"
,
"name"
:
"待分配"
,
"next"
:
"1030"
,
"cstatus"
:
"1030"
,
"dstatus"
:
""
,
},
"1030"
:
{
"status"
:
"1030"
,
"name"
:
"待处理"
,
"next"
:
"1050"
,
"cstatus"
:
"1030"
,
"dstatus"
:
"1030"
,
},
"1040"
:
{
"status"
:
"1040"
,
"name"
:
"交付商关闭"
,
"next"
:
"1020"
,
"cstatus"
:
"1030"
,
"dstatus"
:
"1040"
,
},
"1050"
:
{
"status"
:
"1050"
,
"name"
:
"已开具"
,
"next"
:
"1060"
,
"cstatus"
:
"1050"
,
"dstatus"
:
"1050"
,
},
"1060"
:
{
"status"
:
"1060"
,
"name"
:
"待审核"
,
"next"
:
"1070"
,
"cstatus"
:
"1050"
,
"dstatus"
:
"1070"
,
},
"1070"
:
{
"status"
:
"1070"
,
"name"
:
"审核通过"
,
"next"
:
"1080"
,
"cstatus"
:
"1050"
,
"dstatus"
:
"1070"
,
},
"1080"
:
{
"status"
:
"1080"
,
"name"
:
"已邮寄"
,
"next"
:
"1090"
,
"cstatus"
:
"1050"
,
"dstatus"
:
"1080"
,
},
"1090"
:
{
"status"
:
"1090"
,
"name"
:
"完成"
,
"next"
:
"1100"
,
"cstatus"
:
"1090"
,
"dstatus"
:
"1080"
,
},
"1100"
:
{
"status"
:
"1090"
,
"name"
:
"发票撤回"
,
"next"
:
"1100"
,
"cstatus"
:
"1090"
,
"dstatus"
:
"1080"
,
},
"1200"
:
{
"status"
:
"1200"
,
"name"
:
"红冲"
,
"next"
:
""
,
"cstatus"
:
"1200"
,
"dstatus"
:
""
,
},
"1300"
:
{
"status"
:
"1300"
,
"name"
:
"审核失败(平台第二次审核)"
,
"next"
:
"1060"
,
"cstatus"
:
"1050"
,
"dstatus"
:
"1060"
,
}
};
}
async
apiCalcInvoice
(
pobj
)
{
var
merchantId
=
pobj
.
merchant_id
||
pobj
.
merchantId
;
var
invoiceList
=
pobj
.
invoiceList
;
if
(
!
invoiceList
||
invoiceList
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"请传入试算开票信息"
);
}
var
creditCodes
=
[];
for
(
var
invoice
of
invoiceList
)
{
creditCodes
.
push
(
invoice
.
businessmenCreditCode
);
}
// 查询个体户签约信息
var
mapRs
=
await
this
.
callms
(
"order"
,
"businessmenCompleteMapByCreditCodes"
,
{
creditCodes
:
creditCodes
});
var
map
=
mapRs
.
data
;
var
result
=
[];
for
(
var
invoice
of
invoiceList
)
{
var
calc
=
{
creditCode
:
invoice
.
businessmenCreditCode
,
incomeTax
:
0
,
addedValueTax
:
0
,
serviceTax
:
0
,
specialTax
:
0
,
warning
:
""
,
monthAmt
:
0
,
};
var
signInfo
=
map
[
invoice
.
businessmenCreditCode
];
if
(
!
signInfo
)
{
calc
.
code
=
-
1
;
calc
.
msg
=
"个体工商户【"
+
invoice
.
businessmenCreditCode
+
"】不存在"
;
result
.
push
(
calc
);
continue
;
}
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
.
ruleCode
=
this
.
trim
(
invoice
.
ruleCode
)
||
"10"
;
invoice
.
perCalWay
=
signInfo
.
taxUpType
;
// TODO 确定值
invoice
.
valCalWay
=
signInfo
.
addValueUpType
;
// TODO 确定值
invoice
.
businessmenId
=
signInfo
.
id
;
invoice
.
serviceRate
=
system
.
f2y
(
signInfo
.
serviceRate
);
invoice
.
taxCostPriRat
=
system
.
f2y
(
signInfo
.
costRate
);
invoice
.
taxIncPriRat
=
system
.
f2y
(
signInfo
.
taxRate
);
if
(
invoice
.
type
==
1
)
{
invoice
.
perIncTaxRange
=
JSON
.
parse
(
signInfo
.
specialTaxLadder
);
invoice
.
valAddTaxRange
=
JSON
.
parse
(
signInfo
.
specialOtherLadder
);
}
else
{
invoice
.
perIncTaxRange
=
JSON
.
parse
(
signInfo
.
commonTaxLadder
);
invoice
.
valAddTaxRange
=
JSON
.
parse
(
signInfo
.
commonOtherLadder
);
}
try
{
console
.
log
(
JSON
.
stringify
(
invoice
));
var
rs
=
await
this
.
callms
(
"invoice"
,
"verificationAndCalculation"
,
invoice
);
if
(
rs
.
status
==
0
&&
rs
.
data
)
{
var
calcRs
=
rs
.
data
;
calc
.
code
=
1
;
calc
.
incomeTax
=
Number
(
calcRs
.
personalIncomeTax
||
0
).
toFixed
(
0
);
calc
.
addedValueTax
=
Number
(
calcRs
.
valueAddedTax
||
0
).
toFixed
(
0
);
calc
.
serviceTax
=
Number
(
calcRs
.
serviceCharge
||
0
).
toFixed
(
0
);
calc
.
specialTax
=
Number
(
calcRs
.
additionalTax
||
0
).
toFixed
(
0
);
calc
.
warning
=
this
.
trim
(
calcRs
.
warning
);
calc
.
monthAmt
=
0
;
calc
.
msg
=
"success"
;
}
else
{
calc
.
code
=
-
1
;
calc
.
msg
=
rs
.
msg
||
"发票服务异常"
;
}
console
.
log
(
rs
);
}
catch
(
error
)
{
calc
.
code
=
-
1
;
calc
.
msg
=
"发票服务异常,请联系公司宝"
;
console
.
log
(
error
);
}
result
.
push
(
calc
);
}
return
system
.
getResultSuccess
(
result
);
}
async
apiVerificationAndCalculation
(
pobj
)
{
pobj
.
serviceRate
=
Number
(
pobj
.
serviceRate
)
*
100
;
pobj
.
taxIncPriRat
=
Number
(
pobj
.
taxIncPriRat
)
*
100
;
pobj
.
taxCostPriRat
=
Number
(
pobj
.
taxCostPriRat
)
*
100
;
pobj
.
invoiceAmount
=
system
.
y2f
(
pobj
.
invoiceAmount
);
var
rs
=
await
this
.
callms
(
"invoice"
,
"verificationAndCalculation"
,
pobj
);
if
(
rs
.
status
==
0
)
{
return
rs
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
async
apiSaveInvoice
(
pobj
)
{
var
merchantId
=
pobj
.
merchant_id
||
pobj
.
merchantId
;
var
invoiceList
=
pobj
.
invoiceList
;
if
(
!
invoiceList
||
invoiceList
.
length
==
0
)
{
return
system
.
getResult
(
null
,
"请传入试算开票信息"
);
}
var
creditCodes
=
[];
for
(
var
invoice
of
invoiceList
)
{
creditCodes
.
push
(
invoice
.
businessmenCreditCode
);
}
// 查商户titile
var
merchantRs
=
await
this
.
callms
(
"merchant"
,
"getById"
,
{
id
:
merchantId
});
var
merchant
=
merchantRs
.
data
||
{};
var
title
=
await
this
.
callms
(
"merchant"
,
"getMerchantTitleDefault"
,
{
merchantId
:
merchantId
});
title
=
title
.
data
;
var
address
=
await
this
.
callms
(
"merchant"
,
"getMerchantAddressDefault"
,
{
merchantId
:
merchantId
});
var
address
=
address
.
data
||
{};
// 查询个体户签约信息
var
mapRs
=
await
this
.
callms
(
"order"
,
"businessmenCompleteMapByCreditCodes"
,
{
creditCodes
:
creditCodes
});
var
map
=
mapRs
.
data
;
var
result
=
[];
for
(
var
invoice
of
invoiceList
)
{
var
data
=
{
creditCode
:
invoice
.
businessmenCreditCode
,
code
:
1
,
msg
:
"success"
,
applyNo
:
invoice
.
applyNo
,
};
var
signInfo
=
map
[
invoice
.
businessmenCreditCode
];
if
(
!
signInfo
)
{
data
.
code
=
-
1
;
data
.
msg
=
"个体工商户【"
+
invoice
.
businessmenCreditCode
+
"】不存在"
;
result
.
push
(
data
);
continue
;
}
// 发票类型:10 普通发票 20 增值税专用发票 30 电子发票
if
(
invoice
.
type
===
0
)
{
invoice
.
type
==
"10"
;
}
else
if
(
invoice
.
type
===
1
)
{
invoice
.
type
==
"20"
;
}
else
{
invoice
.
type
==
"30"
;
}
// 购买方
invoice
.
merchantId
=
merchantId
;
invoice
.
merchantName
=
merchant
.
name
;
invoice
.
merchantCreditCode
=
title
.
taxNo
;
invoice
.
merchantAddr
=
title
.
invoiceAddr
;
invoice
.
merchantMobile
=
title
.
invoiceMobile
;
invoice
.
merchantBank
=
title
.
accountName
;
invoice
.
merchantAccount
=
title
.
accountPublic
;
// 申请方联系电话
invoice
.
applyPhone
=
merchant
.
contactMobile
;
// 邮寄地址
invoice
.
mailAddr
=
address
.
mailAddr
;
invoice
.
mailMobile
=
address
.
mailMobile
;
invoice
.
mailTo
=
address
.
mailTo
;
invoice
.
invoiceAmount
=
Number
(
invoice
.
invoiceAmt
);
invoice
.
invoiceTime
=
this
.
trim
(
invoice
.
invoiceTime
);
invoice
.
businessmenCreditCode
=
this
.
trim
(
invoice
.
businessmenCreditCode
);
// 开票内容
if
(
signInfo
.
invoicecontents
&&
signInfo
.
invoicecontents
.
length
>
0
)
{
invoice
.
invoiceContent
=
signInfo
.
invoicecontents
[
0
].
invoicecontentName
;
}
else
{
invoice
.
invoiceContent
=
"服务费"
;
}
invoice
.
settleImg
=
""
;
invoice
.
statements
=
invoice
.
settleImg
;
invoice
.
contract
=
""
;
invoice
.
applyNo
=
invoice
.
applyNo
;
invoice
.
perCalWay
=
signInfo
.
taxUpType
;
invoice
.
valCalWay
=
signInfo
.
addValueUpType
;
// 销售方信息
invoice
.
businessmenType
=
this
.
trim
(
invoice
.
businessmenType
)
||
"10"
;
invoice
.
ruleCode
=
this
.
trim
(
invoice
.
ruleCode
)
||
"10"
;
invoice
.
businessmenId
=
signInfo
.
id
;
invoice
.
businessName
=
signInfo
.
name
;
invoice
.
isBank
=
signInfo
.
isBank
;
invoice
.
taxAuthorities
=
signInfo
.
taxOrg
;
// invoice.taxCostPriRat = signInfo.costRate;
// invoice.taxIncPriRat = signInfo.taxRate;
invoice
.
serviceRate
=
system
.
f2y
(
signInfo
.
serviceRate
);
invoice
.
taxCostPriRat
=
system
.
f2y
(
signInfo
.
costRate
);
invoice
.
taxIncPriRat
=
system
.
f2y
(
signInfo
.
taxRate
);
if
(
invoice
.
type
==
1
)
{
invoice
.
perIncTaxRange
=
JSON
.
parse
(
signInfo
.
specialTaxLadder
);
invoice
.
valAddTaxRange
=
JSON
.
parse
(
signInfo
.
specialOtherLadder
);
}
else
{
invoice
.
perIncTaxRange
=
JSON
.
parse
(
signInfo
.
commonTaxLadder
);
invoice
.
valAddTaxRange
=
JSON
.
parse
(
signInfo
.
commonOtherLadder
);
}
try
{
var
rs
=
await
this
.
callms
(
"invoice"
,
"saveInvoice"
,
invoice
);
if
(
rs
.
status
!=
0
)
{
data
.
code
=
-
1
;
data
.
msg
=
rs
.
msg
||
"发票服务异常"
;
}
console
.
log
(
rs
);
}
catch
(
error
)
{
data
.
code
=
-
1
;
data
.
msg
=
"发票服务异常,请联系公司宝"
;
console
.
log
(
error
);
}
result
.
push
(
data
);
}
return
system
.
getResultSuccess
(
result
);
}
async
apiCancelInvoice
(
pobj
)
{
var
params
=
{
applyNo
:
pobj
.
applyNo
,
merchantId
:
pobj
.
merchantId
||
pobj
.
merchant_id
}
var
rs
=
await
this
.
callms
(
"invoice"
,
"apiCancelInvoice"
,
params
);
if
(
rs
.
data
)
{
rs
.
data
=
null
;
}
return
rs
;
}
async
apiQueryInvoice
(
pobj
)
{
var
params
=
{
applyNo
:
pobj
.
applyNo
,
merchantId
:
pobj
.
merchantId
||
pobj
.
merchant_id
}
// queryInvoices
var
rs
=
await
this
.
callms
(
"invoice"
,
"queryInvoice"
,
params
);
if
(
rs
.
status
!=
0
||
!
rs
.
data
)
{
return
system
.
getResult
(
null
,
"发票不存在"
);
}
var
invoiceApply
=
rs
.
data
||
{};
var
invoice
=
invoiceApply
.
invoice
||
{};
var
result
=
{
"merchantId"
:
this
.
trim
(
invoiceApply
.
merchantId
),
"applyNo"
:
this
.
trim
(
invoiceApply
.
applyNo
),
"status"
:
this
.
trim
(
invoiceApply
.
customerStatus
),
"auditRemark"
:
this
.
trim
(
invoiceApply
.
remark
),
"invoiceNo"
:
this
.
trim
(
invoiceApply
.
id
),
"payVoucher"
:
this
.
trim
(
invoiceApply
.
statements
),
"courierImg"
:
""
,
"courierNo"
:
this
.
trim
(
invoice
.
mailNo
),
"invoiceTime"
:
this
.
trim
(
invoice
.
invoiceTime
),
"invoiceImg"
:
this
.
trim
(
invoice
.
invoiceImg
),
"complateTax"
:
this
.
trim
(
invoice
.
complateTax
),
"taxNo"
:
this
.
trim
(
invoice
.
taxNo
),
"taxTime"
:
this
.
trim
(
invoice
.
taxTime
),
"taxVoucher"
:
this
.
trim
(
invoice
.
taxVoucher
),
}
return
system
.
getResultSuccess
(
result
);
}
async
apiQueryTaxInvoice
(
pobj
)
{
var
params
=
{
applyNo
:
pobj
.
applyNo
,
merchantId
:
pobj
.
merchantId
||
pobj
.
merchant_id
,
id
:
pobj
.
id
}
// queryInvoices
var
rs
=
await
this
.
callms
(
"invoice"
,
"getByApplyNo"
,
params
);
if
(
rs
.
status
!=
0
||
!
rs
.
data
)
{
return
system
.
getResult
(
null
,
"发票不存在"
);
}
var
invoice
=
rs
.
data
||
{};
var
paytaxes
=
invoice
.
paytaxes
||
{};
this
.
handleDate
(
paytaxes
,
[
"payTaxesTime"
],
"YYYY-MM-DD"
,
-
8
);
var
result
=
{
"merchantId"
:
this
.
trim
(
invoice
.
merchantId
),
"applyNo"
:
this
.
trim
(
invoice
.
applyNo
),
"taxNo"
:
this
.
trim
(
paytaxes
.
payTaxesNo
),
"taxTime"
:
this
.
trim
(
paytaxes
.
payTaxesTime
),
"taxVoucher"
:
this
.
trim
(
paytaxes
.
payTaxesImg
),
}
return
system
.
getResultSuccess
(
result
);
}
/**
* 发票明细(平台)
* @param {*} pobj
* @param {string} id
* @param {string} applyNo
* @param {string} merchant_id
*/
async
apiQueryInvoiceAdmin
(
pobj
)
{
var
params
=
{
applyNo
:
pobj
.
applyNo
,
merchantId
:
pobj
.
merchantId
||
pobj
.
merchant_id
,
id
:
pobj
.
id
||
null
}
var
res
=
await
this
.
callms
(
"invoice"
,
"queryInvoice"
,
params
);
if
(
res
.
status
!=
0
||
!
res
.
data
)
{
return
system
.
getResult
(
null
,
"发票不存在"
);
}
res
.
data
.
invoiceAmount
=
system
.
f2y
(
res
.
data
.
invoiceAmount
);
res
.
data
.
personalIncomeTax
=
system
.
f2y
(
res
.
data
.
personalIncomeTax
);
res
.
data
.
additionalTax
=
system
.
f2y
(
res
.
data
.
additionalTax
);
res
.
data
.
valueAddedTax
=
system
.
f2y
(
res
.
data
.
valueAddedTax
);
res
.
data
.
serviceCharge
=
system
.
f2y
(
res
.
data
.
serviceCharge
);
res
.
data
.
isBank
=
res
.
data
.
isBank
==
1
?
"已开户"
:
"未开户"
;
if
(
res
.
data
.
type
==
10
)
{
res
.
data
.
type
=
"普通发票"
;
}
else
if
(
res
.
data
.
type
==
20
)
{
res
.
data
.
type
=
"增值税专用发票"
;
}
else
{
res
.
data
.
type
=
"电子发票"
}
res
.
data
.
payWay
=
res
.
data
.
payWay
==
"20"
?
"线上支付"
:
"系统账户扣款"
;
res
.
data
.
isPay
=
res
.
data
.
isPay
==
1
?
"已支付"
:
"未付款"
;
res
.
data
.
isInvalid
=
res
.
data
.
isInvalid
===
2
?
'未红冲'
:
'已红冲'
;
res
.
data
.
deliverer
.
delivererAmount
=
system
.
f2y
(
res
.
data
.
deliverer
.
delivererAmount
);
res
.
data
.
invoice
.
complateTax
=
res
.
data
.
invoice
.
complateTax
==
"1"
?
"已完税"
:
"未完税"
;
this
.
handleDate
(
res
.
data
,
[
"invoiceTime"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
,
[
"createdAt"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
'deliverer'
],
[
"createdAt"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
'deliverer'
],
[
"updatedAt"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
'invoice'
],
[
"invoiceTime"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
'invoice'
],
[
"taxTime"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
"invoice"
],
[
"createdAt"
],
"YYYY-MM-DD"
,
-
8
);
this
.
handleDate
(
res
.
data
[
"invoice"
],
[
"updatedAt"
],
"YYYY-MM-DD"
,
-
8
);
return
res
;
}
/**
* 发票明细(交付商)
* @param {*} pobj
* @param {string} id
* @param {string} applyNo
* @param {string} merchant_id
*/
async
apiQueryInvoiceDeliverer
(
pobj
)
{
var
params
=
{
applyNo
:
pobj
.
applyNo
,
merchantId
:
pobj
.
merchantId
||
pobj
.
merchant_id
,
id
:
pobj
.
id
||
null
}
var
rs
=
await
this
.
callms
(
"invoice"
,
"queryInvoiceDeliverer"
,
params
);
if
(
rs
.
status
!=
0
||
!
rs
.
data
)
{
return
system
.
getResult
(
null
,
"发票不存在"
);
}
rs
.
data
.
invoiceAmount
=
system
.
f2y
(
rs
.
data
.
invoiceAmount
);
rs
.
data
.
personalIncomeTax
=
system
.
f2y
(
rs
.
data
.
personalIncomeTax
);
rs
.
data
.
additionalTax
=
system
.
f2y
(
rs
.
data
.
additionalTax
);
rs
.
data
.
valueAddedTax
=
system
.
f2y
(
rs
.
data
.
valueAddedTax
);
rs
.
data
.
serviceCharge
=
system
.
f2y
(
rs
.
data
.
serviceCharge
);
return
rs
;
}
/**
* 校验审核
* @param {*} pobj
*/
async
apiVerification
(
pobj
)
{
var
params
=
{
businessmenCreditCode
:
pobj
.
businessmenCreditCode
}
var
rs
=
await
this
.
callms
(
"invoice"
,
"verification"
,
params
);
if
(
rs
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
"发票不存在"
);
}
return
rs
;
}
/**
* 试算
* @param {*} pobj
*/
async
apiCalcInvoice2
(
pobj
)
{
pobj
.
serviceRate
=
Number
(
pobj
.
serviceRate
||
0
)
*
100
;
pobj
.
taxIncPriRat
=
Number
(
pobj
.
taxIncPriRat
||
0
)
*
100
;
pobj
.
taxCostPriRat
=
Number
(
pobj
.
taxCostPriRat
||
0
)
*
100
;
pobj
.
invoiceAmount
=
system
.
y2f
(
pobj
.
invoiceAmount
||
0
);
var
rs
=
await
this
.
callms
(
"invoice"
,
"verificationAndCalculation"
,
pobj
);
if
(
rs
.
status
==
0
)
{
return
rs
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 保存发票申请(提供管理)
* @param {*} pobj
*/
async
apiSaveInvoiceAdm
(
pobj
)
{
pobj
.
serviceRate
=
Number
(
pobj
.
serviceRate
)
*
100
;
pobj
.
taxIncPriRat
=
Number
(
pobj
.
taxIncPriRat
)
*
100
;
pobj
.
taxCostPriRat
=
Number
(
pobj
.
taxCostPriRat
)
*
100
;
pobj
.
invoiceAmount
=
system
.
y2f
(
pobj
.
invoiceAmount
);
var
rs
=
await
this
.
callms
(
"invoice"
,
"saveInvoice"
,
pobj
);
if
(
rs
.
status
==
0
)
{
return
rs
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 平台审批
* @param {*} pobj
*/
async
apiPlatformAssignment
(
pobj
)
{
if
(
!
pobj
.
nextStatus
)
{
return
system
.
getResult
(
null
,
`参数错误`
);
}
var
rs
=
await
this
.
callms
(
"invoice"
,
"platformAssignment"
,
pobj
);
if
(
rs
.
status
==
0
)
{
this
.
pushDeliver
(
pobj
);
return
rs
;
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 交付商审批
* @param {*} pobj
*/
async
apiDelivererAssignment
(
pobj
)
{
if
(
!
pobj
.
nextStatus
)
{
return
system
.
getResult
(
null
,
`参数错误`
);
}
var
rs
=
await
this
.
callms
(
"invoice"
,
"delivererAssignment"
,
pobj
);
if
(
rs
.
status
==
0
)
{
this
.
pushDeliver
(
pobj
);
return
rs
;
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 完税证明
* @param {*} pobj
*/
async
apiTxPayment
(
pobj
)
{
let
params
=
{};
params
.
id
=
this
.
trim
(
pobj
.
id
);
params
.
taxNo
=
this
.
trim
(
pobj
.
taxNo
);
params
.
complateTax
=
this
.
trim
(
pobj
.
complateTax
);
params
.
taxTime
=
this
.
trim
(
pobj
.
taxTime
);
params
.
taxVoucher
=
this
.
trim
(
pobj
.
taxVoucher
);
var
rs
=
await
this
.
callms
(
"invoice"
,
"txPayment"
,
params
);
if
(
rs
.
status
==
0
)
{
return
rs
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 查看完税证明
* @param {*} pobj
*/
async
apiQueryTxPayment
(
pobj
)
{
let
params
=
{};
params
.
id
=
this
.
trim
(
pobj
.
id
);
var
rs
=
await
this
.
callms
(
"invoice"
,
"queryTxPayment"
,
params
);
if
(
rs
.
status
==
0
)
{
return
rs
}
else
{
return
system
.
getResult
(
null
,
rs
.
msg
);
}
}
/**
* 发票列表(交付商)
* @param {*} pobj
*/
async
apiDelivererInvoices
(
pobj
)
{
if
(
pobj
.
pageIndex
)
{
pobj
.
pageIndex
=
Number
(
pobj
.
pageIndex
)
||
1
;
}
if
(
pobj
.
pageSize
)
{
pobj
.
pageSize
=
Number
(
pobj
.
pageSize
)
||
10
;
}
let
res
=
await
this
.
callms
(
"invoice"
,
"delivererInvoices"
,
pobj
);
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
invoice_amount
=
system
.
f2y
(
item
.
invoice_amount
);
}
if
(
res
.
status
==
0
)
{
return
res
;
}
else
{
return
system
.
getResult
(
null
,
res
.
msg
);
}
}
/**
* 发票申请列表(交付商)
* @param {*} pobj
*/
async
apiDelivererApplyInvoices
(
pobj
)
{
if
(
pobj
.
pageIndex
)
{
pobj
.
pageIndex
=
Number
(
pobj
.
pageIndex
)
||
1
;
}
if
(
pobj
.
pageSize
)
{
pobj
.
pageSize
=
Number
(
pobj
.
pageSize
)
||
10
;
}
let
res
=
await
this
.
callms
(
"invoice"
,
"delivererApplyInvoices"
,
pobj
);
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
invoice_amount
=
system
.
f2y
(
item
.
invoice_amount
);
}
if
(
res
.
status
==
0
)
{
return
res
;
}
else
{
return
system
.
getResult
(
null
,
res
.
msg
);
}
}
/**
* 发票列表(平台)
* @param {*} pobj
*/
async
apiQueryInvoices
(
pobj
)
{
pobj
.
pageIndex
=
Number
(
pobj
.
pageIndex
||
1
);
pobj
.
pageSize
=
Number
(
pobj
.
pageSize
||
10
);
var
complateTax
=
this
.
trim
(
pobj
.
complateTax
);
if
(
complateTax
===
""
)
{
complateTax
=
"-1"
;
}
pobj
.
complateTax
=
complateTax
;
pobj
.
statuses
=
[
'1070'
,
'1080'
,
'1090'
];
let
res
=
await
this
.
callms
(
"invoice"
,
"queryInvoices"
,
pobj
);
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
apply
.
invoice_amount
=
system
.
f2y
(
item
.
apply
.
invoice_amount
);
}
if
(
res
.
status
==
0
)
{
return
res
;
}
else
{
return
system
.
getResult
(
null
,
res
.
msg
);
}
}
/**
* 发票申请列表(平台)
* @param {*} pobj
*/
async
apiQueryApplyInvoices
(
pobj
)
{
pobj
.
pageIndex
=
Number
(
pobj
.
pageIndex
||
1
);
pobj
.
pageSize
=
Number
(
pobj
.
pageSize
||
10
);
let
res
=
await
this
.
callms
(
"invoice"
,
"queryApplyInvoices"
,
pobj
);
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
invoiceAmount
=
system
.
f2y
(
item
.
invoiceAmount
);
item
.
personalIncomeTax
=
system
.
f2y
(
item
.
personalIncomeTax
);
item
.
valueAddedTax
=
system
.
f2y
(
item
.
valueAddedTax
);
item
.
serviceCharge
=
system
.
f2y
(
item
.
serviceCharge
);
item
.
additionalTax
=
system
.
f2y
(
item
.
additionalTax
);
}
if
(
res
.
status
==
0
)
{
return
res
;
}
else
{
return
system
.
getResult
(
null
,
res
.
msg
);
}
}
/**
* 更新邮寄单号(平台)
* @param {*} pobj
*/
async
apiUpEmNo
(
pobj
)
{
if
(
pobj
.
id
)
{
pobj
.
id
=
this
.
trim
(
pobj
.
id
);
}
if
(
pobj
.
platformMailNo
)
{
pobj
.
platformMailNo
=
this
.
trim
(
pobj
.
platformMailNo
);
}
let
res
=
await
this
.
callms
(
"invoice"
,
"updateEmail"
,
pobj
);
if
(
res
.
status
==
0
)
{
return
res
;
}
else
{
return
system
.
getResult
(
null
,
res
.
msg
);
}
}
async
pushDeliver
(
obj
)
{
var
status
=
obj
.
nextStatus
;
if
(
!
status
)
{
return
;
}
var
pushStatus
=
[
"1010"
,
"1030"
,
"1050"
,
"1090"
];
// 0090开票申请 1010审核驳回 1030审核通过 1050已开票 1090已完成
if
(
pushStatus
.
indexOf
(
status
)
==
-
1
)
{
return
;
}
// 查发票
var
invoiceApply
=
await
this
.
callms
(
"invoice"
,
"queryInvoice"
,
{
id
:
obj
.
id
});
invoiceApply
=
invoiceApply
.
data
;
if
(
!
invoice
)
{
console
.
log
(
"推送信息失败["
+
JSON
.
stringify
(
obj
)
+
"],发票不存在 ------------------------"
);
return
;
}
var
invoice
=
invoiceApply
.
invoice
||
{};
var
merchant
=
await
this
.
callms
(
"merchant"
,
"secretById"
,
{
id
:
order
.
merchant_id
});
merchant
=
merchant
.
data
;
if
(
!
merchant
)
{
console
.
log
(
"推送信息失败["
+
JSON
.
stringify
(
obj
)
+
"],商户不存在 ------------------------"
);
return
;
}
var
options
=
{
merchantId
:
merchant
.
id
,
appKey
:
merchant
.
appSecret
,
dataType
:
3
,
dataId
:
invoiceApply
.
id
,
field
:
"invoiceStatus"
,
};
var
params
=
{
merchantId
:
merchant
.
id
,
status
:
status
,
applyNo
:
invoiceApply
.
applyNo
,
}
// 0090开票申请 1030审核通过 1050已开票 1090已完成
if
(
status
==
"1010"
)
{
// 1010审核驳回
params
.
auditRemark
=
this
.
trim
(
invoiceApply
.
remark
);
}
else
if
(
status
==
"1030"
)
{
// 1030审核通过
params
.
auditRemark
=
this
.
trim
(
invoiceApply
.
remark
);
}
else
if
(
status
==
"1050"
)
{
// invoiceNo : String :发票编号
params
.
invoiceNo
=
this
.
trim
(
invoiceApply
.
id
);
// invoiceTime : String :开票时间
params
.
invoiceTime
=
this
.
trim
(
invoice
.
invoiceTime
);
// invoiceImg : String :发票照片
params
.
invoiceImg
=
this
.
trim
(
invoice
.
invoiceImg
);
// payVoucher : String :支付凭证
params
.
payVoucher
=
this
.
trim
(
invoiceApply
.
statements
);
}
else
if
(
status
==
"1090"
)
{
// courierNo : String :快递单号
params
.
courierNo
=
this
.
trim
(
invoice
.
mailNo
);
// courierImg : String :快递交接单图片
params
.
courierImg
=
""
;
}
else
{
return
;
}
options
.
params
=
params
;
await
this
.
pushapiSve
.
push
(
options
);
}
async
redrush
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"redRushInvoice"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
//交易数据 平台
async
statManageData
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"statTransData"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//发票办理 平台
async
statBusinessData
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"statBusinessData"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
/**
* 交易数据(交付商)
* @param {*} params
*/
async
delStatManageData
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"delStatTransData"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//发票办理(交付商)
async
delStatBusinessData
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"delStatBusinessData"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//交付商列表(平台)
async
statDeliverData
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"statDeliverData"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//计算发票增值税
async
calculationValueAddedTax
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"calculationValueAddedTax"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
//计算发票附加税
async
calculationAdditionalTax
(
params
)
{
try
{
return
await
this
.
callms
(
"invoice"
,
"calculationAdditionalTax"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
async
apiRedrushList
(
params
){
try
{
return
await
this
.
callms
(
"invoice"
,
"redrushList"
,
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
module
.
exports
=
InvoiceService
;
\ No newline at end of file
xgg-deliver/app/base/system.js
View file @
b7e8e132
...
@@ -186,7 +186,7 @@ class System {
...
@@ -186,7 +186,7 @@ class System {
// order: "http://127.0.0.1:3103" + path,
// order: "http://127.0.0.1:3103" + path,
// 发票服务
// 发票服务
invoice
:
domain
2
+
":3105"
+
path
,
invoice
:
domain
+
":3105"
+
path
,
// invoice: "http://127.0.0.1:3105" + path,
// invoice: "http://127.0.0.1:3105" + path,
// 发票服务
// 发票服务
...
...
xgg-deliver/app/front/entry/public/apidoc/invoice/invoice.md
View file @
b7e8e132
<a
name=
"menu"
>
目录
</a>
<a
name=
"menu"
>
目录
</a>
1.
[
发票状态
](
#status
)
1.
[
业务进度字典
](
#processList
)
2.
[
发票申请页
](
#invoicePage
)
1.
[
申请列表页
](
#myInvoicePage
)
1.
[
验证发票是否符合申请
](
#verification
)
已经弃用
1.
[
发票查询明细(平台)
](
#queryInvoice
)
## **<a name="processList"> 业务进度字典 </a>**
1.
[
发票查询明细(交付商)
](
#queryInvoiceDeliverer
)
[
返回到目录
](
#menu
)
##### URL
[
/web/invoice/invoiceCtl/processDics
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
1.
[
发票试算
](
#calcInvoice
)
已经弃用
1.
[
发票申请
](
#invoices
)
1.
[
发票验证&试算
](
#verificationAndCalculation
)
1.
[
计算增值税
](
#calculationValueAddedTax
)
1.
[
发票附加税
](
#calculationAdditionalTax
)
1.
[
发票申请列表(平台)
](
#queryInvoices
)
1.
[
交付查看商审批列表
](
#delivererInvoices
)
1.
[
发票平台审批
](
#platformAssignment
)
1.
[
发票交付商审批
](
#delivererAssignment
)
1.
[
完成税证明
](
#txPayment
)
1.
[
查看完成税证明
](
#queryTxPayment
)
1.
[
平台更新邮寄地址
](
#apiUpEmNO
)
## **<a name="saveInvoice"> 发票状态</a>**
[
返回到目录
](
#menu
)
```
{
"0090": {
"status": "0090",
"name": "未付款",
"next": "1000",
"cstatus": "0090",//客户
"dstatus": "",//交付商
},
"1000": {
"status": "1000",
"name": "待审核",
"next": "1020",
"cstatus": "0090",//客户
"dstatus": "",//交付商
},
"1010": {
"status": "1010",
"name": "审核不通过",
"next": "",
"cstatus": "1010",
"dstatus": "",
},
"1020": {
"status": "1020",
"name": "待分配",
"next": "1030",
"cstatus": "1030",
"dstatus": "",
},
"1030": {
"status": "1030",
"name": "待处理",
"next": "1050",
"cstatus": "1030",
"dstatus": "1030",
},
"1040": {
"status": "1040",
"name": "交付商关闭",
"next": "1020",
"cstatus": "1030",
"dstatus": "1040",
},
"1050": {
"status": "1050",
"name": "已开具",
"next": "1060",
"cstatus": "1050",
"dstatus": "1050",
},
"1060": {
"status": "1060",
"name": "待审核",
"next": "1070",
"cstatus": "1050",
"dstatus": "1070",
},
"1070": {
"status": "1070",
"name": "审核通过",
"next": "1080",
"cstatus": "1050",
"dstatus": "1070",
},
"1080": {
"status": "1080",
"name": "已邮寄",
"next": "1090",
"cstatus": "1050",
"dstatus": "1080",
},
"1090": {
"status": "1090",
"name": "完成",
"next": "1100",
"cstatus": "1090",
"dstatus": "1080",
},
"1100": {
"status": "1090",
"name": "发票撤回",
"next": "1100",
"cstatus": "1090",
"dstatus": "1080",
},
"1200": {
"status": "1200",
"name": "红冲",
"next": "",
"cstatus": "1200",
"dstatus": "",
},
"1300": {
"status": "1300",
"name": "审核失败(平台第二次审核)",
"next": "1060",
"cstatus": "1050",
"dstatus": "1060",
}
}
```
## **<a name="verification"> 验证发票是否符合申请</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/web/invoice/invoiceCtl/verification'
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| businessmenCreditCode| string | 是 | | 发票ID |
**示例**
```
{
"businessmenCreditCode": "91210200MA0QE7GT5L"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"code":200,
"msg":"ok",
"data":[
],
"status":0,
"requestid":"06336188128143c09c935e536c9742f2"
}
```
## **<a name="calcInvoice"> 发票试算</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/calcInvoice
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| businessmenCreditCode | string| 是 | | 销售方社会统一信用代码 |
| serviceRate | number| 是 | | 服务费率 |
| perCalWay | number| 是 | | 个税计算方式 1:年 请填写 1 |
| valCalWay | number| 是 | | 增值税计算方式 1:月 2:季度 |
| merchantId | string | 是 | | 商户id |
| taxIncPriRat | number| 是 | | 不含税价百分比 |
| taxCostPriRat | number| 是 | | 核定成本费用率 |
| invoiceTime | String| 是 | | 开票时间 |
| invoiceAmount | number| 是 | | 发票金额 |
| perIncTaxRange | JSON | 是 | | 个税税额范围 |
| valAddTaxRange | JSON | 是 | | 增值税范围 |
**示例**
```
{
"businessmenCreditCode": "111",
"serviceRate": 225,
"perCalWay": "1",
"valCalWay": "1",
"businessmenId": "12795594625000138",
"taxCostPriRat": 1122,
"taxIncPriRat": 1022,
"invoiceTime": "2019-09-19",
"invoiceAmount": 20000000,
"perIncTaxRange": [
{
"minValue": 0,
"rate": "0",
"quiCalDed": 100000,
"maxValue": 3000000
},
{
"minValue": 3000100,
"rate": "1.5",
"quiCalDed": 200000,
"maxValue": 10000000
},
{
"minValue": 10000001,
"rate": "4.86",
"quiCalDed": 300000,
"maxValue": 214748364700
}
],
"valAddTaxRange": [
{
"minValue": 0,
"zengzhiRate": "0",
"fujiaRate": "0",
"maxValue": 3000000
},
{
"minValue": 3000100,
"zengzhiRate": "0",
"fujiaRate": "0",
"maxValue": 10000000
},
{
"minValue": 10000001,
"zengzhiRate": "3",
"fujiaRate": "12",
"maxValue": 214748364700
}
]
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
## **<a name="saveInvoice"> 发票申请保存</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/saveInvoice
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| serviceRate | number| 是 | | 服务费率 |
| perCalWay | number| 是 | | 个税计算方式 1:月 2:季度 3:年 |
| valCalWay | number| 是 | | 增值税计算方式 1:月 2:季度 3:年 |
| taxIncPriRat | number| 是 | | 不含税价百分比 |
| taxCostPriRat | number| 是 | | 核定成本费用率 |
| invoiceTime | String| 是 | | 开票时间 |
| perIncTaxRange | JSON | 是 | | 个税税额范围 |
| valAddTaxRange | JSON | 是 | | 增值税范围 |
| merchantId | string | 是 | | 商户id |
| merchantAccount | string | 是 | | 商户账户 |
| merchantName | string | 是 | | 商户名称 |
| merchantCreditCode | string | 是 | | 商户社会统一信用代码 |
| merchantAddr | string | 是 | | 商户地址 |
| merchantMobile | string | 是 | | 商户电话 |
| merchantBank | string | 是 | | 商户开户行 |
| businessmenId | string| 是 | | 销售方ID |
| businessmenCreditCode | string| 是 | | 销售方社会统一信用代码 |
| businessmenType | number| 是 | | 销售方类型 10 个体工商 20 自然人 |
| businessName | string| 是 | | 销售方名称 |
| isBank | string| 是 | | 是否开户 1:开户 0:未开户 |
| invoiceNo | string | 否 | | 发票编号 |
| ruleCode | number| 是 | | 算法编码 10 个体工商 20 自然人算法 |
| type | number| 否 | | 发票类型 10 普通发票 20 增值税专用发票 30 电子发票 |
| invoiceAmount | number| 是 | | 发票金额 |
| statements | string | 是 | | 结算单子 |
| contract | string| 是 | | 合同 |
| applyNo | String| 是 | | 申请编号 |
| invoiceContent | string| 否 | | 开票内容 |
| applyMobile | string| 否 | | 申请电话 |
| isInvalid | string| 是 | 2 | 是否红冲 2 未红冲 |
| parentId | string| 否 | | 发票关联ID 红冲时添加此字段 |
| status | string| 否 | 1000 |平台 开票状态 默认 1000 |
| customerStatus | string| 否 | 1000 | 客户开票状态 默认 1000 |
| payWay | string| 是 | | 付款方式 10 系统账户扣款 20 线上支付 |
| payAccount | string| 是 | | 付款账户 |
| isPay | number| 否 | 0 | 是否支付 调用前请再次确认此是否支付 |
| mailAddr | string| 是 | | 邮寄地址 |
| mailMobile | string| 是 | | 邮寄电话 |
| mailTo | string| 是 | | 邮寄人 |
```
{
"serviceRate": 400,
"perCalWay": "1",
"valCalWay": "2",
"taxCostPriRat": 1122,
"taxIncPriRat": 1022,
"invoiceTime": "2019-10-19",
"perIncTaxRange": [
{
"minValue": 0,
"rate": "1",
"quiCalDed": 100000,
"maxValue": 3000000
},
{
"minValue": 3000100,
"rate": "1.5",
"quiCalDed": 200000,
"maxValue": 10000000
},
{
"minValue": 10000001,
"rate": "4.86",
"quiCalDed": 300000,
"maxValue": 214748364700
}
],
"valAddTaxRange": [
{
"minValue": 0,
"zengzhiRate": "1",
"fujiaRate": "6",
"maxValue": 3000000
},
{
"minValue": 3000100,
"zengzhiRate": "2",
"fujiaRate": "8",
"maxValue": 10000000
},
{
"minValue": 10000001,
"zengzhiRate": "3",
"fujiaRate": "12",
"maxValue": 214748364700
}
],
"merchantId":"11064622752480055",
"merchantAccount":"driverBabyPublicAccount",
"merchantName": "司机宝",
"merchantCreditCode":"91110108MA008KB56P",
"merchantAddr":"北京市海淀区北太平庄路18号3层3-0227",
"merchantMobile":"010-5369854",
"merchantBank":"110108022130868",
"businessmenType":"10",
"businessmenId": "110115023996882",
"businessmenCreditCode": "91110115MA00HDC44L",
"businessName":"北京富通勤国际贸易有限责任公司(个体工商)",
"isBank":1,
"taxAuthorities":"北京大兴税务局",
"type":20,
"ruleCode":"10",
"invoiceAmount": 40000000,
"statements":"wwww.baidu.com",
"contract":"www.qq.com",
"applyNo":"gongsibao-futong001",
"isInvalid":2,
"parentId":null,
"status":"1000",
"customerStatus":"1000",
"payWay":"20",
"payAccount":null,
"isPay":1,
"mailAddr":"北京市海淀区北太平庄路18号3层3-0227",
"mailMobile":"18633923636",
"mailTo":"赵彩红"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"ea903ff378d4469a8fef10a6e15f5036"
}
```
## **<a name="verificationAndCalculation"> 发票验证&试算</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/verificationAndCalculation
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| businessmenType | number| 是 | | 销售方类型 10 个体工商 20 自然人 |
| businessmenCreditCode | string| 是 | | 销售方社会统一信用代码 |
| ruleCode | number| 是 | | 算法编码 10 个体工商 20 自然人算法 |
| serviceRate | number| 是 | | 服务费率 例子:10.11% |
| perCalWay | number| 是 | | 个税计算方式 1:年 请填写 1 |
| valCalWay | number| 是 | | 增值税计算方式 1:月 2:季度 |
| merchantId | string | 是 | | 商户id |
| taxIncPriRat | number| 是 | | 不含税价百分比 例子:10.11%|
| taxCostPriRat | number| 是 | | 核定成本费用率 例子:10.11%|
| invoiceTime | String| 是 | | 开票时间 |
| invoiceAmount | number| 是 | | 发票金额 |
| perIncTaxRange | JSON | 是 | | 个税税额范围 |
| valAddTaxRange | JSON | 是 | | 增值税范围 |
**示例**
```
{
"businessmenCreditCode": "111",
"serviceRate": 2.25,
"perCalWay": "1",
"valCalWay": "1",
"businessmenId": "12795594625000138",
"taxCostPriRat": 11.22,
"taxIncPriRat": 10.22,
"invoiceTime": "2019-09-19",
"invoiceAmount": 2000000,
"perIncTaxRange": [
{
"minValue": 0,
"rate": "0",
"quiCalDed": 100000,
"maxValue": 3000000
},
{
"minValue": 3000100,
"rate": "1.5",
"quiCalDed": 200000,
"maxValue": 10000000
},
{
"minValue": 10000001,
"rate": "4.86",
"quiCalDed": 300000,
"maxValue": 214748364700
}
],
"valAddTaxRange": [
{
"minValue": 0,
"zengzhiRate": "0",
"fujiaRate": "0",
"maxValue": 3000000
},
{
"minValue": 3000100,
"zengzhiRate": "0",
"fujiaRate": "0",
"maxValue": 10000000
},
{
"minValue": 10000001,
"zengzhiRate": "3",
"fujiaRate": "12",
"maxValue": 214748364700
}
]
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
## **<a name="calculationValueAddedTax"> 计算增值税</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/calculationValueAddedTax
**参数验证**
否
**参数**
```
javascript
```
javascript
{}
// 字段描述 是否必填 默认值/注释
{
"businessmenCreditCode"
:
"111"
,
//销售方统一社会信用代码 是
"businessmenType"
:
"10"
,
//销售方类型 是 10:个体工商户 20:自然人
"calNames"
:
"valueAddedTax"
,
//计算类型 是 valueAddedTax:增值税
"valCalWay"
:
"1"
,
//计算时间类型 是 1:月 2:季度 3:年
"businessmenId"
:
"12795594625000138"
,
//销售方ID 是
"taxIncPriRat"
:
0.03
,
//不含税价百分比 是 如果3% 请填写 0.03 此字段不能大于1
"invoiceTime"
:
"2019-11-26"
,
//发票时间 是
"invoiceAmount"
:
20000000
,
//发票金额 单位:分 是
"valAddTaxRange"
:
[
//增值税范围 是
{
"minValue"
:
0
,
//最小值 单位:分 是
"zengzhiRate"
:
"3"
,
//增值税百分比 是 如果3%请填写 3
"fujiaRate"
:
"12"
,
//附加税 否
"maxValue"
:
3000000
//最大值 单位:分 是
}
]
}
```
```
#### 返回结果
#### 返回结果
```
javascript
```
javascript
{
{
"status"
:
0
,
"status"
:
0
,
"msg"
:
"操作成功"
,
"msg"
:
"success"
,
"data"
:
"776699.03"
,
//增值税 单位:分
"data"
:
[
"bizmsg"
:
"empty"
,
"requestid"
:
"c19a411e7b5e41a48eb8b4a2d99a2987"
}
```
## **<a name="calculationAdditionalTax"> 计算附加税</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/calculationAdditionalTax
**参数验证**
否
**参数**
```
javascript
// 字段描述 是否必填 默认值/注释
{
"businessmenType"
:
"10"
,
//销售方类型 是 10:个体工商户 20:自然人
"calNames"
:
"additionalTax"
,
//计算类型 是 valueAddedTax:增值税
"valueAddedTax"
:
10000000
,
//增值税金额 单位:分 是
"valAddTaxRange"
:
[
//增值税范围 是
{
"minValue"
:
0
,
//最小值 单位:分 是
"zengzhiRate"
:
"3"
,
//增值税百分比 是 如果3%请填写 3
"fujiaRate"
:
"12"
,
//附加税 否
"maxValue"
:
3000000
//最大值 单位:分 是
}
]
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"操作成功"
,
"data"
:
"1500000.00"
,
//附加税
"bizmsg"
:
"empty"
,
"requestid"
:
"833f1dfa957d44fabde9ed71652f0677"
}
```
## **<a name="queryInvoice"> 查询发票明细(平台)</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/web/invoice/invoiceCtl/queryInvoice
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string | 否 | | 发票ID |
| applyNo | string | 否 | | 发票申请号 |
| merchantId | string | 否 | | 商户ID |
**示例**
```
注意:applyNo结合merchantId 一起使用,当id存在是优先使用Id查询
{
"merchantId":"11665033820002912",
"applyNo": "1020",
"id":"xxxx"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"操作成功",
"data":{
"id":"11665033820002912",
"merchantId":"18asf854584",
"merchantName":"腾讯信息科有限公司",
"merchantCreditCode":"5456461654165",
"merchantAddr":"北京海淀区上地",
"merchantMobile":"18833836392",
"merchantBank":"招商银大望路支行",
"merchantAccount":"tengxunkeji",
"businessmenId":"12795594625000138",
"businessmenCreditCode":"91210200MA0QE7GT5L",
"businessName":"网易信息科技",
"isBank":"已开户",
"taxAuthorities":"北京朝阳税务局",
"type":"普通发票",
"invoiceAmount":200000,
"statements":"wwww.baidu.com",
"contract":"www.qq.com",
"invoiceTime":"2019-09-19",
"settleImg":"www.taobao.com",
"applyNo":"gongsibao001",
"invoiceContent":null,
"personalIncomeTax":482926.51,
"additionalTax":65323.9,
"valueAddedTax":544365.81,
"serviceCharge":45,
"applyMobile":null,
"isInvalid":"已红冲",
"parentId":null,
"status":"1090",
"customerStatus":"1090",
"payWay":"系统账户扣款",
"payAccount":null,
"isPay":"已支付",
"mailAddr":"北京来广营",
"mailMobile":"0-012535",
"mailTo":"脚姐",
"remark":"脚姐已批准",
"delivererId":"11329678846003516",
"createdAt":"2019-10-25",
"updatedAt":"2019-10-26T05:36:15.000Z",
"deletedAt":null,
"version":0,
"statusName":"完成",
"customerStatusName":"",
"deliverer":{
"id":"11329678846003516",
"invoiceId":"11665033820002912",
"applyNo":"gongsibao001",
"merchantId":"18asf854584",
"delivererId":"1536854655",
"delivererName":"国投迎新科技有限公司",
"delivererAmount":10,
"breakReason":null,
"auditContent":"审核内容信息",
"delivererContent":"交付商交付内容信息",
"mailAddr":"北京大望路",
"mailMobile":"1000",
"mailTo":"脚姐",
"delivererMailNo":"JIDNUId625815",
"platformMailNo":"545sre55sg",
"createdAt":"2019-10-25",
"updatedAt":"2019-10-28",
"deletedAt":null,
"version":0
},
"invoice":{
"id":"11665033820002912",
"applyNo":"gongsibao001",
"merchantId":"18asf854584",
"status":"1080",
"invoiceNo":"gongsibao4584585",
"invoiceTime":"2019-10-12",
"invoiceImg":"www.baidu.com",
"taxNo":"DIE552SDKD",
"complateTax":"已完税",
"taxTime":"2019-10-10",
"taxVoucher":null,
"mailNo":"JIDNUId625815",
"createdAt":"2019-10-25",
"updatedAt":"2019-10-26",
"deletedAt":null,
"version":0,
"statusName":"已邮寄"
},
"parentInvoice":null
},
"bizmsg":"empty",
"requestid":"9120426859914d88ba56a58709683be4"
}
```
## **<a name="queryInvoiceDeliverer"> 查询发票明细(交付商)</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/api/op/action/springboard
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string | 否 | | 发票ID |
| applyNo | string | 否 | | 发票申请号 |
| merchantId | string | 是 | | 商户ID |
**示例**
```
注意:applyNo结合merchantId 一起使用,当id存在是优先使用Id查询
{
"merchantId":"11665033820002912",
"applyNo": "1020",
"id":"xxxx"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"操作成功",
"data":{
"id":"11665033820002912",
"delivererId":"11329678846003516",
"merchantId":"18asf854584",
"merchantName":"腾讯信息科有限公司",
"merchantCreditCode":"5456461654165",
"merchantAddr":"北京海淀区上地",
"merchantMobile":"18833836392",
"merchantBank":"招商银大望路支行",
"merchantAccount":"tengxunkeji",
"businessmenId":"12795594625000138",
"businessmenCreditCode":"91210200MA0QE7GT5L",
"businessName":"网易信息科技",
"isBank":"未开户",
"taxAuthorities":"北京朝阳税务局",
"type":"普通发票",
"invoiceAmount":20000000,
"statements":"wwww.baidu.com",
"contract":"www.qq.com",
"invoiceTime":"2019-09-19",
"settleImg":"www.taobao.com",
"applyNo":"gongsibao001",
"invoiceContent":null,
"personalIncomeTax":48292651,
"additionalTax":6532390,
"valueAddedTax":54436581,
"serviceCharge":4500,
"applyMobile":null,
"mailAddr":"北京来广营",
"mailMobile":"0-012535",
"mailTo":"脚姐",
"createdAt":"2019-10-25",
"deliverer":{
"auditContent":"审核内容信息",
"delivererContent":"交付商交付内容信息",
"mailAddr":"北京大望路",
"mailMobile":"1000",
"mailTo":"脚姐",
"delivererMailNo":"JIDNUId625815",
"status":"1080",
"statusName":"已邮寄"
},
"invoice":{
"invoiceNo":"gongsibao4584585",
"invoiceTime":"2019-10-12",
"invoiceImg":"www.baidu.com",
"taxNo":"DIE552SDKD",
"complateTax":"已完税",
"taxTime":"2019-10-10",
"taxVoucher":null
}
},
"bizmsg":"empty",
"requestid":"eecdd1283154468897f30b0c2fd37cb3"
}
```
## **<a name="platformAssignment"> 发票平台第一次审批</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/web/invoice/invoiceCtl/platformAssignment'
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | | 发票状态 |
| remark | string | 是 | | 平台审核备注 |
| isPay | number | 是 | | 发票支付 必须写 1 请确认是否已经支付 |
**示例**
```
{
"id":"11665430003004143",
"nextStatus": "1020",
"isPay": 1,
"remark": "材料准确无误"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"ea903ff378d4469a8fef10a6e15f5036"
}
```
## **<a name="platformAssignment"> 分配交付商</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/web/invoice/invoiceCtl/platformAssignment'
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1030 | 发票状态 |
| merchantId | string | 是 | | 购买方ID |
| delivererId | number | 是 | | 交付商ID |
| delivererName | string | 是 | | 交付商名称 |
| delivererAmount | string | 是 | | 交付商分成 |
**示例**
```
{
"id":"11665033820002912",
"nextStatus": "1030",
"merchantId":"18asf854584",
"delivererId":"1536854655",
"delivererName":"国投迎新科技有限公司",
"delivererAmount":"1000"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="delivererAssignment"> 交付商开具</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/delivererAssignment
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1050 | 发票状态 |
| invoiceNo | string | 是 | | 发票编号 |
| invoiceTime | number | 是 | | 开具时间 |
| invoiceImg | string | 是 | | 发票图片 |
**示例**
```
{
"id":"11665430003004143",
"nextStatus": "1050",
"invoiceNo":"gongsibao4584585",
"invoiceTime":"2019-10-12",
"invoiceImg":"www.baidu.com"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="delivererAssignment"> 交付商提交审核</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/delivererAssignment
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1060 | 发票状态 |
**示例**
```
{
"id":"11665033820002912",
"nextStatus": "1060",
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="platformAssignment"> 发票平台第二次审核</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/web/invoice/invoiceCtl/platformAssignment'
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1070 | 发票状态 |
| auditContent | string | 是 | | 审核内容 |
| delivererContent | string | 是 | | 交付内容 |
| mailAddr | string | 是 | | 邮寄地址 |
| mailMobile | string | 是 | | 邮寄电话 |
| mailTo | string | 是 | | 邮寄人 |
**示例**
```
{
"id":"11665430003004143",
"nextStatus": "1070",
"auditContent":"审核内容信息",
"delivererContent":"交付商交付内容信息",
"mailAddr":"北京大望路",
"mailMobile":"010-65658565",
"mailTo":"杨庆菊"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="delivererAssignment"> 交付商邮寄</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/delivererAssignment
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1080 | 发票状态 |
| mailNo | string | 是 | | 邮寄单号 |
**示例**
```
{
"id":"11665430003004143",
"nextStatus": "1080",
"mailNo":"JIDNUId625815"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="platformAssignment"> 发票平台完成</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/platformAssignment'
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1090 | 发票状态 |
**示例**
```
{
"id":"11665430003004143",
"nextStatus": "1090"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="apiCancelInvoice"> 发票撤销</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/api/op/action/springboard
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| merchantId | string | 是 | | 平台审核备注 |
| applyNo | number | 是 | | 发票支付 必须写 1 请确认是否已经支付 |
**示例**
```
{
"action_process": "sijibao",
"action_type": "apiCancelInvoice",
"action_body": {
"merchantId":"11665033820002912",
"applyNo": "1020"
}
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
## **<a name="txPayment"> 完税证明 </a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/txPayment
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | number | 是 | | 发票ID |
| taxNo | number | 是 | | 发票编号 |
| complateTax | string | 是 | | 是否完税 |
| taxTime | string | 是 | | 完税时间 |
| taxVoucher | string | 是 | | 完税图片 |
**示例**
```
{
"id":"11665448190004592",
"taxNo": "DIE552SDKD",
"complateTax":1,
"taxTime":"2019-10-10",
"taxVoucher":"www.baidu.com"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
## **<a name="queryTxPayment"> 查看完税证明</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/api/op/action/springboard
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string | 是 | | 发票ID |
**示例**
```
{
"id":"11665033820002912"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
```
{
"status":0,
"msg":"操作成功",
"data":{
"invoiceTime":"2019-10-31 13:09:03",
"complateTax":"已完成",
"taxTime":"2019-10-10 08:00:00",
"createdAt":"2019-10-31 13:09:03",
"updatedAt":"2019-10-31 13:09:03",
"id":"11665448190004592",
"taxNo":"DIE552SDKD",
"taxVoucher":"www.baidu.com"
},
"bizmsg":"empty",
"requestid":"b00a9b2244504505bf1ef1bc36b6949e"
}
```
## **<a name="apiUpEmNo"> 平台更新邮寄号 </a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/api/op/action/springboard
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string | 是 | | 发票ID |
| platformMailNo | string | 是 | | 邮寄编号 |
**示例**
```
{
"id":"11665033820002912",
"platformMailNo":"545sre55sg"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
## **<a name="queryInvoices"> 发票列表(平台) </a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/queryInvoices
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| pageIndex | number | 否 | 1 | 当前页数 |
| pageSize | number | 否 | 10 | 每页记录数 |
| complateTax | string | 否 | | 是否完税 |
| invoiceTime | string | 否 | | 开发票时间 |
| applyNo | string | 否 | | 发票申请编号 |
| inInvalid | string | 否 | | 是否完税 |
| type | string | 否 | | 发票类型 |
**示例**
```
{
"type":"10"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"操作成功",
"data":{
"count":3,
"rows":[
{
{
"invoiceTime":"2019-10-28 10:22:05",
"status"
:
"1000"
,
// 状态码
"complateTax":"未完成",
"name"
:
"待分配"
// 状态名称
"taxTime":"2019-10-28 10:22:05",
"createdAt":"2019-10-28 10:22:05",
"updatedAt":"2019-10-28 10:22:05",
"id":"11665258555003154",
"applyNo":"gongsibao001",
"merchantId":"18asf854584",
"status":"1030",
"invoiceNo":"",
"invoiceImg":null,
"taxNo":"",
"taxVoucher":null,
"mailNo":"",
"deletedAt":null,
"version":0,
"apply":{
"isInvalid":"红冲",
"createdAt":"2019-10-31 12:15:42",
"updatedAt":"2019-10-31 12:15:42",
"type":10,
"applyNo":"gongsibao001",
"merchantName":"腾讯信息科有限公司",
"businessName":"悦图遥感科技"
}
},
},
{
{
"invoiceTime":"2019-10-26 14:41:42",
"status"
:
"1010"
,
"complateTax":"已完成",
"name"
:
"待完善"
"taxTime":"2019-10-10 08:00:00",
"createdAt":"2019-10-25 19:56:30",
"updatedAt":"2019-10-26 14:41:42",
"id":"11665033820002912",
"applyNo":"gongsibao001",
"merchantId":"18asf854584",
"status":"1080",
"invoiceNo":"gongsibao4584585",
"invoiceImg":"www.baidu.com",
"taxNo":"DIE552SDKD",
"taxVoucher":null,
"mailNo":"JIDNUId625815",
"deletedAt":null,
"version":0,
"apply":{
"isInvalid":"未红冲",
"createdAt":"2019-10-31 12:15:42",
"updatedAt":"2019-10-31 12:15:42",
"type":10,
"applyNo":"gongsibao001",
"merchantName":"腾讯信息科有限公司",
"businessName":"网易信息科技"
}
},
},
{
],
"invoiceTime":"2019-10-25 17:38:48",
"requestid"
:
"db9a3248c6b7483d93ccea6d66d0affc"
"complateTax":"未完成",
}
"taxTime":"2019-10-25 17:36:36",
"createdAt":"2019-10-25 17:36:36",
"updatedAt":"2019-10-25 17:38:48",
"id":"11665025426002758",
"applyNo":"zjietiaodong999",
"merchantId":"11064622752480998",
"status":"1030",
"invoiceNo":"",
"invoiceImg":null,
"taxNo":"",
"taxVoucher":null,
"mailNo":"",
"deletedAt":null,
"version":0,
"apply":{
"isInvalid":"红冲",
"createdAt":"2019-10-31 12:15:42",
"updatedAt":"2019-10-31 12:15:42",
"type":10,
"applyNo":"zjietiaodong999",
"merchantName":"网易科技",
"businessName":"zijietiaodongmingcheng"
}
}
]
},
"bizmsg":"empty",
"requestid":"8296ad60d1bc46b8a73f7405f2861aec"
}
```
```
## **<a name="queryInvoices"> 发票申请列表(平台) </a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/queryInvoices
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| pageIndex | number | 否 | 1 | 当前页数 |
| pageSize | number | 否 | 10 | 每页记录数 |
| invoiceTime | string | 是 | | 开发票时间 |
| applyNo | string | 是 | | 发票申请编号 |
| type | string | 是 | | 发票类型 |
| status | string | 是 | | 发票状态 |
**示例**
```
## **<a name="invoicePage"> 发票申请页 </a>**
{
[
返回到目录
](
#menu
)
"type":"10"
##### URL
}
[
/web/invoice/invoiceCtl/invoicePage
]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
```
javascript
{
"currentPage"
:
1
,
"pageSize"
:
2
,
"apply_no"
:
""
,
// 申请编号
"status"
:
""
,
// 进度状态
"invoice_type"
:
""
,
// 发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票
"createTimeBegin"
:
""
,
// 申请时间-开始
"createTimeEnd"
:
""
// 申请时间-结束
}
```
```
**返回结果**
#### 返回结果
```
javascript
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
{
"count"
:
5
,
"status":0,
"rows"
:
[
"msg":"操作成功",
"data":{
"count":3,
"rows":[
{
"invoiceTime":"2019-10-28 10:22:05",
"complateTax":"未完成",
"taxTime":"2019-10-28 10:22:05",
"createdAt":"2019-10-28 10:22:05",
"updatedAt":"2019-10-28 10:22:05",
"id":"11665258555003154",
"applyNo":"gongsibao001",
"merchantId":"18asf854584",
"status":"1030",
"invoiceNo":"",
"invoiceImg":null,
"taxNo":"",
"taxVoucher":null,
"mailNo":"",
"deletedAt":null,
"version":0,
"apply":{
"isInvalid":"红冲",
"createdAt":"2019-10-31 12:15:42",
"updatedAt":"2019-10-31 12:15:42",
"type":10,
"applyNo":"gongsibao001",
"merchantName":"腾讯信息科有限公司",
"businessName":"悦图遥感科技"
}
},
{
{
"i
nvoiceTime":"2019-10-26 14:41:42
",
"i
d"
:
"11855671564003193
"
,
"c
omplateTax":"已完成
",
"c
hannel_id"
:
"1
"
,
"
taxTime":"2019-10-10 08:00:
00",
"
product_id"
:
"500100
00"
,
"
createdAt":"2019-10-25 19:56:30",
"
apply_no"
:
"GONGSIBAO20200213"
,
// 申请编号
"
updatedAt":"2019-10-26 14:41:42",
"
invoice_type"
:
"10"
,
// 发票类型
"i
d":"11665033820002912",
"i
nvoice_amount"
:
5000
,
// 价税合计总额
"
applyNo":"gongsibao001",
"
created_at"
:
"2020-03-12 10:46:00"
,
// 申请时间
"
merchantId":"18asf854584",
"
status"
:
"1110"
,
// 进度状态
"status
":"1080",
"status
_name"
:
"业务完成"
,
// 进度状态名称
"
invoiceNo":"gongsibao4584585",
"
next_status"
:
[
// 下一个进度
"invoiceImg":"www.baidu.com",
{
"taxNo":"DIE552SDKD",
"next_status"
:
"1010"
,
// 状态码
"taxVoucher":null,
"next_name"
:
"待完善"
// 状态名称
"mailNo":"JIDNUId625815",
}
"deletedAt":null
,
]
,
"version":0,
"
apply":{
"
merchant_name"
:
"汉唐信通(北京)科技有限公司"
,
// 发票抬头
"isInvalid":"未红冲",
"businessmen_name"
:
"北京创知厚德科技有限公司"
,
// 开票方
"createdAt":"2019-10-31 12:15:42",
"invoice_deliver"
:
{
// 交付商对象
"
updatedAt":"2019-10-31 12:15:42",
"
deliver_name"
:
"1"
,
// 交付商名称
"type":10
,
}
,
"applyNo":"gongsibao001",
"oproduct"
:
{
// 产品
"
merchantName":"腾讯信息科有限公司
",
"
name"
:
"发票申请
"
,
"
businessName":"网易信息科技"
"
desc"
:
"发票申请,发票红冲"
,
}
}
},
},
{
],
"invoiceTime":"2019-10-25 17:38:48",
"requestid"
:
"dc53b7fb2151425e8366edfe317bb8b5"
"complateTax":"未完成",
}
"taxTime":"2019-10-25 17:36:36",
"createdAt":"2019-10-25 17:36:36",
"updatedAt":"2019-10-25 17:38:48",
"id":"11665025426002758",
"applyNo":"zjietiaodong999",
"merchantId":"11064622752480998",
"status":"1030",
"invoiceNo":"",
"invoiceImg":null,
"taxNo":"",
"taxVoucher":null,
"mailNo":"",
"deletedAt":null,
"version":0,
"apply":{
"isInvalid":"红冲",
"createdAt":"2019-10-31 12:15:42",
"updatedAt":"2019-10-31 12:15:42",
"type":10,
"applyNo":"zjietiaodong999",
"merchantName":"网易科技",
"businessName":"zijietiaodongmingcheng"
}
}
]
},
"bizmsg":"empty",
"requestid":"8296ad60d1bc46b8a73f7405f2861aec"
}
```
```
## **<a name="delivererInvoices"> 发票列表(交付商) </a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/delivererInvoices
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| pageIndex | number | 否 | 1 | 当前页数 |
| pageSize | number | 否 | 10 | 每页记录数 |
| complateTax | string | 否 | | 是否完税 |
| invoiceTime | string | 否 | | 开发票时间 |
| applyNo | string | 否 | | 发票申请编号 |
| inInvalid | string | 否 | | 是否完税 |
| type | string | 否 | | 发票类型 |
**示例**
## **<a name="myInvoicePage"> 申请列表页 </a>**
[
返回到目录
](
#menu
)
```
##### URL
{
[
/web/invoice/invoiceCtl/myInvoicePage
]
"type":"10"
#### 参数格式 `JSON`
}
#### HTTP请求方式 `POST`
```
javascript
{
"currentPage"
:
1
,
"pageSize"
:
2
,
"apply_no"
:
""
,
// 申请编号
"status"
:
""
,
// 进度状态
"invoice_type"
:
""
,
// 发票类型 10 增值税专用发票 20 增值税普通发票 30 普通发票
"createTimeBegin"
:
""
,
// 申请时间-开始
"createTimeEnd"
:
""
// 申请时间-结束
}
```
```
**返回结果**
#### 返回结果
```
javascript
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
{
{
"status":0,
"count"
:
5
,
"msg":"操作成功",
"rows"
:
[
"data":{
"count":2,
"rows":
[
{
{
"applyNo":"gongsibao-futong001",
"id"
:
"11855671564003193"
,
"invoiceId":"11665448190004592",
"channel_id"
:
"1"
,
"breakReason":null,
"product_id"
:
"50010000"
,
"apply":{
"apply_no"
:
"GONGSIBAO20200213"
,
// 申请编号
"merchantId":"11064622752480055",
"invoice_type"
:
"10"
,
// 发票类型
"merchantName":"司机宝",
"invoice_amount"
:
5000
,
// 价税合计总额
"type":"增值税专用发票",
"created_at"
:
"2020-03-12 10:46:00"
,
// 申请时间
"invoiceAmount":400000000,
"status"
:
"1110"
,
// 进度状态
"invoiceTime":"2019-10-19",
"status_name"
:
"业务完成"
,
// 进度状态名称
"businessName":"北京富通勤国际贸易有限责任公司(个体工商)"
"next_status"
:
[
// 下一个进度
{
"next_status"
:
"1010"
,
// 状态码
"next_name"
:
"待完善"
// 状态名称
}
],
"merchant_name"
:
"汉唐信通(北京)科技有限公司"
,
// 发票抬头
"businessmen_name"
:
"北京创知厚德科技有限公司"
,
// 开票方
"invoice_deliver"
:
{
// 交付商对象
"deliver_name"
:
"1"
,
// 交付商名称
},
},
"invoice":{
"oproduct"
:
{
// 产品
"invoiceNo":"gongsibao4584585",
"name"
:
"发票申请"
,
"status":"1060",
"desc"
:
"发票申请,发票红冲"
,
"statusName":"待审核"
}
}
},
},
{
],
"applyNo":"gongsibao-futong001",
"requestid"
:
"dc53b7fb2151425e8366edfe317bb8b5"
"invoiceId":"11665448190004592",
}
"breakReason":"业务繁忙",
"apply":{
"merchantId":"11064622752480055",
"merchantName":"司机宝",
"type":"增值税专用发票",
"invoiceAmount":400000000,
"invoiceTime":"2019-10-19",
"businessName":"北京富通勤国际贸易有限责任公司(个体工商)"
},
"invoice":{
"invoiceNo":"gongsibao4584585",
"status":"1060",
"statusName":"待审核"
}
}
]
},
"bizmsg":"empty",
"requestid":"21da505b34d7423fbbb8865d64f652a5"
}
```
```
\ No newline at end of file
xgg-deliver/app/front/entry/public/apidoc/invoice/invoicebak.md
0 → 100644
View file @
b7e8e132
<a
name=
"menu"
>
目录
</a>
1.
[
发票状态
](
#status
)
1.
[
验证发票是否符合申请
](
#verification
)
已经弃用
1.
[
发票查询明细(平台)
](
#queryInvoice
)
1.
[
发票查询明细(交付商)
](
#queryInvoiceDeliverer
)
1.
[
发票试算
](
#calcInvoice
)
已经弃用
1.
[
发票申请
](
#invoices
)
1.
[
发票验证&试算
](
#verificationAndCalculation
)
1.
[
计算增值税
](
#calculationValueAddedTax
)
1.
[
发票附加税
](
#calculationAdditionalTax
)
1.
[
发票申请列表(平台)
](
#queryInvoices
)
1.
[
交付查看商审批列表
](
#delivererInvoices
)
1.
[
发票平台审批
](
#platformAssignment
)
1.
[
发票交付商审批
](
#delivererAssignment
)
1.
[
完成税证明
](
#txPayment
)
1.
[
查看完成税证明
](
#queryTxPayment
)
1.
[
平台更新邮寄地址
](
#apiUpEmNO
)
## **<a name="saveInvoice"> 发票状态</a>**
[
返回到目录
](
#menu
)
```
{
"0090": {
"status": "0090",
"name": "未付款",
"next": "1000",
"cstatus": "0090",//客户
"dstatus": "",//交付商
},
"1000": {
"status": "1000",
"name": "待审核",
"next": "1020",
"cstatus": "0090",//客户
"dstatus": "",//交付商
},
"1010": {
"status": "1010",
"name": "审核不通过",
"next": "",
"cstatus": "1010",
"dstatus": "",
},
"1020": {
"status": "1020",
"name": "待分配",
"next": "1030",
"cstatus": "1030",
"dstatus": "",
},
"1030": {
"status": "1030",
"name": "待处理",
"next": "1050",
"cstatus": "1030",
"dstatus": "1030",
},
"1040": {
"status": "1040",
"name": "交付商关闭",
"next": "1020",
"cstatus": "1030",
"dstatus": "1040",
},
"1050": {
"status": "1050",
"name": "已开具",
"next": "1060",
"cstatus": "1050",
"dstatus": "1050",
},
"1060": {
"status": "1060",
"name": "待审核",
"next": "1070",
"cstatus": "1050",
"dstatus": "1070",
},
"1070": {
"status": "1070",
"name": "审核通过",
"next": "1080",
"cstatus": "1050",
"dstatus": "1070",
},
"1080": {
"status": "1080",
"name": "已邮寄",
"next": "1090",
"cstatus": "1050",
"dstatus": "1080",
},
"1090": {
"status": "1090",
"name": "完成",
"next": "1100",
"cstatus": "1090",
"dstatus": "1080",
},
"1100": {
"status": "1090",
"name": "发票撤回",
"next": "1100",
"cstatus": "1090",
"dstatus": "1080",
},
"1200": {
"status": "1200",
"name": "红冲",
"next": "",
"cstatus": "1200",
"dstatus": "",
},
"1300": {
"status": "1300",
"name": "审核失败(平台第二次审核)",
"next": "1060",
"cstatus": "1050",
"dstatus": "1060",
}
}
```
## **<a name="verification"> 验证发票是否符合申请</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/web/invoice/invoiceCtl/verification'
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| businessmenCreditCode| string | 是 | | 发票ID |
**示例**
```
{
"businessmenCreditCode": "91210200MA0QE7GT5L"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"code":200,
"msg":"ok",
"data":[
],
"status":0,
"requestid":"06336188128143c09c935e536c9742f2"
}
```
## **<a name="calcInvoice"> 发票试算</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/calcInvoice
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| businessmenCreditCode | string| 是 | | 销售方社会统一信用代码 |
| serviceRate | number| 是 | | 服务费率 |
| perCalWay | number| 是 | | 个税计算方式 1:年 请填写 1 |
| valCalWay | number| 是 | | 增值税计算方式 1:月 2:季度 |
| merchantId | string | 是 | | 商户id |
| taxIncPriRat | number| 是 | | 不含税价百分比 |
| taxCostPriRat | number| 是 | | 核定成本费用率 |
| invoiceTime | String| 是 | | 开票时间 |
| invoiceAmount | number| 是 | | 发票金额 |
| perIncTaxRange | JSON | 是 | | 个税税额范围 |
| valAddTaxRange | JSON | 是 | | 增值税范围 |
**示例**
```
{
"businessmenCreditCode": "111",
"serviceRate": 225,
"perCalWay": "1",
"valCalWay": "1",
"businessmenId": "12795594625000138",
"taxCostPriRat": 1122,
"taxIncPriRat": 1022,
"invoiceTime": "2019-09-19",
"invoiceAmount": 20000000,
"perIncTaxRange": [
{
"minValue": 0,
"rate": "0",
"quiCalDed": 100000,
"maxValue": 3000000
},
{
"minValue": 3000100,
"rate": "1.5",
"quiCalDed": 200000,
"maxValue": 10000000
},
{
"minValue": 10000001,
"rate": "4.86",
"quiCalDed": 300000,
"maxValue": 214748364700
}
],
"valAddTaxRange": [
{
"minValue": 0,
"zengzhiRate": "0",
"fujiaRate": "0",
"maxValue": 3000000
},
{
"minValue": 3000100,
"zengzhiRate": "0",
"fujiaRate": "0",
"maxValue": 10000000
},
{
"minValue": 10000001,
"zengzhiRate": "3",
"fujiaRate": "12",
"maxValue": 214748364700
}
]
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
## **<a name="saveInvoice"> 发票申请保存</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/saveInvoice
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| serviceRate | number| 是 | | 服务费率 |
| perCalWay | number| 是 | | 个税计算方式 1:月 2:季度 3:年 |
| valCalWay | number| 是 | | 增值税计算方式 1:月 2:季度 3:年 |
| taxIncPriRat | number| 是 | | 不含税价百分比 |
| taxCostPriRat | number| 是 | | 核定成本费用率 |
| invoiceTime | String| 是 | | 开票时间 |
| perIncTaxRange | JSON | 是 | | 个税税额范围 |
| valAddTaxRange | JSON | 是 | | 增值税范围 |
| merchantId | string | 是 | | 商户id |
| merchantAccount | string | 是 | | 商户账户 |
| merchantName | string | 是 | | 商户名称 |
| merchantCreditCode | string | 是 | | 商户社会统一信用代码 |
| merchantAddr | string | 是 | | 商户地址 |
| merchantMobile | string | 是 | | 商户电话 |
| merchantBank | string | 是 | | 商户开户行 |
| businessmenId | string| 是 | | 销售方ID |
| businessmenCreditCode | string| 是 | | 销售方社会统一信用代码 |
| businessmenType | number| 是 | | 销售方类型 10 个体工商 20 自然人 |
| businessName | string| 是 | | 销售方名称 |
| isBank | string| 是 | | 是否开户 1:开户 0:未开户 |
| invoiceNo | string | 否 | | 发票编号 |
| ruleCode | number| 是 | | 算法编码 10 个体工商 20 自然人算法 |
| type | number| 否 | | 发票类型 10 普通发票 20 增值税专用发票 30 电子发票 |
| invoiceAmount | number| 是 | | 发票金额 |
| statements | string | 是 | | 结算单子 |
| contract | string| 是 | | 合同 |
| applyNo | String| 是 | | 申请编号 |
| invoiceContent | string| 否 | | 开票内容 |
| applyMobile | string| 否 | | 申请电话 |
| isInvalid | string| 是 | 2 | 是否红冲 2 未红冲 |
| parentId | string| 否 | | 发票关联ID 红冲时添加此字段 |
| status | string| 否 | 1000 |平台 开票状态 默认 1000 |
| customerStatus | string| 否 | 1000 | 客户开票状态 默认 1000 |
| payWay | string| 是 | | 付款方式 10 系统账户扣款 20 线上支付 |
| payAccount | string| 是 | | 付款账户 |
| isPay | number| 否 | 0 | 是否支付 调用前请再次确认此是否支付 |
| mailAddr | string| 是 | | 邮寄地址 |
| mailMobile | string| 是 | | 邮寄电话 |
| mailTo | string| 是 | | 邮寄人 |
```
{
"serviceRate": 400,
"perCalWay": "1",
"valCalWay": "2",
"taxCostPriRat": 1122,
"taxIncPriRat": 1022,
"invoiceTime": "2019-10-19",
"perIncTaxRange": [
{
"minValue": 0,
"rate": "1",
"quiCalDed": 100000,
"maxValue": 3000000
},
{
"minValue": 3000100,
"rate": "1.5",
"quiCalDed": 200000,
"maxValue": 10000000
},
{
"minValue": 10000001,
"rate": "4.86",
"quiCalDed": 300000,
"maxValue": 214748364700
}
],
"valAddTaxRange": [
{
"minValue": 0,
"zengzhiRate": "1",
"fujiaRate": "6",
"maxValue": 3000000
},
{
"minValue": 3000100,
"zengzhiRate": "2",
"fujiaRate": "8",
"maxValue": 10000000
},
{
"minValue": 10000001,
"zengzhiRate": "3",
"fujiaRate": "12",
"maxValue": 214748364700
}
],
"merchantId":"11064622752480055",
"merchantAccount":"driverBabyPublicAccount",
"merchantName": "司机宝",
"merchantCreditCode":"91110108MA008KB56P",
"merchantAddr":"北京市海淀区北太平庄路18号3层3-0227",
"merchantMobile":"010-5369854",
"merchantBank":"110108022130868",
"businessmenType":"10",
"businessmenId": "110115023996882",
"businessmenCreditCode": "91110115MA00HDC44L",
"businessName":"北京富通勤国际贸易有限责任公司(个体工商)",
"isBank":1,
"taxAuthorities":"北京大兴税务局",
"type":20,
"ruleCode":"10",
"invoiceAmount": 40000000,
"statements":"wwww.baidu.com",
"contract":"www.qq.com",
"applyNo":"gongsibao-futong001",
"isInvalid":2,
"parentId":null,
"status":"1000",
"customerStatus":"1000",
"payWay":"20",
"payAccount":null,
"isPay":1,
"mailAddr":"北京市海淀区北太平庄路18号3层3-0227",
"mailMobile":"18633923636",
"mailTo":"赵彩红"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"ea903ff378d4469a8fef10a6e15f5036"
}
```
## **<a name="verificationAndCalculation"> 发票验证&试算</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/verificationAndCalculation
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| businessmenType | number| 是 | | 销售方类型 10 个体工商 20 自然人 |
| businessmenCreditCode | string| 是 | | 销售方社会统一信用代码 |
| ruleCode | number| 是 | | 算法编码 10 个体工商 20 自然人算法 |
| serviceRate | number| 是 | | 服务费率 例子:10.11% |
| perCalWay | number| 是 | | 个税计算方式 1:年 请填写 1 |
| valCalWay | number| 是 | | 增值税计算方式 1:月 2:季度 |
| merchantId | string | 是 | | 商户id |
| taxIncPriRat | number| 是 | | 不含税价百分比 例子:10.11%|
| taxCostPriRat | number| 是 | | 核定成本费用率 例子:10.11%|
| invoiceTime | String| 是 | | 开票时间 |
| invoiceAmount | number| 是 | | 发票金额 |
| perIncTaxRange | JSON | 是 | | 个税税额范围 |
| valAddTaxRange | JSON | 是 | | 增值税范围 |
**示例**
```
{
"businessmenCreditCode": "111",
"serviceRate": 2.25,
"perCalWay": "1",
"valCalWay": "1",
"businessmenId": "12795594625000138",
"taxCostPriRat": 11.22,
"taxIncPriRat": 10.22,
"invoiceTime": "2019-09-19",
"invoiceAmount": 2000000,
"perIncTaxRange": [
{
"minValue": 0,
"rate": "0",
"quiCalDed": 100000,
"maxValue": 3000000
},
{
"minValue": 3000100,
"rate": "1.5",
"quiCalDed": 200000,
"maxValue": 10000000
},
{
"minValue": 10000001,
"rate": "4.86",
"quiCalDed": 300000,
"maxValue": 214748364700
}
],
"valAddTaxRange": [
{
"minValue": 0,
"zengzhiRate": "0",
"fujiaRate": "0",
"maxValue": 3000000
},
{
"minValue": 3000100,
"zengzhiRate": "0",
"fujiaRate": "0",
"maxValue": 10000000
},
{
"minValue": 10000001,
"zengzhiRate": "3",
"fujiaRate": "12",
"maxValue": 214748364700
}
]
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
## **<a name="calculationValueAddedTax"> 计算增值税</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/calculationValueAddedTax
**参数验证**
否
**参数**
```
javascript
// 字段描述 是否必填 默认值/注释
{
"businessmenCreditCode"
:
"111"
,
//销售方统一社会信用代码 是
"businessmenType"
:
"10"
,
//销售方类型 是 10:个体工商户 20:自然人
"calNames"
:
"valueAddedTax"
,
//计算类型 是 valueAddedTax:增值税
"valCalWay"
:
"1"
,
//计算时间类型 是 1:月 2:季度 3:年
"businessmenId"
:
"12795594625000138"
,
//销售方ID 是
"taxIncPriRat"
:
0.03
,
//不含税价百分比 是 如果3% 请填写 0.03 此字段不能大于1
"invoiceTime"
:
"2019-11-26"
,
//发票时间 是
"invoiceAmount"
:
20000000
,
//发票金额 单位:分 是
"valAddTaxRange"
:
[
//增值税范围 是
{
"minValue"
:
0
,
//最小值 单位:分 是
"zengzhiRate"
:
"3"
,
//增值税百分比 是 如果3%请填写 3
"fujiaRate"
:
"12"
,
//附加税 否
"maxValue"
:
3000000
//最大值 单位:分 是
}
]
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"操作成功"
,
"data"
:
"776699.03"
,
//增值税 单位:分
"bizmsg"
:
"empty"
,
"requestid"
:
"c19a411e7b5e41a48eb8b4a2d99a2987"
}
```
## **<a name="calculationAdditionalTax"> 计算附加税</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/calculationAdditionalTax
**参数验证**
否
**参数**
```
javascript
// 字段描述 是否必填 默认值/注释
{
"businessmenType"
:
"10"
,
//销售方类型 是 10:个体工商户 20:自然人
"calNames"
:
"additionalTax"
,
//计算类型 是 valueAddedTax:增值税
"valueAddedTax"
:
10000000
,
//增值税金额 单位:分 是
"valAddTaxRange"
:
[
//增值税范围 是
{
"minValue"
:
0
,
//最小值 单位:分 是
"zengzhiRate"
:
"3"
,
//增值税百分比 是 如果3%请填写 3
"fujiaRate"
:
"12"
,
//附加税 否
"maxValue"
:
3000000
//最大值 单位:分 是
}
]
}
```
#### 返回结果
```
javascript
{
"status"
:
0
,
"msg"
:
"操作成功"
,
"data"
:
"1500000.00"
,
//附加税
"bizmsg"
:
"empty"
,
"requestid"
:
"833f1dfa957d44fabde9ed71652f0677"
}
```
## **<a name="queryInvoice"> 查询发票明细(平台)</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/web/invoice/invoiceCtl/queryInvoice
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string | 否 | | 发票ID |
| applyNo | string | 否 | | 发票申请号 |
| merchantId | string | 否 | | 商户ID |
**示例**
```
注意:applyNo结合merchantId 一起使用,当id存在是优先使用Id查询
{
"merchantId":"11665033820002912",
"applyNo": "1020",
"id":"xxxx"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"操作成功",
"data":{
"id":"11665033820002912",
"merchantId":"18asf854584",
"merchantName":"腾讯信息科有限公司",
"merchantCreditCode":"5456461654165",
"merchantAddr":"北京海淀区上地",
"merchantMobile":"18833836392",
"merchantBank":"招商银大望路支行",
"merchantAccount":"tengxunkeji",
"businessmenId":"12795594625000138",
"businessmenCreditCode":"91210200MA0QE7GT5L",
"businessName":"网易信息科技",
"isBank":"已开户",
"taxAuthorities":"北京朝阳税务局",
"type":"普通发票",
"invoiceAmount":200000,
"statements":"wwww.baidu.com",
"contract":"www.qq.com",
"invoiceTime":"2019-09-19",
"settleImg":"www.taobao.com",
"applyNo":"gongsibao001",
"invoiceContent":null,
"personalIncomeTax":482926.51,
"additionalTax":65323.9,
"valueAddedTax":544365.81,
"serviceCharge":45,
"applyMobile":null,
"isInvalid":"已红冲",
"parentId":null,
"status":"1090",
"customerStatus":"1090",
"payWay":"系统账户扣款",
"payAccount":null,
"isPay":"已支付",
"mailAddr":"北京来广营",
"mailMobile":"0-012535",
"mailTo":"脚姐",
"remark":"脚姐已批准",
"delivererId":"11329678846003516",
"createdAt":"2019-10-25",
"updatedAt":"2019-10-26T05:36:15.000Z",
"deletedAt":null,
"version":0,
"statusName":"完成",
"customerStatusName":"",
"deliverer":{
"id":"11329678846003516",
"invoiceId":"11665033820002912",
"applyNo":"gongsibao001",
"merchantId":"18asf854584",
"delivererId":"1536854655",
"delivererName":"国投迎新科技有限公司",
"delivererAmount":10,
"breakReason":null,
"auditContent":"审核内容信息",
"delivererContent":"交付商交付内容信息",
"mailAddr":"北京大望路",
"mailMobile":"1000",
"mailTo":"脚姐",
"delivererMailNo":"JIDNUId625815",
"platformMailNo":"545sre55sg",
"createdAt":"2019-10-25",
"updatedAt":"2019-10-28",
"deletedAt":null,
"version":0
},
"invoice":{
"id":"11665033820002912",
"applyNo":"gongsibao001",
"merchantId":"18asf854584",
"status":"1080",
"invoiceNo":"gongsibao4584585",
"invoiceTime":"2019-10-12",
"invoiceImg":"www.baidu.com",
"taxNo":"DIE552SDKD",
"complateTax":"已完税",
"taxTime":"2019-10-10",
"taxVoucher":null,
"mailNo":"JIDNUId625815",
"createdAt":"2019-10-25",
"updatedAt":"2019-10-26",
"deletedAt":null,
"version":0,
"statusName":"已邮寄"
},
"parentInvoice":null
},
"bizmsg":"empty",
"requestid":"9120426859914d88ba56a58709683be4"
}
```
## **<a name="queryInvoiceDeliverer"> 查询发票明细(交付商)</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/api/op/action/springboard
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string | 否 | | 发票ID |
| applyNo | string | 否 | | 发票申请号 |
| merchantId | string | 是 | | 商户ID |
**示例**
```
注意:applyNo结合merchantId 一起使用,当id存在是优先使用Id查询
{
"merchantId":"11665033820002912",
"applyNo": "1020",
"id":"xxxx"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"操作成功",
"data":{
"id":"11665033820002912",
"delivererId":"11329678846003516",
"merchantId":"18asf854584",
"merchantName":"腾讯信息科有限公司",
"merchantCreditCode":"5456461654165",
"merchantAddr":"北京海淀区上地",
"merchantMobile":"18833836392",
"merchantBank":"招商银大望路支行",
"merchantAccount":"tengxunkeji",
"businessmenId":"12795594625000138",
"businessmenCreditCode":"91210200MA0QE7GT5L",
"businessName":"网易信息科技",
"isBank":"未开户",
"taxAuthorities":"北京朝阳税务局",
"type":"普通发票",
"invoiceAmount":20000000,
"statements":"wwww.baidu.com",
"contract":"www.qq.com",
"invoiceTime":"2019-09-19",
"settleImg":"www.taobao.com",
"applyNo":"gongsibao001",
"invoiceContent":null,
"personalIncomeTax":48292651,
"additionalTax":6532390,
"valueAddedTax":54436581,
"serviceCharge":4500,
"applyMobile":null,
"mailAddr":"北京来广营",
"mailMobile":"0-012535",
"mailTo":"脚姐",
"createdAt":"2019-10-25",
"deliverer":{
"auditContent":"审核内容信息",
"delivererContent":"交付商交付内容信息",
"mailAddr":"北京大望路",
"mailMobile":"1000",
"mailTo":"脚姐",
"delivererMailNo":"JIDNUId625815",
"status":"1080",
"statusName":"已邮寄"
},
"invoice":{
"invoiceNo":"gongsibao4584585",
"invoiceTime":"2019-10-12",
"invoiceImg":"www.baidu.com",
"taxNo":"DIE552SDKD",
"complateTax":"已完税",
"taxTime":"2019-10-10",
"taxVoucher":null
}
},
"bizmsg":"empty",
"requestid":"eecdd1283154468897f30b0c2fd37cb3"
}
```
## **<a name="platformAssignment"> 发票平台第一次审批</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/web/invoice/invoiceCtl/platformAssignment'
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | | 发票状态 |
| remark | string | 是 | | 平台审核备注 |
| isPay | number | 是 | | 发票支付 必须写 1 请确认是否已经支付 |
**示例**
```
{
"id":"11665430003004143",
"nextStatus": "1020",
"isPay": 1,
"remark": "材料准确无误"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"ea903ff378d4469a8fef10a6e15f5036"
}
```
## **<a name="platformAssignment"> 分配交付商</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/web/invoice/invoiceCtl/platformAssignment'
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1030 | 发票状态 |
| merchantId | string | 是 | | 购买方ID |
| delivererId | number | 是 | | 交付商ID |
| delivererName | string | 是 | | 交付商名称 |
| delivererAmount | string | 是 | | 交付商分成 |
**示例**
```
{
"id":"11665033820002912",
"nextStatus": "1030",
"merchantId":"18asf854584",
"delivererId":"1536854655",
"delivererName":"国投迎新科技有限公司",
"delivererAmount":"1000"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="delivererAssignment"> 交付商开具</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/delivererAssignment
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1050 | 发票状态 |
| invoiceNo | string | 是 | | 发票编号 |
| invoiceTime | number | 是 | | 开具时间 |
| invoiceImg | string | 是 | | 发票图片 |
**示例**
```
{
"id":"11665430003004143",
"nextStatus": "1050",
"invoiceNo":"gongsibao4584585",
"invoiceTime":"2019-10-12",
"invoiceImg":"www.baidu.com"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="delivererAssignment"> 交付商提交审核</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/delivererAssignment
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1060 | 发票状态 |
**示例**
```
{
"id":"11665033820002912",
"nextStatus": "1060",
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="platformAssignment"> 发票平台第二次审核</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/web/invoice/invoiceCtl/platformAssignment'
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1070 | 发票状态 |
| auditContent | string | 是 | | 审核内容 |
| delivererContent | string | 是 | | 交付内容 |
| mailAddr | string | 是 | | 邮寄地址 |
| mailMobile | string | 是 | | 邮寄电话 |
| mailTo | string | 是 | | 邮寄人 |
**示例**
```
{
"id":"11665430003004143",
"nextStatus": "1070",
"auditContent":"审核内容信息",
"delivererContent":"交付商交付内容信息",
"mailAddr":"北京大望路",
"mailMobile":"010-65658565",
"mailTo":"杨庆菊"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="delivererAssignment"> 交付商邮寄</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/delivererAssignment
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1080 | 发票状态 |
| mailNo | string | 是 | | 邮寄单号 |
**示例**
```
{
"id":"11665430003004143",
"nextStatus": "1080",
"mailNo":"JIDNUId625815"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="platformAssignment"> 发票平台完成</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/platformAssignment'
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string| 是 | | 发票申请ID |
| nextStatus | string | 是 | 1090 | 发票状态 |
**示例**
```
{
"id":"11665430003004143",
"nextStatus": "1090"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"success",
"data":null,
"requestid":"3ea95f1837b9475da4a4d9aacc3ff74b"
}
```
## **<a name="apiCancelInvoice"> 发票撤销</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/api/op/action/springboard
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| merchantId | string | 是 | | 平台审核备注 |
| applyNo | number | 是 | | 发票支付 必须写 1 请确认是否已经支付 |
**示例**
```
{
"action_process": "sijibao",
"action_type": "apiCancelInvoice",
"action_body": {
"merchantId":"11665033820002912",
"applyNo": "1020"
}
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
## **<a name="txPayment"> 完税证明 </a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/txPayment
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | number | 是 | | 发票ID |
| taxNo | number | 是 | | 发票编号 |
| complateTax | string | 是 | | 是否完税 |
| taxTime | string | 是 | | 完税时间 |
| taxVoucher | string | 是 | | 完税图片 |
**示例**
```
{
"id":"11665448190004592",
"taxNo": "DIE552SDKD",
"complateTax":1,
"taxTime":"2019-10-10",
"taxVoucher":"www.baidu.com"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
## **<a name="queryTxPayment"> 查看完税证明</a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/api/op/action/springboard
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string | 是 | | 发票ID |
**示例**
```
{
"id":"11665033820002912"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
```
{
"status":0,
"msg":"操作成功",
"data":{
"invoiceTime":"2019-10-31 13:09:03",
"complateTax":"已完成",
"taxTime":"2019-10-10 08:00:00",
"createdAt":"2019-10-31 13:09:03",
"updatedAt":"2019-10-31 13:09:03",
"id":"11665448190004592",
"taxNo":"DIE552SDKD",
"taxVoucher":"www.baidu.com"
},
"bizmsg":"empty",
"requestid":"b00a9b2244504505bf1ef1bc36b6949e"
}
```
## **<a name="apiUpEmNo"> 平台更新邮寄号 </a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
'/api/op/action/springboard
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| id | string | 是 | | 发票ID |
| platformMailNo | string | 是 | | 邮寄编号 |
**示例**
```
{
"id":"11665033820002912",
"platformMailNo":"545sre55sg"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
## **<a name="queryInvoices"> 发票列表(平台) </a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/queryInvoices
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| pageIndex | number | 否 | 1 | 当前页数 |
| pageSize | number | 否 | 10 | 每页记录数 |
| complateTax | string | 否 | | 是否完税 |
| invoiceTime | string | 否 | | 开发票时间 |
| applyNo | string | 否 | | 发票申请编号 |
| inInvalid | string | 否 | | 是否完税 |
| type | string | 否 | | 发票类型 |
**示例**
```
{
"type":"10"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"操作成功",
"data":{
"count":3,
"rows":[
{
"invoiceTime":"2019-10-28 10:22:05",
"complateTax":"未完成",
"taxTime":"2019-10-28 10:22:05",
"createdAt":"2019-10-28 10:22:05",
"updatedAt":"2019-10-28 10:22:05",
"id":"11665258555003154",
"applyNo":"gongsibao001",
"merchantId":"18asf854584",
"status":"1030",
"invoiceNo":"",
"invoiceImg":null,
"taxNo":"",
"taxVoucher":null,
"mailNo":"",
"deletedAt":null,
"version":0,
"apply":{
"isInvalid":"红冲",
"createdAt":"2019-10-31 12:15:42",
"updatedAt":"2019-10-31 12:15:42",
"type":10,
"applyNo":"gongsibao001",
"merchantName":"腾讯信息科有限公司",
"businessName":"悦图遥感科技"
}
},
{
"invoiceTime":"2019-10-26 14:41:42",
"complateTax":"已完成",
"taxTime":"2019-10-10 08:00:00",
"createdAt":"2019-10-25 19:56:30",
"updatedAt":"2019-10-26 14:41:42",
"id":"11665033820002912",
"applyNo":"gongsibao001",
"merchantId":"18asf854584",
"status":"1080",
"invoiceNo":"gongsibao4584585",
"invoiceImg":"www.baidu.com",
"taxNo":"DIE552SDKD",
"taxVoucher":null,
"mailNo":"JIDNUId625815",
"deletedAt":null,
"version":0,
"apply":{
"isInvalid":"未红冲",
"createdAt":"2019-10-31 12:15:42",
"updatedAt":"2019-10-31 12:15:42",
"type":10,
"applyNo":"gongsibao001",
"merchantName":"腾讯信息科有限公司",
"businessName":"网易信息科技"
}
},
{
"invoiceTime":"2019-10-25 17:38:48",
"complateTax":"未完成",
"taxTime":"2019-10-25 17:36:36",
"createdAt":"2019-10-25 17:36:36",
"updatedAt":"2019-10-25 17:38:48",
"id":"11665025426002758",
"applyNo":"zjietiaodong999",
"merchantId":"11064622752480998",
"status":"1030",
"invoiceNo":"",
"invoiceImg":null,
"taxNo":"",
"taxVoucher":null,
"mailNo":"",
"deletedAt":null,
"version":0,
"apply":{
"isInvalid":"红冲",
"createdAt":"2019-10-31 12:15:42",
"updatedAt":"2019-10-31 12:15:42",
"type":10,
"applyNo":"zjietiaodong999",
"merchantName":"网易科技",
"businessName":"zijietiaodongmingcheng"
}
}
]
},
"bizmsg":"empty",
"requestid":"8296ad60d1bc46b8a73f7405f2861aec"
}
```
## **<a name="queryInvoices"> 发票申请列表(平台) </a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/queryInvoices
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| pageIndex | number | 否 | 1 | 当前页数 |
| pageSize | number | 否 | 10 | 每页记录数 |
| invoiceTime | string | 是 | | 开发票时间 |
| applyNo | string | 是 | | 发票申请编号 |
| type | string | 是 | | 发票类型 |
| status | string | 是 | | 发票状态 |
**示例**
```
{
"type":"10"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```
{
"status":0,
"msg":"操作成功",
"data":{
"count":3,
"rows":[
{
"invoiceTime":"2019-10-28 10:22:05",
"complateTax":"未完成",
"taxTime":"2019-10-28 10:22:05",
"createdAt":"2019-10-28 10:22:05",
"updatedAt":"2019-10-28 10:22:05",
"id":"11665258555003154",
"applyNo":"gongsibao001",
"merchantId":"18asf854584",
"status":"1030",
"invoiceNo":"",
"invoiceImg":null,
"taxNo":"",
"taxVoucher":null,
"mailNo":"",
"deletedAt":null,
"version":0,
"apply":{
"isInvalid":"红冲",
"createdAt":"2019-10-31 12:15:42",
"updatedAt":"2019-10-31 12:15:42",
"type":10,
"applyNo":"gongsibao001",
"merchantName":"腾讯信息科有限公司",
"businessName":"悦图遥感科技"
}
},
{
"invoiceTime":"2019-10-26 14:41:42",
"complateTax":"已完成",
"taxTime":"2019-10-10 08:00:00",
"createdAt":"2019-10-25 19:56:30",
"updatedAt":"2019-10-26 14:41:42",
"id":"11665033820002912",
"applyNo":"gongsibao001",
"merchantId":"18asf854584",
"status":"1080",
"invoiceNo":"gongsibao4584585",
"invoiceImg":"www.baidu.com",
"taxNo":"DIE552SDKD",
"taxVoucher":null,
"mailNo":"JIDNUId625815",
"deletedAt":null,
"version":0,
"apply":{
"isInvalid":"未红冲",
"createdAt":"2019-10-31 12:15:42",
"updatedAt":"2019-10-31 12:15:42",
"type":10,
"applyNo":"gongsibao001",
"merchantName":"腾讯信息科有限公司",
"businessName":"网易信息科技"
}
},
{
"invoiceTime":"2019-10-25 17:38:48",
"complateTax":"未完成",
"taxTime":"2019-10-25 17:36:36",
"createdAt":"2019-10-25 17:36:36",
"updatedAt":"2019-10-25 17:38:48",
"id":"11665025426002758",
"applyNo":"zjietiaodong999",
"merchantId":"11064622752480998",
"status":"1030",
"invoiceNo":"",
"invoiceImg":null,
"taxNo":"",
"taxVoucher":null,
"mailNo":"",
"deletedAt":null,
"version":0,
"apply":{
"isInvalid":"红冲",
"createdAt":"2019-10-31 12:15:42",
"updatedAt":"2019-10-31 12:15:42",
"type":10,
"applyNo":"zjietiaodong999",
"merchantName":"网易科技",
"businessName":"zijietiaodongmingcheng"
}
}
]
},
"bizmsg":"empty",
"requestid":"8296ad60d1bc46b8a73f7405f2861aec"
}
```
## **<a name="delivererInvoices"> 发票列表(交付商) </a>**
[
返回到目录
](
#menu
)
**接口方式**
HTTP
**HTTP方法**
POST
**URI路径**
/web/invoice/invoiceCtl/delivererInvoices
**参数验证**
否
**参数**
| 参数名|数据类型|必须|默认| 说明 |
|---|:---:|:---:|:---:|---|
| pageIndex | number | 否 | 1 | 当前页数 |
| pageSize | number | 否 | 10 | 每页记录数 |
| complateTax | string | 否 | | 是否完税 |
| invoiceTime | string | 否 | | 开发票时间 |
| applyNo | string | 否 | | 发票申请编号 |
| inInvalid | string | 否 | | 是否完税 |
| type | string | 否 | | 发票类型 |
**示例**
```
{
"type":"10"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
{
"status":0,
"msg":"操作成功",
"data":{
"count":2,
"rows":
[
{
"applyNo":"gongsibao-futong001",
"invoiceId":"11665448190004592",
"breakReason":null,
"apply":{
"merchantId":"11064622752480055",
"merchantName":"司机宝",
"type":"增值税专用发票",
"invoiceAmount":400000000,
"invoiceTime":"2019-10-19",
"businessName":"北京富通勤国际贸易有限责任公司(个体工商)"
},
"invoice":{
"invoiceNo":"gongsibao4584585",
"status":"1060",
"statusName":"待审核"
}
},
{
"applyNo":"gongsibao-futong001",
"invoiceId":"11665448190004592",
"breakReason":"业务繁忙",
"apply":{
"merchantId":"11064622752480055",
"merchantName":"司机宝",
"type":"增值税专用发票",
"invoiceAmount":400000000,
"invoiceTime":"2019-10-19",
"businessName":"北京富通勤国际贸易有限责任公司(个体工商)"
},
"invoice":{
"invoiceNo":"gongsibao4584585",
"status":"1060",
"statusName":"待审核"
}
}
]
},
"bizmsg":"empty",
"requestid":"21da505b34d7423fbbb8865d64f652a5"
}
```
\ 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