feat: 添加筛选条件和mlogbin 校验

This commit is contained in:
caoqianming 2024-07-18 13:46:16 +08:00
parent d561a0d24b
commit 6a51fd1177
2 changed files with 4 additions and 1 deletions

View File

@ -47,7 +47,8 @@ class WMaterialFilter(filters.FilterSet):
"batch": ["exact", "contains"], "batch": ["exact", "contains"],
"mgroup": ["exact", "in", "isnull"], "mgroup": ["exact", "in", "isnull"],
"mgroup__name": ["exact", "in"], "mgroup__name": ["exact", "in"],
"count": ["gte", "lte", "exact"] "count": ["gte", "lte", "exact"],
"notok_sign": ["exact", "in", "isnull"]
} }
class MlogFilter(filters.FilterSet): class MlogFilter(filters.FilterSet):

View File

@ -368,6 +368,8 @@ class MlogbInSerializer(CustomModelSerializer):
mlog: Mlog = attrs['mlog'] mlog: Mlog = attrs['mlog']
mtask: Mtask = attrs['mtask'] mtask: Mtask = attrs['mtask']
wm_in: WMaterial = attrs['wm_in'] wm_in: WMaterial = attrs['wm_in']
if wm_in.notok_sign is not None:
raise ValidationError('不合格物料不可使用')
if mlog.route != mtask.route: if mlog.route != mtask.route:
raise ValidationError('工序不匹配') raise ValidationError('工序不匹配')
route = mlog.route route = mlog.route