Commit 2ad4065d by 宋毅

tj

parent d0892f31
node_modules/
.idea
.history/
.vscode
\ No newline at end of file
......@@ -53,7 +53,7 @@ class APIBase {
await this.redisClient.setWithEx(shaStr, JSON.stringify(result), 3600);
}
var tmpResult = pobj.actionType && pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
this.execClientNew.execLogs("center-channel-doexecMethod-reqPath:" + req.path, pobj, "center-channel-doexecMethod", tmpResult, null);
this.execClientNew.execLogs("api-center-channel-doexecMethod-reqPath:" + req.path, pobj, "center-channel-doexecMethod", tmpResult, null);
return result;
} catch (e) {
const stackStr = e.stack ? e.stack : JSON.stringify(e);
......
var WEBBase = require("../../web.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class ProductAPI extends WEBBase {
constructor() {
super();
this.utilsOrderSve = system.getObject("service.utilsSve.utilsOrderSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionProcess) {
return system.getResult(null, "actionProcess参数不能为空");
......@@ -22,15 +24,19 @@ class ProductAPI extends WEBBase {
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
pobj.requestId = req.requestId;
var opResult = null;
switch (action_type) {
case "addOrder"://创建订单
opResult = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
//处理推送到峰擎
// opType:值为query、add
this.pushNewFq(pobj, opResult);
break;
case "addOrderWeb"://创建订单 官网
opResult = await this.utilsOrderSve.addOrderWeb(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.addOrderWeb(pobj, pobj.actionBody);
break;
case "getOrderInfo"://获取订单列表信息
opResult = await this.utilsOrderSve.getOrderInfo(pobj, pobj.actionBody);
......@@ -69,22 +75,22 @@ class ProductAPI extends WEBBase {
// opResult = await this.utilsOrderSve.addOrder(pobj, pobj.actionBody);
// break;
case "addUsuallyContacts"://添加常用联系人、申请人
opResult = await this.utilsOrderSve.addUsuallyContacts(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.addUsuallyContacts(pobj, pobj.actionBody);
break;
case "delUsuallyContacts"://删除常用联系人、申请人
opResult = await this.utilsOrderSve.delUsuallyContacts(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.delUsuallyContacts(pobj, pobj.actionBody);
break;
case "updateUsuallyContacts"://修改常用联系人、申请人
opResult = await this.utilsOrderSve.updateUsuallyContacts(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.updateUsuallyContacts(pobj, pobj.actionBody);
break;
case "getUsuallyContacts"://查询常用联系人、申请人
opResult = await this.utilsOrderSve.getUsuallyContacts(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.getUsuallyContacts(pobj, pobj.actionBody);
break;
case "importOrders":
opResult = await this.utilsOrderSve.importOrders(pobj,req);
opResult = await this.utilsOrderSve.importOrders(pobj, req);
break;
case "pushTest":
opResult = await this.utilsOrderSve.pushTest(pobj,pobj.actionBody);
opResult = await this.utilsOrderSve.pushTest(pobj, pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......@@ -93,5 +99,18 @@ class ProductAPI extends WEBBase {
return opResult;
}
async pushNewFq(pobj, result) {
if (result.status == 0 && result.data && result.data.channelOrderNo) {
try {
pobj.actionType = "getOrderInfoByChannelOrderNo";
pobj.actionBody.channelOrderNo = result.data.channelOrderNo;
await this.utilsOrderSve.pushNewFqByChannelOrderNo(pobj);
} catch (e) {
const stackStr = e.stack ? e.stack : JSON.stringify(e);
this.execClientNew.execLogs("pushNewFq异常:", pobj, "center-channel-pushNewFq", null, stackStr);
}
}
}
}
module.exports = ProductAPI;
......@@ -38,7 +38,7 @@ class WEBBase {
opTitle: "api服务提供方appKey:" + settings.appKey,
});
var tmpResult = pobj.actionType && pobj.actionType.indexOf("List") < 0 ? result : { status: result.status, message: result.message, requestId: result.requestId };
this.execClientNew.execLogs("reqPath:" + req.path, pobj, "center-channel-doexecMethod-web", tmpResult, null);
this.execClientNew.execLogs("web-center-channel--reqPath:" + req.path, pobj, "center-channel-doexecMethod-web", tmpResult, null);
return result;
} catch (e) {
console.log(e.stack, "api调用出现异常,请联系管理员..........")
......@@ -53,16 +53,16 @@ class WEBBase {
agent: req.uagent,
opTitle: "api调用出现异常,请联系管理员error,appKey:" + settings.appKey,
});
this.logCtl.error({
appid: req.app.id,
appkey: req.app.uappKey,
requestId: req.requestId,
op: req.classname + "/" + methodname,
content: e.stack,
clientIp: pobj.clientIp,
agent: req.uagent,
optitle: "api调用出现异常,请联系管理员",
});
// this.logCtl.error({
// appid: req.app.id,
// appkey: req.app.uappKey,
// requestId: req.requestId,
// op: req.classname + "/" + methodname,
// content: e.stack,
// clientIp: pobj.clientIp,
// agent: req.uagent,
// optitle: "api调用出现异常,请联系管理员",
// });
var rtnerror = system.getResultFail(-200, "出现异常,error:" + e.stack);
rtnerror.requestId = req.requestId;
return rtnerror;
......
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