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
5f946b9b
Commit
5f946b9b
authored
Dec 26, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laolan
parent
f714853a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
136 additions
and
64 deletions
+136
-64
igirl-channel-gateway/app/base/service/impl/utilsSve/regCenterOrderSve.js
+136
-64
No files found.
igirl-channel-gateway/app/base/service/impl/utilsSve/regCenterOrderSve.js
View file @
5f946b9b
...
...
@@ -76,7 +76,7 @@ class RegCenterOrderService extends AppServiceBase {
var
needInfoUrl
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
needInfoRes
=
await
this
.
execlient
.
execPostTK
(
reqData
,
needInfoUrl
,
tokenInfo
.
data
.
token
);
if
(
needInfoRes
.
status
==
0
){
pobj
.
mobile
=
needInfoRes
.
channelNeedNo
pobj
.
mobile
=
needInfoRes
.
data
.
channelUserId
}
}
...
...
@@ -164,7 +164,6 @@ class RegCenterOrderService extends AppServiceBase {
};
}
// 获取app token
// var tokenInfo = await this.getCenterToken();
var
tokenInfo
=
await
this
.
getCenterTokenByApp
(
pobj
.
appInfo
);
if
(
tokenInfo
.
status
!=
0
)
{
return
{
...
...
@@ -194,13 +193,57 @@ class RegCenterOrderService extends AppServiceBase {
}
pobj
[
'province'
]
=
pobj
.
area
;
}
else
{
var
userpin
=
""
;
//传手机号
if
(
pobj
.
phone
&&!
pobj
.
mobile
){
pobj
.
mobile
=
pobj
.
phone
;
}
else
{
//没传手机号就自己去查渠道唯一码
var
reqData
=
{
actionType
:
"selectNeedInfo"
,
actionBody
:
{
channelNeedNo
:
pobj
.
intentionBizId
}
}
var
needInfoUrl
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
needInfoRes
=
await
this
.
execlient
.
execPostTK
(
reqData
,
needInfoUrl
,
tokenInfo
.
data
.
token
);
if
(
needInfoRes
.
status
==
0
){
pobj
.
mobile
=
needInfoRes
.
data
.
channelUserId
}
}
if
(
pobj
.
mobile
)
{
//有传手机号就直接获取用户userpin
var
userparam
=
{
actionType
:
"getLoginByUserName"
,
actionBody
:
{
"channelUserId"
:
pobj
.
mobile
,
"mobile"
:
pobj
.
mobile
,
"userName"
:
pobj
.
mobile
}
};
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/accessAuth/springBoard"
;
var
userpinResultTmp
=
await
this
.
execlient
.
execPostTK
(
userparam
,
url
,
tokenInfo
.
data
.
token
);
if
(
userpinResultTmp
.
status
!=
0
&&
userpinResultTmp
.
status
!=
2060
)
{
return
system
.
getResultFail
(
-
99
,
"获取userpin失败"
);
}
userpin
=
userpinResultTmp
.
data
.
userpin
;
if
(
!
userpin
)
{
return
system
.
getResultFail
(
-
88
,
"获取userpin失败!!"
);
}
}
var
sobj
=
{
"actionType"
:
"getItemByChannelSolutionNo"
,
"actionBody"
:
pobj
}
// getItemByChannelSolutionNo
var
url
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
result
=
await
this
.
execlient
.
execPostTK
(
sobj
,
url
,
token
);
var
result
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
if
(
result
&&
result
.
stdout
){
result
=
result
.
stdout
result
=
JSON
.
parse
(
result
)
}
if
(
result
.
status
!=
0
)
{
return
{
"requestId"
:
result
.
requestId
,
...
...
@@ -209,58 +252,39 @@ class RegCenterOrderService extends AppServiceBase {
"errorCode"
:
"ok"
};
}
userparam
.
actionBody
.
channelUserId
=
result
.
data
.
channelUserId
userparam
.
actionBody
.
mobile
=
result
.
data
.
publishMobile
userparam
.
actionBody
.
userName
=
result
.
data
.
publishMobile
pobj
.
publishMobile
=
result
.
data
.
publishMobile
;
pobj
.
channelNeedNo
=
result
.
data
.
channelNeedNo
;
pobj
.
needNo
=
result
.
data
.
needNo
;
pobj
.
channelTypeCode
=
result
.
data
.
channelTypeCode
;
pobj
[
'province'
]
=
result
.
data
.
solutionProvince
;
//北京(新购)?
}
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"
:
regCfg
.
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"
};
console
.
log
(
'regOrderStatus--start--'
)
// 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"
};
}
}
return
{
"requestId"
:
result
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
}
//百度reg 2.4 请求 关闭reg订单
async
regOrderClose
(
pobj
)
{
if
(
!
pobj
.
appInfo
||
!
pobj
.
appInfo
.
uapp_key
||
!
pobj
.
appInfo
.
uapp_secret
){
...
...
@@ -288,16 +312,64 @@ class RegCenterOrderService extends AppServiceBase {
"actionBody"
:
pobj
}
// getItemByChannelSolutionNo
var
url
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
result
=
await
this
.
execlient
.
execPostTK
(
sobj
,
url
,
token
);
if
(
result
.
status
!=
0
||
!
result
.
data
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
}
var
userpin
=
""
;
//传手机号
if
(
pobj
.
phone
&&!
pobj
.
mobile
){
pobj
.
mobile
=
pobj
.
phone
;
}
else
{
//没传手机号就自己去查渠道唯一码
var
reqData
=
{
actionType
:
"selectNeedInfo"
,
actionBody
:
{
orderNo
:
pobj
.
orderNo
}
}
var
needInfoUrl
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
needInfoRes
=
await
this
.
execlient
.
execPostTK
(
reqData
,
needInfoUrl
,
tokenInfo
.
data
.
token
);
if
(
needInfoRes
.
status
==
0
){
pobj
.
mobile
=
needInfoRes
.
data
.
channelUserId
}
}
if
(
pobj
.
mobile
)
{
//有传手机号就直接获取用户userpin
var
userparam
=
{
actionType
:
"getLoginByUserName"
,
actionBody
:
{
"channelUserId"
:
pobj
.
mobile
,
"mobile"
:
pobj
.
mobile
,
"userName"
:
pobj
.
mobile
}
};
var
url
=
settings
.
centerChannelUrl
()
+
"/api/opreceive/accessAuth/springBoard"
;
var
userpinResultTmp
=
await
this
.
execlient
.
execPostTK
(
userparam
,
url
,
tokenInfo
.
data
.
token
);
if
(
userpinResultTmp
.
status
!=
0
&&
userpinResultTmp
.
status
!=
2060
)
{
return
system
.
getResultFail
(
-
99
,
"获取userpin失败"
);
}
userpin
=
userpinResultTmp
.
data
.
userpin
;
if
(
!
userpin
)
{
return
system
.
getResultFail
(
-
88
,
"获取userpin失败!!"
);
}
}
var
sobj
=
{
"actionType"
:
"getItemByChannelSolutionNo"
,
"actionBody"
:
pobj
}
var
url
=
settings
.
centerChannelUrl
()
+
"/api/action/regapi/springBoard"
;
var
result
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
token
,
userpin
);
if
(
result
&&
result
.
stdout
){
result
=
result
.
stdout
result
=
JSON
.
parse
(
result
)
}
if
(
result
.
status
!=
0
)
{
return
{
"requestId"
:
result
.
requestId
,
"success"
:
false
,
"errorMsg"
:
result
.
msg
,
"errorCode"
:
"ok"
};
}
if
(
!
result
.
data
.
solutionContent
||
!
result
.
data
.
solutionContent
.
customerInfo
||
!
result
.
data
.
solutionContent
.
customerInfo
.
publishMobile
){
return
{
"requestId"
:
result
.
requestId
,
...
...
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