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
a25497f4
Commit
a25497f4
authored
May 08, 2020
by
王昆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xgg-admin' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-admin
parents
caf2d580
8f0d8b71
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
5 deletions
+51
-5
xgg-admin/app/base/api/impl/test/testApi.js
+20
-0
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
+16
-4
xgg-admin/app/base/service/impl/order/orderSve.js
+14
-0
xgg-admin/app/base/system.js
+1
-1
No files found.
xgg-admin/app/base/api/impl/test/testApi.js
View file @
a25497f4
...
@@ -36,6 +36,26 @@ class TestAPI extends APIBase {
...
@@ -36,6 +36,26 @@ class TestAPI extends APIBase {
return
"success"
;
return
"success"
;
}
}
/**
* 重置订单处理流程
* @param pobj
* @param query
* @param req
* @returns {Promise<void>}
*/
async
resetOrderProcess
(
pobj
,
query
,
req
){
if
(
pobj
.
ids
.
length
==
0
){
return
system
.
getResult
(
null
,
`参数错误`
);
}
let
res
=
[];
for
(
let
item
of
pobj
.
ids
)
{
let
temp
=
await
this
.
orderSve
.
resetOrderProcess
({
id
:
item
})
||
{};
temp
.
id
=
item
;
res
.
push
(
temp
);
}
return
system
.
getResultSuccess
(
res
);
}
async
testInvoice
()
{
async
testInvoice
()
{
let
params
=
{
let
params
=
{
uploadPeriod
:
"201910"
,
uploadPeriod
:
"201910"
,
...
...
xgg-admin/app/base/service/impl/invoice/invoiceSve.js
View file @
a25497f4
...
@@ -266,7 +266,7 @@ class InvoiceService extends ServiceBase {
...
@@ -266,7 +266,7 @@ class InvoiceService extends ServiceBase {
companyId
:
deliver
.
nt_company_id
,
//公司ID
companyId
:
deliver
.
nt_company_id
,
//公司ID
customerId
:
businessmen
.
customer_id
,
//客户ID
customerId
:
businessmen
.
customer_id
,
//客户ID
uploadPeriod
:
moment
(
businessmen
.
create_account_time
).
format
(
'YYYYMM'
),
//上传账期
uploadPeriod
:
moment
(
businessmen
.
create_account_time
).
format
(
'YYYYMM'
),
//上传账期
imageName
:
invoice
[
'invoice_img'
].
slice
(
invoice
[
'invoice_img'
].
lastIndexOf
(
"/"
)
+
1
,
-
1
)
||
""
,
//图片名称
imageName
:
invoice
[
'invoice_img'
].
slice
(
invoice
[
'invoice_img'
].
lastIndexOf
(
"/"
)
+
1
)
||
""
,
//图片名称
imageBasename
:
invoice
[
'invoice_img'
]
||
""
,
//图片url
imageBasename
:
invoice
[
'invoice_img'
]
||
""
,
//图片url
billType
:
this
.
formatInvoiceType
(
_invoicesummaryinfo
),
//发票类型
billType
:
this
.
formatInvoiceType
(
_invoicesummaryinfo
),
//发票类型
isDaikai
:
`1`
,
//是否代开 1:yes 0:no
isDaikai
:
`1`
,
//是否代开 1:yes 0:no
...
@@ -329,6 +329,20 @@ class InvoiceService extends ServiceBase {
...
@@ -329,6 +329,20 @@ class InvoiceService extends ServiceBase {
if
(
!
businessmenBean
.
sign_time
)
{
if
(
!
businessmenBean
.
sign_time
)
{
return
system
.
getResult
(
null
,
`个体户未签约`
);
return
system
.
getResult
(
null
,
`个体户未签约`
);
}
}
//************************************************************一下是计算服务费************************************* */
let
service_rate
=
new
Decimal
(
businessmenBean
.
service_rate
).
div
(
100
).
toNumber
();
let
service_amount
=
new
Decimal
(
params
.
invoice_amount
).
mul
(
service_rate
).
toNumber
();
//如果已经开户 所有的税金都应该是0 ,之后服务费用
if
(
businessmenBean
.
is_bank
)
{
return
system
.
getResultSuccess
({
personal_invoice_tax
:
0
,
value_added_tax
:
0
,
additional_tax
:
0
,
service_amount
:
service_amount
,
credit_code
:
params
.
credit_code
});
}
// params.invoice_amount = system.y2f(this.trim(params.invoice_amount));
// params.invoice_amount = system.y2f(this.trim(params.invoice_amount));
//增值税累计类型 1按月 2按季度 add_value_up_type
//增值税累计类型 1按月 2按季度 add_value_up_type
//个税累计类型 1按月累计 2按季度累计 tax_up_type
//个税累计类型 1按月累计 2按季度累计 tax_up_type
...
@@ -378,9 +392,7 @@ class InvoiceService extends ServiceBase {
...
@@ -378,9 +392,7 @@ class InvoiceService extends ServiceBase {
//附加税 =增值税*附加税
//附加税 =增值税*附加税
let
additional_tax
=
new
Decimal
(
value_added_tax
).
mul
(
AVRateRes
.
fujiaRate
).
toNumber
().
toFixed
(
2
);
let
additional_tax
=
new
Decimal
(
value_added_tax
).
mul
(
AVRateRes
.
fujiaRate
).
toNumber
().
toFixed
(
2
);
//************************************************************一下是计算服务费************************************* */
let
service_rate
=
new
Decimal
(
businessmenBean
.
service_rate
).
div
(
100
).
toNumber
();
let
service_amount
=
new
Decimal
(
params
.
invoice_amount
).
mul
(
service_rate
).
toNumber
();
personal_invoice_tax
=
system
.
f2y
(
personal_invoice_tax
);
personal_invoice_tax
=
system
.
f2y
(
personal_invoice_tax
);
value_added_tax
=
system
.
f2y
(
value_added_tax
);
value_added_tax
=
system
.
f2y
(
value_added_tax
);
...
...
xgg-admin/app/base/service/impl/order/orderSve.js
View file @
a25497f4
...
@@ -288,5 +288,18 @@ class OrderService extends ServiceBase {
...
@@ -288,5 +288,18 @@ class OrderService extends ServiceBase {
return
system
.
getResult
(
null
,
`系统错误`
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
}
// 重置订单处理流程
async
resetOrderProcess
(
params
)
{
if
(
!
params
.
id
)
{
return
system
.
getResult
(
null
,
`参数错误 ID不能为空`
);
}
try
{
return
await
this
.
callms
(
"order"
,
"resetOrderProcess"
,
params
);
}
catch
(
error
)
{
console
.
log
(
error
);
return
system
.
getResult
(
null
,
`系统错误 错误信息
${
error
}
`
);
}
}
}
}
module
.
exports
=
OrderService
;
module
.
exports
=
OrderService
;
\ No newline at end of file
xgg-admin/app/base/system.js
View file @
a25497f4
...
@@ -182,7 +182,7 @@ class System {
...
@@ -182,7 +182,7 @@ class System {
// merchant: "http://127.0.0.1:3101" + path,
// merchant: "http://127.0.0.1:3101" + path,
// 订单服务
// 订单服务
order
:
domain
+
":3103"
+
path
,
order
:
domain
2
+
":3103"
+
path
,
// order: domain + ":3103" + path,
// order: domain + ":3103" + 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