Commit caf54f3b by 王栋源

wdy

parent 14bfd80f
......@@ -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": { "orderNumber": orderinfo.dataValue.fq_ordernum },
"errorMsg": "成功",
"module": { "orderId": orderinfo.data.orderNo },
"requestId": req.requestId,
"success": true
}
return result;
} else if (orderinfo.status == "2") {
return {
var result={
"errorCode": "OK",
"errorMsg": "订单已存在",
"module": { "orderId": orderinfo.dataValue.fq_ordernum },
"module": { "orderId": orderinfo.data },
"requestId": req.requestId,
"success": true
}
return result;
}
} else {
return {
var result={
"errorCode": "error",
"errorMsg": "",
"module": { "orderNumber": "" },
"module": { "orderId": "" },
"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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment