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
fd64dc6d
Commit
fd64dc6d
authored
Apr 13, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddg
parent
010c42d8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
84 deletions
+91
-84
xgg-saas-platform/app/base/controller/impl/saas/invoiceCtl.js
+46
-38
xgg-saas-platform/app/base/service/impl/saas/saasinvoiceSve.js
+42
-44
xgg-saas-platform/app/base/system.js
+1
-1
xgg-saas-platform/app/config/settings.js
+2
-1
No files found.
xgg-saas-platform/app/base/controller/impl/saas/invoiceCtl.js
View file @
fd64dc6d
var
system
=
require
(
"../../../system"
)
var
system
=
require
(
"../../../system"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
const
CtlBase
=
require
(
"../../ctlms.base"
);
const
validation
=
system
.
getObject
(
"util.validation"
);
const
validation
=
system
.
getObject
(
"util.validation"
);
var
moment
=
require
(
'moment'
);
const
settings
=
require
(
"../../../../config/settings"
);
const
axios
=
require
(
"axios"
);
class
InvoiceCtl
extends
CtlBase
{
class
InvoiceCtl
extends
CtlBase
{
constructor
()
{
constructor
()
{
super
();
super
();
...
@@ -139,6 +141,7 @@ class InvoiceCtl extends CtlBase {
...
@@ -139,6 +141,7 @@ class InvoiceCtl extends CtlBase {
"invoice_type"
:
invoice_type
,
"invoice_type"
:
invoice_type
,
"invoice_amount"
:
amount
"invoice_amount"
:
amount
});
});
// TODO 总统计算 end
// TODO 总统计算 end
invoiceList
.
push
({
invoiceList
.
push
({
"name"
:
businessmen
.
name
,
"name"
:
businessmen
.
name
,
...
@@ -163,43 +166,48 @@ class InvoiceCtl extends CtlBase {
...
@@ -163,43 +166,48 @@ class InvoiceCtl extends CtlBase {
// TODO 总统计算 begin
// TODO 总统计算 begin
// 计算税金
// 计算税金
let
url
=
settings
.
deliverSysApi
().
calcInvoice
;
try
{
let
res
=
await
axios
({
let
url
=
settings
.
deliverSysApi
().
calcInvoice
;
method
:
'post'
,
let
res
=
await
axios
({
url
:
url
,
method
:
'post'
,
data
:
calcParams
url
:
url
,
});
data
:
calcParams
if
(
!
res
||
!
res
.
data
||
res
.
status
!=
0
){
});
return
system
.
getResult
(
null
,
`试算错误`
);
if
(
!
res
||
!
res
.
data
||
res
.
data
.
status
!=
0
||
res
.
data
.
data
.
length
==
0
){
}
return
system
.
getResult
(
null
,
`试算错误`
);
}
let
calcList
=
res
.
data
;
let
calcMap
=
{};
let
calcList
=
res
.
data
.
data
;
for
(
let
c
of
calcList
)
{
let
calcMap
=
{};
calcMap
[
c
.
credit_code
]
=
c
;
for
(
let
c
of
calcList
)
{
}
calcMap
[
c
.
credit_code
]
=
c
;
}
for
(
let
invoice
of
invoiceList
)
{
let
invoiceCalc
=
calcMap
[
invoice
.
credit_code
];
for
(
let
invoice
of
invoiceList
)
{
additional_tax_total
=
additional_tax_total
+
Number
(
invoiceCalc
.
additional_tax
);
let
invoiceCalc
=
calcMap
[
invoice
.
credit_code
];
personal_invoice_tax_total
=
personal_invoice_tax_total
+
Number
(
invoiceCalc
.
personal_invoice_tax
);
additional_tax_total
=
additional_tax_total
+
Number
(
invoiceCalc
.
additional_tax
);
value_added_tax_total
=
value_added_tax_total
+
Number
(
invoiceCalc
.
value_added_tax
);
personal_invoice_tax_total
=
personal_invoice_tax_total
+
Number
(
invoiceCalc
.
personal_invoice_tax
);
service_tax_total
=
service_tax_total
+
Number
(
invoiceCalc
.
service_tax
);
value_added_tax_total
=
value_added_tax_total
+
Number
(
invoiceCalc
.
value_added_tax
);
service_tax_total
=
service_tax_total
+
Number
(
invoiceCalc
.
service_tax
);
invoice
.
personal_invoice_tax
=
Number
(
invoiceCalc
.
personal_invoice_tax
);
invoice
.
additional_tax
=
Number
(
invoiceCalc
.
additional_tax
);
invoice
.
personal_invoice_tax
=
Number
(
invoiceCalc
.
personal_invoice_tax
);
invoice
.
service_tax
=
Number
(
invoiceCalc
.
service_tax
);
invoice
.
additional_tax
=
Number
(
invoiceCalc
.
additional_tax
);
invoice
.
value_added_tax
=
Number
(
invoiceCalc
.
value_added_tax
);
invoice
.
service_tax
=
Number
(
invoiceCalc
.
service_tax
);
}
invoice
.
value_added_tax
=
Number
(
invoiceCalc
.
value_added_tax
);
}
return
{
tax
:
{
return
{
additional_tax_total
:
additional_tax_total
,
tax
:
{
personal_invoice_tax_total
:
personal_invoice_tax_total
,
additional_tax_total
:
additional_tax_total
,
value_added_tax_total
:
value_added_tax_total
,
personal_invoice_tax_total
:
personal_invoice_tax_total
,
service_tax_total
:
service_tax_total
,
value_added_tax_total
:
value_added_tax_total
,
},
service_tax_total
:
service_tax_total
,
invoiceList
:
invoiceList
},
invoiceList
:
invoiceList
}
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
}
...
...
xgg-saas-platform/app/base/service/impl/saas/saasinvoiceSve.js
View file @
fd64dc6d
...
@@ -71,16 +71,19 @@ class SaasinvoiceService extends ServiceBase {
...
@@ -71,16 +71,19 @@ class SaasinvoiceService extends ServiceBase {
return
system
.
getResult
(
null
,
"发票状态错误,请刷新重试"
);
return
system
.
getResult
(
null
,
"发票状态错误,请刷新重试"
);
}
}
// TODO 总统 推送发票信息 begin
// TODO 总统 推送发票信息 begin
await
this
.
pushInvoiceToDeliver
(
apply
);
let
res
=
await
this
.
pushInvoiceToDeliver
(
apply
);
// TODO 总统 推送发票信息 end
// TODO 总统 推送发票信息 end
if
(
!
res
||
!
res
.
data
||
res
.
status
!=
0
){
let
updateStatus
=
{
return
system
.
getResult
(
null
,
`发票推送失败`
);
id
:
apply
.
id
,
}
else
{
preStatus
:
"1010"
,
let
updateStatus
=
{
status
:
"1050"
,
id
:
apply
.
id
,
};
preStatus
:
"1010"
,
let
rs
=
await
this
.
invoiceapplyStatus
(
updateStatus
);
status
:
"1050"
,
return
rs
;
};
let
rs
=
await
this
.
invoiceapplyStatus
(
updateStatus
);
return
rs
;
}
}
}
/**
/**
...
@@ -102,42 +105,36 @@ class SaasinvoiceService extends ServiceBase {
...
@@ -102,42 +105,36 @@ class SaasinvoiceService extends ServiceBase {
* 4. 申请时间 不存在
* 4. 申请时间 不存在
*/
*/
async
pushInvoiceToDeliver
(
invoice
)
{
async
pushInvoiceToDeliver
(
invoice
)
{
try
{
let
params
=
{
let
params
=
{
"businessmen_type"
:
this
.
DEFAULT_BUSINESSMEN_TYPE
,
"businessmen_type"
:
this
.
DEFAULT_BUSINESSMEN_TYPE
,
"businessmen_id"
:
invoice
.
from_id
||
""
,
"from_id"
:
invoice
.
from_id
||
""
,
"businessmen_credit_code"
:
invoice
.
from_credit_code
,
"from_credit_code"
:
invoice
.
from_credit_code
,
"businessmen_name"
:
invoice
.
from_name
,
"from_name"
:
invoice
.
from_name
,
"businessmen_addr"
:
invoice
.
from_addr
,
"from_addr"
:
invoice
.
from_addr
,
"businessmen_mobile"
:
invoice
.
from_mobile
,
"from_mobile"
:
invoice
.
from_mobile
,
"businessmen_bank"
:
invoice
.
from_bank
||
""
,
"from_bank"
:
invoice
.
from_bank
||
""
,
"businessmen_account"
:
invoice
.
from_account
||
""
,
"from_account"
:
invoice
.
from_account
||
""
,
"mail_to"
:
invoice
.
mail_to
,
"mail_to"
:
invoice
.
mail_to
,
"mail_mobile"
:
invoice
.
mail_mobile
,
"mail_mobile"
:
invoice
.
mail_mobile
,
"mail_addr"
:
invoice
.
mail_addr
,
"mail_addr"
:
invoice
.
mail_addr
,
"merchant_id"
:
invoice
.
to_id
||
""
,
"to_id"
:
invoice
.
to_id
||
""
,
"merchant_name"
:
invoice
.
to_name
,
"to_name"
:
invoice
.
to_name
,
"merchant_credit_code"
:
invoice
.
to_credit_code
,
"to_credit_code"
:
invoice
.
to_credit_code
,
"merchant_addr"
:
invoice
.
to_addr
,
"to_addr"
:
invoice
.
to_addr
,
"merchant_mobile"
:
invoice
.
to_mobile
,
"to_mobile"
:
invoice
.
to_mobile
,
"merchant_bank"
:
invoice
.
to_bank
,
"to_bank"
:
invoice
.
to_bank
,
"merchant_account"
:
invoice
.
to_account
,
"to_account"
:
invoice
.
to_account
,
"apply_no"
:
invoice
.
id
,
"apply_no"
:
invoice
.
id
,
"invoice_type"
:
invoice
.
invoice_type
,
"invoice_type"
:
invoice
.
invoice_type
,
"apply_time"
:
invoice
.
created_at
,
"apply_time"
:
invoice
.
apply_time
,
"invoice_amount"
:
invoice
.
invoice_amount
,
"invoice_amount"
:
invoice
.
invoice_amount
,
"invoice_content"
:
invoice
.
invoice_content
||
""
,
"invoice_content"
:
invoice_content
||
""
,
"personal_invoice_tax"
:
invoice
.
personal_invoice_tax
||
0
,
"personal_invoice_tax"
:
invoice
.
personal_invoice_tax
,
"additional_tax"
:
invoice
.
additional_tax
||
0
,
"additional_tax"
:
invoice
.
additional_tax
,
"value_added_tax"
:
invoice
.
value_added_tax
||
0
,
"value_added_tax"
:
invoice
.
value_added_tax
,
"channel_id"
:
this
.
DEFAULT_CHANNEL_ID
"channel_id"
:
this
.
DEFAULT_CHANNEL_ID
}
let
rs
=
await
this
.
callms
(
"invoice"
,
"invoiceApply"
,
params
);
return
rs
;
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
return
await
this
.
callms
(
"invoice"
,
"invoiceApply"
,
params
);
}
}
}
}
module
.
exports
=
SaasinvoiceService
;
module
.
exports
=
SaasinvoiceService
;
\ No newline at end of file
xgg-saas-platform/app/base/system.js
View file @
fd64dc6d
...
@@ -206,7 +206,7 @@ class System {
...
@@ -206,7 +206,7 @@ class System {
uc
:
dev
+
":3106"
+
path
,
uc
:
dev
+
":3106"
+
path
,
// 交易
// 交易
trade
:
local
+
":3107"
+
path
,
trade
:
dev
+
":3107"
+
path
,
}
}
}
else
{
}
else
{
return
{
return
{
...
...
xgg-saas-platform/app/config/settings.js
View file @
fd64dc6d
...
@@ -90,7 +90,8 @@ var settings = {
...
@@ -90,7 +90,8 @@ var settings = {
deliverSysApi
:
function
()
{
deliverSysApi
:
function
()
{
let
domain
=
""
;
let
domain
=
""
;
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
domain
=
"http://39.107.234.14:3002"
;
// domain = "http://39.107.234.14:3002";
domain
=
"http://127.0.0.1:3002"
;
}
else
{
}
else
{
domain
=
"https://xggadmin.gongsibao.com"
;
domain
=
"https://xggadmin.gongsibao.com"
;
}
}
...
...
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