From 1222b7be7648d0399be8395c0e88c0aa877729ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Wed, 21 Sep 2022 18:25:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E6=A0=A1=E9=AA=8Cbu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/develop/views.py | 14 +++++++++----- apps/utils/tools.py | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/develop/views.py b/apps/develop/views.py index 3d3ef559..451f8fd5 100755 --- a/apps/develop/views.py +++ b/apps/develop/views.py @@ -252,7 +252,8 @@ class TestViewSet(CustomGenericViewSet): 位置信息改变 """ - data = {'buildId': '204878', 'floorNo': 'Floor1', 'userId': '1918B2001A26', 'timestampMillisecond': 1663749630302, 'xMillimeter': 314364, 'yMillimeter': 362752, 'zMillimeter': 0, 'pointProperties': 0, 'locationType': 1, 'status': 0, 'src': 0, 'longitude': 114.63020038067505, 'latitude': 38.81357371331778} + data = {'buildId': '204878', 'floorNo': 'Floor1', 'userId': '1918B2001A26', 'timestampMillisecond': 1663749630302, 'xMillimeter': 314364, 'yMillimeter': 362752, + 'zMillimeter': 0, 'pointProperties': 0, 'locationType': 1, 'status': 0, 'src': 0, 'longitude': 114.63020038067505, 'latitude': 38.81357371331778} res = loc_change(data=data) return Response(res) @@ -267,18 +268,17 @@ class TestViewSet(CustomGenericViewSet): res = handle_xx_event(name='one_key_alarm', data=data) return Response(res) - @action(methods=['post'], detail=False, serializer_class=Serializer) def test_rail_in(self, request, pk=None): """测试围栏进入 测试围栏进入 """ - data = {'railId': '80fe94bff7b240aa893976965197487c', 'userId': '1918B20019F5',"railName":"二道门", - 'time': 1663067822887, "type":1, "buildId": "204878", "floorNo":"Floor1"} + data = {'railId': '80fe94bff7b240aa893976965197487c', 'userId': '1918B20019F5', "railName": "二道门", + 'time': 1663067822887, "type": 1, "buildId": "204878", "floorNo": "Floor1"} res = rail_in(data=data) return Response(res) - + @action(methods=['post'], detail=False, serializer_class=AreaManSerializer) def test_area_man(self, request, pk=None): """测试区域超员/缺员事件 @@ -288,6 +288,10 @@ class TestViewSet(CustomGenericViewSet): res = update_count_people(i=Area.objects.get(id=request.data['area'])) return Response(res) + @action(methods=['post'], detail=False, serializer_class=Serializer) + def correct_rail(self, request, pk=None): + pass + @action(methods=['post'], detail=False, serializer_class=Serializer) def test_not_in_place(self, request, pk=None): check_not_in_place(Opl.objects.get(id='1568880208688320512')) diff --git a/apps/utils/tools.py b/apps/utils/tools.py index ca759d07..631e780c 100755 --- a/apps/utils/tools.py +++ b/apps/utils/tools.py @@ -171,7 +171,7 @@ def check_id_number(idcard): def check_phone_e(phone): - re_phone = r'/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/' + re_phone = r'^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\\d{8}$' if not re.match(re_phone, phone): raise ValidationError('手机号格式错误') return phone