develop test_not_in_place
This commit is contained in:
parent
3433071b06
commit
6556379273
|
@ -309,6 +309,12 @@ class TestViewSet(CustomGenericViewSet):
|
|||
v_num=2)
|
||||
return Response()
|
||||
|
||||
@action(methods=['post'], detail=False, serializer_class=Serializer)
|
||||
def test_not_in_place(self, request, pk=None):
|
||||
opl = request.data.get('opl')
|
||||
check_not_in_place(opl=Opl.objects.get(id=opl))
|
||||
return Response()
|
||||
|
||||
@action(methods=['post'], detail=False, serializer_class=Serializer)
|
||||
def send_wx_msg(self, request, pk=None):
|
||||
"""微信模板消息发送测试
|
||||
|
|
|
@ -244,7 +244,7 @@ def check_not_in_place(opl: Opl):
|
|||
blt_list = res['recordList']
|
||||
macs = [] # 所有该区域在线标签
|
||||
for i in blt_list:
|
||||
macs.append(i['mac'])
|
||||
macs.append(i['userId'])
|
||||
tds = TDevice.objects.filter(type=TDevice.DEVICE_BLT, employee__user__opl_worker__opl=opl) # 所有工作人员的定位标签
|
||||
for i in tds:
|
||||
if i.code not in macs:
|
||||
|
|
|
@ -11,6 +11,7 @@ from rest_framework.exceptions import ParseError
|
|||
from apps.am.serializers import AreaSimpleSerializer
|
||||
from apps.wf.serializers import TicketSerializer
|
||||
from apps.system.serializers import FileSerializer
|
||||
from apps.third.serializers import TDeviceSimpleSerializer
|
||||
from django_celery_results.models import TaskResult
|
||||
|
||||
|
||||
|
@ -62,6 +63,7 @@ class OperationDetailSerializer(CustomModelSerializer):
|
|||
coordinator_ = UserSimpleSerializer(source='coordinator', read_only=True)
|
||||
create_by_ = UserSimpleSerializer(source='create_by', read_only=True)
|
||||
cates_ = OplCateSimpleSerializer(source='cates', read_only=True, many=True)
|
||||
vchannels_ = TDeviceSimpleSerializer(source='vchannels', read_only=True)
|
||||
|
||||
class Meta:
|
||||
model = Operation
|
||||
|
|
Loading…
Reference in New Issue