|
@ -23,6 +23,13 @@ module.exports = function (app, opts) { |
|
|
const { database: dataAlarm } = clickHouse.dataAlarm.opts.config |
|
|
const { database: dataAlarm } = clickHouse.dataAlarm.opts.config |
|
|
const { pushBySms, pushByEmail, sendNoticeToWeb } = app.fs.utils |
|
|
const { pushBySms, pushByEmail, sendNoticeToWeb } = app.fs.utils |
|
|
const curMinOfYear = moment().diff(moment().startOf('year'), 'minutes') |
|
|
const curMinOfYear = moment().diff(moment().startOf('year'), 'minutes') |
|
|
|
|
|
|
|
|
|
|
|
const pLog = (msg) => { |
|
|
|
|
|
if (proDebug) { |
|
|
|
|
|
console.log(msg) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const configListRes = await models.AlarmPushConfig.findAll({ |
|
|
const configListRes = await models.AlarmPushConfig.findAll({ |
|
|
where: { |
|
|
where: { |
|
|
del: false, |
|
|
del: false, |
|
@ -1220,6 +1227,7 @@ module.exports = function (app, opts) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// console.log('数据组合', JSON.stringify(pepProject_name));
|
|
|
// console.log('数据组合', JSON.stringify(pepProject_name));
|
|
|
|
|
|
pLog('数据组合' + JSON.stringify(pepProject_name)) |
|
|
|
|
|
|
|
|
pepProject_name.forEach(h => { |
|
|
pepProject_name.forEach(h => { |
|
|
let rowspan1 = 0 |
|
|
let rowspan1 = 0 |
|
@ -1287,6 +1295,7 @@ module.exports = function (app, opts) { |
|
|
function packageAlarmData2Table ({ |
|
|
function packageAlarmData2Table ({ |
|
|
titlePrefix, alarmData, alarmTitleArr, keyOfStartTime = 'StartTime', type |
|
|
titlePrefix, alarmData, alarmTitleArr, keyOfStartTime = 'StartTime', type |
|
|
}) { |
|
|
}) { |
|
|
|
|
|
pLog(`${titlePrefix} ${alarmData.length}`) |
|
|
if (!alarmData.length) { |
|
|
if (!alarmData.length) { |
|
|
return '' |
|
|
return '' |
|
|
} |
|
|
} |
|
@ -1299,8 +1308,6 @@ module.exports = function (app, opts) { |
|
|
|
|
|
|
|
|
let accumulate = 0 |
|
|
let accumulate = 0 |
|
|
if (type == 1) { |
|
|
if (type == 1) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alarmData.map((h, hi) => { |
|
|
alarmData.map((h, hi) => { |
|
|
accumulate += h.rowspan || 0 |
|
|
accumulate += h.rowspan || 0 |
|
|
if (h.projects && h.projects.length) { |
|
|
if (h.projects && h.projects.length) { |
|
|