Commit d5a882d9 by linboxuan

acceptOrder update

parent 571332c6
......@@ -31,75 +31,109 @@ class TradetransferAPI extends APIBase {
}
//订单创建
// 2020 0828 lin 修改 匹配商标交易
async acceptOrder(pobj,qobj,req) {
if (!pobj.BizId) {
return {
"errorCode": "error",
"errorMsg": "订单号不能为空",
"module": { "orderNumber": "" },
"requestId": req.requestId,
"success": false
"ErrorCode": "error",
"ErrorMsg": "订单号不能为空",
"Module": { "orderNumber": "" },
"RequestId": req.requestId,
"Success": false
}
}
if (!pobj.UserName) {
return {
"errorCode": "error",
"errorMsg": "用户不能为空",
"module": { "orderNumber": "" },
"requestId": req.requestId,
"success": false
"ErrorCode": "error",
"ErrorMsg": "用户不能为空",
"Module": { "orderNumber": "" },
"RequestId": req.requestId,
"Success": false
}
}
if (!pobj.Mobile) {
return {
"errorCode": "error",
"errorMsg": "用户手机号不能为空",
"module": { "orderNumber": "" },
"requestId": req.requestId,
"success": false
"ErrorCode": "error",
"ErrorMsg": "用户手机号不能为空",
"Module": { "orderNumber": "" },
"RequestId": req.requestId,
"Success": false
}
}
if (!pobj.Price) {
return {
"errorCode": "error",
"errorMsg": "价格不能为空",
"module": { "orderNumber": "" },
"requestId": req.requestId,
"success": false
"ErrorCode": "error",
"ErrorMsg": "价格不能为空",
"Module": { "orderNumber": "" },
"RequestId": req.requestId,
"Success": false
}
}
if (!pobj.RegisterNumber) {
return {
"ErrorCode": "error",
"ErrorMsg": "商标注册号不能为空",
"Module": { "orderNumber": "" },
"RequestId": req.requestId,
"Success": false
}
}
if (!pobj.Classification) {
return {
"ErrorCode": "error",
"ErrorMsg": "商标国际一级分类不能为空",
"Module": { "orderNumber": "" },
"RequestId": req.requestId,
"Success": false
}
}
var sobj = {
"actionProcess": "aliyuntmtransfer",
"actionType": "aliclient",
"sign": "2FviZ9PGws8Pt1fBhq0t90mjUvI",
"isUser": "yes",
"actionBody": {
"itemCode": "alitmtt",
"channelParams": pobj,
"channelUser": {
"channelUserId": pobj.Mobile,
"channelUserName": pobj.UserName,
"channelUserMoblie": pobj.Mobile,
"nickname": "",
"orgName": "",
"orgPath": ""
},
"channelOrder": {
"channelServiceNo": pobj.BizId,
"channelOrderNo": "",
"needNo": pobj.BizId,
"quantity": 1,
"totalSum": parseInt(pobj.Price),
"payTotalSum": parseInt(pobj.Price) * 0.2,
"payStatus": "bfyfk",
"payTime": (new Date()).Format("yyyy-MM-dd hh:mm:ss")
}
"bizId": pobj.BizId,
"userName": pobj.UserName,
"mobile": pobj.Mobile,
"registerNumber": pobj.RegisterNumber,
"classification": pobj.Classification,
"price": pobj.price
}
}
// 获取token
var tokenInfo = await this.getToken();
if (tokenInfo.status != 0) {
return {
"ErrorCode": "error",
"ErrorMsg": "网络错误",
"Module": { "orderNumber": "" },
"RequestId": req.requestId,
"Success": false
};
}
// 获取userpin
var userparam = {
actionType: "getLoginByUserName",
actionBody: {
"channelUserId": pobj.Mobile,
"mobile": pobj.Mobile,
"userName": pobj.Mobile
}
};
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 {
"ErrorCode": "error",
"ErrorMsg": "网络错误",
"Module": { "orderNumber": "" },
"RequestId": req.requestId,
"Success": false
};
}
// 调取channel 开始业务
var url = this.channelApiUrl + "/action/tradetransfer/createtransfer";
var rtn = await this.execlient.execPostTK(sobj, url, tokenInfo.data.token);
//var rtn = await this.execlient.execPostTK(sobj, url,"token");
// 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;
}
//订单查询
......
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