Browse Source

有 -> 新增

release_1.3.0
巴林闲侠 2 years ago
parent
commit
082e8efa3e
  1. 6
      code/VideoAccess-VCMP/api/app/lib/schedule/cameraStatePush.js

6
code/VideoAccess-VCMP/api/app/lib/schedule/cameraStatePush.js

@ -126,7 +126,7 @@ module.exports = function (app, opts) {
if (offArr.length && c.noticeWay && c.noticeWay.includes('offline') && receiver.length) { if (offArr.length && c.noticeWay && c.noticeWay.includes('offline') && receiver.length) {
if (c.pushWay == 'email') { if (c.pushWay == 'email') {
// 邮件 // 邮件
let text = `${corUser[0].username}】账号下的设备,截止【${moment(timeNow).format('MM月DD日 HH时mm分')}】,${offArr.length}个设备掉线:\n` let text = `${corUser[0].username}】账号下的设备,截止【${moment(timeNow).format('MM月DD日 HH时mm分')}】,新增${offArr.length}个设备掉线:\n`
text += offArr.map(o => `${o.name}】于【${moment(o.time).format('MM月DD日 HH时mm分')}】掉线,`).join('\n') text += offArr.map(o => `${o.name}】于【${moment(o.time).format('MM月DD日 HH时mm分')}】掉线,`).join('\n')
text += `\n请及时处理!` text += `\n请及时处理!`
await pushByEmail({ await pushByEmail({
@ -285,7 +285,7 @@ module.exports = function (app, opts) {
], ],
}) })
for (let c of configRes) { for (let c of configRes) {
// 查配置信息所对应的摄像头15min内的在离线状态 // 查配置信息所对应的摄像头在离线状态
const cameraIds = c.cameraStatusPushMonitors.map(m => m.cameraId) const cameraIds = c.cameraStatusPushMonitors.map(m => m.cameraId)
const offlineRes = await models.Camera.findAll({ const offlineRes = await models.Camera.findAll({
where: { where: {
@ -330,7 +330,7 @@ module.exports = function (app, opts) {
group: ['cameraId'], group: ['cameraId'],
}) })
if (offlineTimeRes.length) { if (offlineTimeRes.length) {
let text = `${corUser[0].username}】账号下的设备,截止${moment(timeNow).format('MM月DD日 HH时mm分')}${offlineRes.length}个设备掉线:\n` let text = `${corUser[0].username}】账号下的设备,截止${moment(timeNow).format('MM月DD日 HH时mm分')}新增${offlineRes.length}个设备掉线:\n`
text += offlineTimeRes.map(o => { text += offlineTimeRes.map(o => {
let corCamera = offlineRes.find(c => c.id == o.cameraId) let corCamera = offlineRes.find(c => c.id == o.cameraId)
if (corCamera) { if (corCamera) {

Loading…
Cancel
Save