提交 0ead8970 authored 作者: 刘擎阳's avatar 刘擎阳

1.优化单号匹配

上级 7616d7fb
......@@ -634,6 +634,7 @@ class OrderStateChangeRule(models.Model):
# 提单号
order_no = None
ze_2 = re.compile("\\d{3}-\\d{8,}")
ze_3 = re.compile("DYBS(\d{11})$")
# 清关开始日期
date_str = None
pattern = r'\d{2}/\d{2}/\d{4}\s*\d{2}:\d{2}:\d{2}'
......@@ -642,6 +643,10 @@ class OrderStateChangeRule(models.Model):
break
if ze_2.findall(w):
order_no = ze_2.findall(w)[0]
if not order_no:
match = ze_3.search(w)
if match:
order_no = match.group(1)
matches = re.findall(pattern, w)
if matches:
date_str = matches[0]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论