Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
deee0d04
提交
deee0d04
authored
9月 24, 2025
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
托盘理货的优化
上级
c8d9c597
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
13 行删除
+14
-13
order_controller.py
ccs_connect_tiktok/controllers/order_controller.py
+14
-13
没有找到文件。
ccs_connect_tiktok/controllers/order_controller.py
浏览文件 @
deee0d04
...
...
@@ -595,7 +595,7 @@ class OrderController(http.Controller):
res
=
{
'state'
:
201
,
'message'
:
''
}
try
:
logging
.
info
(
'last_mile_tally kwargs:
%
s'
%
kwargs
)
return
self
.
_get_last_mile_grouped
(
'unprocessed_goods'
,
pda_lang
)
return
self
.
_get_last_mile_grouped
(
[
'unprocessed_goods'
,
'picked_up'
]
,
pda_lang
)
except
Exception
as
e
:
exceptions_msg_dic
=
{
'en'
:
'System parsing error, the reason for the error is
%
s'
%
e
,
...
...
@@ -618,7 +618,7 @@ class OrderController(http.Controller):
try
:
logging
.
info
(
'last_mile_delivery kwargs:
%
s'
%
kwargs
)
# 按尾程交货时,检查时间风险 大包或小包对应的提单是否已存在成功扫码记录
res
=
self
.
_get_last_mile_grouped
(
'checked_goods'
,
pda_lang
)
res
=
self
.
_get_last_mile_grouped
(
[
'checked_goods'
,
'picked_up'
]
,
pda_lang
)
return
res
except
Exception
as
e
:
exceptions_msg_dic
=
{
...
...
@@ -693,7 +693,7 @@ class OrderController(http.Controller):
logging
.
info
(
'last_mile_tally_time_check res:
%
s'
%
res
)
return
res
def
_get_last_mile_grouped
(
self
,
tally_state
,
pda_lang
,
is_pallet
=
False
):
def
_get_last_mile_grouped
(
self
,
tally_state
_arr
,
pda_lang
,
is_pallet
=
False
):
lang
=
'zh_CN'
if
pda_lang
==
'zh'
else
'en_US'
# 语言
# if is_pallet:
# domain=[('state', '!=', 'done')]# 1. 按托盘理货时,查非已完成状态的提单
...
...
@@ -701,8 +701,8 @@ class OrderController(http.Controller):
# 先都查清关中的,如果以后要查非已完成状态的提单,再修改domain。而且查尾程快递和对应的大包或托盘信息得分两个接口
domain
=
[(
'bl_id.state'
,
'='
,
'ccing'
)]
# 1. 按尾程理货时,查所有清关中提单
# 2. 查所有大包 如果是托盘的交货,不需要过滤理货状态
if
not
is_pallet
or
(
is_pallet
and
tally_state
==
'unprocessed_goods'
):
domain
+=
[(
'tally_state'
,
'
='
,
tally_state
)]
if
not
is_pallet
or
(
is_pallet
and
'unprocessed_goods'
in
tally_state_arr
):
domain
+=
[(
'tally_state'
,
'
in'
,
tally_state_arr
)]
big_packages
=
request
.
env
[
'cc.big.package'
]
.
sudo
()
.
search
(
domain
)
# 3. 按"下一阶段服务商名称"分组
group_dict
=
{}
...
...
@@ -719,13 +719,14 @@ class OrderController(http.Controller):
group_dict
[
key
][
'ship_package_arr'
]
=
[]
# 小包信息
group_dict
[
key
][
'pallet_info_arr'
]
=
[]
# 托盘信息
group_dict
[
key
][
'count'
]
+=
1
if
tally_state
==
'unprocessed_goods'
or
(
tally_state
==
'checked_goods'
and
not
is_pallet
):
group_dict
[
key
][
'big_package_arr'
]
.
append
(
pkg
.
search_big_package_info
(
pda_lang
=
pda_lang
,
type
=
tally_state
))
if
'unprocessed_goods'
in
tally_state_arr
or
(
'checked_goods'
in
tally_state_arr
and
not
is_pallet
):
for
tally_state
in
tally_state_arr
:
group_dict
[
key
][
'big_package_arr'
]
.
append
(
pkg
.
search_big_package_info
(
pda_lang
=
pda_lang
,
type
=
tally_state
))
# 按托盘理货时返回未使用的托盘信息,按尾程时返回小包信息
if
is_pallet
:
# 如果是未理货,查未使用托盘;如果是已理货,查已使用托盘
if
tally_state
==
'unprocessed_goods'
:
if
'unprocessed_goods'
in
tally_state_arr
:
domain
=
[(
'usage_state'
,
'='
,
'unused'
)]
else
:
domain
=
[(
'usage_state'
,
'='
,
'used'
)]
...
...
@@ -914,7 +915,7 @@ class OrderController(http.Controller):
res
=
{
'state'
:
201
,
'message'
:
''
}
try
:
logging
.
info
(
'pallet_tally kwargs:
%
s'
%
kwargs
)
return
self
.
_get_last_mile_grouped
(
'unprocessed_goods'
,
pda_lang
,
is_pallet
=
True
)
return
self
.
_get_last_mile_grouped
(
[
'unprocessed_goods'
,
'picked_up'
]
,
pda_lang
,
is_pallet
=
True
)
except
Exception
as
e
:
exceptions_msg_dic
=
{
'en'
:
'System parsing error, the reason for the error is
%
s'
%
e
,
...
...
@@ -937,7 +938,7 @@ class OrderController(http.Controller):
res
=
{
'state'
:
201
,
'message'
:
''
}
try
:
logging
.
info
(
'pallet_handover kwargs:
%
s'
%
kwargs
)
res
=
self
.
_get_last_mile_grouped
(
'checked_goods'
,
pda_lang
,
is_pallet
=
True
)
res
=
self
.
_get_last_mile_grouped
(
[
'checked_goods'
,
'picked_up'
]
,
pda_lang
,
is_pallet
=
True
)
except
Exception
as
e
:
exceptions_msg_dic
=
{
'en'
:
'System parsing error, the reason for the error is
%
s'
%
e
,
...
...
@@ -1015,12 +1016,12 @@ class OrderController(http.Controller):
package_obj
.
update_exception_info
(
exception_cause_ids
)
# 修改异常信息
tally_time
=
package_item
.
get
(
'tally_time'
)
if
(
action_type
==
'tally'
and
package_item
.
get
(
'tally_state'
)
==
'checked_goods'
)
or
(
if
(
action_type
==
'
pickup'
and
package_item
.
get
(
'tally_state'
)
==
'picked_up'
)
or
(
action_type
==
'
tally'
and
package_item
.
get
(
'tally_state'
)
==
'checked_goods'
)
or
(
action_type
==
'handover'
and
package_item
.
get
(
'tally_state'
)
==
'handover_completed'
):
for
package
in
package_obj
:
if
(
action_type
==
'tally'
and
package
.
tally_state
==
'unprocessed_goods'
)
or
(
action_type
==
'
pickup'
and
package
.
tally_state
==
'unprocessed_goods'
)
or
(
action_type
==
'
tally'
and
package
.
tally_state
==
'unprocessed_goods'
)
or
(
action_type
==
'handover'
and
package
.
tally_state
in
(
'unprocessed_goods'
,
'checked_goods'
)):
ship_packages
.
append
({
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论