提交 49889fce authored 作者: 贺阳's avatar 贺阳

倒挂之后后续的也不生成

上级 bae6d6bc
......@@ -405,13 +405,15 @@ class CcBl(models.Model):
logging.info(f"latest_prev_time: {latest_prev_time}")
if candidate_time < latest_prev_time:
remark = (
f"自动补写提单前序关务节点被跳过,节点:{before_node.desc or before_node.name},"
f"自动补写提单前序关务节点被拦截,节点:{before_node.desc or before_node.name},"
f"候选时间:{candidate_time.strftime('%Y-%m-%d %H:%M:%S')},"
f"前序节点最新时间:{latest_prev_time.strftime('%Y-%m-%d %H:%M:%S')}。"
f"存在时间倒挂风险,请核查。"
)
bl.message_post(body=remark)
continue
# continue
is_ok = False
break
next_nodes = self.env['cc.node'].sudo().search([
('node_type', '=', 'bl'),
('is_must', '=', True),
......@@ -468,10 +470,12 @@ class CcBl(models.Model):
('is_must', '=', True),
('seq', '>', state_obj.seq),
])
logging.info(f"next_nodes: {next_nodes}")
if next_nodes:
next_codes = next_nodes.mapped('tk_code')
next_logs = bl.bl_sync_log_ids.filtered(
lambda r: r.process_code in next_codes and r.operate_time)
logging.info(f"next_logs: {next_logs}")
if next_logs:
earliest_next_time = min(next_logs.mapped('operate_time'))
if candidate_time > earliest_next_time:
......@@ -483,6 +487,7 @@ class CcBl(models.Model):
)
logging.info(f"allow_push: {allow_push}")
if allow_push:
logging.info(f"state_obj: {state_obj.tk_code}")
bl.customs_clearance_status = state_obj.id
bl.process_time = candidate_time
bl.is_bl_sync = state_obj.node_is_sync()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论