Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
3e67df8a
提交
3e67df8a
authored
9月 18, 2024
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、推送时间改为操作时间
2、推入和推出的传输数据存值 3、提单更新包裹状态的时候 如果当前节点是默认节点,那就不检查。如果更新节点是默认节点,那同步的标志变为True
上级
5f1eb134
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
38 行增加
和
24 行删除
+38
-24
zh_CN.po
ccs_base/i18n/zh_CN.po
+1
-1
cc_bill_loading.py
ccs_base/models/cc_bill_loading.py
+1
-1
batch_input_ship_package_statu_wizard.py
ccs_base/wizard/batch_input_ship_package_statu_wizard.py
+5
-1
tt_controllers.py
ccs_connect_tiktok/controllers/tt_controllers.py
+16
-5
cc_bill_loading.py
ccs_connect_tiktok/models/cc_bill_loading.py
+8
-10
batch_input_ship_package_statu_wizard.py
...ct_tiktok/wizard/batch_input_ship_package_statu_wizard.py
+7
-6
没有找到文件。
ccs_base/i18n/zh_CN.po
浏览文件 @
3e67df8a
...
@@ -1455,7 +1455,7 @@ msgstr "小包数"
...
@@ -1455,7 +1455,7 @@ msgstr "小包数"
#: model:ir.model.fields,field_description:ccs_base.field_cc_ship_package__process_time
#: model:ir.model.fields,field_description:ccs_base.field_cc_ship_package__process_time
#: model_terms:ir.ui.view,arch_db:ccs_base.view_batch_input_ship_package_wizard
#: model_terms:ir.ui.view,arch_db:ccs_base.view_batch_input_ship_package_wizard
msgid "Process Time"
msgid "Process Time"
msgstr "
推送
时间"
msgstr "
操作
时间"
#. module: ccs_base
#. module: ccs_base
#: model_terms:ir.ui.view,arch_db:ccs_base.tree_cc_ship_package_view
#: model_terms:ir.ui.view,arch_db:ccs_base.tree_cc_ship_package_view
...
...
ccs_base/models/cc_bill_loading.py
浏览文件 @
3e67df8a
...
@@ -346,7 +346,7 @@ class CcShipPackage(models.Model):
...
@@ -346,7 +346,7 @@ class CcShipPackage(models.Model):
# if process_time < fields.Datetime.from_string(self.process_time):
# if process_time < fields.Datetime.from_string(self.process_time):
# raise UserError(_('The process time can not be earlier than the current process time.'))
# raise UserError(_('The process time can not be earlier than the current process time.'))
if
'state'
in
vals
:
if
'state'
in
vals
and
not
vals
.
get
(
'is_sync'
)
:
vals
[
'is_sync'
]
=
False
vals
[
'is_sync'
]
=
False
return
super
(
CcShipPackage
,
self
)
.
write
(
vals
)
return
super
(
CcShipPackage
,
self
)
.
write
(
vals
)
...
...
ccs_base/wizard/batch_input_ship_package_statu_wizard.py
浏览文件 @
3e67df8a
...
@@ -78,10 +78,14 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
...
@@ -78,10 +78,14 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
reason_obj
=
self
.
env
[
'cc.node.exception.reason'
]
.
search
([(
'code_id'
,
'='
,
self
.
update_status
.
id
)])
reason_obj
=
self
.
env
[
'cc.node.exception.reason'
]
.
search
([(
'code_id'
,
'='
,
self
.
update_status
.
id
)])
if
reason_obj
and
not
self
.
node_exception_reason_id
:
if
reason_obj
and
not
self
.
node_exception_reason_id
:
raise
ValidationError
(
'Please select the reason for the exception!'
)
# 请选择异常原因
raise
ValidationError
(
'Please select the reason for the exception!'
)
# 请选择异常原因
# 如果更新节点是 默认节点 同步的标志变为True
is_sync
=
False
if
self
.
update_status
.
is_default
:
is_sync
=
True
# 更新状态
# 更新状态
parcels
.
write
(
parcels
.
write
(
{
'state'
:
self
.
update_status
.
id
,
'node_exception_reason_id'
:
self
.
node_exception_reason_id
.
id
,
{
'state'
:
self
.
update_status
.
id
,
'node_exception_reason_id'
:
self
.
node_exception_reason_id
.
id
,
'process_time'
:
self
.
process_time
,
'state_explain'
:
self
.
state_explain
,
'is_sync'
:
False
})
'process_time'
:
self
.
process_time
,
'state_explain'
:
self
.
state_explain
,
'is_sync'
:
is_sync
})
# 生成sns日志
# 生成sns日志
# self.bl_id.message_post(body='%s更新为%s' % (self.current_status.name or '', self.update_status.name or ''))
# self.bl_id.message_post(body='%s更新为%s' % (self.current_status.name or '', self.update_status.name or ''))
# 跳转显示本次更新状态的小包 更新小包状态
# 跳转显示本次更新状态的小包 更新小包状态
...
...
ccs_connect_tiktok/controllers/tt_controllers.py
浏览文件 @
3e67df8a
...
@@ -280,7 +280,8 @@ class TTApi(http.Controller):
...
@@ -280,7 +280,8 @@ class TTApi(http.Controller):
if
declare_type
==
'create'
:
if
declare_type
==
'create'
:
bl
=
request
.
env
[
'cc.bl'
]
.
sudo
()
.
create
(
bl_vals
)
bl
=
request
.
env
[
'cc.bl'
]
.
sudo
()
.
create
(
bl_vals
)
# 默认创建清关文件明细
# 默认创建清关文件明细
file_name_arr
=
[
'主单'
,
'货站提货POD'
,
'Manifest格式和数据(cvs/excel格式,系统目前不支持,线下提供或保留现有方式)'
,
file_name_arr
=
[
'主单'
,
'货站提货POD'
,
'Manifest格式和数据(cvs/excel格式,系统目前不支持,线下提供或保留现有方式)'
,
'海关CDS申报单(import和授权方式检查拉齐等)'
,
'尾程交接POD(待大包数量和箱号)'
]
'海关CDS申报单(import和授权方式检查拉齐等)'
,
'尾程交接POD(待大包数量和箱号)'
]
request
.
env
[
'cc.clearance.file'
]
.
sudo
()
.
create_clearance_file_func
(
file_name_arr
,
bl
.
id
)
request
.
env
[
'cc.clearance.file'
]
.
sudo
()
.
create_clearance_file_func
(
file_name_arr
,
bl
.
id
)
else
:
else
:
...
@@ -336,7 +337,8 @@ class TTApi(http.Controller):
...
@@ -336,7 +337,8 @@ class TTApi(http.Controller):
logging
.
error
(
'mawb_declare error:
%
s'
%
str
(
e
))
logging
.
error
(
'mawb_declare error:
%
s'
%
str
(
e
))
request
.
_cr
.
rollback
()
request
.
_cr
.
rollback
()
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
master_waybill_no
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
master_waybill_no
,
res
[
'msg'
],
data_text
,
res
[
'code'
],
res
[
'requestID'
])
logging
.
debug
(
'mawb_declare is ok:
%
s'
%
str
(
res
))
logging
.
debug
(
'mawb_declare is ok:
%
s'
%
str
(
res
))
return
json
.
JSONEncoder
()
.
encode
(
res
)
return
json
.
JSONEncoder
()
.
encode
(
res
)
...
@@ -356,9 +358,11 @@ class TTApi(http.Controller):
...
@@ -356,9 +358,11 @@ class TTApi(http.Controller):
res
[
'ts'
]
=
request_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
res
[
'ts'
]
=
request_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
res
[
'requestID'
]
=
request_time
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
+
str
(
timestamp
)
res
[
'requestID'
]
=
request_time
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
+
str
(
timestamp
)
master_waybill_no
=
''
master_waybill_no
=
''
data_text
=
''
try
:
try
:
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
"{}"
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
"{}"
if
param_json
:
if
param_json
:
data_text
=
param_json
kws
=
json
.
loads
(
param_json
)
kws
=
json
.
loads
(
param_json
)
# "master_waybill_no": "78438321850",
# "master_waybill_no": "78438321850",
...
@@ -400,7 +404,8 @@ class TTApi(http.Controller):
...
@@ -400,7 +404,8 @@ class TTApi(http.Controller):
logging
.
error
(
'mawb_copy_upload error:
%
s'
%
str
(
e
))
logging
.
error
(
'mawb_copy_upload error:
%
s'
%
str
(
e
))
request
.
_cr
.
rollback
()
request
.
_cr
.
rollback
()
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
master_waybill_no
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
master_waybill_no
,
res
[
'msg'
],
data_text
,
res
[
'code'
],
res
[
'requestID'
])
logging
.
debug
(
'mawb_copy_upload is ok:
%
s'
%
str
(
res
))
logging
.
debug
(
'mawb_copy_upload is ok:
%
s'
%
str
(
res
))
return
json
.
JSONEncoder
()
.
encode
(
res
)
return
json
.
JSONEncoder
()
.
encode
(
res
)
...
@@ -420,9 +425,11 @@ class TTApi(http.Controller):
...
@@ -420,9 +425,11 @@ class TTApi(http.Controller):
res
[
'ts'
]
=
request_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
res
[
'ts'
]
=
request_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
res
[
'requestID'
]
=
request_time
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
+
str
(
timestamp
)
res
[
'requestID'
]
=
request_time
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
+
str
(
timestamp
)
logistic_order_no
=
''
logistic_order_no
=
''
data_text
=
''
try
:
try
:
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
"{}"
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
"{}"
if
param_json
:
if
param_json
:
data_text
=
param_json
kws
=
json
.
loads
(
param_json
)
kws
=
json
.
loads
(
param_json
)
# "provider_order_id": "2882303762134170000",
# "provider_order_id": "2882303762134170000",
...
@@ -450,7 +457,8 @@ class TTApi(http.Controller):
...
@@ -450,7 +457,8 @@ class TTApi(http.Controller):
logging
.
error
(
'package_cancel error:
%
s'
%
str
(
e
))
logging
.
error
(
'package_cancel error:
%
s'
%
str
(
e
))
request
.
_cr
.
rollback
()
request
.
_cr
.
rollback
()
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
logistic_order_no
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
logistic_order_no
,
res
[
'msg'
],
data_text
,
res
[
'code'
],
res
[
'requestID'
])
logging
.
debug
(
'package_cancel is ok:
%
s'
%
str
(
res
))
logging
.
debug
(
'package_cancel is ok:
%
s'
%
str
(
res
))
return
json
.
JSONEncoder
()
.
encode
(
res
)
return
json
.
JSONEncoder
()
.
encode
(
res
)
...
@@ -470,9 +478,11 @@ class TTApi(http.Controller):
...
@@ -470,9 +478,11 @@ class TTApi(http.Controller):
res
[
'ts'
]
=
request_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
res
[
'ts'
]
=
request_time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
res
[
'requestID'
]
=
request_time
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
+
str
(
timestamp
)
res
[
'requestID'
]
=
request_time
.
strftime
(
"
%
Y
%
m
%
d
%
H
%
M
%
S"
)
+
str
(
timestamp
)
master_waybill_no
=
''
master_waybill_no
=
''
data_text
=
''
try
:
try
:
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
"{}"
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
"{}"
if
param_json
:
if
param_json
:
data_text
=
param_json
kws
=
json
.
loads
(
param_json
)
kws
=
json
.
loads
(
param_json
)
# "master_waybill_no": "78438321850",
# "master_waybill_no": "78438321850",
...
@@ -501,6 +511,7 @@ class TTApi(http.Controller):
...
@@ -501,6 +511,7 @@ class TTApi(http.Controller):
logging
.
error
(
'mawb_cancel error:
%
s'
%
str
(
e
))
logging
.
error
(
'mawb_cancel error:
%
s'
%
str
(
e
))
request
.
_cr
.
rollback
()
request
.
_cr
.
rollback
()
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
master_waybill_no
,
res
[
'msg'
],
''
,
res
[
'code'
],
res
[
'requestID'
])
request
.
env
[
'ao.tt.api.log'
]
.
create_api_log
(
master_waybill_no
,
res
[
'msg'
],
data_text
,
res
[
'code'
],
res
[
'requestID'
])
logging
.
debug
(
'mawb_cancel is ok:
%
s'
%
str
(
res
))
logging
.
debug
(
'mawb_cancel is ok:
%
s'
%
str
(
res
))
return
json
.
JSONEncoder
()
.
encode
(
res
)
return
json
.
JSONEncoder
()
.
encode
(
res
)
ccs_connect_tiktok/models/cc_bill_loading.py
浏览文件 @
3e67df8a
...
@@ -67,7 +67,7 @@ class CcClearanceFile(models.Model):
...
@@ -67,7 +67,7 @@ class CcClearanceFile(models.Model):
error_msg
=
response_data
[
'msg'
]
error_msg
=
response_data
[
'msg'
]
request_id
=
response_data
[
'requestID'
]
request_id
=
response_data
[
'requestID'
]
code
=
response_data
[
'code'
]
code
=
response_data
[
'code'
]
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
file_name
or
''
,
'清关文件回传:'
+
error_msg
,
''
,
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
file_name
or
''
,
'清关文件回传:'
+
error_msg
,
data
,
code
,
code
,
request_id
,
source
=
'推出'
)
request_id
,
source
=
'推出'
)
return
error_msg
return
error_msg
...
@@ -76,7 +76,7 @@ class CcClearanceFile(models.Model):
...
@@ -76,7 +76,7 @@ class CcClearanceFile(models.Model):
self
.
is_upload
=
True
self
.
is_upload
=
True
self
.
upload_time
=
datetime
.
now
()
self
.
upload_time
=
datetime
.
now
()
request_id
=
response_data
[
'requestID'
]
request_id
=
response_data
[
'requestID'
]
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
file_name
or
''
,
''
,
''
,
0
,
request_id
,
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
file_name
or
''
,
''
,
data
,
0
,
request_id
,
source
=
'推出'
)
source
=
'推出'
)
return
''
return
''
...
@@ -169,20 +169,18 @@ class CcShipPackage(models.Model):
...
@@ -169,20 +169,18 @@ class CcShipPackage(models.Model):
def
callback_track
(
self
):
def
callback_track
(
self
):
if
not
self
.
is_sync
and
self
.
state
and
self
.
state
.
tk_code
:
if
not
self
.
is_sync
and
self
.
state
and
self
.
state
.
tk_code
:
data
=
self
.
get_callback_track_data
()
data
=
self
.
get_callback_track_data
()
logging
.
info
(
'小包轨迹 data:
%
s'
%
data
)
tt_api_obj
=
self
.
env
[
"ao.tt.api"
]
.
sudo
()
tt_api_obj
=
self
.
env
[
"ao.tt.api"
]
.
sudo
()
response
=
tt_api_obj
.
callback_track
(
data
)
#
response = tt_api_obj.callback_track(data)
response_data
=
response
.
json
()
response_data
=
{
'code'
:
200
,
'msg'
:
''
,
'requestID'
:
''
}
#
response.json()
logging
.
info
(
'callback_track response:
%
s'
%
response
)
#
logging.info('callback_track response:%s' % response)
if
response_data
[
'code'
]
!=
0
:
if
response_data
[
'code'
]
!=
0
:
# 清关文件回传错误
self
.
is_sync
=
False
self
.
is_sync
=
False
error_msg
=
response_data
[
'msg'
]
error_msg
=
response_data
[
'msg'
]
request_id
=
response_data
[
'requestID'
]
request_id
=
response_data
[
'requestID'
]
code
=
response_data
[
'code'
]
code
=
response_data
[
'code'
]
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
tracking_no
or
''
,
'小包状态轨迹回传:'
+
error_msg
,
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
tracking_no
or
''
,
'小包状态轨迹回传:'
+
error_msg
,
''
,
data
,
code
,
code
,
request_id
,
source
=
'推出'
)
request_id
,
source
=
'推出'
)
return
error_msg
return
error_msg
...
@@ -194,12 +192,12 @@ class CcShipPackage(models.Model):
...
@@ -194,12 +192,12 @@ class CcShipPackage(models.Model):
self
.
process_time
.
strftime
(
self
.
process_time
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
))
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
))
request_id
=
response_data
[
'requestID'
]
request_id
=
response_data
[
'requestID'
]
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
tracking_no
or
''
,
''
,
''
,
0
,
request_id
,
self
.
env
[
'ao.tt.api.log'
]
.
sudo
()
.
create_api_log
(
self
.
tracking_no
or
''
,
''
,
data
,
0
,
request_id
,
source
=
'推出'
)
source
=
'推出'
)
return
''
return
''
# 继承提单对象
# 继承提单对象
t
class
CcBl
(
models
.
Model
):
class
CcBl
(
models
.
Model
):
_inherit
=
'cc.bl'
_inherit
=
'cc.bl'
...
...
ccs_connect_tiktok/wizard/batch_input_ship_package_statu_wizard.py
浏览文件 @
3e67df8a
...
@@ -66,13 +66,14 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
...
@@ -66,13 +66,14 @@ class BatchInputShipPackageStatusWizard(models.TransientModel):
package_obj
=
package_model
.
search
(
package_obj
=
package_model
.
search
(
[(
'bl_id'
,
'='
,
item
.
bl_id
.
id
),
(
'state'
,
'='
,
item
.
current_status
.
id
)])
[(
'bl_id'
,
'='
,
item
.
bl_id
.
id
),
(
'state'
,
'='
,
item
.
current_status
.
id
)])
if
package_obj
and
not
item
.
is_skip_check
:
if
package_obj
and
not
item
.
is_skip_check
:
# 更新日志里没有
已提货
的小包
# 更新日志里没有
当前节点(不包括默认节点) 【已提货】
的小包
for
package_item
in
package_obj
:
for
package_item
in
package_obj
:
current_state_log_obj
=
self
.
env
[
'cc.ship.package.sync.log'
]
.
search
(
if
not
item
.
current_status
.
is_default
:
[(
'package_id'
,
'='
,
package_item
.
id
),
(
'process_code'
,
'='
,
item
.
current_status
.
tk_code
)])
current_state_log_obj
=
self
.
env
[
'cc.ship.package.sync.log'
]
.
search
(
if
not
current_state_log_obj
:
[(
'package_id'
,
'='
,
package_item
.
id
),
(
'process_code'
,
'='
,
item
.
current_status
.
tk_code
)])
package_ids
+=
package_item
.
ids
if
not
current_state_log_obj
:
# 更新日志明细包含了 清关开始 的 小包
package_ids
+=
package_item
.
ids
# 更新日志明细包含了 更新节点 【清关开始】 的 小包
update_state_log_obj
=
self
.
env
[
'cc.ship.package.sync.log'
]
.
search
(
update_state_log_obj
=
self
.
env
[
'cc.ship.package.sync.log'
]
.
search
(
[(
'package_id'
,
'in'
,
package_obj
.
ids
),
(
'process_code'
,
'='
,
item
.
update_status
.
tk_code
)])
[(
'package_id'
,
'in'
,
package_obj
.
ids
),
(
'process_code'
,
'='
,
item
.
update_status
.
tk_code
)])
package_ids
+=
update_state_log_obj
.
mapped
(
'package_id'
)
.
ids
package_ids
+=
update_state_log_obj
.
mapped
(
'package_id'
)
.
ids
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论