Commit 89874f80 by 岳巧源

handle unit after update

parent e55be983
...@@ -221,6 +221,42 @@ def update_vc_attr(conf: dict): ...@@ -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)) 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))
""" """
......
"""
拉取及更新pop店铺最新数据。
"""
...@@ -21,4 +21,6 @@ alter table lie_shop_push_sku_log modify column push_status tinyint(1) default 0 ...@@ -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 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 '异常信息'; 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
select resp_body_msg from lie_shop_push_sku_log where apply_id = '' limit 1;
\ No newline at end of file
...@@ -378,3 +378,5 @@ ...@@ -378,3 +378,5 @@
=====update audit status, apply_id: 5634aa7cd560488aba29ea9608beb9d6===========> =====update audit status, apply_id: 5634aa7cd560488aba29ea9608beb9d6===========>
=====update audit status, apply_id: b1b31900dca84316b3b9bb4bb579c174===========> =====update audit status, apply_id: b1b31900dca84316b3b9bb4bb579c174===========>
=====update audit status, apply_id: 7b160b83aa5944c3b15a6655eb404be5===========> =====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
...@@ -378,5 +378,4 @@ def get_vc_goods_info(ware_id: str): ...@@ -378,5 +378,4 @@ def get_vc_goods_info(ware_id: str):
if __name__ == '__main__': if __name__ == '__main__':
pass get_vc_audit("6db37def5bcd467ca063863e04ea4d4b")
# 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
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment