Commit 4122c4b8 by 宋毅

添加日志

parent f915732c
...@@ -8,42 +8,31 @@ class UtilsDeliverSystemService extends AppServiceBase { ...@@ -8,42 +8,31 @@ class UtilsDeliverSystemService extends AppServiceBase {
super(); super();
this.opPushQueueUrl = settings.opPushQueueUrl(); this.opPushQueueUrl = settings.opPushQueueUrl();
} }
/** /**
* 推送业务信息到交付系统 * 推送业务信息到交付系统
* 业务操作的信息不变外加增加组装的一些参数(推送需求商机、关闭需求、订单商机、关闭订单) * 业务操作的信息不变外加增加组装的一些参数(推送需求商机、关闭需求、订单商机、关闭订单)
* @param {*} pobj * @param {*} pobj
*/ */
async pushBusiness2DeliverSystem(pobj) {//推送业务信息到交付系统 async pushBusiness2DeliverSystem(pobj) {//推送业务信息到交付系统
this.execClientNew.execLogs(`推送资质宝结果->pushBusiness2DeliverSystem`, pobj, "center-channel-utilsDeliverSystemSve-pushBusiness2DeliverSystem", null, null);
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;
// var reqParams = { let params = null
// actionType: "produceData",// Y 功能名称 let headInfo = {}
// actionBody: { if (pobj.appInfo) {
// pushUrl: interface_params_info.pushUrl,// Y 推送地址 headInfo["appcode"] = pobj.appInfo.app_code
// actionType: interface_params_info.actionType,// Y 推送地址接收时的功能名称
// notifyUrl: interface_params_info.notifyUrl || "",// N 推送成功后通知的Url
// identifyCode: interface_params_info.identifyCode,// Y 操作的业务标识
// messageBody: pobj.actionBody, // Y 推送的业务消息,必须有一项对象属性值
// headData: interface_params_info.headData //N 请求头信息,Json格式,如:{token:"XXXXXXX"}
// },
// requestId: pobj.requestId || "" // N 请求id
// }
let params=null
let headInfo={}
if(pobj.appInfo){
headInfo["appcode"]=pobj.appInfo.app_code
params = { params = {
actionType:interface_params_info.actionType, actionType: interface_params_info.actionType,
actionBody: pobj.actionBody, actionBody: pobj.actionBody,
headData:headInfo headData: headInfo
} }
}else{ } else {
params = { params = {
actionType:interface_params_info.actionType, actionType: interface_params_info.actionType,
actionBody: pobj.actionBody actionBody: pobj.actionBody
} }
} }
...@@ -57,26 +46,18 @@ class UtilsDeliverSystemService extends AppServiceBase { ...@@ -57,26 +46,18 @@ class UtilsDeliverSystemService extends AppServiceBase {
async opQueuePushClientPost(pobj, pushQueueUrl, reqParams) { async opQueuePushClientPost(pobj, pushQueueUrl, reqParams) {
try { try {
var rtn = await this.restPostUrl(reqParams, pushQueueUrl); var rtn = await this.restPostUrl(reqParams, pushQueueUrl);
this.execClientNew.execLogs(`推送资质宝结果->opQueuePushClientPost->url:` + pushQueueUrl, reqParams, "center-channel-utilsDeliverSystemSve-opQueuePushClientPost", rtn, null);
if (rtn.status != 1) { if (rtn.status != 1) {
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) {
//日志记录 const stackStr = e.stack ? e.stack : JSON.stringify(e);
// this.logCtl.error({ this.execClientNew.execLogs(`推送操作异常deliver->opQueuePushClientPost`, pobj, "center-channel-utilsDeliverSystemSve-opQueuePushClientPost", null, stackStr);
// appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", return system.getResult(null, "推送操作异常deliver->opQueuePushClientPost->error:" + stackStr);
// appkey: pobj.appInfo ? pobj.appInfo.uapp_key || "" : "",
// requestId: pobj.requestId || "",
// op: "utilsSve/utilsDeliverSystemSve/opQueuePushClientPost",
// content: "error:" + e.stack,
// // clientIp: pobj.clientIp,
// 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);
} }
} }
async verifyParam(pobj) {//参数信息验证 async verifyParam(pobj) {//参数信息验证
var verify = system.getResultSuccess(); var verify = system.getResultSuccess();
if (!pobj.interface_params) { if (!pobj.interface_params) {
...@@ -92,4 +73,5 @@ class UtilsDeliverSystemService extends AppServiceBase { ...@@ -92,4 +73,5 @@ class UtilsDeliverSystemService extends AppServiceBase {
//--------------------------------------------------内部辅助方法-------------------end----------------- //--------------------------------------------------内部辅助方法-------------------end-----------------
} }
module.exports = UtilsDeliverSystemService; module.exports = UtilsDeliverSystemService;
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