diff --git a/apps/ecm/service.py b/apps/ecm/service.py index d899c5a5..51e7dbcb 100644 --- a/apps/ecm/service.py +++ b/apps/ecm/service.py @@ -9,9 +9,9 @@ class EcmService: """事件处理服务 """ - def create_remind(cls): + def create_remind_and_speak(cls): """ - 创建事件提醒并发送通知 + 创建事件提醒并发送短信/微信/音响 """ pass @@ -62,8 +62,14 @@ class EcmService: if area: json = {"railId": data['railId'], "type": ""} _, res = xxClient.request(**xxapis['rail_ibeacon_list'], json=json) - if res['totalCount'] >= area.count_people_max: + total_count = res['totalCount'] + if total_count >= area.count_people_max: # 触发超员事件 - area.count_people = res['totalCount'] + area.count_people = total_count + area.save() + pass + elif total_count < area.count_people_min: + # 触发缺员事件 + area.count_people_min = total_count area.save() pass diff --git a/apps/ecm/tasks.py b/apps/ecm/tasks.py new file mode 100644 index 00000000..e69de29b diff --git a/apps/hrm/views.py b/apps/hrm/views.py index 4903890c..e183f6e0 100755 --- a/apps/hrm/views.py +++ b/apps/hrm/views.py @@ -189,3 +189,4 @@ class CertificateViewSet(CustomModelViewSet): create_serializer_class = CertificateCreateUpdateSerializer update_serializer_class = CertificateCreateUpdateSerializer serializer_class = CertificateSerializer + filterset_fields = ['employee__user']