loc change bug
This commit is contained in:
		
							parent
							
								
									2711bcb8f5
								
							
						
					
					
						commit
						255e23f1cd
					
				|  | @ -447,7 +447,7 @@ def rail_out(data): | ||||||
| 
 | 
 | ||||||
| def loc_change(data): | def loc_change(data): | ||||||
|     blts = TDevice.objects.filter(code=data['userId']).first() |     blts = TDevice.objects.filter(code=data['userId']).first() | ||||||
|     if blts.employee: |     if blts and blts.employee: | ||||||
|         # 从缓存查询人员位置信息 |         # 从缓存查询人员位置信息 | ||||||
|         key_str = 'ep_{}'.format(blts.employee.id) |         key_str = 'ep_{}'.format(blts.employee.id) | ||||||
|         ep_loc_dict = cache.get_or_set( |         ep_loc_dict = cache.get_or_set( | ||||||
|  | @ -485,7 +485,7 @@ def handle_xx_event(name: str, data: dict): | ||||||
|     # 有绑定对象再提示事件(包括一键报警事件/低电量) |     # 有绑定对象再提示事件(包括一键报警事件/低电量) | ||||||
|     blts = TDevice.objects.filter(code=data['mac']).first() |     blts = TDevice.objects.filter(code=data['mac']).first() | ||||||
|     ep_loc_dict = {} |     ep_loc_dict = {} | ||||||
|     if blts.employee: |     if blts and blts.employee: | ||||||
|         # 触发事件 |         # 触发事件 | ||||||
|         cate = EventCate.objects.filter(code=name).first() |         cate = EventCate.objects.filter(code=name).first() | ||||||
|         # 找到最近未处理同一人发生的事件 |         # 找到最近未处理同一人发生的事件 | ||||||
|  |  | ||||||
|  | @ -44,7 +44,7 @@ class TDevice(BaseModel): | ||||||
|                                     null=True, blank=True) |                                     null=True, blank=True) | ||||||
|     is_clock = models.BooleanField('是否打卡设备', default=False) |     is_clock = models.BooleanField('是否打卡设备', default=False) | ||||||
|     access_list = models.JSONField('自动下发人员类型', default=list, |     access_list = models.JSONField('自动下发人员类型', default=list, | ||||||
|                                    null=False, blank=True, help_text='employee/remployee/visitor') |                                    null=False, blank=True, help_text='employee/remployee/visitor/driver') | ||||||
|     third_info = models.JSONField('三方信息', default=dict, |     third_info = models.JSONField('三方信息', default=dict, | ||||||
|                                   null=False, blank=True) |                                   null=False, blank=True) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue