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
caf54f3b
Commit
caf54f3b
authored
Dec 04, 2019
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
14bfd80f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
79 deletions
+19
-79
igirl-channel/app/base/api/impl/action/tradetransfer.js
+19
-79
No files found.
igirl-channel/app/base/api/impl/action/tradetransfer.js
View file @
caf54f3b
...
...
@@ -13,106 +13,46 @@ class TradetransferAPI extends APIBase {
//订单创建
async
createtransfer
(
p
,
obj
,
req
)
{
if
(
!
obj
.
actionBody
.
BizId
)
{
return
{
"errorCode"
:
"error"
,
"errorMsg"
:
"订单号不能为空"
,
"module"
:
{
"orderNumber"
:
""
},
"requestId"
:
req
.
requestId
,
"success"
:
false
}
}
if
(
!
obj
.
actionBody
.
UserName
)
{
return
{
"errorCode"
:
"error"
,
"errorMsg"
:
"用户不能为空"
,
"module"
:
{
"orderNumber"
:
""
},
"requestId"
:
req
.
requestId
,
"success"
:
false
}
}
if
(
!
obj
.
actionBody
.
Mobile
)
{
return
{
"errorCode"
:
"error"
,
"errorMsg"
:
"用户手机号不能为空"
,
"module"
:
{
"orderNumber"
:
""
},
"requestId"
:
req
.
requestId
,
"success"
:
false
}
}
if
(
!
obj
.
actionBody
.
Price
)
{
return
{
"errorCode"
:
"error"
,
"errorMsg"
:
"价格不能为空"
,
"module"
:
{
"orderNumber"
:
""
},
"requestId"
:
req
.
requestId
,
"success"
:
false
}
}
var
a
=
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
);
var
orderc
=
{
"actionProcess"
:
"ali"
,
"actionType"
:
"addOrder"
,
"isUser"
:
"yes"
,
"actionBody"
:
{
"itemCode"
:
"alitmtt"
,
"channelParams"
:
obj
.
actionBody
,
"channelUser"
:
{
"channelUserId"
:
obj
.
actionBody
.
Mobile
,
"channelUserName"
:
obj
.
actionBody
.
UserName
,
"channelUserMoblie"
:
obj
.
actionBody
.
Mobile
,
"nickname"
:
""
,
"orgName"
:
""
,
"orgPath"
:
""
},
"channelOrder"
:
{
"channelServiceNo"
:
obj
.
actionBody
.
BizId
,
"channelOrderNo"
:
""
,
"needNo"
:
obj
.
actionBody
.
BizId
,
"quantity"
:
1
,
"totalSum"
:
parseInt
(
obj
.
actionBody
.
Price
),
"payTotalSum"
:
parseInt
(
obj
.
actionBody
.
Price
)
*
0.2
,
"payStatus"
:
"yfk"
,
"payTime"
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
}
}
}
var
orderinfo
=
await
this
.
corderSve
.
createOrder
(
orderc
.
actionBody
,
req
);
var
orderinfo
=
await
this
.
corderSve
.
createOrder
(
p
.
actionBody
,
req
);
if
(
orderinfo
)
{
if
(
orderinfo
.
status
==
"
1
"
)
{
return
{
if
(
orderinfo
.
status
==
"
0
"
)
{
var
result
=
{
"errorCode"
:
"OK"
,
"errorMsg"
:
""
,
"module"
:
{
"order
Number"
:
orderinfo
.
dataValue
.
fq_ordernum
},
"errorMsg"
:
"
成功
"
,
"module"
:
{
"order
Id"
:
orderinfo
.
data
.
orderNo
},
"requestId"
:
req
.
requestId
,
"success"
:
true
}
return
result
;
}
else
if
(
orderinfo
.
status
==
"2"
)
{
return
{
var
result
=
{
"errorCode"
:
"OK"
,
"errorMsg"
:
"订单已存在"
,
"module"
:
{
"orderId"
:
orderinfo
.
data
Value
.
fq_ordernum
},
"module"
:
{
"orderId"
:
orderinfo
.
data
},
"requestId"
:
req
.
requestId
,
"success"
:
true
}
return
result
;
}
}
else
{
return
{
var
result
=
{
"errorCode"
:
"error"
,
"errorMsg"
:
""
,
"module"
:
{
"order
Number
"
:
""
},
"module"
:
{
"order
Id
"
:
""
},
"requestId"
:
req
.
requestId
,
"success"
:
false
}
return
result
;
}
}
//订单查询
async
ordersel
(
p
,
obj
)
{
var
url
=
this
.
transferurl
+
"api/transfer/tradeApi/queryOrderState"
;
var
transferinfo
=
await
this
.
execlient
.
execPost
(
obj
.
actionBody
,
url
);
var
transferinfo
=
await
this
.
execlient
.
execPost
(
p
.
actionBody
,
url
);
var
a
=
JSON
.
parse
(
transferinfo
.
stdout
)
return
a
;
}
...
...
@@ -120,7 +60,7 @@ class TradetransferAPI extends APIBase {
//订单关闭
async
orderclose
(
obj
)
{
var
url
=
this
.
transferurl
+
"api/transfer/tradeApi/closeOrder"
;
var
transferinfo
=
await
this
.
execlient
.
execPost
(
obj
,
url
);
var
transferinfo
=
await
this
.
execlient
.
execPost
(
p
,
url
);
var
a
=
JSON
.
parse
(
transferinfo
.
stdout
)
return
a
;
...
...
@@ -141,9 +81,9 @@ class TradetransferAPI extends APIBase {
//阿里网关
async
aliclienttransfer
(
obj
)
{
if
(
obj
.
actionBody
)
{
var
rtn
=
await
this
.
aliclient
.
reqbyget
(
obj
.
actionBody
)
async
aliclienttransfer
(
p
,
obj
)
{
if
(
p
.
actionBody
)
{
var
rtn
=
await
this
.
aliclient
.
reqbyget
(
p
.
actionBody
)
return
rtn
;
}
}
...
...
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