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
f4b6bb32
Commit
f4b6bb32
authored
Feb 27, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
b1072334
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
44 deletions
+52
-44
center-channel/app/base/api/impl/opaction/order.js
+2
-41
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
+0
-1
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+1
-2
center-channel/app/base/service/impl/utilsSve/utilsPushSve.js
+49
-0
No files found.
center-channel/app/base/api/impl/opaction/order.js
View file @
f4b6bb32
...
@@ -5,6 +5,7 @@ class ProductAPI extends APIBase {
...
@@ -5,6 +5,7 @@ class ProductAPI extends APIBase {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
}
}
/**
/**
* 接口跳转-POST请求
* 接口跳转-POST请求
...
@@ -27,8 +28,7 @@ class ProductAPI extends APIBase {
...
@@ -27,8 +28,7 @@ class ProductAPI extends APIBase {
switch
(
action_type
)
{
switch
(
action_type
)
{
case
"addOrder"
:
//创建订单
case
"addOrder"
:
//创建订单
opResult
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
addOrder
(
pobj
,
pobj
.
actionBody
);
await
this
.
pushInfo
(
opResult
,
pobj
,
pobj
.
actionBody
,
"pushBusiness"
);
await
this
.
utilsPushSve
.
pushInfo
(
opResult
,
pobj
,
pobj
.
actionBody
,
"pushBusiness"
);
await
this
.
pushInfo
(
opResult
,
pobj
,
pobj
.
actionBody
,
"pushOrder"
);
break
;
break
;
case
"getOrderInfo"
:
//获取订单列表信息
case
"getOrderInfo"
:
//获取订单列表信息
opResult
=
await
this
.
utilsOrderSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
opResult
=
await
this
.
utilsOrderSve
.
getOrderInfo
(
pobj
,
pobj
.
actionBody
);
...
@@ -48,44 +48,6 @@ class ProductAPI extends APIBase {
...
@@ -48,44 +48,6 @@ class ProductAPI extends APIBase {
}
}
return
opResult
;
return
opResult
;
}
}
async
pushInfo
(
orderResult
,
pobj
,
actionBody
,
opType
)
{
if
(
orderResult
.
status
!=
0
)
{
return
""
;
}
var
interface_list
=
actionBody
.
product_info
.
interface_info
;
if
(
!
interface_list
)
{
return
""
;
}
var
interface_info
=
null
;
var
interface_list_temp
=
interface_list
.
filter
(
f
=>
f
.
op_type
==
opType
)
if
(
interface_list_temp
&&
interface_list_temp
.
length
>
0
)
{
interface_info
=
interface_list_temp
[
0
];
}
if
(
!
interface_info
)
{
return
""
;
}
pobj
.
actionBody
.
add_order_info
=
orderResult
.
data
;
var
refOpResult
=
this
.
reflexAction
(
interface_info
,
pobj
);
return
refOpResult
;
}
async
reflexAction
(
interface_info
,
pobj
)
{
var
refResult
=
null
;
if
(
interface_info
.
interface_type
==
"bd"
)
{
if
(
!
interface_info
.
method_name
)
{
return
system
.
getResult
(
null
,
"产品接口参数信息有误,20110"
);
}
//操作的方法名称
var
invokeObj
=
system
.
getObject
(
interface_info
.
interface_url
);
if
(
!
invokeObj
[
interface_info
.
method_name
])
{
return
system
.
getResult
(
null
,
"产品接口参数方法信息有误,20130"
);
}
pobj
.
interface_params
=
interface_info
.
params
;
var
params
=
[
pobj
];
refResult
=
await
invokeObj
[
interface_info
.
method_name
].
apply
(
invokeObj
,
params
);
}
else
if
(
interface_info
.
interface_type
==
"yc"
)
{
}
return
refResult
;
}
}
}
module
.
exports
=
ProductAPI
;
module
.
exports
=
ProductAPI
;
\ No newline at end of file
center-channel/app/base/service/impl/utilsSve/utilsFqAliyunSve.js
View file @
f4b6bb32
...
@@ -24,7 +24,6 @@ class UtilsFqAliyunSve extends AppServiceBase {
...
@@ -24,7 +24,6 @@ class UtilsFqAliyunSve extends AppServiceBase {
if
(
!
interface_params_info
||
!
interface_params_info
.
opUrl
||
!
interface_params_info
.
key
||
!
interface_params_info
.
secret
)
{
if
(
!
interface_params_info
||
!
interface_params_info
.
opUrl
||
!
interface_params_info
.
key
||
!
interface_params_info
.
secret
)
{
return
""
;
return
""
;
}
}
var
url
=
"https://yunfuapi-dev.gongsibao.com"
+
pobj
.
interface_params
;
var
params
=
{
var
params
=
{
idempotentId
:
add_order_info
.
orderNo
,
// 是 业务 ID
idempotentId
:
add_order_info
.
orderNo
,
// 是 业务 ID
idempotentSource
:
product_info
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
idempotentSource
:
product_info
.
service_business_code
,
// 是 业务来源(ic_jdyun、ic_ali)
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
f4b6bb32
...
@@ -106,8 +106,7 @@ class UtilsOrderService extends AppServiceBase {
...
@@ -106,8 +106,7 @@ class UtilsOrderService extends AppServiceBase {
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
var
result
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
return
result
;
return
result
;
}
}
/**
/**
* 获取H5支付地址
* 获取H5支付地址
* @param {*} pobj
* @param {*} pobj
...
...
center-channel/app/base/service/impl/utilsSve/utilsPushSve.js
0 → 100644
View file @
f4b6bb32
const
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
const
querystring
=
require
(
'querystring'
);
const
AppServiceBase
=
require
(
"../../app.base"
);
class
UtilsPushService
extends
AppServiceBase
{
constructor
()
{
super
();
};
async
pushInfo
(
orderResult
,
pobj
,
actionBody
,
opType
)
{
if
(
orderResult
.
status
!=
0
)
{
return
""
;
}
var
interface_list
=
actionBody
.
product_info
.
interface_info
;
if
(
!
interface_list
)
{
return
""
;
}
var
interface_info
=
null
;
var
interface_list_temp
=
interface_list
.
filter
(
f
=>
f
.
op_type
==
opType
)
if
(
interface_list_temp
&&
interface_list_temp
.
length
>
0
)
{
interface_info
=
interface_list_temp
[
0
];
}
if
(
!
interface_info
)
{
return
""
;
}
pobj
.
actionBody
.
add_order_info
=
orderResult
.
data
;
var
refOpResult
=
this
.
reflexAction
(
interface_info
,
pobj
);
return
refOpResult
;
}
async
reflexAction
(
interface_info
,
pobj
)
{
var
refResult
=
null
;
if
(
interface_info
.
interface_type
==
"bd"
)
{
if
(
!
interface_info
.
method_name
)
{
return
system
.
getResult
(
null
,
"产品接口参数信息有误,20110"
);
}
//操作的方法名称
var
invokeObj
=
system
.
getObject
(
interface_info
.
interface_url
);
if
(
!
invokeObj
[
interface_info
.
method_name
])
{
return
system
.
getResult
(
null
,
"产品接口参数方法信息有误,20130"
);
}
pobj
.
interface_params
=
interface_info
.
params
;
var
params
=
[
pobj
];
refResult
=
await
invokeObj
[
interface_info
.
method_name
].
apply
(
invokeObj
,
params
);
}
else
if
(
interface_info
.
interface_type
==
"yc"
)
{
}
return
refResult
;
}
}
module
.
exports
=
UtilsPushService
;
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