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
b55b0072
Commit
b55b0072
authored
Jun 08, 2020
by
xsren@gongsibao.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保存用户选项,详情获取数据中心数据,保存到数据库
parent
c647c0cc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
16 deletions
+40
-16
center-channel/app/base/api/impl/nmaction/name.js
+32
-14
center-channel/app/config/routes/api.js
+1
-1
center-channel/app/config/settings.js
+7
-1
No files found.
center-channel/app/base/api/impl/nmaction/name.js
View file @
b55b0072
...
...
@@ -5,8 +5,9 @@ class NameAPI extends WEBBase{
constructor
()
{
super
();
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
this
.
utilsOrderSve
=
system
.
getObject
(
"service.utilsSve.utilsOrderSve"
);
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
centerCacheUrl
=
"http://123.57.217.203:30005/"
;
this
.
centerCacheUrl
=
settings
.
centerCacheUrl
()
;
}
/**
* 接口跳转-POST请求
...
...
@@ -32,6 +33,9 @@ class NameAPI extends WEBBase{
case
"createName"
:
//起名
opResult
=
await
this
.
addOrderDelivery
(
pobj
,
pobj
.
actionBody
);
break
;
case
"getNameDetail"
:
opResult
=
await
this
.
getNameDetail
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
@@ -77,7 +81,6 @@ class NameAPI extends WEBBase{
* @returns {Promise<{msg: string, data: (*|null), bizmsg: *, status: number}|{msg: *, data: *, status: *}|{msg: *, data: (*|null), status: number}>}
*/
async
addOrderDelivery
(
pobj
,
actionBody
){
var
nameResult
=
{};
if
(
!
actionBody
.
orderId
)
{
return
system
.
getResult
(
null
,
"orderId参数不能为空"
);
}
...
...
@@ -99,20 +102,35 @@ class NameAPI extends WEBBase{
if
(
!
actionBody
.
preference
)
{
return
system
.
getResult
(
null
,
"preference参数不能为空"
);
}
//获取取名结果
nameResult
=
await
this
.
restPostUrl
(
actionBody
,
this
.
centerCacheUrl
+
"treasure_name"
);
if
(
nameResult
.
code
==
200
){
pobj
.
actionType
=
'addOrderDelivery'
pobj
.
actionBody
=
nameResult
.
data
;
//取名结果存储
var
reut
=
await
this
.
restPostUrl
(
pobj
,
this
.
centerOrderUrl
+
"action/nameOrder/springBoard"
);
if
(
reut
.
status
===
0
){
return
system
.
getResultSuccess
();
await
this
.
redisClient
.
set
(
"ch"
+
JSON
.
stringify
(
actionBody
.
orderId
),
JSON
.
stringify
(
actionBody
));
return
system
.
getResultSuccess
();
}
//获取取名结果,并保存到数据库
async
getNameDetail
(
pobj
){
pobj
.
actionType
=
'getOrderDeliveryInfo'
;
const
opResult
=
await
this
.
utilsOrderSve
.
getOrderDeliveryInfo
(
pobj
,
pobj
.
actionBody
);
if
(
opResult
.
status
==
0
){
if
(
!
opResult
.
data
.
hasOwnProperty
(
'result_name'
)){
const
actionBody
=
await
this
.
redisClient
.
get
(
'ch'
+
JSON
.
stringify
(
pobj
.
actionBody
.
orderNo
));
if
(
actionBody
!=
null
){
const
nameResult
=
await
this
.
restPostUrl
(
JSON
.
parse
(
actionBody
),
this
.
centerCacheUrl
+
"treasure_name"
);
if
(
nameResult
.
code
==
200
){
pobj
.
actionType
=
'addOrderDelivery'
pobj
.
actionBody
=
nameResult
.
data
;
//取名结果存储
await
this
.
restPostUrl
(
pobj
,
this
.
centerOrderUrl
+
"action/nameOrder/springBoard"
);
return
system
.
getResult
(
nameResult
.
data
,
"操作成功"
)
}
}
else
{
return
system
.
getResult
()
}
}
else
{
return
system
.
getResult
Fail
(
-
1
,
reut
.
msg
)
return
system
.
getResult
(
opResult
.
data
,
'操作成功'
)
}
}
else
{
await
this
.
addOrderDelivery
(
pobj
);
}
else
{
return
system
.
getResultFail
(
''
,
opResult
.
msg
);
}
}
}
...
...
center-channel/app/config/routes/api.js
View file @
b55b0072
...
...
@@ -114,7 +114,7 @@ module.exports = function (app) {
"addOrder"
,
"getH5PayUrl"
,
"getOrderQrCode"
,
"queryOrderStatus"
,
"getOrderInfo"
,
"getOrderDeliveryInfo"
,
"getOrderDetails"
,
"getOrderDeliveryFlowInfo"
,
"getOrderDeliveryFlowList"
,
"getOrderLogInfo"
,
"updateContacts"
,
"updateTmOrder"
,
"delOrder"
,
"submitProgramme"
,
"getProgrammeListByUser"
,
"getProgrammeInfoByNeedNo"
,
"abolishProgramme"
,
"getAliPayInfo"
,
"getPaidLogoListByUser"
,
"getCollectibleLogoListByUser"
,
"collectLogo"
,
"getLogoMaterial"
,
"cancelCollectLogo"
,
"icpNotify"
,
"createName"
"getPaidLogoListByUser"
,
"getCollectibleLogoListByUser"
,
"collectLogo"
,
"getLogoMaterial"
,
"cancelCollectLogo"
,
"icpNotify"
,
"createName"
,
"getNameDetail"
];
if
(
lst
.
indexOf
(
req
.
body
.
actionType
)
>=
0
)
{
var
userpin
=
req
.
headers
[
"userpin"
]
||
""
;
...
...
center-channel/app/config/settings.js
View file @
b55b0072
...
...
@@ -90,7 +90,13 @@ var settings = {
return
"http://igirl-service/"
;
}
},
centerCacheUrl
:
function
(){
if
(
this
.
env
==
'dev'
){
return
"http://123.57.217.203:30005/"
;
}
else
{
return
"http://specialname-service/"
}
},
reqTransferurl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.18.61:3003/"
;
...
...
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