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
2a356e75
Commit
2a356e75
authored
Dec 09, 2019
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
6bef5bcb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
+16
-5
No files found.
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
View file @
2a356e75
...
...
@@ -24,6 +24,7 @@ class tmqueryCtl extends CtlBase {
if
(
req
.
session
.
userPinInfo
.
encryptChannelUserId
!=
pobj
.
actionBody
.
channelUserId
)
{
return
system
.
getResult
(
null
,
"ueser login is error"
);
}
pobj
.
isDecryptUser
=
"yes"
;
}
var
rc
=
system
.
getObject
(
"util.execClient"
);
...
...
@@ -106,7 +107,7 @@ class tmqueryCtl extends CtlBase {
return
system
.
getResult
(
null
,
"处理请求失败"
);
}
if
([
"jd"
].
indexOf
(
pobj
.
actionProcess
)
>=
0
&&
pobj
.
actionType
==
"subTmOrder"
)
{
var
opPayPageInfoResult
=
await
this
.
opPayPageInfo
(
pobj
);
var
opPayPageInfoResult
=
await
this
.
opPayPageInfo
(
pobj
,
req
);
return
opPayPageInfoResult
;
}
return
result
;
...
...
@@ -241,9 +242,16 @@ class tmqueryCtl extends CtlBase {
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
async
opPayPageInfo
(
pobj
)
{
async
opPayPageInfo
(
pobj
,
req
)
{
if
(
!
pobj
.
itemCode
)
{
return
system
.
getResult
(
null
,
"itemCode param is not empty"
);
}
if
(
pobj
.
actionProcess
==
"jd"
)
{
var
tmpResult
=
await
this
.
opJdOrder
();
var
itemCodeList
=
pobj
.
itemCode
.
spilt
(
'-'
);
if
(
itemCodeList
.
length
<
2
)
{
return
system
.
getResult
(
null
,
"itemCode is error"
);
}
var
tmpResult
=
await
this
.
opJdOrder
(
pobj
.
itemCode
,
itemCodeList
,
req
);
// { result: true,
// data:
// '{"success":true,"code":null,"msg":null,"data":{"orderNumber":"6058867","erpOrderId":"523198741458590844",
...
...
@@ -254,6 +262,7 @@ class tmqueryCtl extends CtlBase {
var
payDataResult
=
JSON
.
parse
(
tmpResult
.
data
);
console
.
log
(
payDataResult
,
"payDataResult...........payDataResult........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$..002.."
);
if
(
payDataResult
&&
payDataResult
.
success
&&
payDataResult
.
success
==
true
)
{
//更新订单信息
return
system
.
getResultSuccess
({
payUrl
:
payDataResult
.
data
.
returnUrl
});
}
//成功
}
...
...
@@ -261,8 +270,9 @@ class tmqueryCtl extends CtlBase {
}
return
system
.
getResultSuccess
()
}
async
opJdOrder
(
pobj
,
qobj
,
req
)
{
async
opJdOrder
(
itemCode
,
itemCodeList
,
req
)
{
try
{
const
{
Signer
,
Context
}
=
require
(
'../jd-gateway-sdk'
);
let
ctx
=
new
Context
(
'x3k0s704lfun-test.cn-north-1.jdcloud-api.net'
,
'/market/order/api/submit'
,
'POST'
,
null
,
'empty'
);
ctx
.
regionId
=
'cn-north-1'
...
...
@@ -277,7 +287,8 @@ class tmqueryCtl extends CtlBase {
//ctx.body = "pin=jcloud_pRiHQTd&serviceId=580010&itemCode=FW_GOODS-580010-1&platform=6"
//POST
var
qs
=
require
(
'querystring'
);
var
post_data
=
{
pin
:
"syaify"
,
serviceId
:
580010
,
itemCode
:
"FW_GOODS-580010-1"
,
platform
:
6
,
orderNum
:
1
,
articleType
:
1
};
//这是需要提交的数据
// var post_data = { pin: "syaify", serviceId: 580010, itemCode: "FW_GOODS-580010-1", platform: 6, orderNum: 1, articleType: 1 };//这是需要提交的数据
var
post_data
=
{
pin
:
req
.
session
.
userPinInfo
.
channelUserId
,
serviceId
:
itemCodeList
[
1
],
itemCode
:
itemCode
,
platform
:
6
,
orderNum
:
1
,
articleType
:
1
,
additions
:
{
"195"
:
0
}
};
//这是需要提交的数据
var
tmpContent
=
JSON
.
stringify
(
post_data
);
var
tmpContentLength
=
Buffer
.
byteLength
(
tmpContent
);
var
content
=
qs
.
stringify
(
post_data
);
...
...
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