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

流程九脚本编写

parent f211fb3a
Showing with 192 additions and 16 deletions
+192 -16
......@@ -3,6 +3,7 @@ import sys
from airtest.core.helper import using
from air_case.public1.public1.public1 import dept_query_all
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
from common.db.sql.sql_del_notices_info import delByNoticeName
......@@ -71,3 +72,4 @@ def test1():
test1()
dept_query_all()
\ No newline at end of file
......@@ -203,6 +203,7 @@ try:
# 中心库type=1 二级type=2三级type=3
set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'],2)
set_dept_user(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid3'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid3'],3)
updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) #设置登录账号默认权限是中心库
center_warehouse_return()#中心库退货
# center_warehouse_return()#中心库退货
OBh_ID=settle() # 生成结算单
......
......@@ -20,8 +20,9 @@ class delData(object):
cursor.execute("commit;")
print('内网院区数据已删除成功')
cursor.close()
#删除融合外网的院区信息
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_platform_test2",
# 删除融合外网的院区信息
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023",
database="spd3_platform_test2",
charset="utf8")
cursor = connection.cursor()
# 删除新增的院区数据,减少垃圾数据的产生,保证脚本下次还可以正常运行,接口脚本每次都使用新增数据
......@@ -133,6 +134,7 @@ class delData(object):
# cursor.execute("commit;")
# print('多余库房信息删除成功 ')
cursor.close()
def Delete_probeInfo_other(self):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
......@@ -144,6 +146,7 @@ class delData(object):
cursor.execute("commit;")
print('多余库房信息删除成功 ')
cursor.close()
def Delete_role(self):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
......@@ -155,6 +158,7 @@ class delData(object):
cursor.execute("commit;")
print('角色信息删除成功 ')
cursor.close()
def Delete_user(self):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
......@@ -166,6 +170,7 @@ class delData(object):
cursor.execute("commit;")
print('用户信息删除成功 ')
cursor.close()
def Delete_lcTask(self):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
......@@ -182,6 +187,7 @@ class delData(object):
cursor.execute("commit;")
print('临采任务主表信息删除成功 ')
cursor.close()
def Delete_ld_directory(self):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
......@@ -198,28 +204,30 @@ class delData(object):
cursor.execute("commit;")
print('带量项目主表信息删除成功 ')
cursor.close()
def Del_goods_info(self,goodsid):
#内网的
def Del_goods_info(self, goodsid):
# 内网的
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
cursor = connection.cursor()
# 删除产品信息
sql = "delete from mcms_goods_info where id='%s';"%goodsid
sql = "delete from mcms_goods_info where id='%s';" % goodsid
print(sql)
cursor.execute(sql)
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()
sql = "delete from mcms_goods_info where id='%s';"%goodsid
sql = "delete from mcms_goods_info where id='%s';" % goodsid
print(sql)
cursor.execute(sql)
cursor.execute("commit;")
print('外网产品信息删除成功 ')
cursor.close()
def Del_supply_relation(self):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
......@@ -228,7 +236,7 @@ class delData(object):
info = FileUtils().r_info8('b5_spd3_core_business_flow', "供货关系申请2", 'message')
try:
e_corpId = info['e_corpId']
sql = "delete from supply_relation where prov_id in(select id from bas_company_info where id = '%s');"%e_corpId
sql = "delete from supply_relation where prov_id in(select id from bas_company_info where id = '%s');" % e_corpId
print(sql)
except:
sql = "delete from supply_relation where prov_id in(select id from bas_company_info where id = 'aaaa');"
......@@ -237,12 +245,14 @@ class delData(object):
cursor.execute("commit;")
print('内网供应关系删除成功 ')
cursor.close()
def Del_reporter_data(self):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_report_hospitaltest2",
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023",
database="spd3_report_hospitaltest2",
charset="utf8")
cursor = connection.cursor()
branch_id=FileUtils().r_info8('b2_herp3_bs', "院区新增", 'message')['branch_id']
sql = "delete from mcms_finance_daybook where branch_id= '%s';"%branch_id
branch_id = FileUtils().r_info8('b2_herp3_bs', "院区新增", 'message')['branch_id']
sql = "delete from mcms_finance_daybook where branch_id= '%s';" % branch_id
cursor.execute(sql)
cursor.execute("commit;")
......@@ -264,6 +274,168 @@ class delData(object):
print('报表数据删除成功')
cursor.close()
def Delete_business_Data(self):
# 删除业务数据,包括采购,出入库,结算等
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023",
database="spd3_herp_test2",
charset="utf8")
cursor = connection.cursor()
branch_id = FileUtils().r_info8('b2_herp3_bs', "院区新增", 'message')['branch_id']
hosGoodsId1 = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId']
hosGoodsId2 = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId']
hosGoodsId3 = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId']
# 条码
sql1 = "delete from mcms_pkg where branch_id=%s" % branch_id
sql2 = "delete from mcms_pkg_batch where hos_goods_id in('%s','%s','%s');" % (
hosGoodsId1, hosGoodsId2, hosGoodsId3)
sql3 = "delete from hdi_barcode where branch_id=%s" % branch_id
sql4 = "delete from cabinet_epc_info where branch_id=%s" % branch_id
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute(sql4)
cursor.execute("commit;")
# 批次
sql = "delete from mcms_hos_batch where branch_id=%s" % branch_id
cursor.execute(sql)
cursor.execute("commit;")
# 库存
sql1 = "delete from mcms_stockpile where branch_id=%s" % branch_id
sql2 = "delete from mcms_stockpile_taking where hos_goods_id in('%s','%s','%s')" % (
hosGoodsId1, hosGoodsId2, hosGoodsId3)
sql3 = "delete from mcms_stockpile_flow where branch_id=%s" % branch_id
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute("commit;")
# 采购
sql = "delete from mcms_purchase_detail where order_no in(select order_no from mcms_purchase where branch_id='%s');" % branch_id
cursor.execute(sql)
cursor.execute("commit;")
sql = "delete from mcms_pur_plan_detail where prov_name like '%国药集团公司_____';"
cursor.execute(sql)
cursor.execute("commit;")
sql = "delete from mcms_pur_plan where branch_id= '%s';" % branch_id
cursor.execute(sql)
cursor.execute("commit;")
sql = "delete from mcms_purchase where branch_id= '%s';" % branch_id
cursor.execute(sql)
cursor.execute("commit;")
dept1 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
dept2 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
dept3 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid3']
dept4 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid4']
# 拣货单
sql4 = "delete from mcms_pick_detail where pid in(select id from mcms_pick where branch_id='%s');" % branch_id
sql1 = "delete from mcms_pick where branch_id= '%s';" % branch_id
sql2 = "delete from mcms_pick_gen where dept_id in('%s','%s','%s','%s')" % (dept1, dept2, dept3, dept4)
sql3 = "delete from mcms_pick_batch where hos_goods_id in('%s','%s','%s')" % (
hosGoodsId1, hosGoodsId2, hosGoodsId3)
cursor.execute(sql4)
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute("commit;")
# 验收单
sql1 = "delete from mcms_check where prov_name like '%国药集团公司_____';"
sql2 = "delete from mcms_check_batch where hos_goods_id in('%s','%s','%s')" % (
hosGoodsId1, hosGoodsId2, hosGoodsId3)
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute("commit;")
# 配送单
sql1 = "delete from hdi_distr_barcode where pid in(select id FROM hdi_distr where branch_id='%s');" % branch_id
sql2 = "delete from hdi_distr where branch_id='%s';" % branch_id
sql3 = "delete from hdi_distr_detail where hos_goods_id in('%s','%s','%s')" % (
hosGoodsId1, hosGoodsId2, hosGoodsId3)
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute("commit;")
# 单据
sql1 = "delete from mcms_psi where target_branch_id=%s" % branch_id
sql2 = "delete from mcms_psi_batch where hos_goods_id in('%s','%s','%s');" % (
hosGoodsId1, hosGoodsId2, hosGoodsId3)
sql3 = "delete from mcms_psi_dept where target_branch_id='%s';" % branch_id
sql4 = "delete from mcms_psi_dept_batch where hos_goods_id in('%s','%s','%s');" % (
hosGoodsId1, hosGoodsId2, hosGoodsId3)
sql5 = "delete from his_order where branch_id='%s';" % branch_id
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute(sql4)
cursor.execute(sql5)
cursor.execute("commit;")
# 手术通知单
sql1 = "delete from mcms_operation_apply where branch_id='%s';" % branch_id
sql2 = "delete from mcms_operation_apply_list where hos_goods_id in('%s','%s','%s');" % (
hosGoodsId1, hosGoodsId2, hosGoodsId3)
sql3 = "delete from mcms_operation_notice where branch_id='%s';" % branch_id
sql4 = "delete from mcms_operation_notice_list where hos_goods_id in('%s','%s','%s');" % (
hosGoodsId1, hosGoodsId2, hosGoodsId3)
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute(sql4)
cursor.execute("commit;")
# 结算
sql1 = "delete from mcms_out_balance where branch_id='%s';" % branch_id
sql2 = "delete from mcms_out_balance_detail where prov_name like '%国药集团公司_____';"
sql3 = "delete from mcms_out_un_balance where branch_id='%s';" % branch_id
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute("commit;")
# 发票
sql1 = "delete from mcms_invoice where prov_name like '%国药集团公司_____';"
sql2 = "delete from mcms_invoice_comment where pid in(select invoice_id from mcms_invoice_ext_detail where pid in(select id from mcms_invoice_ext where prov_name like '%国药集团公司_____'));"
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='%s';" % branch_id
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute(sql4)
cursor.execute(sql5)
cursor.execute("commit;")
# 退货
sql1 = "delete from yb_return_batch where pid in(select id from yb_return where prov_name like '%国药集团公司_____');"
sql2 = "delete from yb_return where prov_name like '%国药集团公司_____';"
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute("commit;")
# 请领单
sql1 = "delete from mcms_dept_buy_detail where pid in (select id from mcms_dept_buy where branch_id='%s');" % branch_id
sql2 = "delete from mcms_dept_buy where branch_id='%s';" % branch_id
sql3 = "delete from mcms_dept_buy_car where branch_id='%s';" % branch_id
sql4 = "delete from mcms_dept_patient where id ='自动化测试';"
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
cursor.execute(sql4)
cursor.execute("commit;")
# 报表
sql1 = "delete from portal_card where branch_id='%s';" % branch_id
sql2 = "delete from portal_chart where branch_id='%s';" % branch_id
sql3 = "delete from portal_worklist where branch_id='%s';" % branch_id
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()
......@@ -273,4 +445,4 @@ class delData(object):
# delData().Delete_user()
# delData().Del_goods_info(i)
# delData().Del_supply_relation()
# delData().Del_reporter_data()
\ No newline at end of file
# delData().Del_reporter_data()
......@@ -104,7 +104,7 @@ json_headers2: {
"payload29": {"deptId":"%s","userId":"%s"}
"payload30": {"targetDeptId":"%s","targetAreaCode":"%s","hosId":"%s","sourceId":"%s","sourceType":"%s","billMode":"%s"}
"payload31": {"batchList":[{"viewId":"%s","shelfCode":"%s","shelfKind":0}],"sourceId":"%s","sourceType":"%s","sourceVersion":0,"targetDeptId":"%s","targetDeptName":"%s","targetAreaCode":"%s","targetAreaName":"%s"}
"payload32": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":[],"goodsName":"","branchId":"%s","ssccCode":"","deptId":"%s","deptQuery":true,"bottleId":"","billModes":null,"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}}
"payload32": {"pageNum":1,"pageSize":50,"queryObject":{"areacodelist":[],"goodsName":"","branchId":"%s","ssccCode":"","deptId":"%s","deptQuery":true,"bottleId":"","billModes":["25"],"provId":"","goodsSpec":"","batchCode":"","mfrCode":"","jskFlag":0}}
"payload33": {"areaCode":"%s","areaName":"%s","deptId":"%s","stockId":"%s","hosId":"%s","sourceType":"%s","pickType":"%s","patientName":"张三","patientId":"自动化测试","patientInHosId":"112233","sex":"1","age":42,"operName":"血管溶栓手术","chargeDeptId":"%s","operDate":"%s 00:00:00","remark":"无","consumeType":1,"pickCreateVO":{"pickType":"%s","areaCode":"%s","areaName":"%s","deptId":"%s","stockId":"%s","hosId":"%s","branchId":"%s","barCodeList":[{"id":"%s","hosGoodsId":"%s","mdmGoodsCode":"%s","goodsCode":"%s","batchCode":"%s","productDate":"%s","expdtDate":"%s","qty":1,"purMode":"%s","shelfCode":"%s"}]}}
"payload34": {"tbStatus":61,"code":"%s","stockId":"%s","stockName":"%s","areaCode":"%s","areaName":"%s","consumeType":"1"}
"payload35": {"batchList":[{"viewId":"%s","qty":1,"hosGoodsId":"%s","pid":"%s","barcodeId":"%s"}],"billMode":"%s","targetDeptId":"%s","targetAreaCode":"%s","targetAreaName":"%s","consumeType":"1"}
......
......@@ -56,7 +56,7 @@
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分53</td>
<td class='details-col-elapsed'>1分45</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
</table>
......@@ -72,9 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_a8流程五_中心库入库结算_正结算3_外网开票/log.html' target='_blank'>a_a8流程五_中心库入库结算_正结算3_外网开票</a></td>
<td class="details-col-elapsed"><a href='../log/a_b1流程八_高值跟台业务流程/log.html' target='_blank'>a_b1流程八_高值跟台业务流程</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">52.962</td>
<td class="details-col-elapsed">105.043</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