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

流程十一脚本编写

parent b051432f
......@@ -331,4 +331,6 @@ except:
print('新增产品信息出现异常,后续的脚本必然无法走通,需要检查程序或者脚本或者环境是否出现问题')
commonFuc().check_text_exist_result_text('产品新增失败', '产品新增成功')
else:
#删除今天之前的产品信息(包含内外网)
delData().Del_goods_info_all()
commonFuc().check_text_exist_result_text('succees','succees')
\ No newline at end of file
......@@ -300,11 +300,15 @@ def edit_goods_target(currentDeptId, targetDeptId):
shelfCode = commonFuc().analysis_json('shelfCode', i)
id1 = commonFuc().analysis_json('id', i)
pkgDefId = commonFuc().analysis_json('pkgDefId', i)
packetQty = commonFuc().analysis_json('packetQty', i)
# packetQty = commonFuc().analysis_json('packetQty', i)
tbStatus = commonFuc().analysis_json('tbStatus', i)
url= commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"basic_mcmsDeptGoodsInfo_updateById")
"herpService_basic_mcmsDeptGoodsInfo_url")
url=url+id1
result = commonFuc().http_get(url, headers)
print('获取产品详情信息', result)
data2 = commonFuc().analysis_json('data', result)
packetQty = commonFuc().analysis_json('packetQty', data2)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"basic_mcmsDeptGoodsInfo_updateById")
......
......@@ -472,7 +472,7 @@ class delData(object):
# 获取库区version
branch_id = "select id from mcms_branch_info"
# 条码
sql1 = "delete from mcms_pkg_batch where pkg_id in(select id from mcms_pkg where branch_id not in(%s));"% branch_id
sql1 = "delete from mcms_pkg_batch where pkg_id in(select id from mcms_pkg where branch_id not in(%s));" % branch_id
sql2 = "delete from mcms_pkg where branch_id not in(%s);" % branch_id
sql3 = "delete from hdi_barcode where branch_id not in(%s);" % branch_id
# sql4 = "delete from cabinet_epc_info where branch_id not in%s" % branch_id
......@@ -486,7 +486,7 @@ class delData(object):
cursor.execute(sql)
cursor.execute("commit;")
# 库存
sql1 = "delete from mcms_stockpile_taking where stockpile_id in(select id from mcms_stockpile where branch_id not in(%s));"%branch_id
sql1 = "delete from mcms_stockpile_taking where stockpile_id in(select id from mcms_stockpile where branch_id not in(%s));" % branch_id
sql2 = "delete from mcms_stockpile where branch_id not in(%s);" % branch_id
sql3 = "delete from mcms_stockpile_flow where branch_id not in(%s);" % branch_id
cursor.execute(sql1)
......@@ -498,7 +498,7 @@ class delData(object):
cursor.execute(sql)
cursor.execute("commit;")
sql = "delete from mcms_pur_plan_detail where pid in(select id from mcms_pur_plan where branch_id not in(%s));"% branch_id
sql = "delete from mcms_pur_plan_detail where pid in(select id from mcms_pur_plan where branch_id not in(%s));" % branch_id
cursor.execute(sql)
cursor.execute("commit;")
......@@ -518,7 +518,7 @@ class delData(object):
# 拣货单
sql4 = "delete from mcms_pick_detail where pid in(select id from mcms_pick where branch_id not in (%s));" % branch_id
sql1 = "delete from mcms_pick where branch_id not in (%s);" % branch_id
sql2 = "delete from mcms_pick_gen where dept_id in(select dept_id from mcms_stock_info where branch_id not in(%s));"% branch_id
sql2 = "delete from mcms_pick_gen where dept_id in(select dept_id from mcms_stock_info where branch_id not in(%s));" % branch_id
sql3 = "delete from mcms_pick_batch where pid in(select id from mcms_pick where branch_id not in (select id from mcms_branch_info));"
cursor.execute(sql4)
cursor.execute(sql1)
......@@ -626,10 +626,10 @@ class delData(object):
sql3 = "delete from mcms_invoice_comment where pid in(select id from mcms_invoice where prov_name like '%国药集团公司_____');"
sql4 = "delete from mcms_invoice_detail where pid in(select id from mcms_invoice where prov_name like '%国药集团公司_____');"
sql5 = "delete from mcms_invoice where prov_name like '%国药集团公司_____';"
sql6="delete from mcms_operation_notice_list where pid in(select id from mcms_operation_notice where branch_name like '%东土城路院区_____');"
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 );"
sql6 = "delete from mcms_operation_notice_list where pid in(select id from mcms_operation_notice where branch_name like '%东土城路院区_____');"
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 );"
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
......@@ -643,6 +643,34 @@ class delData(object):
print('外网业务数据,包括采购,发票,结算等据删除成功')
cursor.close()
def Del_goods_info_all(self):
# 内网的
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
cursor = connection.cursor()
# 删除产品信息
sql1 = "delete from mcms_goods_info where goods_name like '%一次性注射器%'and goods_spec ='G-31891'and create_time < DATE_SUB(CURDATE(),INTERVAL 1 day);"
sql2 = "delete from mcms_goods_info where goods_name like '%新型冠状病毒检测试剂%'and goods_spec ='G-31891'and create_time < DATE_SUB(CURDATE(),INTERVAL 1 day);"
sql3 = "delete from mcms_goods_info where goods_name like '%高值牙钻机%'and goods_spec ='G-31891'and create_time < DATE_SUB(CURDATE(),INTERVAL 1 day);"
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute("commit;")
print('内网产品信息删除成功 ')
cursor.close()
# 外网的
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd_ybtest_hdi",
charset="utf8")
cursor = connection.cursor()
sql1 = "delete from mcms_goods_info where goods_name like '%一次性注射器%'and goods_spec ='G-31891'and create_time < DATE_SUB(CURDATE(),INTERVAL 1 day);"
sql2 = "delete from mcms_goods_info where goods_name like '%新型冠状病毒检测试剂%'and goods_spec ='G-31891'and create_time < DATE_SUB(CURDATE(),INTERVAL 1 day);"
sql3 = "delete from mcms_goods_info where goods_name like '%高值牙钻机%'and goods_spec ='G-31891'and create_time < DATE_SUB(CURDATE(),INTERVAL 1 day);"
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute("commit;")
print('外网产品信息删除成功 ')
cursor.close()
# delData().Delete_branch_by_id()
# delData().Delete_goods_change_info()
# delData().Delete_sys_config()
......@@ -656,4 +684,4 @@ class delData(object):
# delData().Del_reporter_data()
# delData().Delete_yb_logic_stock()
# delData().Delete_business_Data_All()
# delData().Delete_business_Data_All2()
\ No newline at end of file
# delData().Delete_business_Data_All2()
......@@ -77,7 +77,7 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分4</td>
<td class='details-col-elapsed'>0分5</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
</table>
......@@ -95,7 +95,7 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_b5流程十二请领业务流_二级库向二级库/log.html' target='_blank'>a_b5流程十二请领业务流_二级库向二级库</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">4.302</td>
<td class="details-col-elapsed">5.807</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
......
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