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
bc57d590
Commit
bc57d590
authored
May 19, 2020
by
王昆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xgg-saas-platform' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-saas-platform
parents
fec68967
17d9a037
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
23 deletions
+74
-23
xgg-saas-platform/app/base/controller/impl/saas/invoiceCtl.js
+22
-18
xgg-saas-platform/app/base/service/impl/saas/orderSve.js
+23
-0
xgg-saas-platform/app/base/service/impl/saas/saasinvoiceSve.js
+21
-2
xgg-saas-platform/app/base/service/impl/trade/tradeSve.js
+5
-0
xgg-saas-platform/app/base/system.js
+3
-3
No files found.
xgg-saas-platform/app/base/controller/impl/saas/invoiceCtl.js
View file @
bc57d590
...
@@ -19,7 +19,9 @@ class InvoiceCtl extends CtlBase {
...
@@ -19,7 +19,9 @@ class InvoiceCtl extends CtlBase {
async
audit
(
params
,
pobj2
,
req
)
{
async
audit
(
params
,
pobj2
,
req
)
{
try
{
try
{
params
.
id
=
this
.
trim
(
params
.
id
);
params
.
id
=
this
.
trim
(
params
.
id
);
if
(
!
params
.
id
)
{
let
saasInvoiceApply
=
await
this
.
saasinvoiceSve
.
getSaasInvoiceById
({
id
:
params
.
id
,
attrs
:
"id,fee_type,data_ids"
});
saasInvoiceApply
=
saasInvoiceApply
.
status
==
0
?
saasInvoiceApply
.
data
:
null
;
if
(
!
params
.
id
||
!
saasInvoiceApply
||
!
saasInvoiceApply
.
id
)
{
return
system
.
getResult
(
null
,
"发票申请不存在"
);
return
system
.
getResult
(
null
,
"发票申请不存在"
);
}
}
params
.
remark
=
this
.
trim
(
params
.
remark
);
params
.
remark
=
this
.
trim
(
params
.
remark
);
...
@@ -27,9 +29,22 @@ class InvoiceCtl extends CtlBase {
...
@@ -27,9 +29,22 @@ class InvoiceCtl extends CtlBase {
return
system
.
getResult
(
null
,
"请填写审核备注"
);
return
system
.
getResult
(
null
,
"请填写审核备注"
);
}
}
params
.
status
=
Number
(
params
.
status
||
0
)
?
"1010"
:
"1020"
;
params
.
status
=
Number
(
params
.
status
||
0
)
?
"1010"
:
"1020"
;
let
rs
=
await
this
.
saasinvoiceSve
.
audit
(
params
)
if
(
rs
.
status
===
0
&&
!
params
.
status
)
{
let
rs
=
await
this
.
saasinvoiceSve
.
audit
(
params
);
await
this
.
tradeSve
.
cancelInvoice
({
saas_invoice_id
:
params
.
id
});
if
(
rs
.
status
===
0
&&
params
.
status
==
"1020"
)
{
let
data_ids
=
saasInvoiceApply
.
data_ids
;
if
(
!
data_ids
||
data_ids
.
split
(
','
).
length
==
0
){
return
rs
;
}
let
fee_type
=
saasInvoiceApply
.
fee_type
;
if
(
fee_type
==
"10"
||
fee_type
==
"20"
){
//交易流水
// await this.tradeSve.cancelInvoice({saas_invoice_id: params.id});
await
this
.
tradeSve
.
cancelInvoiceByDataIds
({
data_ids
:
data_ids
.
split
(
','
)});
}
else
if
(
fee_type
==
"00"
){
//注册订单
await
this
.
orderSve
.
cancelInvoiceByDataIds
({
data_ids
:
data_ids
.
split
(
','
)});
}
else
{
return
rs
;
}
}
}
return
rs
;
return
rs
;
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -245,7 +260,7 @@ class InvoiceCtl extends CtlBase {
...
@@ -245,7 +260,7 @@ class InvoiceCtl extends CtlBase {
try
{
try
{
validation
.
check
(
params
,
"id"
,
{
name
:
"发票申请信息"
,
is_require
:
true
});
validation
.
check
(
params
,
"id"
,
{
name
:
"发票申请信息"
,
is_require
:
true
});
validation
.
check
(
params
,
"invoice_type"
,
{
name
:
"发票类型"
,
is_require
:
true
,
dics
:
[
'
0
0'
,
"10"
,
"20"
]});
validation
.
check
(
params
,
"invoice_type"
,
{
name
:
"发票类型"
,
is_require
:
true
,
dics
:
[
'
3
0'
,
"10"
,
"20"
]});
validation
.
check
(
params
,
"invoiceList"
,
{
name
:
"开票信息"
,
arr_require
:
true
});
validation
.
check
(
params
,
"invoiceList"
,
{
name
:
"开票信息"
,
arr_require
:
true
});
validation
.
check
(
params
,
"mail_to"
,
{
name
:
"收件人"
,
arr_require
:
true
});
validation
.
check
(
params
,
"mail_to"
,
{
name
:
"收件人"
,
arr_require
:
true
});
validation
.
check
(
params
,
"mail_mobile"
,
{
name
:
"联系电话"
,
arr_require
:
true
});
validation
.
check
(
params
,
"mail_mobile"
,
{
name
:
"联系电话"
,
arr_require
:
true
});
...
@@ -306,7 +321,7 @@ class InvoiceCtl extends CtlBase {
...
@@ -306,7 +321,7 @@ class InvoiceCtl extends CtlBase {
mail_addr
:
this
.
trim
(
params
.
mail_addr
),
mail_addr
:
this
.
trim
(
params
.
mail_addr
),
mail_mobile
:
this
.
trim
(
params
.
mail_mobile
),
mail_mobile
:
this
.
trim
(
params
.
mail_mobile
),
mail_to
:
this
.
trim
(
params
.
mail_to
),
mail_to
:
this
.
trim
(
params
.
mail_to
),
data_ids
:
this
.
trim
(
params
.
data_ids
),
// TODO 总统测试
data_ids
:
this
.
trim
(
invoice
.
data_ids
),
// TODO 总统测试
personal_invoice_tax
:
system
.
y2f
(
invoice
.
personal_invoice_tax
),
personal_invoice_tax
:
system
.
y2f
(
invoice
.
personal_invoice_tax
),
additional_tax
:
system
.
y2f
(
invoice
.
additional_tax
),
additional_tax
:
system
.
y2f
(
invoice
.
additional_tax
),
...
@@ -329,18 +344,7 @@ class InvoiceCtl extends CtlBase {
...
@@ -329,18 +344,7 @@ class InvoiceCtl extends CtlBase {
status
:
"1060"
,
status
:
"1060"
,
}
}
});
});
// TODO 总统测试 begin
if
(
rs
&&
rs
.
data
&&
rs
.
data
.
length
>
0
)
{
for
(
let
d
of
rs
.
data
)
{
console
.
log
(
d
.
id
,
d
.
data_ids
);
if
(
!
d
.
data_ids
)
{
continue
;
}
let
tradeIds
=
d
.
data_ids
.
split
(
","
);
await
this
.
tradeSve
.
updateInvoice
({
ids
:
tradeIds
,
saas_invoice_id
:
d
.
id
});
}
}
// TODO 总统测试 end
return
system
.
getResultSuccess
(
rs
);
return
system
.
getResultSuccess
(
rs
);
}
catch
(
error
)
{
}
catch
(
error
)
{
let
msg
=
error
.
message
;
let
msg
=
error
.
message
;
...
...
xgg-saas-platform/app/base/service/impl/saas/orderSve.js
View file @
bc57d590
...
@@ -30,6 +30,12 @@ class OrderService extends ServiceBase {
...
@@ -30,6 +30,12 @@ class OrderService extends ServiceBase {
}
}
return
rs
;
return
rs
;
}
}
/**
* fn:审核后推送交付系统
* @param params
* @returns {Promise<{msg: string, data, bizmsg: *|string, status: number}|*|undefined>}
*/
async
audit
(
params
)
{
async
audit
(
params
)
{
var
rs
=
await
this
.
callms
(
"order"
,
"saasOrderBulkAudit"
,
params
);
var
rs
=
await
this
.
callms
(
"order"
,
"saasOrderBulkAudit"
,
params
);
...
@@ -41,6 +47,11 @@ class OrderService extends ServiceBase {
...
@@ -41,6 +47,11 @@ class OrderService extends ServiceBase {
return
rs
;
return
rs
;
}
}
/**
* fn:推送订单到交付系统
* @param id
* @returns {Promise<void>}
*/
async
pushOrderToDeliver
(
id
)
{
async
pushOrderToDeliver
(
id
)
{
let
order
=
await
this
.
callms
(
"order"
,
"saasOrderInfo"
,
{
id
:
id
})
||
{};
let
order
=
await
this
.
callms
(
"order"
,
"saasOrderInfo"
,
{
id
:
id
})
||
{};
order
=
order
.
data
;
order
=
order
.
data
;
...
@@ -57,6 +68,10 @@ class OrderService extends ServiceBase {
...
@@ -57,6 +68,10 @@ class OrderService extends ServiceBase {
desc
:
"saas个体户注册"
,
desc
:
"saas个体户注册"
,
saas_deliver_api
:
notifyApi
,
saas_deliver_api
:
notifyApi
,
bminfo
:
order
.
bminfo
,
bminfo
:
order
.
bminfo
,
guest_mail_addr
:
order
.
saasOrderDeliverInfo
.
deliver_addr
||
""
,
guest_mail_to
:
order
.
saasOrderDeliverInfo
.
deliver_man
||
""
,
guest_mail_mobile
:
order
.
saasOrderDeliverInfo
.
deliver_mobile
||
""
,
saas_id
:
order
.
saas_id
};
};
// 推送订单到交付平台
// 推送订单到交付平台
...
@@ -108,5 +123,12 @@ class OrderService extends ServiceBase {
...
@@ -108,5 +123,12 @@ class OrderService extends ServiceBase {
row
.
price
=
system
.
f2y
(
row
.
price
);
row
.
price
=
system
.
f2y
(
row
.
price
);
}
}
}
}
async
cancelInvoiceByDataIds
(
params
)
{
let
rs
=
await
this
.
callms
(
"order"
,
"cancelInvoiceByDataIds"
,
params
);
return
rs
;
}
}
}
module
.
exports
=
OrderService
;
module
.
exports
=
OrderService
;
\ No newline at end of file
xgg-saas-platform/app/base/service/impl/saas/saasinvoiceSve.js
View file @
bc57d590
...
@@ -139,7 +139,11 @@ class SaasinvoiceService extends ServiceBase {
...
@@ -139,7 +139,11 @@ class SaasinvoiceService extends ServiceBase {
"value_added_tax"
:
invoice
.
value_added_tax
||
0
,
"value_added_tax"
:
invoice
.
value_added_tax
||
0
,
"channel_id"
:
this
.
DEFAULT_CHANNEL_ID
,
"channel_id"
:
this
.
DEFAULT_CHANNEL_ID
,
"saas_deliver_api"
:
settings
.
outApi
().
deliverNotifyApi
,
"saas_deliver_api"
:
settings
.
outApi
().
deliverNotifyApi
,
"product_id"
:
"50010000"
"product_id"
:
"50010000"
,
"unit"
:
invoice
.
unit
||
0
,
"quantity"
:
invoice
.
quantity
||
0
,
"price"
:
invoice
.
price
||
0
,
"remark"
:
invoice
.
remark
||
""
}
}
let
url
=
settings
.
deliverSysApi
().
pushInvoiceToDeliver
;
let
url
=
settings
.
deliverSysApi
().
pushInvoiceToDeliver
;
...
@@ -194,9 +198,13 @@ class SaasinvoiceService extends ServiceBase {
...
@@ -194,9 +198,13 @@ class SaasinvoiceService extends ServiceBase {
if
(
saasInvoiceApply
.
fee_type
==
"00"
)
{
//个体户注册订单
if
(
saasInvoiceApply
.
fee_type
==
"00"
)
{
//个体户注册订单
tradOrder
=
[];
tradOrder
=
[];
}
else
{
//查询流水
}
else
{
//查询流水
if
(
saasInvoiceApply
.
data_ids
){
saasInvoiceApply
.
data_ids
=
saasInvoiceApply
.
data_ids
.
split
(
','
);
}
let
tradOrderRes
=
await
this
.
callms
(
"trade"
,
"invoiceTrade"
,
{
let
tradOrderRes
=
await
this
.
callms
(
"trade"
,
"invoiceTrade"
,
{
id
:
saasInvoiceApply
.
id
,
id
:
saasInvoiceApply
.
id
,
order_type
:
saasInvoiceApply
.
fee_type
order_type
:
saasInvoiceApply
.
fee_type
,
data_ids
:
saasInvoiceApply
.
data_ids
||
[]
})
||
{};
})
||
{};
if
(
tradOrderRes
.
status
==
0
)
{
if
(
tradOrderRes
.
status
==
0
)
{
tradOrder
=
tradOrderRes
.
data
;
tradOrder
=
tradOrderRes
.
data
;
...
@@ -246,5 +254,15 @@ class SaasinvoiceService extends ServiceBase {
...
@@ -246,5 +254,15 @@ class SaasinvoiceService extends ServiceBase {
return
system
.
getResult
(
null
,
`系统错误`
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
}
/**
* fn:根据ID 查询详情
* @param params
* @returns {Promise<{msg: *, data, bizmsg: *|string, status: number}|any|undefined>}
*/
async
getSaasInvoiceById
(
params
){
let
rs
=
await
this
.
callms
(
"invoice"
,
"getSaasInvoiceById"
,
params
);
return
rs
;
}
}
}
module
.
exports
=
SaasinvoiceService
;
module
.
exports
=
SaasinvoiceService
;
\ No newline at end of file
xgg-saas-platform/app/base/service/impl/trade/tradeSve.js
View file @
bc57d590
...
@@ -110,6 +110,11 @@ class TradeService extends ServiceBase {
...
@@ -110,6 +110,11 @@ class TradeService extends ServiceBase {
return
rs
;
return
rs
;
}
}
async
cancelInvoiceByDataIds
(
params
)
{
let
rs
=
await
this
.
callms
(
"trade"
,
"cancelInvoiceByDataIds"
,
params
);
return
rs
;
}
transFields
(
rows
)
{
transFields
(
rows
)
{
if
(
!
rows
||
rows
.
length
==
0
)
{
if
(
!
rows
||
rows
.
length
==
0
)
{
return
;
return
;
...
...
xgg-saas-platform/app/base/system.js
View file @
bc57d590
...
@@ -197,16 +197,16 @@ class System {
...
@@ -197,16 +197,16 @@ class System {
merchant
:
dev
+
":3101"
+
path
,
merchant
:
dev
+
":3101"
+
path
,
// 订单服务
// 订单服务
order
:
dev
+
":3103"
+
path
,
order
:
local
+
":3103"
+
path
,
// 发票服务
// 发票服务
invoice
:
dev
+
":3105"
+
path
,
invoice
:
local
+
":3105"
+
path
,
// 用户服务
// 用户服务
uc
:
dev
+
":3106"
+
path
,
uc
:
dev
+
":3106"
+
path
,
// 交易
// 交易
trade
:
dev
+
":3107"
+
path
,
trade
:
local
+
":3107"
+
path
,
}
}
}
else
{
}
else
{
return
{
return
{
...
...
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