Browse Source

Merge branch 'dev_trial' of https://gitea.anxinyun.cn/free-sun/FS-IOT into dev_trial

release_1.2.1
wenlele 2 years ago
parent
commit
d9cb940da2
  1. 6
      code/VideoAccess-VCMP/api/app/lib/schedule/cameraStatePush.js
  2. 6
      code/VideoAccess-VCMP/api/app/lib/schedule/freshYingshiMsg.js

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

@ -35,6 +35,7 @@ module.exports = function (app, opts) {
const timeNow = moment().startOf('minute').format() const timeNow = moment().startOf('minute').format()
for (let c of configRes) { for (let c of configRes) {
console.log('上下线推送方式', c.pushWay,);
// 查配置信息所对应的摄像头15min内的在离线状态 // 查配置信息所对应的摄像头15min内的在离线状态
const cameraIds = c.cameraStatusPushMonitors.map(m => m.cameraId) const cameraIds = c.cameraStatusPushMonitors.map(m => m.cameraId)
const offlineStatusRes = await models.CameraStatusOfflineLog.findAll({ const offlineStatusRes = await models.CameraStatusOfflineLog.findAll({
@ -51,7 +52,7 @@ module.exports = function (app, opts) {
}], }],
order: [['time', 'ASC']], order: [['time', 'ASC']],
}) })
console.log('上下线推送路线记录', offlineStatusRes);
if (offlineStatusRes.length) { if (offlineStatusRes.length) {
const cameraStatusMap = {} const cameraStatusMap = {}
// 当前逻辑 // 当前逻辑
@ -120,7 +121,8 @@ module.exports = function (app, opts) {
// camera: cameraIds, // camera: cameraIds,
} }
// 离线推送 // 离线推送
console.log('离线推送', pushWay, offArr, onArr, receiver,); console.log('上下线推送数据', offArr, onArr);
console.log('上下线推送接收', receiver);
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') {
// 邮件 // 邮件

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

@ -4,13 +4,13 @@ const moment = require('moment')
module.exports = function (app, opts) { module.exports = function (app, opts) {
const freshYingshiState = app.fs.scheduleInit( const freshYingshiState = app.fs.scheduleInit(
{ {
interval: '0 */4 * * * *', interval: '50 */4 * * * *',
// interval: '*/3 * * * *', // interval: '*/3 * * * *',
// immediate: true, // immediate: true,
// proRun: true, proRun: true,
}, },
async () => { async () => {
console.log('萤石状态查询 ', moment().format('YYYY-MM-DD HH:mm:ss'));
try { try {
const startTime = moment() const startTime = moment()
const { models } = app.fs.dc const { models } = app.fs.dc

Loading…
Cancel
Save