Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
b127cb4b
提交
b127cb4b
authored
10月 17, 2025
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
获取优化
上级
df7602c3
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
6 行增加
和
9 行删除
+6
-9
cc_bill_loading.py
ccs_base/models/cc_bill_loading.py
+1
-0
batch_get_pod_info_wizard.py
ccs_base/wizard/batch_get_pod_info_wizard.py
+5
-9
没有找到文件。
ccs_base/models/cc_bill_loading.py
浏览文件 @
b127cb4b
...
...
@@ -1152,6 +1152,7 @@ class CcBL(models.Model):
'type'
:
'ir.actions.act_window'
,
'view_mode'
:
'form'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'context'
:
{
'active_id'
:
self
.
ids
},
'target'
:
'new'
,
}
...
...
ccs_base/wizard/batch_get_pod_info_wizard.py
浏览文件 @
b127cb4b
...
...
@@ -44,14 +44,13 @@ class BatchGetPodInfoWizard(models.TransientModel):
bl_objs
=
self
.
get_order
()
# 调用接口获取提单pdf文件
pdf_file_arr
=
self
.
_get_pdf_file_arr
()
if
not
pdf_file_arr
:
raise
ValidationError
(
_
(
'No PDF files found'
))
#提示:没有获取到PDF文件
# 处理PDF文件,匹配提单对象
processed_files
=
self
.
_match_bl_by_file_name
(
pdf_file_arr
)
# 把没有匹配到文件的进行提示
error_bl
=
[]
matched_bl_ids
=
[
f
[
'bl'
]
.
id
for
f
in
processed_files
if
f
.
get
(
'bl'
)]
for
bl
in
bl_objs
:
if
not
bl
in
[
f
[
'bl'
]
for
f
in
processed_files
]
:
if
bl
.
id
not
in
matched_bl_ids
:
error_bl
.
append
(
bl
)
if
error_bl
:
# 英文提示
...
...
@@ -87,7 +86,6 @@ class BatchGetPodInfoWizard(models.TransientModel):
request_data
=
{
"bill_numbers"
:
bill_numbers
}
try
:
response
=
requests
.
post
(
f
"{api_url}/api/release-notes/pdfs"
,
...
...
@@ -107,6 +105,7 @@ class BatchGetPodInfoWizard(models.TransientModel):
# 处理结果数据
results
=
result
.
get
(
'results'
,
[])
if
not
results
:
raise
ValidationError
(
_
(
'No PDF files found in API response'
))
#提示:API调用成功,但没有PDF文件
# 构建PDF文件数组
...
...
@@ -137,11 +136,7 @@ class BatchGetPodInfoWizard(models.TransientModel):
except
Exception
as
e
:
_logger
.
warning
(
f
"API PDF文件验证失败,提单号: {bill_number}, 错误: {str(e)}"
)
continue
if
not
pdf_file_arr
:
_logger
.
error
(
"所有API PDF文件验证都失败"
)
raise
ValidationError
(
_
(
'All API PDF files failed validation'
))
#提示:所有API PDF文件验证都失败
logging
.
info
(
'len(pdf_file_arr):
%
s'
%
len
(
pdf_file_arr
))
return
pdf_file_arr
else
:
raise
ValidationError
(
_
(
'Failed to get PDF file from API:
%
s'
)
%
response
.
text
)
...
...
@@ -194,6 +189,7 @@ class BatchGetPodInfoWizard(models.TransientModel):
}
processed_files
.
append
(
processed_file
)
break
logging
.
info
(
"继续下一个提单"
)
_logger
.
info
(
f
"匹配完成,成功匹配{len(processed_files)}个文件"
)
return
processed_files
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论