Commit 84418eab by 宋毅

增加渠道推送

parent 408028a5
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class PushAliInfo extends APIBase {
constructor() {
super();
this.centerorderSve = system.getObject("service.common.centerorderSve");
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
this.utilsNeedSve = system.getObject("service.utilsSve.utilsNeedSve");
}
/**
* 推送阿里商标跟进信息
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async tmNote(pobj, qobj, req) {
var reqPushParams = {
reqbody: {
BizId: pobj.intentionBizId,
Note: pobj.note.replace(/<[^>]+>/g, "")
},
appInfo: {uapp_id: 18}
};
await this.utilsPushSve.business2Channel(reqPushParams, "pushAliTmNote");
}
/**
* 推送阿里工商跟进信息
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async icNote(pobj, qobj, req) {
var reqPushParams = {
reqbody: {
BizId: pobj.intentionBizId,
Type: 1,// 1需求,2订单
Note: pobj.note.replace(/<[^>]+>/g, "")
},
appInfo: {uapp_id: 18}
};
await this.utilsPushSve.business2Channel(reqPushParams, "pushAliIcNote");
}
}
module.exports = PushAliInfo;
\ No newline at end of file
......@@ -13,7 +13,7 @@ class AppServiceBase {
this.execClient = system.getObject('util.execClient');
this.cacheManager = system.getObject("db.common.cacheManager");
this.pushlogSve = system.getObject("service.common.pushlogSve");
this.pushlogFailType = {OLDRPC: 1, NEWRPC: 2, FAILLOG: 3, FQ: 4};
this.pushlogFailType = {OLDRPC: 1, NEWRPC: 2, FAILLOG: 3, FQ: 4};//1老的rpc调用,2新的rpc调用-需配置,3错误日志,4推送峰擎,5直接调用-无需配置
this.logCtl = system.getObject("service.common.oplogSve");
}
......
const AppServiceBase = require("../../app.base");
var settings = require("../../../../config/settings");
const system = require("../../../system");
class UtilsAliyunInfoService extends AppServiceBase {
constructor() {
super();
}
async sendAliyunInfoByNeedId(pobj) {
let verifyResult = await this.opAliyunRpcVerifyParam(pobj);
if (verifyResult.status != 0) {
return verifyResult;
}
let interface_params = verifyResult.data;
let params = {
action: interface_params.action,
reqbody: pobj.reqbody,
rpcParam: {}
}
if (interface_params.accessKeyId) {
params.rpcParam.accessKeyId = interface_params.accessKeyId;
}
if (interface_params.accessKeySecret) {
params.rpcParam.accessKeySecret = interface_params.accessKeySecret;
}
if (interface_params.endpoint) {
params.rpcParam.endpoint = interface_params.endpoint;
}
if (interface_params.apiVersion) {
params.rpcParam.apiVersion = interface_params.apiVersion;
}
let aliResult = await this.opAliyunRpcReq(pobj, params);
return await this.disposePushResult(pobj, aliResult, "ali->sendAliyunInfoByNeedId->aliResult", this.pushlogFailType.FQ);
}
}
module.exports = UtilsAliyunInfoService;
......@@ -502,7 +502,7 @@ class UtilsNeedService2 extends AppServiceBase {
}
return itemResult;
}
//icp接收方案反馈信息
async writeCommunicationLog(pobj) {
if (!pobj.actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100491");
......
......@@ -73,11 +73,11 @@ class UtilsPushService extends AppServiceBase {
try {
if (interface_info.interface_type == "bd") {
if (!interface_info.method_name) {
return system.getResult(null, "产品接口参数信息有误,100350");
return system.getResult(null, "接口对应的method_name参数信息为空,100350");
}//操作的方法名称
var invokeObj = system.getObject(interface_info.interface_url);
if (!invokeObj[interface_info.method_name]) {
return system.getResult(null, "产品接口参数方法信息有误,100360");
return system.getResult(null, "接口对应的method_name参数方法信息有误,100360");
}
pobj.interface_params = interface_info.params;
var params = [pobj];
......
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