Commit e802cbd6 by 宋毅

tj

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