| 
						
						
							
								
							
						
						
					 | 
					@ -4,9 +4,10 @@ module.exports = function (app, opts) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					   const cameraOnlinePush = app.fs.scheduleInit( | 
					 | 
					 | 
					   const cameraOnlinePush = app.fs.scheduleInit( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      { | 
					 | 
					 | 
					      { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					         interval: '* */15 * * * *', | 
					 | 
					 | 
					         interval: '* */15 * * * *', | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					         interval: '*/15 * * * * *', | 
					 | 
					 | 
					         // interval: '* */1 * * * *',
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					         // interval: '* */5 * * * *',
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					         immediate: false, | 
					 | 
					 | 
					         immediate: false, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					         proRun: true, | 
					 | 
					 | 
					         // proRun: true,
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					      }, | 
					 | 
					 | 
					      }, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      async () => { | 
					 | 
					 | 
					      async () => { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					         try { | 
					 | 
					 | 
					         try { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -39,7 +40,7 @@ module.exports = function (app, opts) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					               const offlineStatusRes = await models.CameraStatusOfflineLog.findAll({ | 
					 | 
					 | 
					               const offlineStatusRes = await models.CameraStatusOfflineLog.findAll({ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                  where: { | 
					 | 
					 | 
					                  where: { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                     cameraId: { $in: cameraIds }, | 
					 | 
					 | 
					                     cameraId: { $in: cameraIds }, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                      | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                     // time: {
 | 
					 | 
					 | 
					                     // time: {
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                     //    $between: [moment(timeNow).subtract(15, 'minutes').format(), timeNow]
 | 
					 | 
					 | 
					                     //    $between: [moment(timeNow).subtract(15, 'minutes').format(), timeNow]
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                     // }
 | 
					 | 
					 | 
					                     // }
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -119,11 +120,12 @@ module.exports = function (app, opts) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                     // camera: cameraIds,
 | 
					 | 
					 | 
					                     // camera: cameraIds,
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                  } | 
					 | 
					 | 
					                  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                  // 离线推送
 | 
					 | 
					 | 
					                  // 离线推送
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                  console.log('object'); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                  if (offArr.length && c.noticeWay && c.noticeWay.includes('offline')) { | 
					 | 
					 | 
					                  if (offArr.length && c.noticeWay && c.noticeWay.includes('offline')) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                     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}】于【${o.time}】掉线,`).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({ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                           email: receiver, | 
					 | 
					 | 
					                           email: receiver, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |