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
e8f105db
Commit
e8f105db
authored
Dec 27, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laolan
parent
5f946b9b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
35 deletions
+77
-35
igirl-channel-gateway/app/base/service/impl/utilsSve/regCenterOrderSve.js
+77
-35
No files found.
igirl-channel-gateway/app/base/service/impl/utilsSve/regCenterOrderSve.js
View file @
e8f105db
...
@@ -40,12 +40,12 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -40,12 +40,12 @@ class RegCenterOrderService extends AppServiceBase {
}
}
async
reqcenterchannel2
(
pobj
)
{
async
reqcenterchannel2
(
pobj
)
{
console
.
log
(
'reqcenterchannel2----'
,
pobj
)
console
.
log
(
'reqcenterchannel2----'
,
pobj
)
var
sobj
=
{
var
sobj
=
{
"actionType"
:
pobj
.
action_type
,
"actionType"
:
pobj
.
action_type
,
"actionBody"
:
pobj
"actionBody"
:
pobj
}
}
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
)
{
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
)
{
return
{
return
{
"requestId"
:
regCfg
.
getUUID
(),
"requestId"
:
regCfg
.
getUUID
(),
"success"
:
false
,
"success"
:
false
,
...
@@ -64,18 +64,18 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -64,18 +64,18 @@ class RegCenterOrderService extends AppServiceBase {
}
}
var
userpin
=
""
;
var
userpin
=
""
;
//传手机号
//传手机号
if
(
pobj
.
phone
&&!
pobj
.
mobile
)
{
if
(
pobj
.
phone
&&
!
pobj
.
mobile
)
{
pobj
.
mobile
=
pobj
.
phone
;
pobj
.
mobile
=
pobj
.
phone
;
}
else
{
//没传手机号就自己去查渠道唯一码
}
else
{
//没传手机号就自己去查渠道唯一码
var
reqData
=
{
var
reqData
=
{
actionType
:
"selectNeedInfo"
,
actionType
:
"selectNeedInfo"
,
actionBody
:
{
actionBody
:
{
channelNeedNo
:
pobj
.
intentionBizId
channelNeedNo
:
pobj
.
intentionBizId
}
}
}
}
var
needInfoUrl
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
needInfoUrl
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
needInfoRes
=
await
this
.
execlient
.
execPostTK
(
reqData
,
needInfoUrl
,
tokenInfo
.
data
.
token
);
var
needInfoRes
=
await
this
.
execlient
.
execPostTK
(
reqData
,
needInfoUrl
,
tokenInfo
.
data
.
token
);
if
(
needInfoRes
.
status
==
0
)
{
if
(
needInfoRes
.
status
==
0
)
{
pobj
.
mobile
=
needInfoRes
.
data
.
channelUserId
pobj
.
mobile
=
needInfoRes
.
data
.
channelUserId
}
}
}
}
...
@@ -155,7 +155,7 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -155,7 +155,7 @@ class RegCenterOrderService extends AppServiceBase {
}
}
//百度reg 2.3 请求
//百度reg 2.3 请求
async
regOrderStatus
(
pobj
)
{
async
regOrderStatus
(
pobj
)
{
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
)
{
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
)
{
return
{
return
{
"requestId"
:
regCfg
.
getUUID
(),
"requestId"
:
regCfg
.
getUUID
(),
"success"
:
false
,
"success"
:
false
,
...
@@ -180,8 +180,8 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -180,8 +180,8 @@ class RegCenterOrderService extends AppServiceBase {
actionBody
:
{}
actionBody
:
{}
};
};
// 引用属性,channel依赖bizId order依赖intentionBizId
// 引用属性,channel依赖bizId order依赖intentionBizId
pobj
.
intentionBizId
=
pobj
.
bizId
pobj
.
intentionBizId
=
pobj
.
bizId
||
pobj
.
orderNo
if
(
pobj
.
isDirectBuy
==
1
)
{
//直购
if
(
pobj
.
isDirectBuy
==
1
)
{
//直购
userparam
.
actionBody
.
channelUserId
=
pobj
.
phone
userparam
.
actionBody
.
channelUserId
=
pobj
.
phone
userparam
.
actionBody
.
mobile
=
pobj
.
phone
userparam
.
actionBody
.
mobile
=
pobj
.
phone
userparam
.
actionBody
.
userName
=
pobj
.
phone
userparam
.
actionBody
.
userName
=
pobj
.
phone
...
@@ -192,21 +192,63 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -192,21 +192,63 @@ class RegCenterOrderService extends AppServiceBase {
pobj
.
area
=
pobj
.
area
pobj
.
area
=
pobj
.
area
}
}
pobj
[
'province'
]
=
pobj
.
area
;
pobj
[
'province'
]
=
pobj
.
area
;
}
else
{
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/accessAuth/springBoard"
;
var
userpinResultTmp
=
await
this
.
execlient
.
execPostTK
(
userparam
,
url
,
tokenInfo
.
data
.
token
);
if
(
userpinResultTmp
.
status
!=
0
)
{
return
{
"requestId"
:
userpinResultTmp
.
requestId
,
"success"
:
false
,
"errorMsg"
:
userpinResultTmp
.
msg
,
"errorCode"
:
"ok"
};
}
// regOrderStatus
var
url
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
sobj
=
{
"actionType"
:
"regOrderStatus"
,
"actionBody"
:
pobj
}
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpinResultTmp
.
data
.
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
"requestId"
:
self
.
getUUID
(),
"success"
:
false
,
"errorMsg"
:
"网络错误"
,
"errorCode"
:
"ok"
};
}
var
result
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
result
.
status
!=
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
}
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
}
else
{
var
userpin
=
""
;
var
userpin
=
""
;
//传手机号
//传手机号
if
(
pobj
.
phone
&&!
pobj
.
mobile
)
{
if
(
pobj
.
phone
&&
!
pobj
.
mobile
)
{
pobj
.
mobile
=
pobj
.
phone
;
pobj
.
mobile
=
pobj
.
phone
;
}
else
{
//没传手机号就自己去查渠道唯一码
}
else
{
//没传手机号就自己去查渠道唯一码
var
reqData
=
{
var
reqData
=
{
actionType
:
"selectNeedInfo"
,
actionType
:
"selectNeedInfo"
,
actionBody
:
{
actionBody
:
{
channelNeedNo
:
pobj
.
intentionBizId
channelNeedNo
:
pobj
.
intentionBizId
}
}
}
}
var
needInfoUrl
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
needInfoUrl
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
needInfoRes
=
await
this
.
execlient
.
execPostTK
(
reqData
,
needInfoUrl
,
tokenInfo
.
data
.
token
);
var
needInfoRes
=
await
this
.
execlient
.
execPostTK
(
reqData
,
needInfoUrl
,
tokenInfo
.
data
.
token
);
if
(
needInfoRes
.
status
==
0
)
{
if
(
needInfoRes
.
status
==
0
)
{
pobj
.
mobile
=
needInfoRes
.
data
.
channelUserId
pobj
.
mobile
=
needInfoRes
.
data
.
channelUserId
}
}
}
}
...
@@ -240,7 +282,7 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -240,7 +282,7 @@ class RegCenterOrderService extends AppServiceBase {
// getItemByChannelSolutionNo
// getItemByChannelSolutionNo
var
url
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
url
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
result
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
var
result
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
if
(
result
&&
result
.
stdout
)
{
if
(
result
&&
result
.
stdout
)
{
result
=
result
.
stdout
result
=
result
.
stdout
result
=
JSON
.
parse
(
result
)
result
=
JSON
.
parse
(
result
)
}
}
...
@@ -287,7 +329,7 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -287,7 +329,7 @@ class RegCenterOrderService extends AppServiceBase {
}
}
//百度reg 2.4 请求 关闭reg订单
//百度reg 2.4 请求 关闭reg订单
async
regOrderClose
(
pobj
)
{
async
regOrderClose
(
pobj
)
{
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
)
{
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
)
{
return
{
return
{
"requestId"
:
regCfg
.
getUUID
(),
"requestId"
:
regCfg
.
getUUID
(),
"success"
:
false
,
"success"
:
false
,
...
@@ -314,18 +356,18 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -314,18 +356,18 @@ class RegCenterOrderService extends AppServiceBase {
// getItemByChannelSolutionNo
// getItemByChannelSolutionNo
var
userpin
=
""
;
var
userpin
=
""
;
//传手机号
//传手机号
if
(
pobj
.
phone
&&!
pobj
.
mobile
)
{
if
(
pobj
.
phone
&&
!
pobj
.
mobile
)
{
pobj
.
mobile
=
pobj
.
phone
;
pobj
.
mobile
=
pobj
.
phone
;
}
else
{
//没传手机号就自己去查渠道唯一码
}
else
{
//没传手机号就自己去查渠道唯一码
var
reqData
=
{
var
reqData
=
{
actionType
:
"selectNeedInfo"
,
actionType
:
"selectNeedInfo"
,
actionBody
:
{
actionBody
:
{
orderNo
:
pobj
.
orderNo
orderNo
:
pobj
.
orderNo
}
}
}
}
var
needInfoUrl
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
needInfoUrl
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
needInfoRes
=
await
this
.
execlient
.
execPostTK
(
reqData
,
needInfoUrl
,
tokenInfo
.
data
.
token
);
var
needInfoRes
=
await
this
.
execlient
.
execPostTK
(
reqData
,
needInfoUrl
,
tokenInfo
.
data
.
token
);
if
(
needInfoRes
.
status
==
0
)
{
if
(
needInfoRes
.
status
==
0
)
{
pobj
.
mobile
=
needInfoRes
.
data
.
channelUserId
pobj
.
mobile
=
needInfoRes
.
data
.
channelUserId
}
}
}
}
...
@@ -358,7 +400,7 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -358,7 +400,7 @@ class RegCenterOrderService extends AppServiceBase {
}
}
var
url
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
url
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
result
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
var
result
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
if
(
result
&&
result
.
stdout
)
{
if
(
result
&&
result
.
stdout
)
{
result
=
result
.
stdout
result
=
result
.
stdout
result
=
JSON
.
parse
(
result
)
result
=
JSON
.
parse
(
result
)
}
}
...
@@ -370,7 +412,7 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -370,7 +412,7 @@ class RegCenterOrderService extends AppServiceBase {
"errorCode"
:
"ok"
"errorCode"
:
"ok"
};
};
}
}
if
(
!
result
.
data
.
solutionContent
||
!
result
.
data
.
solutionContent
.
customerInfo
||
!
result
.
data
.
solutionContent
.
customerInfo
.
publishMobile
)
{
if
(
!
result
.
data
.
solutionContent
||
!
result
.
data
.
solutionContent
.
customerInfo
||
!
result
.
data
.
solutionContent
.
customerInfo
.
publishMobile
)
{
return
{
return
{
"requestId"
:
result
.
requestId
,
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"success"
:
false
,
...
@@ -382,9 +424,9 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -382,9 +424,9 @@ class RegCenterOrderService extends AppServiceBase {
var
userparam
=
{
var
userparam
=
{
actionType
:
"getLoginByUserName"
,
actionType
:
"getLoginByUserName"
,
actionBody
:
{
actionBody
:
{
channelUserId
:
result
.
data
.
solutionContent
.
customerInfo
.
publishMobile
,
channelUserId
:
result
.
data
.
solutionContent
.
customerInfo
.
publishMobile
,
mobile
:
result
.
data
.
solutionContent
.
customerInfo
.
publishMobile
,
mobile
:
result
.
data
.
solutionContent
.
customerInfo
.
publishMobile
,
userName
:
result
.
data
.
solutionContent
.
customerInfo
.
publishMobile
userName
:
result
.
data
.
solutionContent
.
customerInfo
.
publishMobile
}
}
};
};
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/accessAuth/springBoard"
;
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/accessAuth/springBoard"
;
...
@@ -402,7 +444,7 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -402,7 +444,7 @@ class RegCenterOrderService extends AppServiceBase {
"actionBody"
:
pobj
"actionBody"
:
pobj
}
}
var
url
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
url
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
closeobj
,
url
,
token
,
userpinResultTmp
.
data
.
userpin
);
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
closeobj
,
url
,
token
,
userpinResultTmp
.
data
.
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
return
{
"requestId"
:
regCfg
.
getUUID
(),
"requestId"
:
regCfg
.
getUUID
(),
...
@@ -427,7 +469,7 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -427,7 +469,7 @@ class RegCenterOrderService extends AppServiceBase {
"errorCode"
:
"ok"
"errorCode"
:
"ok"
};
};
}
}
// -------------提交reg需求--------laolan 2020.12.17-------百度reg接入使用--------end------------------
// -------------提交reg需求--------laolan 2020.12.17-------百度reg接入使用--------end------------------
async
paySuccess
(
pobj
)
{
async
paySuccess
(
pobj
)
{
var
sobj
=
{
var
sobj
=
{
"actionType"
:
pobj
.
action_type
,
"actionType"
:
pobj
.
action_type
,
...
@@ -566,8 +608,8 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -566,8 +608,8 @@ class RegCenterOrderService extends AppServiceBase {
actionType
:
"getLoginByUserName"
,
actionType
:
"getLoginByUserName"
,
actionBody
:
{}
actionBody
:
{}
};
};
if
(
pobj
.
isDirectBuy
===
"true"
)
{
//直购
if
(
pobj
.
isDirectBuy
===
"true"
)
{
//直购
if
(
!
pobj
.
mobile
)
{
if
(
!
pobj
.
mobile
)
{
var
sobj
=
{
var
sobj
=
{
"actionType"
:
"getSolutionByChannelSolutionNo"
,
"actionType"
:
"getSolutionByChannelSolutionNo"
,
"actionBody"
:
pobj
"actionBody"
:
pobj
...
@@ -588,10 +630,10 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -588,10 +630,10 @@ class RegCenterOrderService extends AppServiceBase {
userparam
.
actionBody
.
mobile
=
pobj
.
mobile
userparam
.
actionBody
.
mobile
=
pobj
.
mobile
userparam
.
actionBody
.
userName
=
pobj
.
mobile
userparam
.
actionBody
.
userName
=
pobj
.
mobile
pobj
.
publishMobile
=
pobj
.
mobile
pobj
.
publishMobile
=
pobj
.
mobile
pobj
.
channelTypeCode
=
pobj
.
bizId
.
startsWith
(
"EDI"
)?
7
:
5
;
pobj
.
channelTypeCode
=
pobj
.
bizId
.
startsWith
(
"EDI"
)
?
7
:
5
;
//pobj.province = pobj.companyLocation+`(${pobj.actionType})`
//pobj.province = pobj.companyLocation+`(${pobj.actionType})`
pobj
.
province
=
pobj
.
area
pobj
.
province
=
pobj
.
area
}
else
{
}
else
{
var
sobj
=
{
var
sobj
=
{
"actionType"
:
"getItemByChannelSolutionNo"
,
"actionType"
:
"getItemByChannelSolutionNo"
,
"actionBody"
:
pobj
"actionBody"
:
pobj
...
@@ -632,7 +674,7 @@ class RegCenterOrderService extends AppServiceBase {
...
@@ -632,7 +674,7 @@ class RegCenterOrderService extends AppServiceBase {
"actionType"
:
"icpNotify"
,
"actionType"
:
"icpNotify"
,
"actionBody"
:
pobj
"actionBody"
:
pobj
}
}
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpinResultTmp
.
data
.
userpin
);
var
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpinResultTmp
.
data
.
userpin
);
if
(
!
rtn
||
!
rtn
.
stdout
)
{
if
(
!
rtn
||
!
rtn
.
stdout
)
{
return
{
return
{
"requestId"
:
regCfg
.
getUUID
(),
"requestId"
:
regCfg
.
getUUID
(),
...
...
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