Commit 065f9b0a by 宋毅

Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel

parents a834e98f 3e6ce91c
var APIBase = require("../../api.base");
var system = require("../../../system");
class AliyunApi extends APIBase {
constructor() {
super();
this.aliclient = system.getObject("util.aliyunClient");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionProcess, pobj.actionType, pobj.actionBody, req);
return result;
}
async opActionProcess(pobj, action_process, action_type, action_body, req) {
pobj.requestId = req.requestId;
var opResult = null;
switch (action_type) {
case "queryAvailabelNumbers":// 获取可用外呼号码列表
opResult = await this.aliclient.queryAvailabelNumbers(pobj.actionBody.bizType);
break;
case "startBackToBackCall":// 发起双呼接口
opResult = await this.aliclient.startBackToBackCall(pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = AliyunApi;
\ No newline at end of file
...@@ -183,7 +183,7 @@ class Order extends APIBase { ...@@ -183,7 +183,7 @@ class Order extends APIBase {
requestUrl: "/icp/order/notify", requestUrl: "/icp/order/notify",
requestjson: JSON.stringify(pobj),//请求地址 requestjson: JSON.stringify(pobj),//请求地址
pushUrl: "/action/intentionapi/springBoard",//调用地址 pushUrl: "/action/intentionapi/springBoard",//调用地址
pushActionType: "icpNotifyNew",//调用参数 pushActionType: "icpOrderStatus",//调用参数
pushtimes: 0,//推送次数 pushtimes: 0,//推送次数
pushStatus: "wts",//推送状态 pushStatus: "wts",//推送状态
} }
......
...@@ -77,37 +77,13 @@ class utils360Sve extends AppServiceBase { ...@@ -77,37 +77,13 @@ class utils360Sve extends AppServiceBase {
} }
let result = await this.restPostUrl(pushObj, url); let result = await this.restPostUrl(pushObj, url);
if (result.code == 200) { if (result.code == 200) {
this.pushlogSve.createDb({ this.disposePushResult(pobj, result, "utils360Sve---pushOrderStatus--推送成功", 4);
op: "360-pushOrderStatus",
content: JSON.stringify(pushObj),//推送的参数信息
resultInfo: JSON.stringify(result),
returnType: '1',
logLevel: 1,
opTitle: "推送360信息返回成功"
});
} else { } else {
this.logCtl.error({ this.disposePushResultFail(pobj, result, "utils360Sve---pushOrderStatus--推送失败", 4);
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "utilsSve/utils360Sve/pushOrderStatus",
content: "error:" + result.msg,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常status->pushOrderStatus",
});
} }
console.log(result, '-------------push360-----------------')
return result; return result;
} catch (e) { } catch (e) {
this.logCtl.error({ this.disposePushResultFail(pobj, e.stack, "utils360Sve---pushOrderStatus", 4);
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "utilsSve/utils360Sve/pushOrderStatus",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常status->pushOrderStatus",
});
} }
} }
...@@ -132,63 +108,40 @@ class utils360Sve extends AppServiceBase { ...@@ -132,63 +108,40 @@ class utils360Sve extends AppServiceBase {
} }
let params = actionBody.itemCode.join(','); let params = actionBody.itemCode.join(',');
let url = settings.requestUrl360() + `api/v1/eshop/GetGoodsLowestPrice?sku_ids=${params}`; let url = settings.requestUrl360() + `api/v1/eshop/GetGoodsLowestPrice?sku_ids=${params}`;
let rtn = await this.restClient.execGet("",url); let rtn = await this.restClient.execGet("", url);
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return system.getResult(null, "restGet data is empty"); return system.getResult(null, "restGet data is empty");
} }
let result = JSON.parse(rtn.stdout); let result = JSON.parse(rtn.stdout);
if(result.code != 200){ if (result.code != 200) {
return system.getResultFail(-1,result.msg) return system.getResultFail(-1, result.msg)
} }
return system.getResultSuccess(result.data); return system.getResultSuccess(result.data);
} }
async pushTmOrderStatus(pobj){ async pushTmOrderStatus(pobj) {
let token = await this.utilsAuthSve.get360Token(); try {
let url = settings.pushUrl360() + 'api/v1/eshop/GsbOrderUpdate?token=' + token.access_token; let token = await this.utilsAuthSve.get360Token();
let order_id = pobj.orderNo; let url = settings.pushUrl360() + 'api/v1/eshop/GsbOrderUpdate?token=' + token.access_token;
let sub_status = pobj.sub_status; let order_id = pobj.orderNo;
let status = pobj.status; let sub_status = pobj.sub_status;
let pushObj = { let status = pobj.status;
order_id, let pushObj = {
status, order_id,
sub_status: sub_status status,
} sub_status: sub_status
let result = await this.restPostUrl(pushObj, url); }
if (result.code == 200) { let result = await this.restPostUrl(pushObj, url);
this.pushlogSve.createDb({ if (result.code == 200) {
op: "360-pushTMOrderStatus", this.disposePushResult(pobj, result, "utils360Sve---pushTmOrderStatus--推送成功", 4)
content: JSON.stringify(pushObj),//推送的参数信息 } else {
resultInfo: JSON.stringify(result), this.disposePushResultFail(pobj, result, "utils360Sve---pushTmOrderStatus--推送失败", 4);
returnType: '1', }
logLevel: 1, return result;
opTitle: "推送360信息返回成功" } catch (e) {
}); this.disposePushResultFail(pobj, e.stack, "utils360Sve---pushTmOrderStatus--推送失败", 4);
} else {
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "utilsSve/utils360Sve/pushTMOrderStatus",
content: "error:" + result.msg,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常status->pushTMOrderStatus",
});
} }
console.log(result, '-------------push360-----------------')
return result;
} catch (e) {
this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "",
op: "utilsSve/utils360Sve/pushTMOrderStatus",
content: "error:" + e.stack,
// clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常status->pushOrderStatus",
});
}
}
} }
module.exports = utils360Sve; module.exports = utils360Sve;
...@@ -11,34 +11,33 @@ class UtilsDeliverSystemService extends AppServiceBase { ...@@ -11,34 +11,33 @@ class UtilsDeliverSystemService extends AppServiceBase {
/** /**
* 推送业务信息到交付系统 * 推送业务信息到交付系统
* 业务操作的信息不变外加增加组装的一些参数(推送需求商机、关闭需求、订单商机、关闭订单) * 业务操作的信息不变外加增加组装的一些参数(推送需求商机、关闭需求、订单商机、关闭订单)
* @param {*} pobj * @param {*} pobj
*/ */
async pushBusiness2DeliverSystem(pobj) {//推送业务信息到交付系统 async pushBusiness2DeliverSystem(pobj) {//推送业务信息到交付系统
console.log(pobj,"pushBusiness2DeliverSystem-zhuangbing------------------------------");
var verifyResult = await this.verifyParam(pobj); var verifyResult = await this.verifyParam(pobj);
if (verifyResult.status != 0) { if (verifyResult.status != 0) {
return await this.disposePushResultFail(pobj, verifyResult, "deliver->pushBusiness2DeliverSystem->verifyResult", this.pushlogFailType.FQ); return await this.disposePushResultFail(pobj, verifyResult, "deliver->pushBusiness2DeliverSystem->verifyResult", this.pushlogFailType.FQ);
} }
var interface_params_info = verifyResult.data; var interface_params_info = verifyResult.data;
if(interface_params_info.headData){ // var reqParams = {
if(pobj && pobj.appInfo && pobj.appInfo.app_code){ // actionType: "produceData",// Y 功能名称
interface_params_info.headData.appcode = pobj.appInfo.app_code; // actionBody: {
} // pushUrl: interface_params_info.pushUrl,// Y 推送地址
} // actionType: interface_params_info.actionType,// Y 推送地址接收时的功能名称
var reqParams = { // notifyUrl: interface_params_info.notifyUrl || "",// N 推送成功后通知的Url
actionType: "produceData",// Y 功能名称 // identifyCode: interface_params_info.identifyCode,// Y 操作的业务标识
actionBody: { // messageBody: pobj.actionBody, // Y 推送的业务消息,必须有一项对象属性值
pushUrl: interface_params_info.pushUrl,// Y 推送地址 // headData: interface_params_info.headData //N 请求头信息,Json格式,如:{token:"XXXXXXX"}
actionType: interface_params_info.actionType,// Y 推送地址接收时的功能名称 // },
notifyUrl: interface_params_info.notifyUrl || "",// N 推送成功后通知的Url // requestId: pobj.requestId || "" // N 请求id
identifyCode: interface_params_info.identifyCode,// Y 操作的业务标识 // }
messageBody: pobj.actionBody, // Y 推送的业务消息,必须有一项对象属性值 let parms = {
headData: interface_params_info.headData //N 请求头信息,Json格式,如:{token:"XXXXXXX"} actionType:interface_params_info.actionType,
}, actionBody: pobj.actionBody
requestId: pobj.requestId || "" // N 请求id
} }
var opQueuePushClientPostRes = await this.opQueuePushClientPost(pobj, this.opPushQueueUrl, reqParams); let url = interface_params_info.opUrl;
console.log(opQueuePushClientPostRes,"pushBusiness2DeliverSystem-zhuangbing----2--------------------------"); var opQueuePushClientPostRes = await this.opQueuePushClientPost(pobj, url, parms);
return await this.disposePushResult(pobj, opQueuePushClientPostRes, "delivery->pushBusiness2DeliverSystem->result", this.pushlogFailType.FQ);
} }
//--------------------------------------------------内部辅助方法-------------------start----------------- //--------------------------------------------------内部辅助方法-------------------start-----------------
...@@ -47,21 +46,22 @@ class UtilsDeliverSystemService extends AppServiceBase { ...@@ -47,21 +46,22 @@ class UtilsDeliverSystemService extends AppServiceBase {
try { try {
var rtn = await this.restPostUrl(reqParams, pushQueueUrl); var rtn = await this.restPostUrl(reqParams, pushQueueUrl);
if (rtn.status != 1) { if (rtn.status != 1) {
this.execClientNew.execLogs(`推送队列接收数据失败->opQueuePushClientPost`, pobj, "center-channel-utilsDeliverSystemSve-opQueuePushClientPost", rtn, JSON.stringify(rtn)); this.execClientNew.execLogs(`推送资质宝失败->opQueuePushClientPost`, pobj, "center-channel-utilsDeliverSystemSve-opQueuePushClientPost", rtn, JSON.stringify(rtn));
return system.getResult(null, "推送队列接收数据失败,失败原因:" + JSON.stringify(rtn)); return system.getResult(null, "推送资质宝失败,失败原因:" + JSON.stringify(rtn));
} }
return system.getResultSuccess(null, "推送成功"); return system.getResultSuccess(null, "推送成功");
} catch (e) { } catch (e) {
//日志记录 //日志记录
this.logCtl.error({ // this.logCtl.error({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", // appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "", // appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
requestId: pobj.requestId || "", // requestId: pobj.requestId || "",
op: "utilsSve/utilsDeliverSystemSve/opQueuePushClientPost", // op: "utilsSve/utilsDeliverSystemSve/opQueuePushClientPost",
content: "error:" + e.stack, // content: "error:" + e.stack,
// clientIp: pobj.clientIp, // // clientIp: pobj.clientIp,
optitle: pobj.opType + "推送操作异常deliver->opQueuePushClientPost", // optitle: pobj.opType + "推送操作异常deliver->opQueuePushClientPost",
}); // });
this.execClientNew.execLogs(`推送资质宝失败->opQueuePushClientPost`, pobj, "center-channel-utilsDeliverSystemSve-opQueuePushClientPost", null, JSON.stringify(e.stack));
return system.getResult(null, "推送操作异常deliver->opQueuePushClientPost->error:" + e.stack); return system.getResult(null, "推送操作异常deliver->opQueuePushClientPost->error:" + e.stack);
} }
} }
...@@ -71,8 +71,8 @@ class UtilsDeliverSystemService extends AppServiceBase { ...@@ -71,8 +71,8 @@ class UtilsDeliverSystemService extends AppServiceBase {
verify = system.getResult(null, "interface_params can not be empty,100400"); verify = system.getResult(null, "interface_params can not be empty,100400");
} }
var interface_params_info = JSON.parse(pobj.interface_params); var interface_params_info = JSON.parse(pobj.interface_params);
if (!interface_params_info || !interface_params_info.pushUrl || !interface_params_info.headData) { if (!interface_params_info || !interface_params_info.opUrl || !interface_params_info.headData) {
verify = system.getResult(null, "interface_params(pushUrl、headData) can not be empty,100430"); verify = system.getResult(null, "interface_params(opUrl、headData) can not be empty,100430");
} }
verify.data = interface_params_info; verify.data = interface_params_info;
return verify; return verify;
......
...@@ -68,11 +68,15 @@ class UtilsNeedService extends AppServiceBase { ...@@ -68,11 +68,15 @@ class UtilsNeedService extends AppServiceBase {
pobj.actionBody.type = "ali.tmd"; pobj.actionBody.type = "ali.tmd";
pobj.actionBody.idempotentSource = "tmd_ali"; pobj.actionBody.idempotentSource = "tmd_ali";
}else if (pobj.actionBody.channel_type_code == 1) { }else if (pobj.actionBody.channel_type_code == 1) {
// 阿里商标交易
pobj.actionBody.type = "ali.tmd"; pobj.actionBody.type = "ali.tmd";
pobj.actionBody.idempotentSource = "tmd_ali"; pobj.actionBody.idempotentSource = "tmd_ali";
pobj.actionBody.contactsDingtalk = pobj.actionBody.idempotentId;
}else if (pobj.actionBody.channel_type_code == 2) { }else if (pobj.actionBody.channel_type_code == 2) {
// 阿里商标注册
pobj.actionBody.type = "ali.tm"; pobj.actionBody.type = "ali.tm";
pobj.actionBody.idempotentSource = "tm_ali"; pobj.actionBody.idempotentSource = "tm_ali";
pobj.actionBody.contactsDingtalk = pobj.actionBody.idempotentId;
}else if (pobj.actionBody.channel_type_code == 'esp.companyreg'){ }else if (pobj.actionBody.channel_type_code == 'esp.companyreg'){
pobj.actionBody.type = "ali.ic"; pobj.actionBody.type = "ali.ic";
pobj.actionBody.idempotentSource = "ic_ali"; pobj.actionBody.idempotentSource = "ic_ali";
...@@ -768,6 +772,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -768,6 +772,7 @@ class UtilsNeedService extends AppServiceBase {
// } // }
pobj.actionBody.data = []; pobj.actionBody.data = [];
await this.queryByAli(pobj, 1); await this.queryByAli(pobj, 1);
pobj.actionBody.data=pobj.actionBody.data.filter(item=>item.Type===1)
pobj.actionType = "getUnCreated"; pobj.actionType = "getUnCreated";
let reqUrl = this.centerOrderUrl + "action/need/springBoard"; let reqUrl = this.centerOrderUrl + "action/need/springBoard";
let result = await this.restPostUrl(pobj, reqUrl); let result = await this.restPostUrl(pobj, reqUrl);
...@@ -776,7 +781,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -776,7 +781,7 @@ class UtilsNeedService extends AppServiceBase {
type: "tmjy" type: "tmjy"
}; };
for (let item of result.data) { for (let item of result.data) {
if (item.Type == 1 && item.RegisterNumber) { if (item.Type == 1) {
pobj.actionBody.intentionBizId = item.BizId; pobj.actionBody.intentionBizId = item.BizId;
pobj.actionBody.mobile = item.Mobile ? item.Mobile : ""; pobj.actionBody.mobile = item.Mobile ? item.Mobile : "";
//pobj.actionBody.Area = item.Area || "北京" //pobj.actionBody.Area = item.Area || "北京"
...@@ -802,10 +807,10 @@ class UtilsNeedService extends AppServiceBase { ...@@ -802,10 +807,10 @@ class UtilsNeedService extends AppServiceBase {
End: pobj.actionBody.End ? pobj.actionBody.End : "", End: pobj.actionBody.End ? pobj.actionBody.End : "",
PageNum: page, PageNum: page,
PageSize: 10, PageSize: 10,
}, apiVersion: "2019-05-08" }, type: "TM"
}); });
if (res.status == 0) { if (res.status == 0) {
pobj.actionBody.data.push(...res.data.Data); pobj.actionBody.data.push(...res.data.Data.Trademark);
if (page < res.data.TotalPageNum) { if (page < res.data.TotalPageNum) {
await this.queryByAli(pobj, page + 1) await this.queryByAli(pobj, page + 1)
} }
......
...@@ -3,7 +3,7 @@ var RPCClient = require('@alicloud/pop-core').RPCClient; ...@@ -3,7 +3,7 @@ var RPCClient = require('@alicloud/pop-core').RPCClient;
const system = require("../system"); const system = require("../system");
class aliyunClient { class aliyunClient {
constructor() { constructor() {
this.execClientNew = system.getObject("util.execClientNew");
this.pushlogSve = system.getObject("service.common.pushlogSve"); this.pushlogSve = system.getObject("service.common.pushlogSve");
} }
getAliClient() { getAliClient() {
...@@ -95,6 +95,77 @@ class aliyunClient { ...@@ -95,6 +95,77 @@ class aliyunClient {
} }
} }
//-----------阿里云双呼能力接口接入------start--------chensicong----2022.01.17----------------------
getAliDoubleCallClient() {
return new RPCClient({
accessKeyId: 'LTAI1pJs7KQizBe2',
accessKeySecret: 'MMNibebAPqR9AnX5YWHnSL2tHMSIoL',
endpoint: "https://companyreg.aliyuncs.com",
apiVersion: '2020-03-06'
});
}
// 获取可用外呼号码列表
async queryAvailabelNumbers(bizType){
let res = null;
try{
console.log(`开始调用阿里云-获取可用外呼号码列表接口。参数bizType=${bizType}`)
// let reqAliclient = this.getAliDoubleCallClient()
var client = new RPCClient({
accessKeyId: 'LTAI1pJs7KQizBe2',
accessKeySecret: 'MMNibebAPqR9AnX5YWHnSL2tHMSIoL',
endpoint: "https://companyreg.aliyuncs.com",
apiVersion: '2020-03-06'
});
let obj = { bizType:bizType }
res = await client.request("QueryAvailableNumbers", obj, {
timeout: 3000, // default 3000 ms
formatAction: true, // default true, format the action to Action
formatParams: true, // default true, format the parameter name to first letter upper case
method: 'POST', // set the http method, default is GET
headers: {}, // set the http request headers
});
console.log(`结束调用阿里云-获取可用外呼号码列表接口。参数bizType=${bizType},结果=${res}`)
this.execClientNew.execLogs(`获取可用外呼号码列表成功`, {bizType:bizType}, "center-channel-aliyunClient-queryAvailabelNumbers", res, null);
return system.getResultSuccess(res.data);
}catch (e){
console.log(`调用异常:阿里云-获取可用外呼号码列表接口。参数bizType=${bizType},结果=${res},异常信息=${e.stack}`)
this.execClientNew.execLogs(`获取可用外呼号码列表失败接口`, {bizType:bizType}, "center-channel-aliyunClient-queryAvailabelNumbers", res, JSON.stringify(e.stack));
return system.getResultFail(-200, "api调用出现异常,error:" + e.stack);
}
}
/**
* 发起双呼
* @param reqbody
* @returns {Promise<{msg: *, data: *, status: *}|{msg: *, data, status: number}>}
*/
async startBackToBackCall(reqbody){
let res = null;
try{
console.log(`开始调用阿里云-发起双呼接口。参数reqbody`,reqbody)
let reqAliclient = this.getAliDoubleCallClient()
res = await reqAliclient.request("StartBackToBackCall",reqbody, {
timeout: 10000, // default 3000 ms 2020 0916 lin修改3000为10000,原因ConfirmIcpIntention BizIds 超过5条会超时
formatAction: true, // default true, format the action to Action
formatParams: true, // default true, format the parameter name to first letter upper case
method: 'POST', // set the http method, default is GET
headers: {}, // set the http request headers
});
console.log(`结束调用阿里云-发起双呼接口。参数reqbody=`,reqbody,'结果=',res)
this.execClientNew.execLogs(`获取可用外呼号码列表成功`, reqbody, "center-channel-aliyunClient-queryAvailabelNumbers", res, null);
return system.getResultSuccess(res.data);
}catch (e){
console.log(`调用异常:阿里云-发起双呼接口。参数reqbody=`,reqbody,'结果=',res,`异常信息=${e.stack}`)
this.execClientNew.execLogs(`调用阿里云发起双呼接口失败`, reqbody, "center-channel-aliyunClient-startBackToBackCall", res, JSON.stringify(e.stack));
return system.getResultFail(-200, "api调用出现异常,error:" + e.stack);
}
}
//-----------阿里云双呼能力接口接入------start--------chensicong----2022.01.17----------------------
// 2020 0924 lin 新增 // 2020 0924 lin 新增
async reqbyLTget(obj, cbk) { async reqbyLTget(obj, cbk) {
var action = obj.action; var action = obj.action;
......
...@@ -2,8 +2,10 @@ const crypto = require('crypto'); ...@@ -2,8 +2,10 @@ const crypto = require('crypto');
const sha256 = require('sha256'); const sha256 = require('sha256');
const system = require("../system"); const system = require("../system");
var settings = require("../../config/settings"); var settings = require("../../config/settings");
class baiduClient { const AppServiceBase = require("../service/app.base");
class baiduClient extends AppServiceBase{
constructor() { constructor() {
super();
this.pushlogSve = system.getObject("service.common.pushlogSve"); this.pushlogSve = system.getObject("service.common.pushlogSve");
this.execClient = system.getObject("util.execClient"); this.execClient = system.getObject("util.execClient");
this.baiduClientParams = settings.baiduClientParams(); this.baiduClientParams = settings.baiduClientParams();
...@@ -50,11 +52,9 @@ class baiduClient { ...@@ -50,11 +52,9 @@ class baiduClient {
data:actionBody data:actionBody
} }
var rtn = await this.execClient.execBaiduPost(baiduObj, url); var rtn = await this.execClient.execBaiduPost(baiduObj, url);
console.log("baiduObj+++++",baiduObj)
console.log("url+++++",url)
console.log("rtn+++++",rtn)
if (!rtn || !rtn.stdout) { if (!rtn || !rtn.stdout) {
return system.getResult(null, "execPost data is empty"); this.execClientNew.execLogs(`baiduClient-opBaiduClientPost-result:url=${url}`, actionBody, "center-channel-opBaiduClientPost", null, rtn);
return system.getResult(null, rtn);
} }
var result = JSON.parse(rtn.stdout); var result = JSON.parse(rtn.stdout);
return result; return result;
...@@ -74,28 +74,33 @@ class baiduClient { ...@@ -74,28 +74,33 @@ class baiduClient {
host:this.baiduClientParams.host host:this.baiduClientParams.host
}, // set the http request headers }, // set the http request headers
}); });
console.log('baidu++++res+++',res) if(res.status == 0){
this.pushlogSve.createDb({ await this.disposePushResult(obj, res, "baidu->pushBusiness2Baidu->result", "");
op: "new-baiduReqbyget", }else{
content: JSON.stringify(obj),//推送的参数信息 await this.disposePushResultFail(obj, res, "badiu->pushBusiness2Baidu->catchError", this.pushlogFailType.FAILLOG);
resultInfo: JSON.stringify(res), }
returnType: '1', // this.pushlogSve.createDb({
logLevel: '1', // op: "new-baiduReqbyget",
opTitle: "new-baiduReqbyget推送百度信息返回成功" // content: JSON.stringify(obj),//推送的参数信息
}); // resultInfo: JSON.stringify(res),
// returnType: '1',
// logLevel: '1',
// opTitle: "new-baiduReqbyget推送百度信息返回成功"
// });
return system.getResultSuccess(res); return system.getResultSuccess(res);
} catch (e) { } catch (e) {
this.pushlogSve.createFailLogDb({ await this.disposePushResultFail(obj, e, "badiu->pushBusiness2Baidu->catchError", this.pushlogFailType.FAILLOG);
appid: obj.appInfo ? obj.appInfo.uapp_id || "" : "", // this.pushlogSve.createFailLogDb({
appkey: obj.appInfo ? obj.appInfo.uapp_key || "" : "", // appid: obj.appInfo ? obj.appInfo.uapp_id || "" : "",
requestId: obj.requestId || "", // appkey: obj.appInfo ? obj.appInfo.uapp_key || "" : "",
content: JSON.stringify(obj),//推送的参数信息 // requestId: obj.requestId || "",
resultInfo: "error:" + JSON.stringify(e), // content: JSON.stringify(obj),//推送的参数信息
clientIp: obj.clientIp || "", // resultInfo: "error:" + JSON.stringify(e),
failType: 1, // clientIp: obj.clientIp || "",
opTitle: "new-baiduReqbyget推送百度信息返回异常", // failType: 1,
pushNumber: obj.pushNumber || 1 // opTitle: "new-baiduReqbyget推送百度信息返回异常",
}); // pushNumber: obj.pushNumber || 1
// });
return system.getResultFail(-200, "出现异常,error:" + e.stack); return system.getResultFail(-200, "出现异常,error:" + e.stack);
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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