Commit e802cbd6 by 宋毅

tj

parent 66a59673
...@@ -12,14 +12,11 @@ module.exports = (db, DataTypes) => { ...@@ -12,14 +12,11 @@ module.exports = (db, DataTypes) => {
values: Object.keys(uiconfig.config.pdict.logLevel), values: Object.keys(uiconfig.config.pdict.logLevel),
defaultValue: "info", defaultValue: "info",
}, },
op: DataTypes.STRING, op: DataTypes.STRING(4000),
content: DataTypes.STRING(5000), content: DataTypes.STRING(5000),
resultInfo: DataTypes.TEXT('long'), resultInfo: DataTypes.TEXT('long'),
clientIp: DataTypes.STRING, clientIp: DataTypes.STRING,
agent: { agent:: DataTypes.STRING(500),
type: DataTypes.STRING,
allowNull: true,
},
opTitle: DataTypes.TEXT, opTitle: DataTypes.TEXT,
}, { }, {
paranoid: false,//假的删除 paranoid: false,//假的删除
......
...@@ -12,11 +12,11 @@ module.exports = (db, DataTypes) => { ...@@ -12,11 +12,11 @@ module.exports = (db, DataTypes) => {
values: Object.keys(uiconfig.config.pdict.logLevel), values: Object.keys(uiconfig.config.pdict.logLevel),
defaultValue: "info", defaultValue: "info",
}, },
op: DataTypes.STRING, op: DataTypes.STRING(4000),
content: DataTypes.TEXT, content: DataTypes.TEXT,
resultInfo: DataTypes.TEXT('long'), resultInfo: DataTypes.TEXT('long'),
returnTypeName:DataTypes.STRING, returnTypeName: DataTypes.STRING,
returnType : { returnType: {
type: DataTypes.ENUM, type: DataTypes.ENUM,
values: Object.keys(uiconfig.config.pdict.push_return_type), values: Object.keys(uiconfig.config.pdict.push_return_type),
set: function (val) { set: function (val) {
...@@ -26,10 +26,7 @@ module.exports = (db, DataTypes) => { ...@@ -26,10 +26,7 @@ module.exports = (db, DataTypes) => {
defaultValue: "0", defaultValue: "0",
}, //数据推送返回结果类型 push_return_type:{"0":"失败","1":"成功"} }, //数据推送返回结果类型 push_return_type:{"0":"失败","1":"成功"}
clientIp: DataTypes.STRING, clientIp: DataTypes.STRING,
agent: { agent: DataTypes.STRING(500),
type: DataTypes.STRING,
allowNull: true,
},
opTitle: DataTypes.STRING(500), opTitle: DataTypes.STRING(500),
}, { }, {
paranoid: false,//假的删除 paranoid: false,//假的删除
......
...@@ -418,11 +418,18 @@ class UtilsOrderService extends AppServiceBase { ...@@ -418,11 +418,18 @@ class UtilsOrderService extends AppServiceBase {
var opResult = await this.restPostUrl(parmas, url); var opResult = await this.restPostUrl(parmas, url);
if (opResult.status == 0) { if (opResult.status == 0) {
opResult.data.appInfo = { opResult.data.appInfo = {
uapp_id: appInfo.uapp_id,
uapp_key: appInfo.uapp_key,
app_code: appInfo.app_code, app_code: appInfo.app_code,
app_name: appInfo.app_name app_name: appInfo.app_name
}; };
await this.utilsPushSve.pushInfo(opResult.data, "pushBusiness"); opResult.data.userInfo = {
await this.utilsPushSve.pushInfo(opResult.data, "pushOrder"); channel_userid: opResult.data.order_info.channelUserId,
channel_username: opResult.data.order_info.channelUserId,
channel_nickname: opResult.data.order_info.channelUserId
};
this.utilsPushSve.pushInfo(opResult.data, "pushBusiness");
this.utilsPushSve.pushInfo(opResult.data, "pushOrder");
} }
opResult.data = null; opResult.data = null;
return opResult; return opResult;
......
...@@ -5,6 +5,7 @@ const AppServiceBase = require("../../app.base"); ...@@ -5,6 +5,7 @@ const AppServiceBase = require("../../app.base");
class UtilsPushService extends AppServiceBase { class UtilsPushService extends AppServiceBase {
constructor() { constructor() {
super(); super();
this.pushlogSve = system.getObject("service.common.pushlogSve");
}; };
async pushInfo(actionBody, opType) { async pushInfo(actionBody, opType) {
var interface_list = actionBody.product_info.interface_info; var interface_list = actionBody.product_info.interface_info;
...@@ -18,26 +19,50 @@ class UtilsPushService extends AppServiceBase { ...@@ -18,26 +19,50 @@ class UtilsPushService extends AppServiceBase {
for (let index = 0; index < interface_list_temp.length; index++) { for (let index = 0; index < interface_list_temp.length; index++) {
const element = interface_list_temp[index]; const element = interface_list_temp[index];
var refOpResult = this.reflexAction(element, actionBody); var refOpResult = this.reflexAction(element, actionBody);
} }
} }
async reflexAction(interface_info, pobj) { async reflexAction(interface_info, pobj) {
var refResult = null; var refResult = null;
if (interface_info.interface_type == "bd") { try {
if (!interface_info.method_name) { if (interface_info.interface_type == "bd") {
return system.getResult(null, "产品接口参数信息有误,100350"); if (!interface_info.method_name) {
}//操作的方法名称 return system.getResult(null, "产品接口参数信息有误,100350");
var invokeObj = system.getObject(interface_info.interface_url); }//操作的方法名称
if (!invokeObj[interface_info.method_name]) { var invokeObj = system.getObject(interface_info.interface_url);
return system.getResult(null, "产品接口参数方法信息有误,100360"); if (!invokeObj[interface_info.method_name]) {
return system.getResult(null, "产品接口参数方法信息有误,100360");
}
pobj.interface_params = interface_info.params;
var params = [pobj];
refResult = await invokeObj[interface_info.method_name].apply(invokeObj, params);
} }
pobj.interface_params = interface_info.params; else if (interface_info.interface_type == "yc") {
var params = [pobj]; if (!interface_info.interface_url) {
refResult = await invokeObj[interface_info.method_name].apply(invokeObj, params); return system.getResult(null, "产品接口interface_url参数不能为空,100370");
} }
else if (interface_info.interface_type == "yc") { refResult = await this.restPostUrl(pobj, interface_info.interface_url);
}
this.pushlogSve.createDb({
appid: pobj.appInfo.uapp_id,
appkey: pobj.appInfo.uapp_key,
op: "推送的接口信息:" + JSON.stringify(interface_info),
content: JSON.stringify(pobj),
resultInfo: refResult ? JSON.stringify(refResult) || "",
returnType: '1',
opTitle: "数据推送成功",
});
return refResult;
} catch (e) {
this.pushlogSve.createDb({
appid: pobj.appInfo.uapp_id,
appkey: pobj.appInfo.uapp_key,
op: "推送的接口信息:" + JSON.stringify(interface_info),
content: JSON.stringify(pobj),
resultInfo: JSON.stringify(e.stack),
returnType: '0',
opTitle: "数据推送异常",
});
} }
return refResult;
} }
} }
module.exports = UtilsPushService; module.exports = UtilsPushService;
已经使用的编码汇总: 已经使用的编码汇总:
...@@ -35,3 +35,4 @@ ...@@ -35,3 +35,4 @@
100340 100340
100350 100350
100360 100360
100370
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