Commit d3a511b8 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

流程十二脚本编写

parent 26f6433a
......@@ -581,11 +581,16 @@ class delData(object):
sql3 = "delete from mcms_invoice_ext_detail where pid in(select id from mcms_invoice_ext where prov_name like '%国药集团公司_____');"
sql4 = "delete from mcms_invoice_ext where prov_name like '%国药集团公司_____';"
sql5 = "delete from mcms_invoice_detail where branch_id not in (%s);" % branch_id
# 删除发票中的垃圾数据
sql6 = " delete from mcms_invoice where id in (select pid from mcms_invoice_detail where hos_goods_id not in(select id from mcms_goods_info));"
sql7 = " delete from mcms_invoice_detail where hos_goods_id not in(select id from mcms_goods_info);"
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute(sql4)
cursor.execute(sql5)
cursor.execute(sql6)
cursor.execute(sql7)
cursor.execute("commit;")
# 退货
sql1 = "delete from yb_return_batch where pid in(select id from yb_return where prov_name like '%国药集团公司_____');"
......@@ -631,9 +636,6 @@ class delData(object):
sql7 = "delete from mcms_operation_notice where branch_name like '%东土城路院区_____';"
sql8 = "delete from mcms_purchase_detail where pid in(select id from mcms_purchase where branch_id not in(select id from spd3_herp_test2.mcms_branch_info ));"
sql9 = "delete from mcms_purchase where branch_id not in(select id from spd3_herp_test2.mcms_branch_info );"
#删除发票中的垃圾数据
sql10=" delete from mcms_invoice where id in (select pid from mcms_invoice_detail where hos_goods_id not in(select id from mcms_goods_info));"
sql11=" delete from mcms_invoice_detail where hos_goods_id not in(select id from mcms_goods_info);"
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
......@@ -643,8 +645,6 @@ class delData(object):
cursor.execute(sql7)
cursor.execute(sql8)
cursor.execute(sql9)
cursor.execute(sql10)
cursor.execute(sql11)
cursor.execute("commit;")
print('外网业务数据,包括采购,发票,结算等据删除成功')
cursor.close()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment