Commit 5922ed7f by linboxuan

ali wangwen 2.1-2.4

parent a0f8192b
...@@ -57,8 +57,8 @@ class TradetransferAPI extends APIBase { ...@@ -57,8 +57,8 @@ class TradetransferAPI extends APIBase {
case "produceNoticeAliEsp":// 2020 0927 lin 新增 阿里文网文 服务商侧提供接口2.3 服务单通知服务商 case "produceNoticeAliEsp":// 2020 0927 lin 新增 阿里文网文 服务商侧提供接口2.3 服务单通知服务商
opResult = await this.utilsNeedSve.produceNoticeAliEsp(pobj); opResult = await this.utilsNeedSve.produceNoticeAliEsp(pobj);
break; break;
case "needCloseAliEsp":// 2020 0926 lin 新增 阿里文网文 服务商侧提供接口2.2 关闭需求通知服务商 case "soulutionFeebackAliEsp":// 2020 0928 lin 新增 阿里文网文 服务商侧提供接口2.4 ⽤户⽅案反馈通知服务商
opResult = await this.utilsNeedSve.needCloseAliEsp(pobj); opResult = await this.utilsNeedSve.soulutionFeebackAliEsp(pobj);
break; break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
......
...@@ -390,7 +390,7 @@ class GatewaypushlogService extends ServiceBase { ...@@ -390,7 +390,7 @@ class GatewaypushlogService extends ServiceBase {
pobj.action_type = "needCloseAliEsp"; pobj.action_type = "needCloseAliEsp";
var param = { var param = {
requestId: self.getUUID(), requestId: self.getUUID(),
requestUrl: "/ali/esp/intention/submit", requestUrl: "/ali/esp/intention/close",
requestjson: JSON.stringify(pobj),//请求地址 requestjson: JSON.stringify(pobj),//请求地址
pushUrl: "/action/intentionapi/springBoard",//调用地址 pushUrl: "/action/intentionapi/springBoard",//调用地址
pushActionType: "needCloseAliEsp",//调用参数 pushActionType: "needCloseAliEsp",//调用参数
...@@ -422,7 +422,7 @@ class GatewaypushlogService extends ServiceBase { ...@@ -422,7 +422,7 @@ class GatewaypushlogService extends ServiceBase {
pobj.action_type = "produceNoticeAliEsp"; pobj.action_type = "produceNoticeAliEsp";
var param = { var param = {
requestId: self.getUUID(), requestId: self.getUUID(),
requestUrl: "/ali/esp/intention/submit", requestUrl: "/ali/esp/produce/notice",
requestjson: JSON.stringify(pobj),//请求地址 requestjson: JSON.stringify(pobj),//请求地址
pushUrl: "/action/intentionapi/springBoard",//调用地址 pushUrl: "/action/intentionapi/springBoard",//调用地址
pushActionType: "produceNoticeAliEsp",//调用参数 pushActionType: "produceNoticeAliEsp",//调用参数
...@@ -433,5 +433,28 @@ class GatewaypushlogService extends ServiceBase { ...@@ -433,5 +433,28 @@ class GatewaypushlogService extends ServiceBase {
return self.getResultSuccess(param.requestId); return self.getResultSuccess(param.requestId);
} }
// 2020 0928 lin 新增 阿里文网文 服务商侧提供接口2.4 ⽤户⽅案反馈通知服务商
async soulutionFeebackAliEsp(pobj) {
var self = this;
if (!pobj.solutionBizId) {
return self.getResultFail("solutionBizId is empty");
}
if (!pobj.operateType) {
return self.getResultFail("operateType is empty");
}
pobj.action_type = "soulutionFeebackAliEsp";
var param = {
requestId: self.getUUID(),
requestUrl: "/ali/esp/intention/submit",
requestjson: JSON.stringify(pobj),//请求地址
pushUrl: "/action/intentionapi/springBoard",//调用地址
pushActionType: "soulutionFeebackAliEsp",//调用参数
pushtimes: 0,//推送次数
pushStatus: "wts",//推送状态
}
await self.create(param);
return self.getResultSuccess(param.requestId);
}
} }
module.exports = GatewaypushlogService; module.exports = GatewaypushlogService;
\ No newline at end of file
...@@ -506,12 +506,12 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -506,12 +506,12 @@ class UtilsNeedSve extends AppServiceBase {
} }
} }
// 2020 0926 lin 新增 阿里文网文 服务商侧提供接口2.2 关闭需求通知服务商 // 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 { return {
"requestId": self.getUUID(), "requestId": this.getUUID(),
"success": true, "success": true,
"errorMsg": "", "errorMsg": "",
"errorCode": "ok" "errorCode": "ok"
...@@ -519,20 +519,14 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -519,20 +519,14 @@ class UtilsNeedSve extends AppServiceBase {
} }
var token = tokenInfo.data.token; var token = tokenInfo.data.token;
var userpin = ""; var userpin = "";
if (pobj.mobile) { //带userpin请求
//获取用户userpin url = settings.centerChannelUrl() + "/api/opreceive/edi/springBoard";
var userparam = { var sobj = {
actionType: "getLoginByUserName", "actionType": pobj.action_type,
actionBody: { "actionBody": pobj
"channelUserId": pobj.userId,
"mobile": pobj.mobile,
"userName": pobj.userName ? pobj.userName : pobj.mobile
} }
}; var rtn = rtn = await this.execlient.execDataPostByTokenUserPin(sobj, url, token, userpin);
var self = this; if (!rtn || !rtn.stdout) {
var url = settings.centerChannelUrl() + "/api/auth/accessAuth/springBoard";
var userpinResultTmp = await this.execlient.execPostTK(userparam, url, tokenInfo.data.token);
if (userpinResultTmp.status != 0 && userpinResultTmp.status != 2060) {
return { return {
"requestId": self.getUUID(), "requestId": self.getUUID(),
"success": false, "success": false,
...@@ -540,17 +534,37 @@ class UtilsNeedSve extends AppServiceBase { ...@@ -540,17 +534,37 @@ class UtilsNeedSve extends AppServiceBase {
"errorCode": "ok" "errorCode": "ok"
}; };
} }
userpin = userpinResultTmp.data.userpin; var result = JSON.parse(rtn.stdout);
if (!userpin) { if (result.status == 0) {
// return { "message": "网络错误", "data": {}, "code": -102 }
return { return {
"requestId": self.getUUID(), "requestId": result.requestId,
"success": true,
"errorMsg": "",
"errorCode": "ok"
};
} else {
return {
"requestId": result.requestId,
"success": false, "success": false,
"errorMsg": "网络错误", "errorMsg": result.msg,
"errorCode": "ok" "errorCode": "ok"
}; };
} }
} }
// 2020 0928 lin 新增 阿里文网文 服务商侧提供接口2.4 ⽤户⽅案反馈通知服务商
async soulutionFeebackAliEsp(pobj) {
var tokenInfo = await this.getCenterToken();
if (tokenInfo.status != 0) {
return {
"requestId": self.getUUID(),
"success": true,
"errorMsg": "",
"errorCode": "ok"
};
}
var token = tokenInfo.data.token;
var userpin = "";
//带userpin请求 //带userpin请求
url = settings.centerChannelUrl() + "/api/opreceive/edi/springBoard"; url = settings.centerChannelUrl() + "/api/opreceive/edi/springBoard";
var sobj = { var sobj = {
......
...@@ -313,7 +313,7 @@ module.exports = function (app) { ...@@ -313,7 +313,7 @@ module.exports = function (app) {
await logCtl.applicationOctetStream2Json(req); await logCtl.applicationOctetStream2Json(req);
} }
var client_ip = system.get_client_ip(req); var client_ip = system.get_client_ip(req);
var result = await gatewaypushlogSve.produceNoticeAliEsp(req.body, client_ip); var result = await gatewaypushlogSve.soulutionFeebackAliEsp(req.body, client_ip);
logCtl.info({ logCtl.info({
optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "回调处理订单结果:,method=" + req.body.trxcode, optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "回调处理订单结果:,method=" + req.body.trxcode,
op: "/ali/esp/produce/notice", op: "/ali/esp/produce/notice",
......
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