Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
jd_data_process
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
89874f80
authored
Oct 28, 2024
by
岳巧源
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
handle unit after update
parent
e55be983
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
5 deletions
crontab.py
crontab_pop.py
tmp.sql
tmp.txt
vc.py
crontab.py
View file @
89874f80
...
...
@@ -221,6 +221,42 @@ def update_vc_attr(conf: dict):
print
(
insert_sql
%
(
class_id
,
attr_id
,
attr_name
,
unit
,
enum_value
,
input_type
,
is_required
,
status
,
platform
,
create_time
))
def
handle_vc_unit
(
conf
:
dict
):
"""
用于处理默认单位字段。
default_unit
"""
host
=
conf
[
"mysql"
][
"host"
]
port
=
conf
[
"mysql"
][
"port"
]
user
=
conf
[
"mysql"
][
"user"
]
password
=
conf
[
"mysql"
][
"password"
]
database
=
conf
[
"mysql"
][
"database"
]
db
=
pymysql
.
connect
(
host
=
host
,
port
=
port
,
user
=
user
,
password
=
password
,
database
=
database
)
cursor
=
db
.
cursor
()
select_sql
=
"select id, unit, input_type from lie_shop_attr where platform = 1 and unit != ''"
cursor
.
execute
(
query
=
select_sql
)
db_result
=
cursor
.
fetchall
()
for
i
in
range
(
len
(
db_result
)):
id
=
db_result
[
i
][
0
]
unit
=
db_result
[
i
][
1
]
input_type
=
db_result
[
i
][
2
]
if
input_type
!=
10
:
update_sql
=
"update lie_shop_attr set default_unit =
%
s where id =
%
s"
cursor
.
execute
(
query
=
update_sql
,
args
=
(
unit
,
id
,))
db
.
commit
()
print
(
update_sql
%
(
unit
,
id
))
else
:
"""
input_type 为10的单位单独处理。
"""
end
=
str
(
unit
)
.
find
(
","
)
default_unit
=
unit
[
2
:
end
-
1
]
update_sql
=
"update lie_shop_attr set default_unit =
%
s where id =
%
s"
cursor
.
execute
(
query
=
update_sql
,
args
=
(
default_unit
,
id
,))
db
.
commit
()
print
(
update_sql
%
(
default_unit
,
id
))
"""
...
...
crontab_pop.py
0 → 100644
View file @
89874f80
"""
拉取及更新pop店铺最新数据。
"""
tmp.sql
View file @
89874f80
...
...
@@ -21,4 +21,6 @@ alter table lie_shop_push_sku_log modify column push_status tinyint(1) default 0
alter
table
lie_shop_push_sku_log
modify
column
init_status
tinyint
(
1
)
default
0
not
null
comment
'库存、时效初始化状态 -1:失败 1:成功'
;
alter
table
lie_shop_push_sku_log
change
audit_failed_msg
error_msg
varchar
(
512
)
default
''
not
null
comment
'异常信息'
;
\ No newline at end of file
alter
table
lie_shop_push_sku_log
change
audit_failed_msg
error_msg
varchar
(
512
)
default
''
not
null
comment
'异常信息'
;
select
resp_body_msg
from
lie_shop_push_sku_log
where
apply_id
=
''
limit
1
;
\ No newline at end of file
tmp.txt
View file @
89874f80
...
...
@@ -378,3 +378,5 @@
=====update audit status, apply_id: 5634aa7cd560488aba29ea9608beb9d6===========>
=====update audit status, apply_id: b1b31900dca84316b3b9bb4bb579c174===========>
=====update audit status, apply_id: 7b160b83aa5944c3b15a6655eb404be5===========>
.\gf_windows_amd64.exe gen dao -l "mysql:liexin_data_distribution:liexin_data_distribution#zsyM@tcp(192.168.1.238:3306)/liexin_data_distribution" -t "lie_shop_push_sku_log" -r "lie_"
\ No newline at end of file
vc.py
View file @
89874f80
...
...
@@ -378,5 +378,4 @@ def get_vc_goods_info(ware_id: str):
if
__name__
==
'__main__'
:
pass
# mysqldump -u DsbuUx -h bigdata2.ichunt.db -p liexin_data_distribution lie_shop_class > /data/tmp/lie_shop_class.sql
\ No newline at end of file
get_vc_audit
(
"6db37def5bcd467ca063863e04ea4d4b"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment