Commit 1333a2eb by 兰国旗

关闭订单优化

parent 3033cb38
...@@ -52,11 +52,11 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -52,11 +52,11 @@ class UtilsNeedSve extends AppServiceBase {
var self = this; var self = this;
var tokenInfo = await this.getCenterToken(); var tokenInfo = await this.getCenterToken();
if (tokenInfo.status != 0) { if (tokenInfo.status != 0) {
return this.getResult(self.getUUID(),"getTokenInfo fail") return this.getResult(self.getUUID(), "getTokenInfo fail")
} }
var userpin = ""; var userpin = "";
if(pobj.phone&&!pobj.mobile){ if (pobj.phone && !pobj.mobile) {
pobj.mobile=pobj.phone; pobj.mobile = pobj.phone;
} }
if (pobj.mobile) { if (pobj.mobile) {
//获取用户userpin //获取用户userpin
...@@ -79,7 +79,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -79,7 +79,7 @@ class UtilsNeedSve extends AppServiceBase {
if (!userpin) { if (!userpin) {
return system.getResultFail(-88, "获取userpin失败!!"); return system.getResultFail(-88, "获取userpin失败!!");
} }
} }
//带userpin请求 //带userpin请求
url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard"; url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
...@@ -93,18 +93,18 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -93,18 +93,18 @@ class UtilsNeedSve extends AppServiceBase {
if (rtn.status == 0) { if (rtn.status == 0) {
return this.getResult(rtn.requestId) return this.getResult(rtn.requestId)
} else { } else {
return this.getResult(rtn.requestId,rtn.msg) return this.getResult(rtn.requestId, rtn.msg)
} }
} }
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (result.status == 0) { if (result.status == 0) {
return this.getResult(result.requestId) return this.getResult(result.requestId)
} else { } else {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
} }
...@@ -123,7 +123,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -123,7 +123,7 @@ class UtilsNeedSve extends AppServiceBase {
"secret": reqParam.uapp_secret "secret": reqParam.uapp_secret
} }
}; };
var rtn = await this.execlient.execPost(param, reqTokenUrl); var rtn = await this.execlient.execPost(param, reqTokenUrl);
if (!rtn.stdout) { if (!rtn.stdout) {
return system.getResult(null, "获取token失败"); return system.getResult(null, "获取token失败");
...@@ -140,17 +140,17 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -140,17 +140,17 @@ class UtilsNeedSve extends AppServiceBase {
"actionType": pobj.action_type, "actionType": pobj.action_type,
"actionBody": pobj "actionBody": pobj
} }
if(!pobj.appInfo || !pobj.appInfo.uapp_key || !pobj.appInfo.uapp_secret){ if (!pobj.appInfo || !pobj.appInfo.uapp_key || !pobj.appInfo.uapp_secret) {
return this.getResult(self.getUUID(),"无效应用") return this.getResult(self.getUUID(), "无效应用")
} }
var self = this; var self = this;
var tokenInfo = await this.getCenterTokenByApp(pobj.appInfo); var tokenInfo = await this.getCenterTokenByApp(pobj.appInfo);
if (tokenInfo.status != 0) { if (tokenInfo.status != 0) {
return this.getResult(self.getUUID(),"getTokenInfo fail") return this.getResult(self.getUUID(), "getTokenInfo fail")
} }
var userpin = ""; var userpin = "";
if(pobj.phone&&!pobj.mobile){ if (pobj.phone && !pobj.mobile) {
pobj.mobile=pobj.phone; pobj.mobile = pobj.phone;
} }
if (pobj.mobile) { if (pobj.mobile) {
//获取用户userpin //获取用户userpin
...@@ -173,7 +173,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -173,7 +173,7 @@ class UtilsNeedSve extends AppServiceBase {
if (!userpin) { if (!userpin) {
return system.getResultFail(-88, "获取userpin失败!!"); return system.getResultFail(-88, "获取userpin失败!!");
} }
} }
//带userpin请求 //带userpin请求
url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard"; url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
...@@ -187,25 +187,25 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -187,25 +187,25 @@ class UtilsNeedSve extends AppServiceBase {
if (rtn.status == 0) { if (rtn.status == 0) {
return this.getResult(rtn.requestId) return this.getResult(rtn.requestId)
} else { } else {
return this.getResult(rtn.requestId,rtn.msg) return this.getResult(rtn.requestId, rtn.msg)
} }
} }
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (result.status == 0) { if (result.status == 0) {
return this.getResult(result.requestId) return this.getResult(result.requestId)
} else { } else {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
} }
//百度icp 2.3 请求 //百度icp 2.3 请求
async icpOrderStatus(pobj) { async icpOrderStatus(pobj) {
var self = this; var self = this;
if(!pobj.appInfo || !pobj.appInfo.uapp_key || !pobj.appInfo.uapp_secret){ if (!pobj.appInfo || !pobj.appInfo.uapp_key || !pobj.appInfo.uapp_secret) {
return this.getResult(self.getUUID(),"无效应用") return this.getResult(self.getUUID(), "无效应用")
} }
// 获取app token // 获取app token
// var tokenInfo = await this.getCenterToken(); // var tokenInfo = await this.getCenterToken();
...@@ -221,7 +221,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -221,7 +221,7 @@ class UtilsNeedSve extends AppServiceBase {
actionType: "getLoginByUserName", actionType: "getLoginByUserName",
actionBody: {} actionBody: {}
}; };
if (pobj.isDirectBuy==1){//直购 if (pobj.isDirectBuy == 1) {//直购
userparam.actionBody.channelUserId = pobj.phone userparam.actionBody.channelUserId = pobj.phone
userparam.actionBody.mobile = pobj.phone userparam.actionBody.mobile = pobj.phone
userparam.actionBody.userName = pobj.phone userparam.actionBody.userName = pobj.phone
...@@ -346,7 +346,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -346,7 +346,7 @@ class UtilsNeedSve extends AppServiceBase {
} }
} }
pobj.province = pobj.area; pobj.province = pobj.area;
}else { } else {
var sobj = { var sobj = {
"actionType": "getItemByChannelSolutionNo", "actionType": "getItemByChannelSolutionNo",
"actionBody": pobj "actionBody": pobj
...@@ -355,7 +355,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -355,7 +355,7 @@ class UtilsNeedSve extends AppServiceBase {
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
var result = await this.execlient.execPostTK(sobj, url, token); var result = await this.execlient.execPostTK(sobj, url, token);
if (result.status != 0) { if (result.status != 0) {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
userparam.actionBody.channelUserId = result.data.channelUserId userparam.actionBody.channelUserId = result.data.channelUserId
userparam.actionBody.mobile = result.data.publishMobile userparam.actionBody.mobile = result.data.publishMobile
...@@ -369,7 +369,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -369,7 +369,7 @@ class UtilsNeedSve extends AppServiceBase {
var url = settings.centerChannelUrl() + "/api/opreceive/accessAuth/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/accessAuth/springBoard";
var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token); var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token);
if (userpinResultTmp.status != 0) { if (userpinResultTmp.status != 0) {
return this.getResult(userpinResultTmp.requestId,userpinResultTmp.msg) return this.getResult(userpinResultTmp.requestId, userpinResultTmp.msg)
} }
// icpNotify // icpNotify
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
...@@ -377,21 +377,21 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -377,21 +377,21 @@ class UtilsNeedSve extends AppServiceBase {
"actionType": "icpNotifyNew", "actionType": "icpNotifyNew",
"actionBody": pobj "actionBody": pobj
} }
var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token,userpinResultTmp.data.userpin); var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpinResultTmp.data.userpin);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (result.status != 0) { if (result.status != 0) {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
return this.getResult(result.requestId) return this.getResult(result.requestId)
} }
//百度icp 2.4 请求 关闭icp订单 //百度icp 2.4 请求 关闭icp订单
async icpOrderClose(pobj) { async icpOrderClose(pobj) {
var self = this; var self = this;
if(!pobj.appInfo || !pobj.appInfo.uapp_key || !pobj.appInfo.uapp_secret){ if (!pobj.appInfo || !pobj.appInfo.uapp_key || !pobj.appInfo.uapp_secret) {
return this.getResult(self.getUUID(),"无效应用") return this.getResult(self.getUUID(), "无效应用")
} }
// 获取app token // 获取app token
// var tokenInfo = await this.getCenterToken(); // var tokenInfo = await this.getCenterToken();
...@@ -408,42 +408,62 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -408,42 +408,62 @@ class UtilsNeedSve extends AppServiceBase {
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
var result = await this.execlient.execPostTK(sobj, url, token); var result = await this.execlient.execPostTK(sobj, url, token);
if (result.status != 0 || !result.data) { if (result.status != 0 || !result.data) {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
//此判断影响阿里退款,先注释掉 //阿里方案没有手机号,就从订单信息里拿
// if(!result.data.solutionContent || !result.data.solutionContent.customerInfo || !result.data.solutionContent.customerInfo.publishMobile){ if (!result.data.solutionContent || !result.data.solutionContent.customerInfo || !result.data.solutionContent.customerInfo.publishMobile) {
// return this.getResult(result.requestId,"方案客户信息有误") // getOrderInfoByChannelOrderNo
// } var sobj1 = {
// 获取userpin "actionType": "getOrderInfoByChannelOrderNo",
var userparam = { "actionBody": pobj
actionType: "getLoginByUserName",
actionBody: {
channelUserId:result.data.solutionContent.customerInfo.publishMobile,
mobile:result.data.solutionContent.customerInfo.publishMobile,
userName:result.data.solutionContent.customerInfo.publishMobile
} }
}; var url1 = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
var result1 = await this.execlient.execPostTK(sobj1, url1, token);
if (result1.status != 0 || !result1.data) {
return this.getResult(result1.requestId, result1.msg)
}
// 获取userpin
var userparam = {
actionType: "getLoginByUserName",
actionBody: {
channelUserId: result1.data.channelUserId,
mobile: result1.data.channelUserId,
userName: result1.data.channelUserId
}
};
// return this.getResult(result.requestId, "方案客户信息有误")
} else {
// 获取userpin
var userparam = {
actionType: "getLoginByUserName",
actionBody: {
channelUserId: result.data.solutionContent.customerInfo.publishMobile,
mobile: result.data.solutionContent.customerInfo.publishMobile,
userName: result.data.solutionContent.customerInfo.publishMobile
}
};
}
var url = settings.centerChannelUrl() + "/api/opreceive/accessAuth/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/accessAuth/springBoard";
var userpinResultTmp = await this.execlient.execPostTK(userparam, url, token); var userpinResultTmp = await this.execlient.execPostTK(userparam, url, token);
if (userpinResultTmp.status != 0) { if (userpinResultTmp.status != 0) {
return this.getResult(userpinResultTmp.requestId,userpinResultTmp.msg) return this.getResult(userpinResultTmp.requestId, userpinResultTmp.msg)
} }
var closeobj = { var closeobj = {
"actionType": "icpOrderClose", "actionType": "icpOrderClose",
"actionBody": pobj "actionBody": pobj
} }
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
var rtn = await this.execlient.execDataPostByTokenUserPin(closeobj, url, token,userpinResultTmp.data.userpin); var rtn = await this.execlient.execDataPostByTokenUserPin(closeobj, url, token, userpinResultTmp.data.userpin);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (result.status != 0) { if (result.status != 0) {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
return this.getResult(result.requestId) return this.getResult(result.requestId)
} }
// -------------提交Icp需求--------庄冰2020.10.21-------百度Icp接入使用--------end------------------ // -------------提交Icp需求--------庄冰2020.10.21-------百度Icp接入使用--------end------------------
async paySuccess(pobj) { async paySuccess(pobj) {
var sobj = { var sobj = {
"actionType": pobj.action_type, "actionType": pobj.action_type,
...@@ -472,12 +492,12 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -472,12 +492,12 @@ class UtilsNeedSve extends AppServiceBase {
var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token); var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token);
if (userpinResultTmp.status != 0 && userpinResultTmp.status != 2060) { if (userpinResultTmp.status != 0 && userpinResultTmp.status != 2060) {
// return { "message": "网络错误", "data": {}, "code": -102 } // return { "message": "网络错误", "data": {}, "code": -102 }
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
userpin = userpinResultTmp.data.userpin; userpin = userpinResultTmp.data.userpin;
if (!userpin) { if (!userpin) {
// return { "message": "网络错误", "data": {}, "code": -102 } // return { "message": "网络错误", "data": {}, "code": -102 }
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
} }
//带userpin请求 //带userpin请求
...@@ -486,7 +506,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -486,7 +506,7 @@ class UtilsNeedSve extends AppServiceBase {
var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin); var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
// return { "message": "网络错误", "data": {}, "code": -102 } // return { "message": "网络错误", "data": {}, "code": -102 }
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (result.status == 0) { if (result.status == 0) {
...@@ -494,7 +514,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -494,7 +514,7 @@ class UtilsNeedSve extends AppServiceBase {
return this.getResult(result.requestId) return this.getResult(result.requestId)
} else { } else {
// return { "message": result.msg, "data": {}, "code": -102 } // return { "message": result.msg, "data": {}, "code": -102 }
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
} }
...@@ -515,11 +535,11 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -515,11 +535,11 @@ class UtilsNeedSve extends AppServiceBase {
if (rtn.status == 0) { if (rtn.status == 0) {
return this.getResult(rtn.requestId) return this.getResult(rtn.requestId)
} else { } else {
return this.getResult(rtn.requestId,rtn.msg) return this.getResult(rtn.requestId, rtn.msg)
} }
} }
//商标建案后通知启服通保存TM_单号 //商标建案后通知启服通保存TM_单号
async tmNotifyChannel(pobj){ async tmNotifyChannel(pobj) {
var tokenInfo = await this.getCenterToken(); var tokenInfo = await this.getCenterToken();
if (tokenInfo.status != 0) { if (tokenInfo.status != 0) {
return this.getResult(self.getUUID()) return this.getResult(self.getUUID())
...@@ -539,7 +559,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -539,7 +559,7 @@ class UtilsNeedSve extends AppServiceBase {
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
var result = await this.execlient.execPostTK(sobj, url, token); var result = await this.execlient.execPostTK(sobj, url, token);
if (result.status != 0) { if (result.status != 0) {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
userparam.actionBody.channelUserId = result.data.channelUserId userparam.actionBody.channelUserId = result.data.channelUserId
userparam.actionBody.mobile = result.data.publishMobile userparam.actionBody.mobile = result.data.publishMobile
...@@ -552,20 +572,20 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -552,20 +572,20 @@ class UtilsNeedSve extends AppServiceBase {
var url = settings.centerChannelUrl() + "/api/opreceive/accessAuth/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/accessAuth/springBoard";
var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token); var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token);
if (userpinResultTmp.status != 0) { if (userpinResultTmp.status != 0) {
return this.getResult(userpinResultTmp.requestId,userpinResultTmp.msg) return this.getResult(userpinResultTmp.requestId, userpinResultTmp.msg)
} }
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
var sobj = { var sobj = {
"actionType": "tmNotifySub", "actionType": "tmNotifySub",
"actionBody": pobj "actionBody": pobj
} }
var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token,userpinResultTmp.data.userpin); var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpinResultTmp.data.userpin);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return this.getResult(this.getUUID(),"网络错误") return this.getResult(this.getUUID(), "网络错误")
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (result.status != 0) { if (result.status != 0) {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
return this.getResult(result.requestId) return this.getResult(result.requestId)
} }
...@@ -585,8 +605,8 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -585,8 +605,8 @@ class UtilsNeedSve extends AppServiceBase {
actionType: "getLoginByUserName", actionType: "getLoginByUserName",
actionBody: {} actionBody: {}
}; };
if (pobj.isDirectBuy === "true"){//直购 if (pobj.isDirectBuy === "true") {//直购
if (!pobj.mobile){ if (!pobj.mobile) {
var sobj = { var sobj = {
"actionType": "getSolutionByChannelSolutionNo", "actionType": "getSolutionByChannelSolutionNo",
"actionBody": pobj "actionBody": pobj
...@@ -594,7 +614,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -594,7 +614,7 @@ class UtilsNeedSve extends AppServiceBase {
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
var result = await this.execlient.execPostTK(sobj, url, token); var result = await this.execlient.execPostTK(sobj, url, token);
if (result.status != 0) { if (result.status != 0) {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
pobj.mobile = result.data.solutionContent.customerInfo.publishMobile pobj.mobile = result.data.solutionContent.customerInfo.publishMobile
} }
...@@ -602,10 +622,10 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -602,10 +622,10 @@ class UtilsNeedSve extends AppServiceBase {
userparam.actionBody.mobile = pobj.mobile userparam.actionBody.mobile = pobj.mobile
userparam.actionBody.userName = pobj.mobile userparam.actionBody.userName = pobj.mobile
pobj.publishMobile = pobj.mobile pobj.publishMobile = pobj.mobile
pobj.channelTypeCode = pobj.bizId.startsWith("EDI")?7:5; pobj.channelTypeCode = pobj.bizId.startsWith("EDI") ? 7 : 5;
//pobj.province = pobj.companyLocation+`(${pobj.actionType})` //pobj.province = pobj.companyLocation+`(${pobj.actionType})`
pobj.province = pobj.area pobj.province = pobj.area
}else { } else {
var sobj = { var sobj = {
"actionType": "getItemByChannelSolutionNo", "actionType": "getItemByChannelSolutionNo",
"actionBody": pobj "actionBody": pobj
...@@ -614,12 +634,12 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -614,12 +634,12 @@ class UtilsNeedSve extends AppServiceBase {
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
var result = await this.execlient.execPostTK(sobj, url, token); var result = await this.execlient.execPostTK(sobj, url, token);
if (result.status != 0) { if (result.status != 0) {
if (pobj.bizId.startsWith("TM_")){ if (pobj.bizId.startsWith("TM_")) {
let pushres = await this.execPostUrl({ "actionProcess": "AliTm", "appCode": "100099", "sign": await this.getFQbossSign(pobj), actionBody: pobj },settings.fqbossTmUrl()) let pushres = await this.execPostUrl({ "actionProcess": "AliTm", "appCode": "100099", "sign": await this.getFQbossSign(pobj), actionBody: pobj }, settings.fqbossTmUrl())
console.log("商标没查到方案,直接推送fqboos----->",pushres) console.log("商标没查到方案,直接推送fqboos----->", pushres)
return this.getResult(result.requestId, pushres.message) return this.getResult(result.requestId, pushres.message)
} }
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
userparam.actionBody.channelUserId = result.data.channelUserId userparam.actionBody.channelUserId = result.data.channelUserId
userparam.actionBody.mobile = result.data.publishMobile userparam.actionBody.mobile = result.data.publishMobile
...@@ -633,7 +653,7 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -633,7 +653,7 @@ class UtilsNeedSve extends AppServiceBase {
var url = settings.centerChannelUrl() + "/api/opreceive/accessAuth/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/accessAuth/springBoard";
var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token); var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token);
if (userpinResultTmp.status != 0) { if (userpinResultTmp.status != 0) {
return this.getResult(userpinResultTmp.requestId,userpinResultTmp.msg) return this.getResult(userpinResultTmp.requestId, userpinResultTmp.msg)
} }
// icpNotify // icpNotify
var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/need/springBoard";
...@@ -641,13 +661,13 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -641,13 +661,13 @@ class UtilsNeedSve extends AppServiceBase {
"actionType": "icpNotify", "actionType": "icpNotify",
"actionBody": pobj "actionBody": pobj
} }
var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token,userpinResultTmp.data.userpin); var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpinResultTmp.data.userpin);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (result.status != 0) { if (result.status != 0) {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
return this.getResult(result.requestId) return this.getResult(result.requestId)
} }
...@@ -675,18 +695,18 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -675,18 +695,18 @@ class UtilsNeedSve extends AppServiceBase {
var url = settings.centerChannelUrl() + "/api/auth/accessAuth/springBoard"; var url = settings.centerChannelUrl() + "/api/auth/accessAuth/springBoard";
var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token); var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token);
if (userpinResultTmp.status != 0 && userpinResultTmp.status != 2060) { if (userpinResultTmp.status != 0 && userpinResultTmp.status != 2060) {
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
userpin = userpinResultTmp.data.userpin; userpin = userpinResultTmp.data.userpin;
if (!userpin) { if (!userpin) {
// return { "message": "网络错误", "data": {}, "code": -102 } // return { "message": "网络错误", "data": {}, "code": -102 }
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
} }
//带userpin请求 //带userpin请求
url = settings.centerChannelUrl() + "/api/opreceive/edi/springBoard"; url = settings.centerChannelUrl() + "/api/opreceive/edi/springBoard";
// 2020 0927 lin 新增 type 由 esp.wangwen 转换为 wangwen // 2020 0927 lin 新增 type 由 esp.wangwen 转换为 wangwen
if(pobj.type == "esp.wangwen") { if (pobj.type == "esp.wangwen") {
pobj.type == "wangwen" pobj.type == "wangwen"
} }
var sobj = { var sobj = {
...@@ -695,13 +715,13 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -695,13 +715,13 @@ class UtilsNeedSve extends AppServiceBase {
} }
var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin); var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (result.status == 0) { if (result.status == 0) {
return this.getResult(result.requestId) return this.getResult(result.requestId)
} else { } else {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
} }
...@@ -727,12 +747,12 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -727,12 +747,12 @@ class UtilsNeedSve extends AppServiceBase {
var url = settings.centerChannelUrl() + "/api/auth/accessAuth/springBoard"; var url = settings.centerChannelUrl() + "/api/auth/accessAuth/springBoard";
var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token); var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token);
if (userpinResultTmp.status != 0 && userpinResultTmp.status != 2060) { if (userpinResultTmp.status != 0 && userpinResultTmp.status != 2060) {
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
userpin = userpinResultTmp.data.userpin; userpin = userpinResultTmp.data.userpin;
if (!userpin) { if (!userpin) {
// return { "message": "网络错误", "data": {}, "code": -102 } // return { "message": "网络错误", "data": {}, "code": -102 }
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
} }
//带userpin请求 //带userpin请求
...@@ -743,41 +763,41 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -743,41 +763,41 @@ class UtilsNeedSve extends AppServiceBase {
} }
var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin); var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (result.status == 0) { if (result.status == 0) {
return this.getResult(result.requestId) return this.getResult(result.requestId)
} else { } else {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
} }
// 2020 0927 lin 新增 阿里文网文 服务商侧提供接口2.3 服务单通知服务商 // 2020 0927 lin 新增 阿里文网文 服务商侧提供接口2.3 服务单通知服务商
async produceNoticeAliEsp(pobj) { async produceNoticeAliEsp(pobj) {
var tokenInfo = await this.getCenterToken(); var tokenInfo = await this.getCenterToken();
if (tokenInfo.status != 0) { if (tokenInfo.status != 0) {
return this.getResult(this.getUUID()) return this.getResult(this.getUUID())
} }
var token = tokenInfo.data.token; var token = tokenInfo.data.token;
var userpin = ""; var userpin = "";
//带userpin请求 //带userpin请求
var url = settings.centerChannelUrl() + "/api/opreceive/edi/springBoard"; var url = settings.centerChannelUrl() + "/api/opreceive/edi/springBoard";
var sobj = { var sobj = {
"actionType": pobj.action_type, "actionType": pobj.action_type,
"actionBody": pobj "actionBody": pobj
} }
var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin); var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
}
var result = JSON.parse(rtn.stdout);
if (result.status == 0) {
return this.getResult(result.requestId)
} else {
return this.getResult(result.requestId,result.msg)
}
} }
var result = JSON.parse(rtn.stdout);
if (result.status == 0) {
return this.getResult(result.requestId)
} else {
return this.getResult(result.requestId, result.msg)
}
}
// 2020 0928 lin 新增 阿里文网文 服务商侧提供接口2.4 ⽤户⽅案反馈通知服务商 // 2020 0928 lin 新增 阿里文网文 服务商侧提供接口2.4 ⽤户⽅案反馈通知服务商
async soulutionFeebackAliEsp(pobj) { async soulutionFeebackAliEsp(pobj) {
...@@ -795,13 +815,13 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -795,13 +815,13 @@ class UtilsNeedSve extends AppServiceBase {
} }
var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin); var rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return this.getResult(self.getUUID(),"网络错误") return this.getResult(self.getUUID(), "网络错误")
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
if (result.status == 0) { if (result.status == 0) {
return this.getResult(result.requestId) return this.getResult(result.requestId)
} else { } else {
return this.getResult(result.requestId,result.msg) return this.getResult(result.requestId, result.msg)
} }
} }
} }
......
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