Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
71df1437
提交
71df1437
authored
9月 19, 2025
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
只要有小包状态不是当前节点的就变为清关中
上级
68e36974
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
11 行增加
和
10 行删除
+11
-10
cc_bill_loading.py
ccs_connect_tiktok/models/cc_bill_loading.py
+11
-10
没有找到文件。
ccs_connect_tiktok/models/cc_bill_loading.py
浏览文件 @
71df1437
...
@@ -2,15 +2,17 @@
...
@@ -2,15 +2,17 @@
import
asyncio
import
asyncio
import
json
import
json
import
logging
import
logging
import
re
import
ssl
import
ssl
from
datetime
import
timedelta
,
datetime
from
datetime
import
timedelta
,
datetime
import
re
import
aiohttp
import
aiohttp
import
certifi
import
certifi
import
pytz
import
pytz
from
odoo
import
models
,
fields
,
api
,
_
from
odoo
import
models
,
fields
,
api
,
_
from
odoo.exceptions
import
ValidationError
from
odoo.exceptions
import
ValidationError
def
get_rfc339_time
(
utc_time
=
None
):
def
get_rfc339_time
(
utc_time
=
None
):
if
not
utc_time
:
if
not
utc_time
:
# 获取当前时间的UTC时间
# 获取当前时间的UTC时间
...
@@ -355,14 +357,14 @@ class CcBl(models.Model):
...
@@ -355,14 +357,14 @@ class CcBl(models.Model):
根据小包的状态修改提单的状态
根据小包的状态修改提单的状态
:return:
:return:
"""
"""
# 如果提单有小包变成了清关开始,提单状态变为清关中
# 如果提单有小包变成了清关开始,提单状态变为清关中
改成 只要有小包状态不是当前节点的就变为清关中
if
self
.
state
==
'draft'
and
self
.
ship_package_ids
.
filtered
(
if
self
.
state
==
'draft'
and
self
.
ship_package_ids
.
filtered
(
lambda
line
:
line
.
state
.
tk_code
==
'cb_imcustoms_start'
):
lambda
line
:
not
line
.
state
.
is_default
):
# == 'cb_imcustoms_start'
self
.
ccing_func
()
self
.
ccing_func
()
# 如果提单所有小包的清关节点变成"是完成节点",则该提单状态变成已完成
# 如果提单所有小包的清关节点变成"是完成节点",则该提单状态变成已完成
if
all
(
line
.
state
.
is_done
for
line
in
if
all
(
line
.
state
.
is_done
for
line
in
self
.
ship_package_ids
)
and
self
.
unsync_package_count
<=
0
and
self
.
customs_clearance_status
.
is_done
and
self
.
is_bl_sync
:
self
.
ship_package_ids
)
and
self
.
unsync_package_count
<=
0
and
self
.
customs_clearance_status
.
is_done
and
self
.
is_bl_sync
:
self
.
done_func
(
is_email
=
True
)
self
.
done_func
(
is_email
=
True
)
def
change_customs_state_by_ship_package
(
self
,
package_state_obj
,
user_obj
=
False
):
def
change_customs_state_by_ship_package
(
self
,
package_state_obj
,
user_obj
=
False
):
"""
"""
...
@@ -455,10 +457,10 @@ class CcBl(models.Model):
...
@@ -455,10 +457,10 @@ class CcBl(models.Model):
is_success
=
result
[
'issue_count'
]
==
0
is_success
=
result
[
'issue_count'
]
==
0
if
not
is_success
:
if
not
is_success
:
if
is_email
:
if
is_email
:
#发送邮件
#
发送邮件
bls
.
_send_patrol_email
(
result
)
bls
.
_send_patrol_email
(
result
)
else
:
else
:
#把错误的进行提示
#
把错误的进行提示
content
=
self
.
get_patrol_email_content
(
result
)
content
=
self
.
get_patrol_email_content
(
result
)
raise
ValidationError
(
content
)
raise
ValidationError
(
content
)
if
is_success
:
if
is_success
:
...
@@ -770,7 +772,7 @@ class CcBl(models.Model):
...
@@ -770,7 +772,7 @@ class CcBl(models.Model):
break
break
return
issues
return
issues
def
_send_patrol_email
(
self
,
result
,
patrol_obj
=
False
):
def
_send_patrol_email
(
self
,
result
,
patrol_obj
=
False
):
"""
"""
发送巡查邮件
发送巡查邮件
"""
"""
...
@@ -809,8 +811,7 @@ class CcBl(models.Model):
...
@@ -809,8 +811,7 @@ class CcBl(models.Model):
except
Exception
as
e
:
except
Exception
as
e
:
logging
.
error
(
f
"发送巡查邮件失败: {str(e)}"
)
logging
.
error
(
f
"发送巡查邮件失败: {str(e)}"
)
def
get_patrol_email_content
(
self
,
result
,
title
=
'您好,经系统巡查。'
):
def
get_patrol_email_content
(
self
,
result
,
title
=
'您好,经系统巡查。'
):
"""
"""
获取巡查邮件内容
获取巡查邮件内容
"""
"""
...
@@ -825,7 +826,7 @@ class CcBl(models.Model):
...
@@ -825,7 +826,7 @@ class CcBl(models.Model):
%
s
%
s
%
s
%
s
请立即处理!!!"""
%
(
title
,
"发现以下提单存在小包轨迹倒挂/轨迹漏推"
if
package_content
else
""
,
请立即处理!!!"""
%
(
title
,
"发现以下提单存在小包轨迹倒挂/轨迹漏推"
if
package_content
else
""
,
package_content
if
package_content
else
""
,
package_content
if
package_content
else
""
,
"发现以下提单存在提单关务节点轨迹倒挂/轨迹漏推"
if
bl_content
else
""
,
"发现以下提单存在提单关务节点轨迹倒挂/轨迹漏推"
if
bl_content
else
""
,
bl_content
if
bl_content
else
""
)
bl_content
if
bl_content
else
""
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论