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
e16c5ead
Commit
e16c5ead
authored
Apr 14, 2020
by
王昆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xgg-admin-ali' into xgg-admin
parents
0c2424ac
a5ee8edf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
26 deletions
+43
-26
xgg-admin/app/base/controller/impl/invoice/invoiceCtl.js
+30
-19
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
+8
-2
xgg-admin/app/base/system.js
+5
-5
No files found.
xgg-admin/app/base/controller/impl/invoice/invoiceCtl.js
View file @
e16c5ead
var
system
=
require
(
"../../../system"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
var
moment
=
require
(
'moment'
);
class
InvoiceCtl
extends
CtlBase
{
constructor
()
{
super
();
this
.
invoiceSve
=
system
.
getObject
(
"service.invoice.invoiceSve"
);
this
.
userSve
=
system
.
getObject
(
"service.uc.userSve"
);
this
.
INVOICE_TYPE
=
[
"10"
,
"20"
,
"30"
];
this
.
INVOICE_TYPE
=
[
"10"
,
"20"
,
"30"
];
}
/**
...
...
@@ -128,18 +129,18 @@ class InvoiceCtl extends CtlBase {
return
res
;
}
/**
* 发票试算接口
* @param {*} pobj
*/
async
calcInvoice
(
pobj
)
{
try
{
return
await
this
.
invoiceSve
.
calcInvoice
(
pobj
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResultFail
(
500
,
`接口错误 错误信息
${
error
}
`
);
}
}
/
/ /
**
//
* 发票试算接口
// * @param {*} pobj
//
*/
//
async calcInvoice(pobj) {
//
try {
//
return await this.invoiceSve.calcInvoice(pobj);
//
} catch (error) {
//
console.log(error);
//
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
//
}
//
}
/**
* 发票试算接口
...
...
@@ -168,15 +169,24 @@ class InvoiceCtl extends CtlBase {
}
try
{
let
rs
=
await
this
.
invoiceSve
.
calcInvoice
(
params
);
if
(
!
rs
)
{
r
s
=
{
if
(
rs
.
status
!==
0
)
{
r
es
.
push
(
{
credit_code
:
item
.
credit_code
,
msg
:
"试算失败"
};
status
:
rs
.
status
,
msg
:
rs
.
msg
});
continue
;
}
res
.
push
(
rs
);
let
data
=
rs
.
data
;
data
.
status
=
rs
.
status
;
res
.
push
(
data
);
}
catch
(
error
)
{
console
.
log
(
error
);
res
.
push
({
credit_code
:
item
.
credit_code
,
status
:
500
,
msg
:
"试算异常,"
+
error
.
message
});
}
}
return
system
.
getResult
(
res
);
...
...
@@ -242,7 +252,6 @@ class InvoiceCtl extends CtlBase {
// }
// /**
// * 计算发票增值税
// * @param {*} pobj
...
...
@@ -438,4 +447,5 @@ class InvoiceCtl extends CtlBase {
// }
// }
}
module
.
exports
=
InvoiceCtl
;
\ No newline at end of file
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
View file @
e16c5ead
...
...
@@ -386,10 +386,16 @@ class InvoiceService extends ServiceBase {
value_added_tax
=
system
.
f2y
(
value_added_tax
);
additional_tax
=
system
.
f2y
(
additional_tax
);
service_amount
=
system
.
f2y
(
service_amount
);
return
{
personal_invoice_tax
:
personal_invoice_tax
,
value_added_tax
:
value_added_tax
,
additional_tax
:
additional_tax
,
service_amount
:
service_amount
,
credit_code
:
params
.
credit_code
};
return
system
.
getResultSuccess
({
personal_invoice_tax
:
personal_invoice_tax
,
value_added_tax
:
value_added_tax
,
additional_tax
:
additional_tax
,
service_amount
:
service_amount
,
credit_code
:
params
.
credit_code
});
}
catch
(
error
)
{
console
.
log
(
error
);
return
null
;
return
system
.
getResult
(
null
,
"试算失败"
)
;
}
}
...
...
xgg-admin/app/base/system.js
View file @
e16c5ead
...
...
@@ -196,11 +196,11 @@ class System {
}
else
{
var
odomain
=
"http://123.57.217.203"
return
{
common
:
"xggsvecommon-service"
+
path
,
merchant
:
"xggsvemerchant-service"
+
path
,
order
:
"xggsveorder-service"
+
path
,
invoice
:
"xggsveinvoice-service"
+
path
,
uc
:
"xggsveuc-service"
+
path
,
common
:
"
ali
xggsvecommon-service"
+
path
,
merchant
:
"
ali
xggsvemerchant-service"
+
path
,
order
:
"
ali
xggsveorder-service"
+
path
,
invoice
:
"
ali
xggsveinvoice-service"
+
path
,
uc
:
"
ali
xggsveuc-service"
+
path
,
}
}
}
...
...
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