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
9f0b513c
Commit
9f0b513c
authored
Sep 01, 2020
by
linboxuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tradetransfer add acceptOrder,tmRefuse
parent
28ba15a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
70 deletions
+96
-70
igirl-channel-gateway/app/base/api/impl/action/tradetransfer.js
+90
-67
igirl-channel-gateway/app/config/settings.js
+6
-3
No files found.
igirl-channel-gateway/app/base/api/impl/action/tradetransfer.js
View file @
9f0b513c
...
...
@@ -14,11 +14,15 @@ class TradetransferAPI extends APIBase {
async
getToken
()
{
var
self
=
this
;
var
reqTokenUrl
=
this
.
channelApiUrl
+
"/auth/accessAuth/getToken"
;
var
reqParam
=
self
.
appInfo
[
"aliyuntmtransfer"
];
if
(
!
reqParam
.
appkey
||
!
reqParam
.
secret
)
{
return
system
.
getResult
(
null
,
"reqType类型有误,请求失败"
);
var
reqTokenUrl
=
this
.
channelApiUrl
+
"/web/auth/accessAuth/getAppTokenByHosts"
;
// var reqParam = self.appInfo["aliyuntmtransfer"];
var
reqParam
=
{
"actionType"
:
"getAppTokenByHosts"
,
"actionBody"
:
{}
}
// if (!reqParam.appkey || !reqParam.secret) {
// return system.getResult(null, "reqType类型有误,请求失败");
// }
var
rtn
=
await
this
.
execlient
.
execPost
(
reqParam
,
reqTokenUrl
);
if
(
!
rtn
.
stdout
)
{
return
system
.
getResult
(
null
,
"获取token失败"
);
...
...
@@ -33,108 +37,126 @@ class TradetransferAPI extends APIBase {
//订单创建
// 2020 0828 lin 修改 匹配商标交易
async
acceptOrder
(
pobj
,
qobj
,
req
)
{
if
(
!
p
obj
.
BizId
)
{
if
(
!
q
obj
.
BizId
)
{
return
{
"
E
rrorCode"
:
"error"
,
"
E
rrorMsg"
:
"订单号不能为空"
,
"
M
odule"
:
{
"orderNumber"
:
""
},
"
R
equestId"
:
req
.
requestId
,
"
S
uccess"
:
false
"
e
rrorCode"
:
"error"
,
"
e
rrorMsg"
:
"订单号不能为空"
,
"
m
odule"
:
{
"orderNumber"
:
""
},
"
e
equestId"
:
req
.
requestId
,
"
s
uccess"
:
false
}
}
if
(
!
p
obj
.
UserName
)
{
if
(
!
q
obj
.
UserName
)
{
return
{
"
E
rrorCode"
:
"error"
,
"
E
rrorMsg"
:
"用户不能为空"
,
"
M
odule"
:
{
"orderNumber"
:
""
},
"
R
equestId"
:
req
.
requestId
,
"
S
uccess"
:
false
"
e
rrorCode"
:
"error"
,
"
e
rrorMsg"
:
"用户不能为空"
,
"
m
odule"
:
{
"orderNumber"
:
""
},
"
r
equestId"
:
req
.
requestId
,
"
s
uccess"
:
false
}
}
if
(
!
p
obj
.
Mobile
)
{
if
(
!
q
obj
.
Mobile
)
{
return
{
"
E
rrorCode"
:
"error"
,
"
E
rrorMsg"
:
"用户手机号不能为空"
,
"
M
odule"
:
{
"orderNumber"
:
""
},
"
R
equestId"
:
req
.
requestId
,
"
S
uccess"
:
false
"
e
rrorCode"
:
"error"
,
"
e
rrorMsg"
:
"用户手机号不能为空"
,
"
m
odule"
:
{
"orderNumber"
:
""
},
"
r
equestId"
:
req
.
requestId
,
"
s
uccess"
:
false
}
}
if
(
!
p
obj
.
Price
)
{
if
(
!
q
obj
.
Price
)
{
return
{
"
E
rrorCode"
:
"error"
,
"
E
rrorMsg"
:
"价格不能为空"
,
"
M
odule"
:
{
"orderNumber"
:
""
},
"
R
equestId"
:
req
.
requestId
,
"
S
uccess"
:
false
"
e
rrorCode"
:
"error"
,
"
e
rrorMsg"
:
"价格不能为空"
,
"
m
odule"
:
{
"orderNumber"
:
""
},
"
r
equestId"
:
req
.
requestId
,
"
s
uccess"
:
false
}
}
if
(
!
p
obj
.
RegisterNumber
)
{
if
(
!
q
obj
.
RegisterNumber
)
{
return
{
"
E
rrorCode"
:
"error"
,
"
E
rrorMsg"
:
"商标注册号不能为空"
,
"
M
odule"
:
{
"orderNumber"
:
""
},
"
R
equestId"
:
req
.
requestId
,
"
S
uccess"
:
false
"
e
rrorCode"
:
"error"
,
"
e
rrorMsg"
:
"商标注册号不能为空"
,
"
m
odule"
:
{
"orderNumber"
:
""
},
"
r
equestId"
:
req
.
requestId
,
"
s
uccess"
:
false
}
}
if
(
!
p
obj
.
Classification
)
{
if
(
!
q
obj
.
Classification
)
{
return
{
"
E
rrorCode"
:
"error"
,
"
E
rrorMsg"
:
"商标国际一级分类不能为空"
,
"
M
odule"
:
{
"orderNumber"
:
""
},
"
R
equestId"
:
req
.
requestId
,
"
S
uccess"
:
false
"
e
rrorCode"
:
"error"
,
"
e
rrorMsg"
:
"商标国际一级分类不能为空"
,
"
m
odule"
:
{
"orderNumber"
:
""
},
"
r
equestId"
:
req
.
requestId
,
"
s
uccess"
:
false
}
}
var
sobj
=
{
"actionProcess"
:
"aliyuntmtransfer"
,
"actionType"
:
"
aliclien
t"
,
"actionType"
:
"
tmAccep
t"
,
"actionBody"
:
{
"bizId"
:
pobj
.
BizId
,
"userName"
:
pobj
.
UserName
,
"mobile"
:
pobj
.
Mobile
,
"registerNumber"
:
pobj
.
RegisterNumber
,
"classification"
:
pobj
.
Classification
,
"price"
:
pobj
.
price
"bizId"
:
qobj
.
BizId
,
"userName"
:
qobj
.
UserName
,
"mobile"
:
qobj
.
Mobile
,
"registerNumber"
:
qobj
.
RegisterNumber
,
"classification"
:
qobj
.
Classification
,
"price"
:
qobj
.
Price
,
"channelItemCode"
:
"tmjy"
,
"payCode"
:
"tmjy-1"
,
"quantity"
:
1
,
"totalSum"
:
qobj
.
Price
,
"payTotalSum"
:
qobj
.
Price
,
"channelOrder"
:{
"channelServiceNo"
:
qobj
.
BizId
,
"channelOrderNo"
:
qobj
.
BizId
}
}
}
// 获取token
var
tokenInfo
=
await
this
.
getToken
();
if
(
tokenInfo
.
status
!=
0
)
{
return
{
"
E
rrorCode"
:
"error"
,
"
ErrorMsg"
:
"网络错误
"
,
"
M
odule"
:
{
"orderNumber"
:
""
},
"
R
equestId"
:
req
.
requestId
,
"
S
uccess"
:
false
"
e
rrorCode"
:
"error"
,
"
errorMsg"
:
"渠道验证失败
"
,
"
m
odule"
:
{
"orderNumber"
:
""
},
"
r
equestId"
:
req
.
requestId
,
"
s
uccess"
:
false
};
}
// 获取userpin
var
userparam
=
{
actionType
:
"getLoginByUserName"
,
actionBody
:
{
"channelUserId"
:
p
obj
.
Mobile
,
"mobile"
:
p
obj
.
Mobile
,
"userName"
:
pobj
.
Mobil
e
"channelUserId"
:
q
obj
.
Mobile
,
"mobile"
:
q
obj
.
Mobile
,
"userName"
:
qobj
.
UserNam
e
}
};
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
{
"
E
rrorCode"
:
"error"
,
"
ErrorMsg"
:
"网络错误
"
,
"
M
odule"
:
{
"orderNumber"
:
""
},
"
R
equestId"
:
req
.
requestId
,
"
S
uccess"
:
false
"
e
rrorCode"
:
"error"
,
"
errorMsg"
:
"用户验证失败
"
,
"
m
odule"
:
{
"orderNumber"
:
""
},
"
r
equestId"
:
req
.
requestId
,
"
s
uccess"
:
false
};
}
// 调取channel 开始业务
var
url
=
this
.
channelApiUrl
+
"/
action/tradetransfer/createtransfer
"
;
var
url
=
this
.
channelApiUrl
+
"/
web/opaction/tmOrder/springBoard
"
;
// var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token);
var
rtn
=
rtn
=
await
this
.
execlient
.
execDataPostByTokenUserPin
(
sobj
,
url
,
tokenInfo
.
data
.
token
,
userpinResultTmp
.
data
.
userpin
);
return
rtn
;
if
(
!
rtn
.
stdout
)
{
return
{
"errorCode"
:
"error"
,
"errorMsg"
:
"建立订单失败"
,
"module"
:
{
"orderNumber"
:
""
},
"requestId"
:
req
.
requestId
,
"success"
:
false
};
}
return
JSON
.
parse
(
rtn
.
stdout
);
}
//订单查询
async
queryOrderState
(
p
,
obj
)
{
...
...
@@ -154,15 +176,16 @@ class TradetransferAPI extends APIBase {
}
//订单关闭
async
closeOrder
(
p
,
obj
)
{
async
tmRefuse
(
p
,
obj
,
req
)
{
var
sobj
=
{
"actionProcess"
:
"aliyuntmtransfer"
,
"actionType"
:
"aliclient"
,
"sign"
:
"2FviZ9PGws8Pt1fBhq0t90mjUvI"
,
"actionBody"
:
p
"actionType"
:
"tmRefuse"
,
"actionBody"
:
{
bizId
:
obj
.
BizId
}
}
var
tokenInfo
=
await
this
.
getToken
();
var
url
=
this
.
channelApiUrl
+
"/
action/tradetransfer/orderclose
"
;
var
url
=
this
.
channelApiUrl
+
"/
web/opaction/tmOrder/springBoard
"
;
var
rtn
=
await
this
.
execlient
.
execPostTK
(
sobj
,
url
,
tokenInfo
.
data
.
token
);
// var rtn = await this.execlient.execPostTK(sobj, url,"token");
return
rtn
;
...
...
igirl-channel-gateway/app/config/settings.js
View file @
9f0b513c
...
...
@@ -33,14 +33,17 @@ var settings = {
},
channelApiUrl
:
function
()
{
//----igirl-channel
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.210.192:4003"
;
// return "http://192.168.210.192:4003";
return
"http://ali.qifu.gongsibao.com:4012"
;
}
else
{
return
"http://zc-channel-service"
;
// return "http://zc-channel-service";
return
"http://ali.qifu.gongsibao.com"
;
}
},
centerChannelUrl
:
function
()
{
//---------center-channel
if
(
this
.
env
==
"dev"
)
{
return
"http://gsbweb.qifu-dev.gongsibao.com"
;
//localsettings.reqEsDevUrl;
// return "http://gsbweb.qifu-dev.gongsibao.com";//localsettings.reqEsDevUrl;
return
"http://gsbweb.qifu-dev.gongsibao.com:4012"
;
}
else
{
return
"http://center-channel-service"
;
}
...
...
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