| 
					
				 | 
			
			
				@@ -194,8 +194,8 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public void handleDayWarning() throws BDException { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         int staBeforeDayNums = Integer.parseInt(staBeforeDays); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        handleResident();//常住人员识别预警 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         handleStranger();//陌生人员识别预警 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        handleResident();//常住人员识别预警 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         handleEveningComming();//昼伏夜出人员识别预警 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         staCommunity(staBeforeDayNums);//按小区统n天前的数据 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -203,13 +203,6 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //陌生人员识别预警 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private void handleStranger() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //先看今天是否运行过程序,若运行过,则返回 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String strangerDate = (String)redisUtil.hget(RedisKeyConstant.HANDLE_WARNING_DATE,"stranger"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(StringUtils.isNotEmpty(strangerDate) && strangerDate.equals(DateUtils.getCurrYyyyMMddDate())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        redisUtil.hset(RedisKeyConstant.HANDLE_WARNING_DATE,"stranger",DateUtils.getCurrYyyyMMddDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<IdenCommunity>  idenCommunityList = this.idenCommunityService.list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(CollUtil.isEmpty(idenCommunityList)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -272,6 +265,13 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     IdenWarningPerson idenWarningPerson = this.idenWarningPersonService.getOne(queryWrapper0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (idenWarningPerson != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        //判断今天数据是不是处理过了 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String today = DateUtils.getCurrYyyyMMddDate(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        String modifyTime = DateUtils.formatToDateStr(idenWarningPerson.getModifyTime(),"yyyyMMdd"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        if(today.equals(modifyTime)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         idenWarningPerson.setAppearFrequency(strangerDayFrequency); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         idenWarningPerson.setStrangerType(strangerType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         idenWarningPerson.setHandleStatus(HandleWarningStatusEnum.NO_HANDLE.getValue()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -307,6 +307,7 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         idenWarningPerson.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        idenWarningPerson.setModifyTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         this.idenWarningPersonService.save(idenWarningPerson); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -314,6 +315,7 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     IdenWarningPersonHis idenWarningPersonHis = new IdenWarningPersonHis(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     BeanUtil.copyProperties(idenWarningPerson,idenWarningPersonHis,"id"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     idenWarningPersonHis.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    idenWarningPersonHis.setModifyTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     idenWarningPersonHisService.save(idenWarningPersonHis); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     IdenWarningEvent idenWarningEvent = new IdenWarningEvent(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -340,6 +342,7 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     idenWarningEvent.setSubdistrict(idenWarningPerson.getSubdistrict()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     idenWarningEvent.setType(WarningTypeEnum.STRANGER.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     idenWarningEvent.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    idenWarningEvent.setModifyTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     this.idenWarningEventService.save(idenWarningEvent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -352,12 +355,6 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //常住人员识别预警,小区人脸库内7天内未被命中人员或标记为独居老人或老人带小孩的7天内未被命中人员视为预警对象 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private void handleResident() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //先看今天是否运行过程序,若运行过,则返回 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String residentDate = (String)redisUtil.hget(RedisKeyConstant.HANDLE_WARNING_DATE,"resident"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(StringUtils.isNotEmpty(residentDate) && residentDate.equals(DateUtils.getCurrYyyyMMddDate())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        redisUtil.hset(RedisKeyConstant.HANDLE_WARNING_DATE,"resident",DateUtils.getCurrYyyyMMddDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //查询全部小区人员 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         QueryWrapper<IdenPerson> queryWrapper = new QueryWrapper<>(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -397,7 +394,15 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .eq(IdenWarningPerson::getUid,idenPerson.getUid()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         .eq(IdenWarningPerson::getType,WarningTypeEnum.RESIDENT.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 IdenWarningPerson idenWarningPerson = this.idenWarningPersonService.getOne(queryWrapper0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (idenWarningPerson != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    //判断今天数据是不是处理过了 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String today = DateUtils.getCurrYyyyMMddDate(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    String modifyTime = DateUtils.formatToDateStr(idenWarningPerson.getModifyTime(),"yyyyMMdd"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if(today.equals(modifyTime)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     idenWarningPerson.setContinueDisappearDays(continueDisappearDays); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     idenWarningPerson.setModifyTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     idenWarningPerson.setHandleStatus(HandleWarningStatusEnum.NO_HANDLE.getValue()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -427,12 +432,14 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     idenWarningPerson.setType(WarningTypeEnum.RESIDENT.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     idenWarningPerson.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    idenWarningPerson.setModifyTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     this.idenWarningPersonService.save(idenWarningPerson); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 IdenWarningPersonHis idenWarningPersonHis = new IdenWarningPersonHis(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 BeanUtil.copyProperties(idenWarningPerson,idenWarningPersonHis,"id"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 idenWarningPersonHis.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                idenWarningPersonHis.setModifyTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 idenWarningPersonHisService.save(idenWarningPersonHis); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 IdenWarningEvent idenWarningEvent = new IdenWarningEvent(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -449,7 +456,9 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 idenWarningEvent.setSubdistrict(idenWarningPerson.getSubdistrict()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 idenWarningEvent.setAppearTime(idenWarningPerson.getLatestAppearTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 idenWarningEvent.setType(WarningTypeEnum.RESIDENT.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 idenWarningEvent.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                idenWarningEvent.setModifyTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 this.idenWarningEventService.save(idenWarningEvent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -458,12 +467,6 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //昼伏夜出人员识别预警 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private void handleEveningComming() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //先看今天是否运行过程序,若运行过,则返回 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String eveningCommingDate = (String)redisUtil.hget(RedisKeyConstant.HANDLE_WARNING_DATE,"eveningComming"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(StringUtils.isNotEmpty(eveningCommingDate) && eveningCommingDate.equals(DateUtils.getCurrYyyyMMddDate())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        redisUtil.hset(RedisKeyConstant.HANDLE_WARNING_DATE,"eveningComming",DateUtils.getCurrYyyyMMddDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<IdenCommunity>  idenCommunityList = this.idenCommunityService.list(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(CollUtil.isEmpty(idenCommunityList)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -569,6 +572,13 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .eq(IdenWarningPerson::getType,WarningTypeEnum.EVENING_COMMING.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             IdenWarningPerson idenWarningPerson = this.idenWarningPersonService.getOne(queryWrapper0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (idenWarningPerson != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //判断今天数据是不是处理过了 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String today = DateUtils.getCurrYyyyMMddDate(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String modifyTime = DateUtils.formatToDateStr(idenWarningPerson.getModifyTime(),"yyyyMMdd"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if(today.equals(modifyTime)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 idenWarningPerson.setAppearFrequency(count); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 idenWarningPerson.setHandleStatus(HandleWarningStatusEnum.NO_HANDLE.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 idenWarningPerson.setModifyTime(new Date()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -609,12 +619,14 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 idenWarningPerson.setType(WarningTypeEnum.EVENING_COMMING.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 idenWarningPerson.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                idenWarningPerson.setModifyTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 this.idenWarningPersonService.save(idenWarningPerson); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             IdenWarningPersonHis idenWarningPersonHis = new IdenWarningPersonHis(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             BeanUtil.copyProperties(idenWarningPerson,idenWarningPersonHis,"id"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             idenWarningPersonHis.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            idenWarningPersonHis.setModifyTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             idenWarningPersonHisService.save(idenWarningPersonHis); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             IdenWarningEvent idenWarningEvent = new IdenWarningEvent(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -639,6 +651,7 @@ public class WarningService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             idenWarningEvent.setAppearTime(idenFaceImage.getPhotographTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             idenWarningEvent.setType(WarningTypeEnum.EVENING_COMMING.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             idenWarningEvent.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            idenWarningEvent.setModifyTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             this.idenWarningEventService.save(idenWarningEvent); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 |