fix: get_dag时matin matout为空时不报错
This commit is contained in:
parent
61488bb4bd
commit
b852e9b740
|
@ -485,14 +485,15 @@ class Route(CommonADModel):
|
|||
edges = []
|
||||
|
||||
for rq in rqs:
|
||||
source = rq.material_in.id
|
||||
target = rq.material_out.id
|
||||
nodes_set.update([source, target])
|
||||
edges.append({
|
||||
'source': source,
|
||||
'target': target,
|
||||
'label': rq.process.name,
|
||||
})
|
||||
if rq.material_in and rq.material_out:
|
||||
source = rq.material_in.id
|
||||
target = rq.material_out.id
|
||||
nodes_set.update([source, target])
|
||||
edges.append({
|
||||
'source': source,
|
||||
'target': target,
|
||||
'label': rq.process.name,
|
||||
})
|
||||
# 将批次号排序
|
||||
nodes_qs = Material.objects.filter(id__in=nodes_set).order_by("process__sort", "create_time")
|
||||
|
||||
|
|
Loading…
Reference in New Issue