feat: route接口增加按product获取总图
This commit is contained in:
parent
7f34d45160
commit
320da10e61
|
|
@ -379,6 +379,16 @@ class RouteViewSet(CustomModelViewSet):
|
||||||
raise ParseError('该工艺步骤被其他步骤引用,无法删除')
|
raise ParseError('该工艺步骤被其他步骤引用,无法删除')
|
||||||
return super().perform_destroy(instance)
|
return super().perform_destroy(instance)
|
||||||
|
|
||||||
|
@action(methods=['post'], detail=False, perms_map={'post': '*'}, serializer_class=Serializer)
|
||||||
|
def dag(self, request, *args, **kwargs):
|
||||||
|
"""获取总图
|
||||||
|
|
||||||
|
获取总图
|
||||||
|
"""
|
||||||
|
materialId = self.request.data.get('product', None)
|
||||||
|
if materialId is None:
|
||||||
|
raise ParseError('缺少参数product')
|
||||||
|
return Response(Route.get_dag(rqs=Route.objects.filter(material__id=materialId)))
|
||||||
|
|
||||||
class SruleViewSet(CustomModelViewSet):
|
class SruleViewSet(CustomModelViewSet):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue