15 lines
488 B
Python
15 lines
488 B
Python
from apps.sam.models import Order, OrderItem
|
|
from apps.mtm.models import Route
|
|
from rest_framework.exceptions import ParseError
|
|
|
|
class PmService:
|
|
|
|
@classmethod
|
|
def make_mtasks_by_order(cls, order: Order):
|
|
"""
|
|
从订单自动生成生产任务
|
|
"""
|
|
for orderitem in OrderItem.objects.filter(order=order):
|
|
routes = Route.objects.filter(material=orderitem.material, is_autotask=True)
|
|
if routes.exists():
|
|
pass |