Commit 7c1e4cb3 by 宋毅

修改推送记录

parent fa4fdbcc
...@@ -249,7 +249,7 @@ class AppServiceBase { ...@@ -249,7 +249,7 @@ class AppServiceBase {
let url = settings.centerOrderUrl() + 'action/opNeed/springBoard'; let url = settings.centerOrderUrl() + 'action/opNeed/springBoard';
this.execPostByTimeOut(null, pobj, url, null, null, 60); this.execPostByTimeOut(null, pobj, url, null, null, 60);
} }
if (["pushOrder", "pushOrderBusiness", "pushOrderICPBusiness"].includes(opType) && pobj.actionBody && pobj.actionBody.orderNo) { if (["pushOrder", "pushOrderBusiness", "pushOrderICPBusiness", "pushOrderICPBusinessNew"].includes(opType) && pobj.actionBody && pobj.actionBody.orderNo) {
pobj.actionBody.pushNumber = pobj.pushNumber || 1; pobj.actionBody.pushNumber = pobj.pushNumber || 1;
pobj.actionBody.pushStatus = 3;//推送状态0待推送2推送失败3已成功推送 pobj.actionBody.pushStatus = 3;//推送状态0待推送2推送失败3已成功推送
this.disposeOrderPush(pobj); this.disposeOrderPush(pobj);
...@@ -267,6 +267,14 @@ class AppServiceBase { ...@@ -267,6 +267,14 @@ class AppServiceBase {
async disposePushResultFail(pobj, result, opTitleDesc, failType) {//处理失败的结果信息--内部使用 async disposePushResultFail(pobj, result, opTitleDesc, failType) {//处理失败的结果信息--内部使用
var opType = pobj.opType || ""; var opType = pobj.opType || "";
let pushNumber = pobj.pushNumber || 1; let pushNumber = pobj.pushNumber || 1;
if (pushNumber == 10) {
pobj.actionBody.pushNumber = pushNumber;
pobj.actionBody.pushStatus = 2;//推送状态0待推送2推送失败3已成功推送
this.disposeOrderPush(pobj);
if (result.errorMsg && result.errorMsg == "订单产品查询出来产品与传递得产品数量不一致") {
this.disposeOrderPushFailSendDing(pobj);
}
}
let resultInfo = JSON.stringify(result); let resultInfo = JSON.stringify(result);
this.pushlogSve.createFailLogDb({ this.pushlogSve.createFailLogDb({
appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "", appid: pobj.appInfo ? pobj.appInfo.uapp_id || "" : "",
...@@ -280,12 +288,6 @@ class AppServiceBase { ...@@ -280,12 +288,6 @@ class AppServiceBase {
pushNumber: pushNumber pushNumber: pushNumber
}); });
result.data = null; result.data = null;
if (pushNumber == 10 && resultInfo.indexOf("订单产品查询出来产品与传递得产品数量不一致,请重新选择") >= 0) {
pobj.actionBody.pushNumber = pushNumber;
pobj.actionBody.pushStatus = 2;//推送状态0待推送2推送失败3已成功推送
this.disposeOrderPushFailSendDing(pobj);
this.disposeOrderPush(pobj);
}
return result; return result;
} }
......
...@@ -121,7 +121,11 @@ class UtilsFqAliyunService extends AppServiceBase { ...@@ -121,7 +121,11 @@ class UtilsFqAliyunService extends AppServiceBase {
if (rtn.success && rtn.code == 200) { if (rtn.success && rtn.code == 200) {
return system.getResultSuccess(rtn.data, "推送成功"); return system.getResultSuccess(rtn.data, "推送成功");
} else { } else {
return system.getResultFail(-1, `推送失败,失败原因11:${JSON.stringify(rtn)}`); let errorMsg = "";
if (rtn.errorMessage && rtn.errorMessage.indexOf("订单产品查询出来产品与传递得产品数量不一致") >= 0) {
errorMsg = "订单产品查询出来产品与传递得产品数量不一致";
}
return system.getResultNewFail(-1, `推送失败,失败原因11:${JSON.stringify(rtn)}`, null, errorMsg);
} }
} catch (e) { } catch (e) {
const stackStr = e.stack ? e.stack : JSON.stringify(e); const stackStr = e.stack ? e.stack : JSON.stringify(e);
......
var fs = require("fs"); var fs = require("fs");
var objsettings = require("../config/objsettings"); var objsettings = require("../config/objsettings");
var settings = require("../config/settings"); var settings = require("../config/settings");
class System { class System {
static declare(ns) { static declare(ns) {
var ar = ns.split('.'); var ar = ns.split('.');
...@@ -15,6 +16,7 @@ class System { ...@@ -15,6 +16,7 @@ class System {
} }
} }
} }
static register(key, ClassObj) { static register(key, ClassObj) {
if (System.objTable[key] != null) { if (System.objTable[key] != null) {
throw new Error("相同key的对象已经存在"); throw new Error("相同key的对象已经存在");
...@@ -25,6 +27,7 @@ class System { ...@@ -25,6 +27,7 @@ class System {
return System.objTable[key]; return System.objTable[key];
} }
static getResult(data, opmsg = "操作成功", req) { static getResult(data, opmsg = "操作成功", req) {
return { return {
status: !data ? -1 : 0, status: !data ? -1 : 0,
...@@ -33,9 +36,11 @@ class System { ...@@ -33,9 +36,11 @@ class System {
bizmsg: req && req.session && req.session.bizmsg ? req.session.bizmsg : "empty" bizmsg: req && req.session && req.session.bizmsg ? req.session.bizmsg : "empty"
}; };
} }
static getErrResult2(errmsg) { static getErrResult2(errmsg) {
return this.getResult2(null, null, null, errmsg); return this.getResult2(null, null, null, errmsg);
} }
static getResult2(data, req, okmsg = "操作成功", errmsg = "操作失败") { static getResult2(data, req, okmsg = "操作成功", errmsg = "操作失败") {
var result = { var result = {
status: 0, status: 0,
...@@ -54,11 +59,12 @@ class System { ...@@ -54,11 +59,12 @@ class System {
} }
return result; return result;
} }
static getResult3(data, req, okmsg = "操作成功", errmsg = "操作失败") { static getResult3(data, req, okmsg = "操作成功", errmsg = "操作失败") {
var total = data.total; var total = data.total;
data = data.hits; data = data.hits;
var sources = []; var sources = [];
data.forEach(function(d) { data.forEach(function (d) {
sources.push(d._source); sources.push(d._source);
}) })
var result = { var result = {
...@@ -80,20 +86,21 @@ class System { ...@@ -80,20 +86,21 @@ class System {
} }
return result; return result;
} }
static getResult4(j, req, okmsg = "操作成功", errmsg = "操作失败") { static getResult4(j, req, okmsg = "操作成功", errmsg = "操作失败") {
var aggs = j.aggregations; var aggs = j.aggregations;
var codes_count = aggs.ncl_one_codes_count; var codes_count = aggs.ncl_one_codes_count;
var bucketlist = codes_count.buckets; var bucketlist = codes_count.buckets;
var bucklist = []; var bucklist = [];
bucketlist.forEach(function(d) { bucketlist.forEach(function (d) {
bucklist.push(d); bucklist.push(d);
}) })
var data = j.hits; var data = j.hits;
var total = data.total; var total = data.total;
var hit = data.hits; var hit = data.hits;
var sources = []; var sources = [];
hit.forEach(function(d) { hit.forEach(function (d) {
sources.push(d._source); sources.push(d._source);
}) })
var result = { var result = {
...@@ -115,13 +122,14 @@ class System { ...@@ -115,13 +122,14 @@ class System {
} }
return result; return result;
} }
static getResultjuhe4(j, req, okmsg = "操作成功", errmsg = "操作失败") { static getResultjuhe4(j, req, okmsg = "操作成功", errmsg = "操作失败") {
var aggs = j.aggregations; var aggs = j.aggregations;
var codes_count = aggs.ncl_one_codes_count; var codes_count = aggs.ncl_one_codes_count;
var bucketlist = codes_count.buckets; var bucketlist = codes_count.buckets;
var bucklist = []; var bucklist = [];
bucketlist.forEach(function(d) { bucketlist.forEach(function (d) {
bucklist.push(d); bucklist.push(d);
}) })
var result = { var result = {
...@@ -135,44 +143,47 @@ class System { ...@@ -135,44 +143,47 @@ class System {
} }
return result; return result;
} }
static getResultjuhetwo(j, req, okmsg = "操作成功", errmsg = "操作失败") { static getResultjuhetwo(j, req, okmsg = "操作成功", errmsg = "操作失败") {
var aggs = j.aggregations; var aggs = j.aggregations;
var notice_count = aggs.notice_count; var notice_count = aggs.notice_count;
var bucketlist = notice_count.buckets; var bucketlist = notice_count.buckets;
var bucklist = []; var bucklist = [];
bucketlist.forEach(function(d) { bucketlist.forEach(function (d) {
var notice_issue = d.key; var notice_issue = d.key;
var date = d.date_max.value; var date = d.date_max.value;
var data = { var data = {
notice_issue: notice_issue, notice_issue: notice_issue,
date: date date: date
}
bucklist.push(data);
})
var result = {
status: 0,
msg: okmsg,
buckets: bucklist,
};
if (!bucklist) {
result.status = -1;
result.msg = errmsg;
} }
return result; bucklist.push(data);
})
var result = {
status: 0,
msg: okmsg,
buckets: bucklist,
};
if (!bucklist) {
result.status = -1;
result.msg = errmsg;
} }
/** return result;
* 请求返回成功 }
* @param {*} data 操作成功返回的数据
* @param {*} okmsg 操作成功的描述 /**
*/ * 请求返回成功
* @param {*} data 操作成功返回的数据
* @param {*} okmsg 操作成功的描述
*/
static getResultSuccess(data, okmsg = "success") { static getResultSuccess(data, okmsg = "success") {
return { return {
status: 0, status: 0,
msg: okmsg, msg: okmsg,
data: data || "成功" data: data || "成功"
}; };
} }
// 2020 0916 lin 新增返回格式 成功status为1
// 2020 0916 lin 新增返回格式 成功status为1
static getResultRedisQueueSuccess(data, okmsg = "success") { static getResultRedisQueueSuccess(data, okmsg = "success") {
return { return {
status: 1, status: 1,
...@@ -207,6 +218,24 @@ class System { ...@@ -207,6 +218,24 @@ class System {
data: data, data: data,
}; };
} }
/**
* 请求返回失败
* @param status
* @param errmsg
* @param data
* @param errorMsg
* @returns {{msg: string, data: string, status: number, errorMsg: *}}
*/
static getResultNewFail(status = -1, errmsg = "fail", data = "", errorMsg) {
return {
status: status,
msg: errmsg,
errorMsg: errorMsg,
data: data,
};
}
static getObject(objpath) { static getObject(objpath) {
var pathArray = objpath.split("."); var pathArray = objpath.split(".");
var packageName = pathArray[0]; var packageName = pathArray[0];
...@@ -230,6 +259,7 @@ class System { ...@@ -230,6 +259,7 @@ class System {
return System.register(objabspath, ClassObj); return System.register(objabspath, ClassObj);
} }
} }
static getUiConfig(appid) { static getUiConfig(appid) {
var configPath = settings.basepath + "/app/base/db/metadata/" + appid + "/index.js"; var configPath = settings.basepath + "/app/base/db/metadata/" + appid + "/index.js";
if (settings.env == "dev") { if (settings.env == "dev") {
...@@ -238,6 +268,7 @@ class System { ...@@ -238,6 +268,7 @@ class System {
var configValue = require(configPath); var configValue = require(configPath);
return configValue; return configValue;
} }
static getUiConfig2(appid) { static getUiConfig2(appid) {
var configPath = settings.basepath + "/app/base/db/metadata/index.js"; var configPath = settings.basepath + "/app/base/db/metadata/index.js";
// if(settings.env=="dev"){ // if(settings.env=="dev"){
...@@ -248,6 +279,7 @@ class System { ...@@ -248,6 +279,7 @@ class System {
var configValue = require(configPath); var configValue = require(configPath);
return configValue[appid]; return configValue[appid];
} }
static get_client_ip(req) { static get_client_ip(req) {
var ip = req.headers['x-forwarded-for'] || var ip = req.headers['x-forwarded-for'] ||
req.ip || req.ip ||
...@@ -296,7 +328,8 @@ class System { ...@@ -296,7 +328,8 @@ class System {
} }
} }
} }
Date.prototype.Format = function(fmt) { //author: meizz
Date.prototype.Format = function (fmt) { //author: meizz
var o = { var o = {
"M+": this.getMonth() + 1, //月份 "M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日 "d+": this.getDate(), //日
......
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