Commit 965e13c8 authored by 肖 和生's avatar 肖 和生
Browse files

Merge remote-tracking branch 'remotes/origin/master' into core_flow

parents 71ea8363 c0c6972a
...@@ -17,14 +17,12 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_ ...@@ -17,14 +17,12 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_
from airtest.core.api import using from airtest.core.api import using
import sys import sys
pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a1_流程一外网企业注册审批.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a1_流程一外网企业注册审批.air')
from a_a1_流程一外网企业注册审批 import test1
def test1():
#企业注册
execute_command("python runner_test.py tag id2232 debug mdm3")
#企业审核
execute_command("python runner_test.py tag id2248 debug mdm3")
#医院注册审核
execute_command("python runner_test.py tag id2249 debug mdm3")
try: try:
test1() test1()
commonFuc().check_text_exist_result_text('succees','succees') commonFuc().check_text_exist_result_text('succees','succees')
......
...@@ -13,167 +13,27 @@ from common.common_func import commonFuc ...@@ -13,167 +13,27 @@ from common.common_func import commonFuc
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
from airtest.core.api import using from airtest.core.api import using
import sys import sys
module = "b6_spd3_core_business_flow_database_check"
def h_login():
#供货关系申请_客户类型_医院_登录_医院登录获取医院id pro_path = commonFuc().get_pro_path2()
module = "a4_mdm3_cm" print('pro_path', pro_path)
#如果需要h0347医院账号登录,这里就从data文件获取登录医院的用户名 sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a2_流程二供货关系申请提交审批.air')
#username = commonFuc().get_business_data(module, "username") using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a2_流程二供货关系申请提交审批.air')
from a_a2_流程二供货关系申请提交审批 import h_login, e_login, supply_and_marketing_apply, submitSupplyRelation_pass, \
supply_and_marketing_apply2
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password1")
print('医院名称', username)
print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
import time
while True:
try:
token,projectCode,uxid,corpId,info= login_system(username, password).get_token()
except:
time.sleep(6)
continue
else:
return token,projectCode,uxid,corpId,username
def e_login(type=1):
module = "a4_mdm3_cm"
username='username'
if type==1:#注册一个新企业,并审批
pro_path=commonFuc().get_pro_path()
sys.path.append(pro_path+r'\\air_case\\a2_mdm3_ea\\企业审核.air')
using(pro_path+r'\\air_case\\a2_mdm3_ea\\企业审核.air')
from 企业审核 import test1
info = FileUtils().r_info("a2_mdm3_ea", "企业信息")
print(info)
username = info['cname']
print('aaaaaaaaaaaaaaaaaaaaaaaaaaa',username)
else:#读取文件中存入的企业信息
info = FileUtils().r_info("a2_mdm3_ea", "企业信息")
print(info)
username = info['cname']
print('aaaaaaaaaaaaaaaaaaaaaaaaaaa', username)
#a2供货关系申请_客户类型_医院_登录_企业登录
# print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
print(username, password)
# 获取token和projectCode
import time
i=1
while True:
if i==1000:
print('6000秒过去了,新注册的企业还未登录,检查同步是否正常')
break
try:
token,projectCode,uxid,corpId,info= login_system(username, password).get_token()
except:
print('新注册的企业登录失败,等待6秒')
time.sleep(6)
i=i+1
continue
else:
return token, projectCode, uxid, corpId, username
# break
def supply_and_marketing_apply():
token, projectCode, uxid, corpId, username = e_login()
# 获取医院corpId
h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
module = "a4_mdm3_cm"
# a3供货关系申请_客户类型_医院_供销关系申请提交
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "submitSupplyRelation_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
contactUser = commonFuc().randomString(5)
contactWay = contactUser
request_body = commonFuc().get_business_data(module, "payload", h_corpId, contactUser, contactWay)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# #获取接口返回数据
#
check_dict = commonFuc().get_business_data(module, "checkDict")
commonFuc().check_result(check_dict, result)
e_corpId = corpId
e_username = username
return e_corpId, h_corpId, e_username, h_name
def submitSupplyRelation_pass():
module = "a4_mdm3_cm"
token, projectCode, uxid, corpId, h_name = h_login()
print(token, projectCode, uxid, corpId, h_name)
pro_path = commonFuc().get_pro_path()
#查询待审核数据=========================================
# a11供货关系审核_驳回_客户类型_医院_供销关系审核_查询待审核数据1
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "listVoPage_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload6", corpId)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
id1 = commonFuc().analysis_json('id', commonFuc().analysis_json('data', commonFuc().analysis_json('data', result)))
print('id1', id1)
# 查询待审核数据======================================
#b15供货关系审核_通过_客户类型_医院
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "auditSupplyRelation_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
contactUser=commonFuc().randomString(5)
contactWay=contactUser
request_body = commonFuc().get_business_data(module, "payload7_2", id1,contactUser,contactWay)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
#断言
checkDict=commonFuc().get_business_data(module,'checkDict')
commonFuc().check_result(checkDict,result)
def supply_and_marketing_apply2():
pro_path=commonFuc().get_pro_path()
token,projectCode,uxid,corpId,username=e_login(2)
#获取医院corpId
h_token,h_projectCode,h_uxid,h_corpId,h_name=h_login()
module = "a4_mdm3_cm"
#a3供货关系申请_客户类型_医院_供销关系申请提交
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "submitSupplyRelation_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
contactUser=commonFuc().randomString(5)
contactWay=contactUser
request_body = commonFuc().get_business_data(module, "payload_2",h_corpId,contactUser,contactWay)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result',result)
# #获取接口返回数据
#
check_dict= commonFuc().get_business_data(module, "checkDict")
commonFuc().check_result(check_dict,result)
e_corpId=corpId
e_username=username
return e_corpId,h_corpId,e_username,h_name
try: try:
h_login()#医院登录 module = "b5_spd3_core_business_flow"
e_login(1)#企业登录 h_login() # 医院登录
#供应关系申请-客户类型医院 e_login(1) # 企业登录
# 供应关系申请-客户类型医院
FileUtils().w_info1(supply_and_marketing_apply(), module, '供货关系申请') FileUtils().w_info1(supply_and_marketing_apply(), module, '供货关系申请')
submitSupplyRelation_pass() submitSupplyRelation_pass()
#供应关系申请-客户类型厂商 # 供应关系申请-客户类型厂商
FileUtils().w_info1(supply_and_marketing_apply2(), module, '供货关系申请2') FileUtils().w_info1(supply_and_marketing_apply2(), module, '供货关系申请2')
submitSupplyRelation_pass() submitSupplyRelation_pass()
commonFuc().check_text_exist_result_text('succees','succees') commonFuc().check_text_exist_result_text('succees', 'succees')
except: print('=================流程二结束=================')
print('a_a2_流程二供货关系申请提交审批,出现异常,请检查') except Exception as e:
\ No newline at end of file # 打印错误信息
print(f"发生错误: {e}")
print('a_a2_流程二供货关系申请提交审批,出现异常,请检查')
...@@ -16,381 +16,33 @@ from air_case.mdm_login.登录外网系统.登录外网系统 import login_syste ...@@ -16,381 +16,33 @@ from air_case.mdm_login.登录外网系统.登录外网系统 import login_syste
from airtest.core.api import using from airtest.core.api import using
import sys import sys
module = "b6_spd3_core_business_flow_database_check"
def h_login():
module = "a4_mdm3_cm"
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password1")
print('医院名称', username)
print(username, password, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
import time
while True:
try:
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
except:
time.sleep(6)
continue
else:
return token, projectCode, uxid, corpId, username
def e_login(type=1):
module = "a4_mdm3_cm"
username = 'username'
if type == 1: # 注册一个新企业,并审批
pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\a2_mdm3_ea\\企业审核.air')
using(pro_path + r'\\air_case\\a2_mdm3_ea\\企业审核.air')
from 企业审核 import test1
info = FileUtils().r_info("a2_mdm3_ea", "企业信息")
print(info)
username = info['cname']
print('aaaaaaaaaaaaaaaaaaaaaaaaaaa', username)
else: # 读取文件中存入的企业信息
info = FileUtils().r_info("a2_mdm3_ea", "企业信息")
print(info)
username = info['cname']
print('aaaaaaaaaaaaaaaaaaaaaaaaaaa', username)
# a2供货关系申请_客户类型_医院_登录_企业登录
# print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
print(username, password)
# 获取token和projectCode
import time
while True:
try:
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
except:
time.sleep(6)
continue
else:
return token, projectCode, uxid, corpId, username
# break
# 高值
def add_goods():
token, projectCode, uxid, corpId, e_name = e_login(2)
# 获取医院corpId
h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
module = "a5_mdm3_pdm"
# b18供货目录申请_客户类型_医院_提交供货申请单_添加产品
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "addGoodsHandleInfos_url")
print('url', url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
goodsname = commonFuc().randomString(5)
request_body = commonFuc().get_business_data(module, "payload_1", h_corpId, h_name, corpId, e_name, goodsname,
e_name)
# request_body = commonFuc().get_business_data(module, "payload10_1")
# print('request_body',request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
if code == 0:
commonFuc().check_text_exist(code, result)
else:
commonFuc().check_text_exist(-1, result)
def apply():
module = "a5_mdm3_pdm"
token, projectCode, uxid, corpId, username = e_login(2)
# 获取医院corpId
h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
# 登录
username = h_name
password = commonFuc().get_business_data(module, "password1")
print(username, password)
# 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# 审批产品驳回
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "singleAudit_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
info = FileUtils().r_info6(module, "产品审核信息", 'message2')
print(info)
MSPid = info['MSPid']
hosId = info['hosId']
hosGoodsId = info['hosGoodsId']
provGoodsid = info['provGoodsid']
goodsAuditBillId = info['goodsAuditBillId']
targetId = info['targetId']
request_body = commonFuc().get_business_data(module, "payload3_1", MSPid, hosId, hosGoodsId, provGoodsid,
goodsAuditBillId, targetId)
print('产品信息审核查询请求体', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print("产品信息审核查询返回结果", result)
checkDict = commonFuc().get_business_data(module, 'checkDict')
commonFuc().check_result(checkDict, result)
def select1(messageNO='message2'):
module = "a5_mdm3_pdm"
token, projectCode, uxid, corpId, username = e_login(2)
# 获取医院corpId
h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
# 登录
username = h_name
password = commonFuc().get_business_data(module, "password1")
print(username, password)
# 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# 产品信息审核查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "getAuditGoodsListByPage_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload2", h_corpId)
# print('产品信息审核查询请求体', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print("产品信息审核查询返回结果", result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
data1 = commonFuc().analysis_json('data', data)
if total >= 1:
id1 = commonFuc().analysis_json('id', data1[0])
auditOrgId = commonFuc().analysis_json('hosId', data1[0])
hosGoodsId = commonFuc().analysis_json('hosGoodsid', data1[0])
provGoodsid = commonFuc().analysis_json('provGoodsid', data1[0])
goodsAuditBillId = commonFuc().analysis_json('billId', data1[0])
targetId = commonFuc().analysis_json('id', data1[0])
print(id1, auditOrgId, hosGoodsId, provGoodsid, goodsAuditBillId, targetId)
info = (id1, auditOrgId, hosGoodsId, provGoodsid, goodsAuditBillId, targetId)
titlename = ("MSPid", 'hosId', 'hosGoodsId', 'provGoodsid', 'goodsAuditBillId', 'targetId')
# 将产品审核信息写入到b5_spd3_core_business_flow模块messsage文件中
FileUtils().w_info6(info, module, '产品审核信息', titlename, 'message2')
# 将产品审核信息写入到文件中
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '产品审核信息', titlename, messageNO)
else:
commonFuc().check_text_exist(0, result)
def add_goods1(): # 低值
token, projectCode, uxid, corpId, e_name = e_login(2)
# 获取医院corpId
h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
module = "a5_mdm3_pdm"
# b18供货目录申请_客户类型_医院_提交供货申请单_添加产品
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "addGoodsHandleInfos_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
goodsname = commonFuc().randomString(5)
request_body = commonFuc().get_business_data(module, "payload", h_corpId, h_name, corpId, e_name, goodsname, e_name)
# request_body = commonFuc().get_business_data(module, "payload10_1")
# print('request_body',request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
if code == 0:
commonFuc().check_text_exist(code, result)
else:
commonFuc().check_text_exist(-1, result)
def add_goods2(): # 试剂
token, projectCode, uxid, corpId, e_name = e_login(2)
# 获取医院corpId
h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
module = "a5_mdm3_pdm"
# b18供货目录申请_客户类型_医院_提交供货申请单_添加产品
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "addGoodsHandleInfos_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
goodsname = commonFuc().randomString(5)
request_body = commonFuc().get_business_data(module, "payload_2", h_corpId, h_name, corpId, e_name, goodsname,
e_name)
# request_body = commonFuc().get_business_data(module, "payload10_1")
# print('request_body',request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
if code == 0:
commonFuc().check_text_exist(code, result)
else:
commonFuc().check_text_exist(-1, result)
def add_goods3():
token, projectCode, uxid, corpId, e_name = e_login(2)
# 获取医院corpId
h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
module = "a5_mdm3_pdm"
# b18供货目录申请_客户类型_医院_提交供货申请单_添加产品
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "addGoodsHandleInfos_url")
print('url', url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
goodsname = commonFuc().randomString(5)
request_body = commonFuc().get_business_data(module, "payload_1_1", h_corpId, h_name, corpId, e_name, goodsname,
'浙江高仰医疗科技有限公司', 'p10d95')
# request_body = commonFuc().get_business_data(module, "payload10_1")
# print('request_body',request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
if code == 0:
commonFuc().check_text_exist(code, result)
else:
commonFuc().check_text_exist(-1, result)
def add_goods4():
token, projectCode, uxid, corpId, e_name = e_login(2)
# 获取医院corpId
h_token, h_projectCode, h_uxid, h_corpId, h_name = h_login()
module = "a5_mdm3_pdm"
# b18供货目录申请_客户类型_医院_提交供货申请单_添加产品
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "addGoodsHandleInfos_url")
print('url', url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
goodsname = commonFuc().randomString(5)
request_body = commonFuc().get_business_data(module, "payload_1_2", h_corpId, h_name, corpId, e_name, goodsname,
'浙江高仰医疗科技有限公司', 'p10d95')
# request_body = commonFuc().get_business_data(module, "payload10_1")
# print('request_body',request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
if code == 0:
commonFuc().check_text_exist(code, result)
else:
commonFuc().check_text_exist(-1, result)
def supplyProvHosGoods_add_DI():
module = "a5_mdm3_pdm"
token, projectCode, uxid, corpId, e_name = e_login(2)
# 维护产品DI信息列表查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "hdiFusion_getHosGoodsForDiList_url")
print('维护产品DI信息列表查询url', url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload6", get_hosid())
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
# import pdb
# pdb.set_trace()
print('维护产品DI信息列表查询result', result)
data = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))
print('维护产品DI信息列表查询data', data)
for i in data:
hosGoodsId = commonFuc().analysis_json('id', i)
url1 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "hdiFusion_getGoodsinfoAndDiLst_url")
request_body1 = commonFuc().get_business_data(module, "payload6_1", hosGoodsId)
print('request_body1', request_body1)
result1 = commonFuc().http_post(url1, request_body1, headers)
packUnit = commonFuc().analysis_json('unit', commonFuc().analysis_json('goodsInfo',
commonFuc().analysis_json('data',
result1)))
basGoodsId = commonFuc().analysis_json('spdGoodsCode', commonFuc().analysis_json('goodsInfo',
commonFuc().analysis_json(
'data', result1)))
url2 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "hdiFusion_supplyProvHosGoods_add_url")
request_body2 = commonFuc().get_business_data(module, "payload6_2", packUnit, basGoodsId)
print('request_body2', request_body2)
result2 = commonFuc().http_post(url2, request_body2, headers)
print('result2', result2)
# 删除上次新增的产品,避免产生过多的重复数据====这里不能每天删除,万一导入产品功能出现问题会影响后续脚本
# 每隔一段时间来删除重复的产品数据即可,内外网同步删除
# try:
# list2=[]
# for i in range(1, 6):
# info = FileUtils().r_info8('b5_spd3_core_business_flow', "产品审核信息", 'message%s' % i)
# hosGoodsId = info['hosGoodsId']
# list2.append(hosGoodsId)
# print(list2)
# for i in list2:
# print(i,'aaaaaaaaaaaaaaaa')
# delData().Del_goods_info(i)
# except:
# print('产品数据删除出现异常')
# 删除上次新增的产品,避免产生过多的重复数据====这里不能每天删除,万一导入产品功能出现问题会影响后续脚本 # 删除上次新增的产品,避免产生过多的重复数据====这里不能每天删除,万一导入产品功能出现问题会影响后续脚本
# 每隔一段时间来删除重复的产品数据即可,内外网同步删除 # 每隔一段时间来删除重复的产品数据即可,内外网同步删除
pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a3_流程三_产品导入和审批.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a3_流程三_产品导入和审批.air')
from a_a3_流程三_产品导入和审批 import add_goods, select1, apply, add_goods1, add_goods2, add_goods3, add_goods4, \
supplyProvHosGoods_add_DI
try: try:
# ==============分割线 暂时注释=============== # ==============分割线 暂时注释===============
add_goods()#直销高值 add_goods() # 直销高值
select1('message1') select1('message1')
apply() apply()
add_goods1()#直销低值 add_goods1() # 直销低值
select1('message2') select1('message2')
apply() apply()
add_goods2()#直销试剂 add_goods2() # 直销试剂
select1('message3') select1('message3')
apply() apply()
add_goods3()#集配 add_goods3() # 集配
select1('message4') select1('message4')
apply() apply()
add_goods4()#定向 "isSubprov": "1" add_goods4() # 定向 "isSubprov": "1"
select1('message5') select1('message5')
apply() apply()
#20240618外网在配送的时候增加了DI验证,加入维护di的脚本 # 20240618外网在配送的时候增加了DI验证,加入维护di的脚本
supplyProvHosGoods_add_DI() supplyProvHosGoods_add_DI()
# ==============分割线 暂时注释=============== # ==============分割线 暂时注释===============
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
...@@ -399,5 +51,6 @@ except: ...@@ -399,5 +51,6 @@ except:
commonFuc().check_text_exist_result_text('产品新增失败', '产品新增成功') commonFuc().check_text_exist_result_text('产品新增失败', '产品新增成功')
else: else:
# 删除今天之前的产品信息(包含内外网) # 删除今天之前的产品信息(包含内外网)
delData().Del_goods_info_all() # delData().Del_goods_info_all()
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
print('=================流程三结束=================')
...@@ -7,7 +7,7 @@ from common.run_cmd_script import execute_command ...@@ -7,7 +7,7 @@ from common.run_cmd_script import execute_command
__author__ = "xiaohesheng" __author__ = "xiaohesheng"
""" """
case_tag:api,b6_spd3_core_business_flow_database_check1,a_a4_流程四_基础模块设置,id2303,id2303-4,sit,on case_tag:api,b6_spd3_core_business_flow_database_check,a_a4_流程四_基础模块设置,id2303,id2303-4,sit,on
主数据平台:a_a4_流程四_基础模块设置 主数据平台:a_a4_流程四_基础模块设置
python runner_test.py tag id2303-4 debug mdm3 python runner_test.py tag id2303-4 debug mdm3
""" """
...@@ -21,289 +21,167 @@ import time ...@@ -21,289 +21,167 @@ import time
module = "b6_spd3_core_business_flow_database_check" module = "b6_spd3_core_business_flow_database_check"
def test1(): def check_test1_info():
# 院区新增 print('检查院区数据,科室数据,库房库区数据')
execute_command("python runner_test.py tag id2263-4 debug sit") # 获取实际值
# 新增科室 # 要验证的数据sql
execute_command( sql1 = "select * from mcms_branch_info order by create_time desc LIMIT 1;"
"python runner_test.py tag id2263-19,id2263-20,id2263-21,id2263-22,id2263-23,id2263-24,id2263-25,id2263-26 debug sit") actual = check_mcms_pur_sql(sql1)
# 一键导入所有产品 print('actual', actual)
execute_command("python runner_test.py tag id2263-48 debug sit") id = get_id("select id from mcms_branch_info order by create_time desc LIMIT 1;")
#导入同步过来的新产品,防止因同步时间差导致新建的产品没有导入过来 branch_id = get_branch_id()
for i in range(1, 6): if branch_id == id:
info = FileUtils().r_info8('b5_spd3_core_business_flow', "产品审核信息", 'message%s' % i) print('ok')
hosGoodsId = info['hosGoodsId'] commonFuc().check_text_exist_result_text('succees', 'succees')
import_goods(hosGoodsId) else:
commonFuc().check_text_exist_result_text('error', 'succees')
# r_b8库房管理_库区设置_同步库房信息 hos_id = get_hosid()
execute_command("python runner_test.py tag id2263-221 debug sit") name = get_id("select name from mcms_branch_info order by create_time desc LIMIT 1;")
# 新增用户 address = name
execute_command("python runner_test.py tag id2263-253 debug sit") create_time = get_create_time("select create_time from mcms_branch_info where id='%s';" % id)
# 根据院区名称查询中心库房id last_modified = get_create_time("select last_modified from mcms_branch_info where id='%s';" % id)
execute_command("python runner_test.py tag id2263-222 debug sit") username = commonFuc().get_business_data('b2_herp3_bs', "username")
# 新增库区 create_user = get_login_user_uxid_bydb(username)
execute_command("python runner_test.py tag id2263-226 debug sit") last_modified_user = create_user
# 查询库区 expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
execute_command("python runner_test.py tag id2263-228 debug sit") 'check_mcms_branch_info', id, hos_id, name, address, create_time,
create_user
# r_d0库房管理_库区设置_人员管理_添加人员_查询人员 , last_modified, last_modified_user)
execute_command("python runner_test.py tag id2263-233 debug sit") actual_value1 = get_process_list2(actual)
# r_d2库房管理_库区设置_人员管理_添加人员 expected_value1 = get_process_list2(expected)
execute_command("python runner_test.py tag id2263-235 debug sit") actual_value2 = actual_value1.replace(" ", "")
# r_d4库房管理_库区设置_货位管理_添加货位 expected_value2 = expected_value1.replace(" ", "")
execute_command("python runner_test.py tag id2263-237 debug sit") # print('actual_value2',actual_value2)
# 科室管理-科室人员查询 设置科室负责人 print('expected_value2')
execute_command("python runner_test.py tag id2263-219 debug sit") print(expected_value2)
print('actual_value2')
def import_goods(hosGoodsId): print(actual_value2)
module = "b2_herp3_bs" result = (compare_text_index(actual_value2, expected_value2))
# 内网登录
username = commonFuc().get_business_data(module, "username")
# print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# 院区产品设置_查询院区产品
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "mcmsDeptGoodsInfo_url")
print('院区产品设置_查询院区产品',url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# 获取院区id
branch_id = FileUtils().r_info(module, '院区新增')["branch_id"]
# hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
goodsId=hosGoodsId.replace(get_hosid(), "")
# #请求体
request_body = commonFuc().get_business_data(module, "payload32_1",get_hosid(), goodsId,branch_id)
print('import_goods',request_body)
# # # 发送请求
result='result'
# j=1
while True:
# if j==600:
# print('600秒过去了,导入产品需要停止')
# break
result = commonFuc().http_post(url, request_body, headers)
total=commonFuc().analysis_json('total',commonFuc().analysis_json('data',result))
print('import_goods', total)
if total==0:
print('产品暂时没有同步到内网,等待6秒')
# j=j+6
time.sleep(6)
# 再次调用一键导入产品
execute_command("python runner_test.py tag id2263-48 debug sit")
else:
break
print('result', result) print('result', result)
if actual_value2 == expected_value2:
print('ok')
def test2(): # 科室添加产品信息(产品是从外网同步过来的) commonFuc().check_text_exist_result_text('succees', 'succees')
module = "b2_herp3_bs" else:
# 内网登录 print('error')
username = commonFuc().get_business_data(module, "username") commonFuc().check_text_exist_result_text('error', 'succees')
# print('医院名称',username) # 验证科室数据
password = commonFuc().get_business_data(module, "password") # 要验证的数据sql
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode for i in range(4):
token, projectCode, uxid, corpId, info = login_system(username, password).get_token() sql1 = "select * from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;" % (
branch_id, i)
# actual = check_mcms_pur_sql(sql1)
url = commonFuc().get_api_add_port_url()+commonFuc().get_business_data(module, "basic_mcmsGoodsInfo_insert") print('actual', actual)
print('basic_mcmsGoodsInfo_insert',url) id = get_id(
# 获取请求头信息 "select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;" % (branch_id, i))
headers = commonFuc().get_business_data(module, "json_headers2", pid = get_id("select pid from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET %s;" % (
commonFuc().get_business_data(module, "json_contentType"), token, branch_id, i))
commonFuc().get_business_data(module, "X-APP-CODE")) code = get_id("select code from sys_org where branch_id='%s' and id='%s';" % (branch_id, id))
list2 = [] corp_id = get_hosid()
i = 1 last_update_datetime = get_create_time("select last_update_datetime from sys_org where id='%s';" % id)
while True: create_time = get_create_time("select create_time from sys_org where id='%s';" % id)
if i == 1000: last_modified = get_create_time("select last_modified from sys_org where id='%s';" % id)
print('6000秒过去了,产品还没过来,检查同步是否正常') if i < 3:
break expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
try: 'check_dept_info' + str(i), id, pid, code, corp_id, branch_id,
for i in range(1, 6): last_update_datetime
info = FileUtils().r_info8('b5_spd3_core_business_flow', "产品审核信息", 'message%s' % i) , create_time, create_user, last_modified_user, last_modified)
hosGoodsId = info['hosGoodsId']
list2.append(hosGoodsId)
except:
print('产品没有同步过来,等待6秒')
time.sleep(6)
i = i + 1
continue
else: else:
break user_leader_id = get_login_user_uxid_bydb(
FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
dept2_id = FileUtils().r_info(module, '科室信息')["dept2_id"] expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
j=1 'check_dept_info' + str(i), id, pid, code, corp_id, branch_id,
for i in list2: last_update_datetime
# 请求体 , create_time, create_user, last_modified_user, last_modified,
if j==1: user_leader_id)
request_body = commonFuc().get_business_data(module, "payload58_6_3", dept2_id, i,20)
elif j==2: actual_value1 = get_process_list2(actual)
request_body = commonFuc().get_business_data(module, "payload58_6_3", dept2_id, i, 10) expected_value1 = get_process_list2(expected)
elif j==3: actual_value2 = actual_value1.replace(" ", "")
request_body = commonFuc().get_business_data(module, "payload58_6_3", dept2_id, i, 60) expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else: else:
request_body = commonFuc().get_business_data(module, "payload58_6_3", dept2_id, i,20) print('error')
j=j+1 commonFuc().check_text_exist_result_text('error', 'succees')
request_body = '[' + str(request_body) + ']' # 检查库房数据
new_request_body = request_body.replace("'", '"') # 要验证的数据sql
print(new_request_body) for i in range(3):
import json sql1 = "select * from mcms_stock_info where branch_id='%s' order by stock_level desc LIMIT 1 OFFSET %s;" % (
request_body_json = json.loads(new_request_body) branch_id, i)
# # # 发送请求 actual = check_mcms_pur_sql(sql1)
result = commonFuc().http_post(url, request_body_json, headers) print('actual', actual)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result) id = get_id(
# 断言 "select id from mcms_stock_info where branch_id='%s' order by stock_level desc LIMIT 1 OFFSET %s;" % (
# checkDict=commonFuc().get_business_data(module,'checkDict10') branch_id, i))
# commonFuc().check_result(checkDict,result) hos_id = get_hosid()
code = commonFuc().analysis_json('code', result) pid = get_id(
data = commonFuc().analysis_json('data', result) "select pid from mcms_stock_info where branch_id='%s' order by stock_level desc LIMIT 1 OFFSET %s;" % (
if code == 0 and data == 1: branch_id, i))
commonFuc().check_text_exist(0, result)
stock_code = get_id(
"select stock_code from mcms_stock_info where branch_id='%s' and id='%s';" % (branch_id, id))
corp_id = get_hosid()
create_time = get_create_time("select create_time from mcms_stock_info where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_stock_info where id='%s';" % id)
if i==0:
dept_id=get_id("select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET 1;"%branch_id)
elif i==1:
dept_id=get_id("select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET 2;"%branch_id)
else: else:
commonFuc().check_text_exist('error', result) dept_id=get_id("select id from sys_org where branch_id='%s' order by create_time desc LIMIT 1 OFFSET 3;"%branch_id)
def grants_user(orgName='d69a68df361a4289b2262e4ef75b55a5', mgrRangeId='feb0cc16618c437fb4d033cd339a0377'):
module = "b2_herp3_bs"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8(module, "用户名信息", 'message3')
print(info)
username1 = info['username1']
username = username1
## print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token1, projectCode1, uxid1, corpId1, info1 = login_system(username, password).get_token()
# 登录获取用户id等信息,使用创建的用户登录============结束
# 内网登录
username = commonFuc().get_business_data(module, "username")
## print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# print( token,projectCode,uxid,corpId,info)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "sys_user_grants_url") expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
# 获取请求头信息 'check_mcms_stock_info' + str(i), id, hos_id, pid, branch_id,
headers = commonFuc().get_business_data(module, "json_headers2", stock_code, dept_id,create_user, create_time, last_modified, last_modified_user
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
userId = uxid1
mgrBranchId = FileUtils().r_info(module, '院区新增')["branch_id"]
mgrBranchName = FileUtils().r_info(module, '院区新增')["branch_name"]
deptid1 = FileUtils().r_info8(module, '所有科室id','message6')["deptid1"]
deptid2 = FileUtils().r_info8(module, '所有科室id','message6')["deptid2"]
deptid3 = FileUtils().r_info8(module, '所有科室id','message6')["deptid3"]
deptid4 = FileUtils().r_info8(module, '所有科室id','message6')["deptid4"]
# # 请求体
request_body = commonFuc().get_business_data(module, "payload63_12_2", userId, mgrBranchId, mgrBranchName, deptid1,
mgrBranchId, mgrBranchName, deptid2, mgrBranchId, mgrBranchName,
deptid3, mgrBranchId, mgrBranchName, deptid4
) )
print('request_body', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaa', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
if code == 0 and data == 4:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
def add_StockArea():#添加货位
module='b2_herp3_bs'
# 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8(module, "用户名信息", 'message3')
print(info)
username1 = info['username1']
username = username1
## print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# 登录获取用户id等信息,使用创建的用户登录============结束
# 获取库区id
deptid1 = FileUtils().r_info8(module, '所有科室id','message6')["deptid1"]
branch_name = FileUtils().r_info(module, '院区新增')["branch_name"]
stockId = get_stockId(branch_name + '中心库房')
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "basic_stockShelf_page_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
request_body = commonFuc().get_business_data(module, "payload62_6", deptid1, stockId)
print('request_body',request_body)
result = commonFuc().http_post(url, request_body, headers)
print('result',result)
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data)
id1 = commonFuc().analysis_json('id', data1)
shelfCode = commonFuc().analysis_json('shelfCode', data1)
createTime = commonFuc().analysis_json('createTime', data1)
stockId = commonFuc().analysis_json('stockId', data1)
shelfName = commonFuc().analysis_json('shelfName', data1)
address = commonFuc().analysis_json('address', data1)
recPhone = commonFuc().analysis_json('recPhone', data1)
lastModified = commonFuc().analysis_json('lastModified', data1)
shelfNo = commonFuc().analysis_json('shelfNo', data1)
print(id1, lastModified, shelfCode, createTime, stockId, shelfName, address, recPhone, shelfNo)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
# r_d4库房管理_库区设置_货位管理_添加货位 actual_value1 = get_process_list2(actual)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "basic_stockUser_insertShelf_url") expected_value1 = get_process_list2(expected)
print('添加货位url',url) actual_value2 = actual_value1.replace(" ", "")
# 获取请求头信息 expected_value2 = expected_value1.replace(" ", "")
headers = commonFuc().get_business_data(module, "json_headers2", # print('actual_value2',actual_value2)
commonFuc().get_business_data(module, "json_contentType"), token, print('expected_value2')
commonFuc().get_business_data(module, "X-APP-CODE")) print(expected_value2)
print('actual_value2')
# # 请求体 print(actual_value2)
request_body = commonFuc().get_business_data(module, "payload62_12", id1, shelfCode, stockId, id1) result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
print('request_body', request_body) if actual_value2 == expected_value2:
# # # # 发送请求 print('ok')
result = commonFuc().http_post(url, request_body, headers) commonFuc().check_text_exist_result_text('succees', 'succees')
print('resultbbbbbbbbbbb', result) else:
print('error')
code = commonFuc().analysis_json('code', result) commonFuc().check_text_exist_result_text('error', 'succees')
data = commonFuc().analysis_json('data', result)
# pageSize = commonFuc().analysis_json('pageSize', data)
# print(pageSize, type(pageSize))
if code == 0 and data == 4: pro_path = commonFuc().get_pro_path2()
commonFuc().check_text_exist(0, result) print('pro_path', pro_path)
else: sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a4_流程四_基础模块设置.air')
commonFuc().check_text_exist('error', result) using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a4_流程四_基础模块设置.air')
from a_a4_流程四_基础模块设置 import test1, test2, grants_user, add_StockArea
try: try:
# ==============删除业务数据和报表数据 # ==============删除业务数据和报表数据
# delData().Delete_business_Data()#删除业务数据 # test1()#参数2是新增院区后缀为6位数的参数1是老模式
# delData().Del_reporter_data() # 删除报表数据 # 检查院区数据,科室数据,库房库区数据
#==============删除业务数据和报表数据 check_test1_info()
test1() test2() # 科室添加产品信息(产品是从外网同步过来的)
test2()# 科室添加产品信息(产品是从外网同步过来的) dept_query_all() # 科室查询,将科室id写入文件中
dept_query_all()# 科室查询,将科室id写入文件中 grants_user() # 给用户授权
grants_user()#给用户授权 set_dept_lead1() # 设置一级科室负责人
set_dept_lead1() #设置一级科室负责人 add_StockArea() # 添加库区
add_StockArea()#添加库区
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
print('=================流程四结束=================')
except Exception as e: except Exception as e:
commonFuc().check_text_exist_result_text('succees','error') print("发生异常:", str(e))
print("发生异常:", str(e)) commonFuc().check_text_exist_result_text('succees', 'error')
\ No newline at end of file
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
import traceback import traceback
from air_case.public1.public1.public1 import updateUserLoginDefaultRange, get_listUserMgrRangePage, call_login, \ from air_case.public1.public1.public1 import updateUserLoginDefaultRange, get_listUserMgrRangePage, call_login, \
get_branch_id, process_tuple, get_dept_buy_id, check_mcms_pur_plan_sql, get_hosid, get_id, \ get_branch_id, get_dept_buy_id, check_mcms_pur_plan_sql, get_hosid, get_id, \
get_stockAreaId_new_fromDb, get_login_user_uxid, get_expdt_date, get_create_time, get_process_list2, \ get_stockAreaId_new_fromDb, get_login_user_uxid, get_expdt_date, get_create_time, get_process_list2, \
compare_text_index, check_mcms_pur_sql, check_source_id, get_mdm_goods_code1, get_goods_code1, get_supply_id, \ compare_text_index, check_mcms_pur_sql, check_source_id, get_mdm_goods_code1, get_goods_code1, get_supply_id, \
get_pkg_def_id, get_goods_gg, get_goods_name get_pkg_def_id, get_goods_gg, get_goods_name, get_login_user_uxid_bydb, process_tuple
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command from common.run_cmd_script import execute_command
...@@ -66,7 +66,7 @@ def check_mcms_mcms_pur_plan(type=16): ...@@ -66,7 +66,7 @@ def check_mcms_mcms_pur_plan(type=16):
branch_id) branch_id)
area_name = process_tuple(get_id(sql1)) area_name = process_tuple(get_id(sql1))
source_id = None source_id = None
rec_user = get_login_user_uxid() rec_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
sql1 = "select rec_addr from mcms_pur_plan where branch_id='%s' order by create_time desc LIMIT 1;" % ( sql1 = "select rec_addr from mcms_pur_plan where branch_id='%s' order by create_time desc LIMIT 1;" % (
branch_id) branch_id)
rec_addr = process_tuple(get_id(sql1)) rec_addr = process_tuple(get_id(sql1))
...@@ -160,7 +160,7 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo): ...@@ -160,7 +160,7 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo):
dept_name2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] dept_name2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
rec_org_id = process_tuple( rec_org_id = process_tuple(
get_id("select id from sys_org where branch_id='%s' and ename='%s';" % (branch_id, dept_name2))) get_id("select id from sys_org where branch_id='%s' and ename='%s';" % (branch_id, dept_name2)))
rec_user = get_login_user_uxid() rec_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_user = rec_user create_user = rec_user
# last_modified = create_time # last_modified = create_time
last_modified_user = create_user last_modified_user = create_user
...@@ -219,7 +219,9 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo): ...@@ -219,7 +219,9 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo):
create_time = get_create_time( create_time = get_create_time(
"select create_time from mcms_pur_plan_detail where id='%s';" % ( "select create_time from mcms_pur_plan_detail where id='%s';" % (
id2)) id2))
last_modified = create_time last_modified = get_create_time(
"select last_modified from mcms_pur_plan_detail where id='%s';" % (
id2))
sub_prov_name = prov_name sub_prov_name = prov_name
source_id = process_tuple( source_id = process_tuple(
get_id("select source_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % ( get_id("select source_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
...@@ -254,7 +256,9 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo): ...@@ -254,7 +256,9 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo):
create_time = get_create_time( create_time = get_create_time(
"select create_time from mcms_pur_plan_detail where id='%s';" % ( "select create_time from mcms_pur_plan_detail where id='%s';" % (
id2)) id2))
last_modified = create_time last_modified = get_create_time(
"select last_modified from mcms_pur_plan_detail where id='%s';" % (
id2))
sub_prov_name = prov_name sub_prov_name = prov_name
source_id = process_tuple( source_id = process_tuple(
get_id("select source_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % ( get_id("select source_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
...@@ -323,7 +327,7 @@ def check_mcms_purchase(type=16): ...@@ -323,7 +327,7 @@ def check_mcms_purchase(type=16):
branch_id, id1) branch_id, id1)
area_name = process_tuple(get_id(sql1)) area_name = process_tuple(get_id(sql1))
rec_user = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'] rec_user = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1']
# rec_user = get_login_user_uxid() # rec_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
sql1 = "select rec_addr from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;" % ( sql1 = "select rec_addr from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1) branch_id, id1)
rec_addr = process_tuple(get_id(sql1)) rec_addr = process_tuple(get_id(sql1))
...@@ -332,7 +336,7 @@ def check_mcms_purchase(type=16): ...@@ -332,7 +336,7 @@ def check_mcms_purchase(type=16):
print(sql) print(sql)
bill_expdt_date = get_expdt_date(sql) bill_expdt_date = get_expdt_date(sql)
create_user = get_login_user_uxid() create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time( create_time = get_create_time(
"select create_time from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;" % ( "select create_time from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1)) branch_id, id1))
...@@ -411,9 +415,9 @@ def check_mcms_purchase(type=16): ...@@ -411,9 +415,9 @@ def check_mcms_purchase(type=16):
'mcms_purchase2_0927', id1, order_no, hos_id, 'mcms_purchase2_0927', id1, order_no, hos_id,
get_branch_id(), dept_id1, dept_name1, rec_org_id, rec_org_name, get_branch_id(), dept_id1, dept_name1, rec_org_id, rec_org_name,
area_code, area_name, bill_expdt_date, source_id, rec_user, area_code, area_name, bill_expdt_date, source_id, rec_user,
rec_addr, prov_id, prov_name, exe_prov_id, exe_prov_name, buyBillId, rec_addr, prov_id, prov_name, exe_prov_id, exe_prov_name,
planBillId, planOrderNo, planBillId, planOrderNo,
buyOrderNo, purOrderNo, purBillId, close_date, create_user, purOrderNo, purBillId, close_date, create_user,
create_time, last_modified, last_auditor, last_audit_time create_time, last_modified, last_auditor, last_audit_time
) )
elif type == 66: elif type == 66:
...@@ -446,9 +450,9 @@ def check_mcms_purchase(type=16): ...@@ -446,9 +450,9 @@ def check_mcms_purchase(type=16):
'mcms_purchase3_0927', id1, order_no, hos_id, 'mcms_purchase3_0927', id1, order_no, hos_id,
get_branch_id(), dept_id1, dept_name1, rec_org_id, rec_org_name, get_branch_id(), dept_id1, dept_name1, rec_org_id, rec_org_name,
area_code, area_name, bill_expdt_date, source_id, rec_user, area_code, area_name, bill_expdt_date, source_id, rec_user,
rec_addr, prov_id, prov_name, exe_prov_id, exe_prov_name, buyBillId, rec_addr, prov_id, prov_name, exe_prov_id, exe_prov_name,
planBillId, planOrderNo, planBillId, planOrderNo,
buyOrderNo, purOrderNo, purBillId, close_date, create_user, purOrderNo, purBillId, close_date, create_user,
create_time, last_modified, last_auditor, last_audit_time create_time, last_modified, last_auditor, last_audit_time
) )
else: else:
...@@ -493,7 +497,7 @@ def check_mcms_purchase_detail(id, type, OrderNo): ...@@ -493,7 +497,7 @@ def check_mcms_purchase_detail(id, type, OrderNo):
dept_name2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'] dept_name2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
rec_org_id = process_tuple( rec_org_id = process_tuple(
get_id("select id from sys_org where branch_id='%s' and ename='%s';" % (branch_id, dept_name2))) get_id("select id from sys_org where branch_id='%s' and ename='%s';" % (branch_id, dept_name2)))
rec_user = get_login_user_uxid() rec_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_user = rec_user create_user = rec_user
# last_modified = create_time # last_modified = create_time
last_modified_user = create_user last_modified_user = create_user
...@@ -531,7 +535,7 @@ def check_mcms_purchase_detail(id, type, OrderNo): ...@@ -531,7 +535,7 @@ def check_mcms_purchase_detail(id, type, OrderNo):
goodsGg = get_goods_gg(hos_goods_id) goodsGg = get_goods_gg(hos_goods_id)
goodsCode = get_goods_code1(hos_goods_id) goodsCode = get_goods_code1(hos_goods_id)
goodsName = get_goods_name(hos_goods_id) goodsName = get_goods_name(hos_goods_id)
create_user = get_login_user_uxid() create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_purchase_detail where id='%s';" % detail_main_key) create_time = get_create_time("select create_time from mcms_purchase_detail where id='%s';" % detail_main_key)
last_modified = create_time last_modified = create_time
last_modified_user = create_user last_modified_user = create_user
...@@ -591,27 +595,35 @@ from a_a5流程五_中心库入库结算_正结算1_提交采购计划 import go ...@@ -591,27 +595,35 @@ from a_a5流程五_中心库入库结算_正结算1_提交采购计划 import go
def main(): def main():
try: try:
# token, projectCode1, uxid1, corpId1, info1 = call_login(2) token, projectCode1, uxid1, corpId1, info1 = call_login(2)
# updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是1级库 updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是1级库
# goods_move3(token) goods_move3(token)
# # 获取低值的hosGoodsId # 获取低值的hosGoodsId
# hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"] hosGoodsId = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
# get_GoodsPkgDef(hosGoodsId,token) # 获取单元包id get_GoodsPkgDef(hosGoodsId,token) # 获取单元包id
# low_vaule_purchase_plan(token,uxid1)#低值采购计划提交 low_vaule_purchase_plan(token,uxid1)#低值采购计划提交
# time.sleep(6) time.sleep(6)
# check_mcms_mcms_pur_plan(16)#低值采购计划数据检查 check_mcms_mcms_pur_plan(16)#低值采购计划数据检查
# #审批 #审批
# approval_center(token) approval_center(token)
# time.sleep(6) time.sleep(6)
check_mcms_purchase(16)#检查采购订单数据 check_mcms_purchase(16)#检查低值采购订单数据
hight_vaule_purchase_plan(token,uxid1)#高值采购计划提交 hight_vaule_purchase_plan(token,uxid1)#高值采购计划提交
time.sleep(6) time.sleep(6)
check_mcms_mcms_pur_plan(20) # 高值采购计划数据检查
approval_center(token) approval_center(token)
reagent_purchase_plan(token,uxid1) time.sleep(6)
check_mcms_purchase(20) #检查高值采购订单数据
time.sleep(6)
reagent_purchase_plan(token,uxid1)#试剂采购计划提交
time.sleep(6)
check_mcms_mcms_pur_plan(66) #试剂采购计划数据检查
approval_center(token) approval_center(token)
time.sleep(6)
check_mcms_purchase(66) # 检查试剂采购订单数据
commonFuc().check_text_exist_result_text('succees', 'succees') commonFuc().check_text_exist_result_text('succees', 'succees')
except Exception as e: except Exception as e:
print('出现错误,请检查脚本或者数据') # print('出现错误,请检查脚本或者数据')
print(f"发生错误: {e}") print(f"发生错误: {e}")
print("发生异常:", str(e)) print("发生异常:", str(e))
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
import traceback import traceback
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
from air_case.public1.public1.public1 import get_branch_id, get_hosid, process_tuple, get_dept_buy_id, reGetString, \
get_login_user_uxid2, get_create_time, get_ext_info, get_process_list2, compare_text_index, check_mcms_pur_plan_sql, \
get_id, get_mdm_goods_code1, get_goods_code1, get_goods_name, get_goods_gg, get_goods_mfrs_id, get_expdt_date, \
get_supply_id, call_login, get_hosname
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command from common.run_cmd_script import execute_command
from common.timeUtils import timeUtils from common.timeUtils import timeUtils
...@@ -19,250 +23,381 @@ from airtest.core.api import using ...@@ -19,250 +23,381 @@ from airtest.core.api import using
import sys import sys
import time import time
module = "b6_spd3_core_business_flow_database_check"
def order_dp(type=1): def check_hdi_distr(type=16):
# execute_command("python runner_test.py tag id2302-5 debug mdm3") from common.db.sql.sql_tools_out import check_mcms_pur_plan_sql, get_id
# # 登录获取用户id等信息,使用创建的用户登录===========开始 branch_id = get_branch_id()
info = FileUtils().r_info8('b5_spd3_core_business_flow', "供货关系申请2", 'message') # 验证配送单主表
# print(info) sql = "select * from spd_hdiorder_test2.hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
username = info['e_username'] branch_id, type)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
hos_id = get_hosid()
# 获取采购订单id
purchase_id = get_id(
"select id from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
# 查询配送单主键
distr_main_key = get_id(
"select id from spd_hdiorder_test2.hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
# 查询配送单order_no
distr_order_no = get_id(
"select order_no from spd_hdiorder_test2.hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
distr_main_key, type))
# 从采购订单获取source_id
source_id = get_id(
"select id from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
pur_bill_id = source_id
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
rec_user = info['username1']
sql = "select id from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
buyBillId = process_tuple(get_dept_buy_id(sql))
bill_relation_json = get_id(
"select bill_relation_json from spd_hdiorder_test2.hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
distr_main_key, type))
print(bill_relation_json)
purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
distrBillId = distr_main_key
distrOrderNo = distr_order_no
distrUser = get_login_user_uxid2()
create_user = distrUser
create_user_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
create_time = get_create_time(
"select create_time from spd_hdiorder_test2.hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
last_modified_user = distrUser
if type == 16:
# 验证子表数据
time.sleep(5)
check_hdi_distr_detail(distr_main_key, type, purchase_id)
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
password = commonFuc().get_business_data("b2_herp3_bs", "password1") planBillId = process_tuple(
# username = '001f90380' get_id(
# password='1qaz!QAZ' "select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
print('username,password', username, password) hos_goods_id)))
# # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# # 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# 登录获取用户id等信息,使用创建的用户登录============结束
# =========================查询待确认订单====================== planOrderNo = process_tuple(
module = "a6_mdm3_dp" get_id(
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "purchase_page_url") "select order_no from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
# 获取请求头信息 hos_goods_id)))
headers = commonFuc().get_business_data(module, "json_headers2", sql = "select order_no from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
commonFuc().get_business_data(module, "json_contentType"), token, branch_id, type)
projectCode) print(sql)
branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"] buyOrderNo = process_tuple(get_dept_buy_id(sql))
hos_id = branch_id[0:5] sql = "select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
exeProvId = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"] branch_id, type)
print(sql)
id1 = process_tuple(get_dept_buy_id(sql))
sql = "select order_no from mcms_purchase where branch_id='%s' and bill_mode='%s'and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, type, id1)
print(sql)
purOrderNo = process_tuple(get_dept_buy_id(sql))
purBillId = id1
prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
exe_prov_id = prov_id
exe_prov_name = prov_name
pur_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
pur_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
rec_org_id = process_tuple(
get_id("select id from spd3_herp_test2.sys_org where branch_id='%s' and ename='%s';" % (
branch_id, FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'])))
rec_org_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
last_modified = get_create_time(
"select last_modified from spd_hdiorder_test2.hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
confirmUser = distrUser
ext_info = get_ext_info(branch_id, type)
confirmTime = reGetString(ext_info, r'"confirmTime":"', r'""confirmUser')
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'hdi_distr_0929', distr_main_key, distr_order_no, hos_id, get_hosname(),
get_branch_id(), source_id, pur_bill_id, prov_id, prov_name,
exe_prov_id, exe_prov_name, pur_dept_id, pur_dept_name, rec_org_id,
rec_org_name, rec_user, planBillId, planOrderNo,
purOrderNo, purBillId, purBillDate, distrBillId, distrOrderNo,
confirmTime, confirmUser, distrUser, create_user, create_user_name,
create_time, last_modified,
last_modified_user
)
if type == 1: elif type == 20:
orderNo1 = FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号', 'message7')["orderNo1"] # 验证子表数据
print(orderNo1) time.sleep(5)
elif type == 2: check_hdi_distr_detail(distr_main_key, type, purchase_id)
orderNo1 = FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号高值', 'message11')["orderNo1"] hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
print(orderNo1)
elif type == 3:
orderNo1 = FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号试剂', 'message12')["orderNo1"]
print(orderNo1)
else:
orderNo1 = 'orderNo1'
request_body = commonFuc().get_business_data(module, "payload1_1_1", orderNo1, hos_id, exeProvId)
# print('request_body',request_body)
# 发送请求
while True:
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
if total == 1:
break
else:
time.sleep(6)
data1 = commonFuc().analysis_json('data', data) planBillId = process_tuple(
id1 = commonFuc().analysis_json('id', data1[0]) get_id(
print('id1', id1) "select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
data = commonFuc().analysis_json('data', result) planOrderNo = process_tuple(
data1 = commonFuc().analysis_json('data', data) get_id(
list_a = [] "select order_no from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
list_b = [] hos_goods_id)))
list_c = [] sql = "select order_no from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
list_a.append(data1) branch_id, type)
list_b.append(data1) print(sql)
list_c.append(data1) buyOrderNo = process_tuple(get_dept_buy_id(sql))
# print('list_a', len(list_a), list_a) sql = "select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
info = (list_a, list_b, list_c) branch_id, type)
titlename = ('list_a', 'list_b', 'list_c') print(sql)
# 将配送订单信息息写入到文件中 id1 = process_tuple(get_dept_buy_id(sql))
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '配送订单信息', titlename, 'message8') sql = "select order_no from mcms_purchase where branch_id='%s' and bill_mode='%s'and id='%s' order by create_time desc LIMIT 1;" % (
# 从message8文件中获取信息 branch_id, type, id1)
info = FileUtils().r_info8('b5_spd3_core_business_flow', "配送订单信息", 'message8') print(sql)
# print('info', info) purOrderNo = process_tuple(get_dept_buy_id(sql))
list_a = info['list_a'] purBillId = id1
list_a = ','.join(map(str, list_a)) prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
import json prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
new_request_body = list_a.replace("'", '"') exe_prov_id = prov_id
new_request_body1 = new_request_body.replace("None", 'null') exe_prov_name = prov_name
print(new_request_body1) pur_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
list_a2 = json.loads(new_request_body1) pur_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
# print('list_a', list_a) rec_org_id = process_tuple(
billMode = "billMode" get_id("select id from spd3_herp_test2.sys_org where branch_id='%s' and ename='%s';" % (
createUser = 'createUser' branch_id, FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'])))
hosId = 'hosId' rec_org_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
provId = 'provId' last_modified = get_create_time(
for i in list_a2: "select last_modified from hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
billMode = i["billMode"] branch_id, type))
createUser = i["createUser"] confirmUser = distrUser
hosId = i['hosId'] ext_info = get_ext_info(branch_id, type)
provId = i['provId'] confirmTime = reGetString(ext_info, r'"confirmTime":"', r'""confirmUser')
break expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'hdi_distr1_0929', distr_main_key, distr_order_no, hos_id, get_hosname(),
get_branch_id(), source_id, pur_bill_id, prov_id, prov_name,
exe_prov_id, exe_prov_name, pur_dept_id, pur_dept_name, rec_org_id,
rec_org_name, rec_user, planBillId, planOrderNo,
purOrderNo, purBillId, purBillDate, distrBillId, distrOrderNo,
confirmTime, confirmUser, distrUser, create_user, create_user_name,
create_time, last_modified,
last_modified_user
)
# =========================查询待确认订单====================== elif type == 66:
# ==============================确认订单================== # 验证子表数据
module = "a6_mdm3_dp" time.sleep(5)
check_hdi_distr_detail(distr_main_key, type, purchase_id)
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "ensure_url") planBillId = process_tuple(
get_id(
"select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
request_body = commonFuc().get_business_data(module, "payload2", id1, uxid) planOrderNo = process_tuple(
get_id(
"select order_no from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
sql = "select order_no from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
buyOrderNo = process_tuple(get_dept_buy_id(sql))
sql = "select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
id1 = process_tuple(get_dept_buy_id(sql))
sql = "select order_no from mcms_purchase where branch_id='%s' and bill_mode='%s'and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, type, id1)
print(sql)
purOrderNo = process_tuple(get_dept_buy_id(sql))
purBillId = id1
prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
exe_prov_id = prov_id
exe_prov_name = prov_name
pur_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
pur_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
rec_org_id = process_tuple(
get_id("select id from spd3_herp_test2.sys_org where branch_id='%s' and ename='%s';" % (
branch_id, FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1'])))
rec_org_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
last_modified = get_create_time(
"select last_modified from spd_hdiorder_test2.hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
confirmUser = distrUser
ext_info = get_ext_info(branch_id, type)
confirmTime = reGetString(ext_info, r'"confirmTime":"', r'""confirmUser')
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'hdi_distr2_0929', distr_main_key, distr_order_no, hos_id, get_hosname(),
get_branch_id(), source_id, pur_bill_id, prov_id, prov_name,
exe_prov_id, exe_prov_name, pur_dept_id, pur_dept_name, rec_org_id,
rec_org_name, rec_user, planBillId, planOrderNo,
purOrderNo, purBillId, purBillDate, distrBillId, distrOrderNo,
confirmTime, confirmUser, distrUser, create_user, create_user_name,
create_time, last_modified,
last_modified_user
)
# print('request_body',request_body) else:
# 发送请求 expected = None
result = commonFuc().http_post(url, request_body, headers) actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result) print('result', result)
# 断言 if actual_value2 == expected_value2:
code = commonFuc().analysis_json('code', result) print('ok')
data = commonFuc().analysis_json('data', result) commonFuc().check_text_exist_result_text('succees', 'succees')
if code == 0:
commonFuc().check_text_exist(code, result)
else: else:
commonFuc().check_text_exist('error', result) print('error')
# ==============================确认订单================== commonFuc().check_text_exist_result_text('error', 'succees')
# ==============================配送==================
# url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "purchase_page_url")
#
# request_body = commonFuc().get_business_data(module, "payload3_1_1",exeProvId,hos_id)
# # 发送请求
# result = commonFuc().http_post(url, request_body, headers)
# print('result', result)
# #断言
# code=commonFuc().analysis_json('code',result)
# data=commonFuc().analysis_json('data',result)
# total=commonFuc().analysis_json('total',data)
# data1 = commonFuc().analysis_json('data', data)
# id1=commonFuc().analysis_json('id', data1[0])
# print('id1',id1)
# ==================a3获取订单详细信息中的子表id_3_0医院
# a1订单配送列表数据查询_全部
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "detail_id_url")
request_body = commonFuc().get_business_data(module, "payload4", id1)
# print('request_body',request_body) def check_hdi_distr_detail(distr_main_key, type, purchase_id):
# 发送请求 sql = "select * from spd_hdiorder_test2.hdi_distr_detail where pid = '%s';" % distr_main_key
result = commonFuc().http_post(url, request_body, headers) # 获取实际值
print('resulta3获取订单详细信息中的子表id_3_0医院', result) actual = check_mcms_pur_plan_sql(sql)
# 断言 print('actual', actual)
code = commonFuc().analysis_json('code', result) # 获取子表主键
data = commonFuc().analysis_json('data', result) distr_detail_main_key = get_id(
total = commonFuc().analysis_json('total', data) "select id from spd_hdiorder_test2.hdi_distr_detail where pid = '%s';" % (
distr_main_key))
commonFuc().check_text_exist(code, result) source_id = purchase_id
data1 = commonFuc().analysis_json('data', data) source_detail_id = get_id("select id from mcms_purchase_detail where pid='%s'" % purchase_id)
id2 = commonFuc().analysis_json('id', data1[0]) pur_detail_id = source_detail_id
print(id1, id2) if type == 16:
data1 = commonFuc().analysis_json('data', data) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
list_a = [] elif type == 20:
list_b = [] hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
list_c = [] else:
list_a.append(data1) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
list_b.append(data1)
list_c.append(data1)
# print('list_a', len(list_a), list_a)
info = (list_a, list_b, list_c)
titlename = ('list_a', 'list_b', 'list_c')
# 将配送订单信息息写入到文件中
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '配送订单详细信息', titlename, 'message9')
# ==================a3获取订单详细信息中的子表id_3_0医院 mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
# ==================订单配送======================== goods_code = get_goods_code1(hos_goods_id)
module = "a6_mdm3_dp" goods_name = get_goods_name(hos_goods_id)
# a1订单配送列表数据查询_全部 goods_gg = get_goods_gg(hos_goods_id)
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "submit_url") mfrs_id = get_goods_mfrs_id(hos_goods_id)
# 获取请求头信息 expdt_date = get_expdt_date(
headers = commonFuc().get_business_data(module, "json_headers2", "select expdt_date from spd_hdiorder_test2.hdi_distr_detail where pid = '%s';" % (
commonFuc().get_business_data(module, "json_contentType"), token, distr_main_key))
projectCode) product_date = get_expdt_date(
# 从message9文件中获取信息 "select product_date from spd_hdiorder_test2.hdi_distr_detail where pid = '%s';" % (
info = FileUtils().r_info8('b5_spd3_core_business_flow', "配送订单详细信息", 'message9') distr_main_key))
print('info从message9文件中获取信息', info) pkg_def_id = process_tuple(
# print('info', info) get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id))
list_a = info['list_a'] supply_id = get_supply_id(hos_goods_id)
# print('list_a',list_a,type(list_a)) sub_prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
# list_a = ','.join(map(str, list_a)) sub_prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
# import json planBillId = process_tuple(
# new_request_body = list_a.replace("'", '"') get_id(
# new_request_body1 = new_request_body.replace("None", 'null') "select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
# print('new_request_body1',new_request_body1) hos_goods_id)))
# sql = "select id from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
# list_a2 = json.loads(new_request_body1) get_branch_id(), type)
# print('list_a2', list_a2) print(sql)
# print('list_a2', type(list_a2)) buyBillId = process_tuple(get_dept_buy_id(sql))
hosGoodsId = 'hosGoodsId' buyDetailId = get_id(
mdmGoodsCode = 'mdmGoodsCode' "select id from mcms_dept_buy_detail where pid='%s';" % buyBillId)
goodsCode = 'goodsCode' # planBillId = process_tuple(
pkgDefId = 'pkgDefId' # get_id(
erpCode = 'erpCode' # "select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
for i in list_a: # hos_goods_id)))
print('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', i) planDetailId = get_id(
for j in i: "select id from spd3_herp_test2.mcms_pur_plan_detail where pid='%s';" % planBillId)
print('bbbbbbbbbbbbbbbbbbb', j) purDetailId = pur_detail_id
hosGoodsId = j['hosGoodsId'] sql = "select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
mdmGoodsCode = j['mdmGoodsCode'] get_branch_id(), type)
goodsCode = j['goodsCode'] print(sql)
pkgDefId = j['pkgDefId'] id1 = process_tuple(get_dept_buy_id(sql))
erpCode = j['erpCode'] purBillId = id1
break distrDetailId = distr_detail_main_key
# # #获取日期 distrBillId = distr_main_key
productDate = timeUtils().get_time_hms(5) erpCode = mdm_goods_code # 11661563
expdtDate = timeUtils().get_time_add(190, 2) create_user = get_login_user_uxid2()
if type == 1: create_time = get_create_time(
request_body = commonFuc().get_business_data(module, "payload9_2_1_1", id1, id1, hosId, provId, billMode, "select create_time from spd_hdiorder_test2.hdi_distr_detail where id = '%s';" % (
createUser, username, createUser, id2, hosGoodsId, mdmGoodsCode, distr_detail_main_key))
goodsCode, pkgDefId, productDate, expdtDate, erpCode, id2) last_modified = get_create_time(
elif type == 2: "select last_modified from spd_hdiorder_test2.hdi_distr_detail where id = '%s';" % (
request_body = commonFuc().get_business_data(module, "payload9_2_1_2", id1, id1, hosId, provId, billMode, distr_detail_main_key))
createUser, username, createUser, id2, hosGoodsId, mdmGoodsCode, last_modified_user = create_user
goodsCode, productDate, expdtDate, erpCode, id2) if type == 16:
elif type == 3: expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
request_body = commonFuc().get_business_data(module, "payload9_2_1_3", id1, id1, hosId, provId, billMode, 'hdi_distr_detail_0929', distr_detail_main_key, distr_main_key, source_id,
createUser, username, createUser, id2, hosGoodsId, mdmGoodsCode, source_detail_id, pur_detail_id
goodsCode, pkgDefId, productDate, expdtDate, erpCode, id2) , hos_goods_id, mdm_goods_code, goods_code, goods_name, goods_gg,
mfrs_id, expdt_date, product_date
, pkg_def_id, supply_id, sub_prov_id, sub_prov_name, planBillId,
planDetailId, purDetailId, purBillId, distrDetailId,
distrBillId, goods_gg, goods_code, goods_name, erpCode, create_user,
create_time, last_modified, last_modified_user)
elif type == 20:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'hdi_distr_detail2_0929', distr_detail_main_key, distr_main_key, source_id,
source_detail_id, pur_detail_id
, hos_goods_id, mdm_goods_code, goods_code, goods_name, goods_gg,
mfrs_id, expdt_date, product_date
, pkg_def_id, supply_id, sub_prov_id, sub_prov_name, planBillId,
planDetailId, purDetailId, purBillId, distrDetailId,
distrBillId, goods_gg, goods_code, goods_name, erpCode, create_user,
create_time, last_modified, last_modified_user)
elif type == 66:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'hdi_distr_detail3_0929', distr_detail_main_key, distr_main_key, source_id,
source_detail_id, pur_detail_id
, hos_goods_id, mdm_goods_code, goods_code, goods_name, goods_gg,
mfrs_id, expdt_date, product_date
, pkg_def_id, supply_id, sub_prov_id, sub_prov_name, planBillId,
planDetailId, purDetailId, purBillId, distrDetailId,
distrBillId, goods_gg, goods_code, goods_name, erpCode, create_user,
create_time, last_modified, last_modified_user)
else:
expected = None
print('request_body', request_body) # comparison_result(actual, expected)
# 发送请求 actual_value1 = get_process_list2(actual)
result = commonFuc().http_post(url, request_body, headers) expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result) print('result', result)
# 断言 if actual_value2 == expected_value2:
code = commonFuc().analysis_json('code', result) print('ok')
data = commonFuc().analysis_json('data', result) commonFuc().check_text_exist_result_text('succees', 'succees')
id1 = commonFuc().analysis_json('id', data)
info = (id1, id1)
titlename = ('distrBillId1', 'distrBillId2')
# 将配送订单信息息写入到文件中
if type==1:
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '低值配送单号', titlename, 'message10')
elif type==2:
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '高值配送单号', titlename, 'message10')
elif type==3:
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '试剂配送单号', titlename, 'message10')
if code == 0:
commonFuc().check_text_exist(code, result)
else: else:
commonFuc().check_text_exist('error', result) print('error')
# ==================订单配送===================================== commonFuc().check_text_exist_result_text('error', 'succees')
pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a6流程五_中心库入库结算_正结算2_外网配送.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a6流程五_中心库入库结算_正结算2_外网配送.air')
from a_a6流程五_中心库入库结算_正结算2_外网配送 import order_dp
try: try:
order_dp(1)# 1低值 token, projectCode1, uxid1, corpId1, info1 = call_login(1)
order_dp(2)#2高值 #
order_dp(3)#3试剂 order_dp(1, token, projectCode1, uxid1) # 1低值
order_dp(2, token, projectCode1, uxid1) # 2高值
order_dp(3, token, projectCode1, uxid1) # 3试剂
time.sleep(12)
list_data = ['16', '20', '66']
for i in list_data:
time.sleep(6)
check_hdi_distr(int(i)) # 检查配送单(外网)
except Exception as e: except Exception as e:
print('订单配送发生错误,请检查脚本或者数据') print('订单配送发生错误,请检查脚本或者数据')
print("发生异常:", str(e)) print("发生异常:", str(e))
......
...@@ -3,6 +3,7 @@ import traceback ...@@ -3,6 +3,7 @@ import traceback
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from air_case.public1.public1.public1 import * from air_case.public1.public1.public1 import *
from common.dateUtils import dateUtils
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command from common.run_cmd_script import execute_command
from common.timeUtils import timeUtils from common.timeUtils import timeUtils
...@@ -21,401 +22,1156 @@ from airtest.core.api import using ...@@ -21,401 +22,1156 @@ from airtest.core.api import using
import sys import sys
import time import time
module = "b6_spd3_core_business_flow_database_check" def check_mcms_check(type=1):
def check_accept_order(type=1):
# execute_command("python runner_test.py tag id2302-6 debug mdm3")
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
# print(info)
username = info['username1']
password = commonFuc().get_business_data("b2_herp3_bs", "password")
# username = '001f90380'
# password='1qaz!QAZ'
print('username,password', username, password)
# # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# # 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# 登录获取用户id等信息,使用创建的用户登录============结束
# =========================查询待验收订单======================
module = "b5_spd3_core_business_flow"
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "check_wait_page_url")
print('url', url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"]
hos_id = branch_id[0:5]
if type == 1: if type == 1:
sourceOrderNo = FileUtils().r_info8(module, '低值配送单号', 'message10')["distrBillId1"] bill_mode = 16
elif type == 2: elif type == 2:
sourceOrderNo = FileUtils().r_info8(module, '高值配送单号', 'message10')["distrBillId1"] bill_mode = 20
elif type == 3: else:
sourceOrderNo = FileUtils().r_info8(module, '试剂配送单号', 'message10')["distrBillId1"] bill_mode = 66
else: print('检查验收单数据库写值')
sourceOrderNo = FileUtils().r_info8(module, '低值配送单号', 'message10')["distrBillId1"] check_no = FileUtils().r_info8('b5_spd3_core_business_flow', '验收单号', 'message15')['CHECK_NO1']
request_body = commonFuc().get_business_data(module, "payload", hos_id, branch_id, sourceOrderNo) sql = "select * from mcms_check where id = '%s';" % check_no
print('request_body', request_body) order_no = get_id("select order_no from mcms_check where id = '%s';" % check_no)
# 发送请求 # 获取实际值
while True: actual = check_mcms_pur_plan_sql(sql)
result = commonFuc().http_post(url, request_body, headers) print('actual', actual)
print('result', result) if type == 1:
# 断言 source_id = FileUtils().r_info8('b5_spd3_core_business_flow', '低值配送单号', 'message10')['distrBillId1']
code = commonFuc().analysis_json('code', result) elif type == 2:
data = commonFuc().analysis_json('data', result) source_id = FileUtils().r_info8('b5_spd3_core_business_flow', '高值配送单号', 'message10')['distrBillId1']
total = commonFuc().analysis_json('total', data) else:
if total == 1: source_id = FileUtils().r_info8('b5_spd3_core_business_flow', '试剂配送单号', 'message10')['distrBillId1']
break source_no = source_id
else: prov_id = get_prov_id()
time.sleep(6) prov_name = get_prov_name()
rec_org_id = get_rec_org_id(1)
data = commonFuc().analysis_json('data', result) rec_org_name = get_rec_org_name(1)
data1 = commonFuc().analysis_json('data', data) dept_id = rec_org_id
list_a = [] dept_name = rec_org_name
list_b = [] branch_id = get_branch_id()
list_c = [] buyBillId = get_buyBillId(branch_id, bill_mode)
list_a.append(data1) buyOrderNo = get_buyOrderNo(branch_id, bill_mode)
list_b.append(data1) if type == 1:
list_c.append(data1) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
# print('list_a', len(list_a), list_a) elif type == 2:
info = (list_a, list_b, list_c) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
titlename = ('list_a', 'list_b', 'list_c') else:
# 将验收单信息写入到文件中 hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '验收单信息', titlename, 'message13') planBillId = get_planBillId(hos_goods_id)
# 从message13文件中获取信息 planOrderNo = get_planOrderNo(hos_goods_id)
info = FileUtils().r_info8('b5_spd3_core_business_flow', "验收单信息", 'message13') purOrderNo = get_purOrderNo(branch_id, bill_mode)
# print('info', info) purBillId = get_purBillId(branch_id, bill_mode)
list_a = info['list_a'] bill_relation_json = get_mcms_chek_purBillDate(branch_id, bill_mode)
print('list_a', list_a) purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
sourceType = "sourceType" distrBillId = get_distrBillId(branch_id, bill_mode)
billMode = 'billMode' distrOrderNo = get_distrOrderNo(branch_id, bill_mode)
recOrgId = 'recOrgId' checkBillId = check_no
recOrgName = 'recOrgName' checkOrderNo = order_no
sourceOrgId = 'sourceOrgId' create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
sourceOrgName = 'sourceOrgName' sql = "select create_time from mcms_check where id='%s';" % check_no
sourceVersion = 'sourceVersion' create_time = get_create_time(sql)
tbStatus = 'tbStatus' sql = "select last_modified from mcms_check where id='%s';" % check_no
for i in list_a: last_modified = get_create_time(sql)
print('i', i) last_modified_user = create_user
for j in i: if type == 1:
sourceType = j["sourceType"] check_mcms_check_batch(type, check_no, order_no, hos_goods_id)
billMode = j["billMode"] expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check_1008', check_no,
recOrgId = j['recOrgId'] order_no, get_hosid(), get_branch_id(), source_id, source_no, prov_id,
recOrgName = j['recOrgName'] prov_name, rec_org_id, rec_org_name, dept_id, dept_name,
sourceOrgId = j['sourceOrgId'] planBillId, planOrderNo, purOrderNo, purBillId,
sourceOrgName = j['sourceOrgName'] purBillDate,
sourceVersion = j['sourceVersion'] distrBillId, distrOrderNo, checkBillId, checkOrderNo, create_user,
tbStatus = j['tbStatus'] create_time, last_modified,
break last_modified_user)
elif type == 2:
# =========================查询待验收订单====================== check_mcms_check_batch(type, check_no, order_no, hos_goods_id)
# ==============================查看订单详情================== expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check1_1008', check_no,
order_no, get_hosid(), get_branch_id(), source_id, source_no, prov_id,
sourceId = sourceOrderNo prov_name, rec_org_id, rec_org_name, dept_id, dept_name,
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "check_wait_detail_url") planBillId, planOrderNo, purOrderNo, purBillId,
print('url', url) purBillDate,
request_body = commonFuc().get_business_data(module, "payload1", sourceId, sourceType, billMode, branch_id) distrBillId, distrOrderNo, checkBillId, checkOrderNo, create_user,
create_time, last_modified,
# print('request_body',request_body) last_modified_user)
# 发送请求 else:
while True: check_mcms_check_batch(type, check_no, order_no, hos_goods_id)
time.sleep(6) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check2_1008', check_no,
result = commonFuc().http_post(url, request_body, headers) order_no, get_hosid(), get_branch_id(), source_id, source_no, prov_id,
code = commonFuc().analysis_json('code', result) prov_name, rec_org_id, rec_org_name, dept_id, dept_name,
if code == 0: planBillId, planOrderNo, purOrderNo, purBillId,
break purBillDate,
else: distrBillId, distrOrderNo, checkBillId, checkOrderNo, create_user,
print('验收单数据未同步完成,等待6秒') create_time, last_modified,
last_modified_user)
# 对比预期值和实际值是否一致
# comparison_result(actual, expected)
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result) print('result', result)
# 断言 if actual_value2 == expected_value2:
data = commonFuc().analysis_json('data', result) print('ok')
list_a = [] commonFuc().check_text_exist_result_text('succees', 'succees')
list_b = [] else:
list_c = [] print('error')
list_a.append(data) commonFuc().check_text_exist_result_text('error', 'succees')
list_b.append(data)
list_c.append(data)
# print('list_a', len(list_a), list_a) def check_mcms_check_batch(type, check_no, order_no, hos_goods_id):
info = (list_a, list_b, list_c) print('数据库检查验收单子表')
titlename = ('list_a', 'list_b', 'list_c') if type == 1:
# 将验收单详细信息写入到文件中 bill_mode = 16
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '验收单详情信息', titlename, 'message14') elif type == 2:
# 读取viewId bill_mode = 20
info = FileUtils().r_info8('b5_spd3_core_business_flow', "验收单详情信息", 'message14') else:
# print('info', info) bill_mode = 66
sql = "select * from mcms_check_batch where pid='%s' order by create_time desc LIMIT 1;" % check_no
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
id = get_id("select id from mcms_check_batch where pid='%s' order by create_time desc LIMIT 1;" % check_no)
pid = check_no
branch_id = get_branch_id()
distr_detail_id = get_distr_detail_id(branch_id, bill_mode)
source_detail_id = distr_detail_id
mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
goods_code = get_goods_code1(hos_goods_id)
sql = "select barcode_id from mcms_check_batch where pid='%s' order by create_time desc LIMIT 1;" % (
check_no)
barcode_id = get_id(sql)
if check_barcode_id(barcode_id)==True:
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_check_batch where pid='%s'" % check_no)
last_modified = get_create_time("select last_modified from mcms_check_batch where pid='%s'" % check_no)
last_modified_user = create_user
if type == 1:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check_batch', id,
pid, order_no, source_detail_id, distr_detail_id, hos_goods_id,
mdm_goods_code,
goods_code, barcode_id, create_user, create_time, last_modified,
last_modified_user
)
elif type == 2:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check_batch1', id,
pid, order_no, source_detail_id, distr_detail_id, hos_goods_id,
mdm_goods_code,
goods_code, barcode_id, create_user, create_time, last_modified,
last_modified_user
)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'mcms_check_batch2', id,
pid, order_no, source_detail_id, distr_detail_id, hos_goods_id,
mdm_goods_code,
goods_code, barcode_id, create_user, create_time, last_modified,
last_modified_user
)
# 对比预期值和实际值是否一致
# comparison_result(actual, expected)
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi(type=1):
print('检查中心库入库单')
if type == 1:
bill_mode = 16
elif type == 2:
bill_mode = 20
else:
bill_mode = 66
branch_id = get_branch_id()
sql = "select * from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_YS' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
sql = "select id from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_YS' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
id = get_id(sql)
sql = "select order_no from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_YS' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
order_no = get_id(sql)
target_corp_id = get_hosid()
target_branch_id = get_branch_id()
target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_name = get_branch_name() + "中心库房"
target_stock_id = get_stockId_fromdb(stock_name)
target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 1)
# source_id = FileUtils().r_info8('b5_spd3_core_business_flow', '验收单号', 'message15')['CHECK_NO1']
sql = "select source_id from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='RK_YS' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, bill_mode)
source_id=get_id(sql)
# source_no = get_distrBillId(branch_id, bill_mode)
source_no=None
source_repl_id = source_no
source_corp_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
source_dept_id = source_corp_id
source_dept_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
source_stock_id = source_corp_id
accounter = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
account_date = get_create_time("select account_date from mcms_psi where id='%s';" % id)
buyBillId = get_buyBillId(branch_id, bill_mode)
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
planBillId = get_planBillId(hos_goods_id)
planOrderNo = get_planOrderNo(hos_goods_id)
buyOrderNo = get_buyOrderNo(branch_id, bill_mode)
purOrderNo = get_purOrderNo(branch_id, bill_mode)
purBillId = get_purBillId(branch_id, bill_mode)
bill_relation_json = get_purBillDate2(branch_id, bill_mode)
purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
distrBillId = get_distrBillId(branch_id, bill_mode)
distrOrderNo = get_distrOrderNo(branch_id, bill_mode)
checkBillId = source_id
sql = "select order_no from mcms_check where id='%s';" % checkBillId
checkOrderNo = get_id(sql)
psiInBillId = id
psiInOrderNo = order_no
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_psi where id='%s';" % id)
last_modified_user = create_user
if type == 1:
# 检查子表
check_mcms_psi_batch_in(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi1_1008', id,
order_no, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id
, target_area_code, source_id, source_no, source_repl_id,
source_corp_id, source_dept_id, source_dept_name
, source_stock_id, accounter, account_date, planBillId,
planOrderNo, purOrderNo, purBillId
, purBillDate, distrBillId, distrOrderNo, checkBillId, checkOrderNo,
psiInBillId, psiInOrderNo, create_user
, create_time, last_modified, last_modified_user)
elif type == 2:
check_mcms_psi_batch_in(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi2_1008', id,
order_no, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id
, target_area_code, source_id, source_no, source_repl_id,
source_corp_id, source_dept_id, source_dept_name
, source_stock_id, accounter, account_date, planBillId,
planOrderNo, purOrderNo, purBillId
, purBillDate, distrBillId, distrOrderNo, checkBillId, checkOrderNo,
psiInBillId, psiInOrderNo, create_user
, create_time, last_modified, last_modified_user)
else:
check_mcms_psi_batch_in(id, type, order_no, source_id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi3_1008', id,
order_no, target_corp_id, target_branch_id, target_dept_id,
target_dept_name, target_stock_id
, target_area_code, source_id, source_no, source_repl_id,
source_corp_id, source_dept_id, source_dept_name
, source_stock_id, accounter, account_date, planBillId,
planOrderNo, purOrderNo, purBillId
, purBillDate, distrBillId, distrOrderNo, checkBillId, checkOrderNo,
psiInBillId, psiInOrderNo, create_user
, create_time, last_modified, last_modified_user)
# 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
# # 检查中心库出库单====================================================================
# sql = "select * from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_QL' order by CREATE_TIME desc LIMIT 1;" % (
# branch_id, bill_mode)
# # 获取实际值
# actual = check_mcms_pur_plan_sql(sql)
# print('actual', actual)
# sql = "select id from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_QL' order by CREATE_TIME desc LIMIT 1;" % (
# branch_id, bill_mode)
# id_out = get_id(sql)
# sql = "select order_no from mcms_psi where target_branch_id='%s' and bill_mode='%s' and stock_kind='CK_QL' order by CREATE_TIME desc LIMIT 1;" % (
# branch_id, bill_mode)
# order_no_out = get_id(sql)
# target_corp_id = get_hosid()
# target_branch_id = get_branch_id()
# target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
# target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
# stock_name = target_dept_name + "库房"
# target_stock_id = get_stockId_fromdb(stock_name)
# target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 2)
# source_id_out = id
# source_no_out = order_no
# source_repl_id = source_no
# source_corp_id = get_hosid()
# source_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
# source_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
# source_stock_id = get_stockId_fromdb(get_branch_name() + '中心库房')
# accounter = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
# account_date = get_create_time("select account_date from mcms_psi where id='%s';" % id_out)
#
# buyBillId = get_buyBillId(branch_id, bill_mode)
# if type == 1:
# hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
# elif type == 2:
# hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
# else:
# hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
# planBillId = get_planBillId(hos_goods_id)
# planOrderNo = get_planOrderNo(hos_goods_id)
# buyOrderNo = get_buyOrderNo(branch_id, bill_mode)
# purOrderNo = get_purOrderNo(branch_id, bill_mode)
# purBillId = get_purBillId(branch_id, bill_mode)
# bill_relation_json = get_purBillDate2(branch_id, bill_mode)
# purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
# distrBillId = get_distrBillId(branch_id, bill_mode)
# distrOrderNo = get_distrOrderNo(branch_id, bill_mode)
# checkBillId = source_id
# sql = "select order_no from mcms_check where id='%s';" % checkBillId
# checkOrderNo = get_id(sql)
# psiInBillId = id
# psiInOrderNo = order_no
# psiOutBillId = id_out
# psiOutOrderNo = order_no_out
# create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
# create_time = get_create_time("select create_time from mcms_psi where id='%s';" % id_out)
# last_modified = get_create_time("select last_modified from mcms_psi where id='%s';" % id_out)
# last_modified_user = create_user
# source_branch_id = get_branch_id()
# source_area_code = get_stockAreaId_new_fromDb(source_dept_name)
# if type == 1:
# check_mcms_psi_batch_out(id, type, order_no, source_id)
# expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi_out1',
# id_out,
# order_no_out, target_corp_id, target_branch_id, target_dept_id,
# target_dept_name, target_stock_id
# , target_area_code, source_id_out, source_no_out, source_repl_id,
# source_corp_id, source_branch_id, source_dept_id, source_dept_name
# , source_stock_id, source_area_code, buyBillId, planBillId,
# planOrderNo, buyOrderNo, purOrderNo, purBillId
# , purBillDate, distrBillId, distrOrderNo, checkBillId, checkOrderNo,
# psiInBillId, psiInOrderNo, psiOutBillId, psiOutOrderNo, create_user
# , create_time, last_modified, last_modified_user)
# elif type == 2:
# check_mcms_psi_batch_out(id, type, order_no, source_id)
# expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi_out2',
# id_out,
# order_no_out, target_corp_id, target_branch_id, target_dept_id,
# target_dept_name, target_stock_id
# , target_area_code, source_id_out, source_no_out, source_repl_id,
# source_corp_id, source_branch_id, source_dept_id, source_dept_name
# , source_stock_id, source_area_code, buyBillId, planBillId,
# planOrderNo, buyOrderNo, purOrderNo, purBillId
# , purBillDate, distrBillId, distrOrderNo, checkBillId, checkOrderNo,
# psiInBillId, psiInOrderNo, psiOutBillId, psiOutOrderNo, create_user
# , create_time, last_modified, last_modified_user)
# else:
# check_mcms_psi_batch_out(id, type, order_no, source_id)
# expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check', 'check_mcms_psi_out3',
# id_out,
# order_no_out, target_corp_id, target_branch_id, target_dept_id,
# target_dept_name, target_stock_id
# , target_area_code, source_id_out, source_no_out, source_repl_id,
# source_corp_id, source_branch_id, source_dept_id, source_dept_name
# , source_stock_id, source_area_code, buyBillId, planBillId,
# planOrderNo, buyOrderNo, purOrderNo, purBillId
# , purBillDate, distrBillId, distrOrderNo, checkBillId, checkOrderNo,
# psiInBillId, psiInOrderNo, psiOutBillId, psiOutOrderNo, create_user
# , create_time, last_modified, last_modified_user)
# # 对比预期值和实际值是否一致
# actual_value1 = get_process_list2(actual)
# expected_value1 = get_process_list2(expected)
# actual_value2 = actual_value1.replace(" ", "")
# expected_value2 = expected_value1.replace(" ", "")
# # print('actual_value2',actual_value2)
# print('expected_value2')
# print(expected_value2)
# print('actual_value2')
# print(actual_value2)
# result = (compare_text_index(actual_value2, expected_value2))
# print('result', result)
# if actual_value2 == expected_value2:
# print('ok')
# commonFuc().check_text_exist_result_text('succees', 'succees')
# else:
# print('error')
# commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi_batch_in(DR_ID, type, order_no, source_id1):
if type == 1:
bill_mode = 16
elif type == 2:
bill_mode = 20
else:
bill_mode = 66
branch_id = get_branch_id()
sql = " select * from mcms_psi_batch where pid='%s' order by create_time desc LIMIT 1;" % (
DR_ID)
actual = check_mcms_dept_buy_sql(sql)
print('actual', actual)
batch_main_key = get_id("select id from mcms_psi_batch where pid='%s' order by create_time desc LIMIT 1;" % DR_ID)
pid = DR_ID
# order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_ID)
source_detail_id = get_id("select source_detail_id from mcms_psi_batch where id='%s';" % batch_main_key)
pick_detail_id = None
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
goods_code = get_goods_code1(hos_goods_id)
pkg_def_id = get_pkg_def_id(hos_goods_id)
picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
picker = get_login_user_uxid_bydb(picker_name)
source_batch_id = get_id("select source_batch_id from mcms_psi_batch where pid='%s';" % DR_ID)
distrBillId = get_distrBillId(branch_id, bill_mode)
target_batch_id = get_id(
"select id from mcms_hos_batch where hos_goods_id='%s' order by create_time desc LIMIT 1;" % hos_goods_id)
if check_batch_id(source_batch_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
barcode_id = get_id("select barcode_id from mcms_psi_batch where id='%s';" % batch_main_key)
if check_barcode_id(barcode_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
shelf_code = get_stockAreaId_new_fromDb(get_branch_name(), 1)
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi_batch where id='%s';" % batch_main_key)
last_modified = get_create_time("select last_modified from mcms_psi_batch where id='%s';" % batch_main_key)
last_modified_user = create_user
if type == 1:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_in1', batch_main_key, pid, order_no, source_detail_id
, hos_goods_id, mdm_goods_code, goods_code, source_batch_id,
target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified, last_modified_user
)
elif type == 2:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_in2', batch_main_key, pid, order_no, source_detail_id
, hos_goods_id, mdm_goods_code, goods_code, source_batch_id,
target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified, last_modified_user
)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_batch_in3', batch_main_key, pid, order_no, source_detail_id
, hos_goods_id, mdm_goods_code, goods_code, source_batch_id,
target_batch_id, barcode_id, shelf_code, create_user, create_time,
last_modified, last_modified_user
)
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
print(compare_text_index(actual_value2, expected_value2))
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_out_balance(type=1, OBh_ID=""):
print('===检查结算数据======')
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
branch_id = get_branch_id()
sql = "select * from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
sql = "select id from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id)
id = get_id(sql)
if id == OBh_ID:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
order_no = get_id(
"select order_no from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id))
hos_id = get_hosid()
prov_id = get_prov_id()
prov_name = get_prov_name()
sub_prov_id = prov_id
settle_dept_id = None
distr_detail_id = get_id("select distr_detail_id from mcms_out_un_balance where id='%s';" % id)
if check_distr_detail_id(distr_detail_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
hos_batch_id = get_id("select hos_batch_id from mcms_out_un_balance where id='%s';" % id)
if check_batch_id(hos_batch_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
# 从文件中获取条码信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18')
list_a = info['list_a'] list_a = info['list_a']
print('list_a', list_a) bar_id = commonFuc().analysis_json('id', list_a)
viewId = "viewId" bar_code = commonFuc().analysis_json('pkgCodeSee', list_a)
settlement = 'settlement' from_id = get_id(
recTemperature = 'recTemperature' "select id from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (hos_goods_id))
recHumidity = 'recHumidity' from_order_no = get_id(
hosGoodsId='hosGoodsId' "select order_no from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
distrQty='distrQty' hos_goods_id))
distrPkgQty='distrPkgQty' settle_start_time = get_account_date1("select settle_start_time from mcms_out_balance where id='%s';" % id)
for i in list_a: settle_end_time = get_account_date1("select settle_end_time from mcms_out_balance where id='%s';" % id)
for j in i: account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
viewId = j["viewId"] create_user = account_user_id
settlement = j["settlement"] create_time = get_create_time("select create_time from mcms_out_balance where id='%s';" % id)
recTemperature = j['recTemperature'] last_modified = get_create_time("select last_modified from mcms_out_balance where id='%s';" % id)
recHumidity = j['recHumidity'] last_modified_user = create_user
hosGoodsId= j['hosGoodsId'] goods_code = get_goods_code1(hos_goods_id)
distrQty= j['distrQty'] charge_dept_id = settle_dept_id
distrPkgQty=j['distrPkgQty'] settle_month = get_id("select settle_month from mcms_out_balance where id='%s';" % id)
year, month = dateUtils().get_year_month(dateUtils().get_current_time())
break if month < 10:
# ==============================查看订单详情================== month = "0" + str(month)
# ========设置验收全部合格 year_month = str(year) + str(month)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "check_barcode_save_url") if year_month == settle_month:
print('check_barcode_save_url', url) print('ok')
sourceBillId = sourceId commonFuc().check_text_exist_result_text('success', 'success')
request_body = commonFuc().get_business_data(module, "payload2", sourceBillId, viewId) else:
commonFuc().check_text_exist_result_text('error', 'success')
print('设置验收全部合格request_body',request_body) expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
# 发送请求 'check_mcms_out_balance_1008', id,
time.sleep(6) order_no, branch_id, hos_id, prov_id, prov_name, settle_month,
settle_start_time, settle_end_time, create_user, create_time,
last_modified, last_modified_user
)
while True: # 对比预期值和实际值是否一致
result = commonFuc().http_post(url, request_body, headers) actual_value1 = get_process_list2(actual)
print('result', result) expected_value1 = get_process_list2(expected)
data = commonFuc().analysis_json('data', result) actual_value2 = actual_value1.replace(" ", "")
code= commonFuc().analysis_json('code', result) expected_value2 = expected_value1.replace(" ", "")
print(code) # print('actual_value2',actual_value2)
if code ==0 and data==100: print('expected_value2')
break print(expected_value2)
else: print('actual_value2')
print('设置产品合格出现问题') print(actual_value2)
time.sleep(6) result = (compare_text_index(actual_value2, expected_value2))
continue
# ========设置验收全部合格
# =============提交验收单========================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "check_submit_url")
deptId = recOrgId
deptName = recOrgName
provId = sourceOrgId
provName = sourceOrgName
createUser = uxid
sourceNo = sourceId
checkQty=distrQty
checkPkgQty=distrPkgQty
time.sleep(6)
request_body = commonFuc().get_business_data(module, "payload3", billMode, branch_id, deptId, deptName, hos_id,
provId, provName, recOrgId, recOrgName, sourceId, sourceVersion,
sourceType, tbStatus, createUser, sourceNo, viewId, hosGoodsId,viewId, settlement,
checkQty,distrPkgQty,checkPkgQty,recTemperature, recHumidity)
print('request_body', '提交验收单', request_body)
# 发送请求
while True:
time.sleep(3)
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
CHECK_NO = commonFuc().analysis_json('data', result)
code = commonFuc().analysis_json('code', result)
if code == 0:
break
info = (CHECK_NO, CHECK_NO)
titlename = ('CHECK_NO1', 'CHECK_NO2')
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '验收单号', titlename, 'message15')
# 入库上架
def putaway():
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
# print(info)
username = info['username1']
password = commonFuc().get_business_data("b2_herp3_bs", "password")
# username = '001f90380'
# password='1qaz!QAZ'
print('username,password', username, password)
# # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# # 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# 登录获取用户id等信息,使用创建的用户登录============结束
# =====================上架入库列表查询==========================
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "stock_in_page_url")
print(url)
branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"]
hosId = branch_id[0:5]
request_body = commonFuc().get_business_data(module, "payload6", branch_id, hosId)
result = commonFuc().http_post(url, request_body, headers)
print('result', result) print('result', result)
data = commonFuc().analysis_json('data', result) if actual_value2 == expected_value2:
total = commonFuc().analysis_json('total', data) print('ok')
if total >= 1: commonFuc().check_text_exist_result_text('succees', 'succees')
# 将上架入库列表数据写入文件 else:
data = commonFuc().analysis_json('data', result) print('error')
data1 = commonFuc().analysis_json('data', data) commonFuc().check_text_exist_result_text('error', 'succees')
list_a = []
list_b = [] # 检查结算表子表数据
list_c = [] check_mcms_out_balance_detail(type, id)
list_a.append(data1) check_mcms_out_balance_detail2(type, id)
list_b.append(data1)
list_c.append(data1)
# print('list_a', len(list_a), list_a) def check_mcms_out_balance_detail(type=1, pid=""):
info = (list_a, list_b, list_c) print('===检查结算数据子表======')
titlename = ('list_a', 'list_b', 'list_c') if type == 1:
# 将验收单详细信息写入到文件中 hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '上架入库列表数据', titlename, 'message16') elif type == 2:
# =====================上架入库列表查询========================== hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
# =============查看验收单详情======================== else:
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "stock_detail_url") hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
print('查看验收单详情',url) branch_id = get_branch_id()
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"] sql = "select * from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;;" % (
areaCode = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["shelfCode"] pid)
branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"] # 获取实际值
hosId = branch_id[0:5] actual = check_mcms_pur_plan_sql(sql)
# 从message16文件中获取信息 print('actual', actual)
info = FileUtils().r_info8('b5_spd3_core_business_flow', "上架入库列表数据", 'message16') sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;" % (
pid)
id = get_id(sql)
sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % (
pid)
id2 = get_id(sql)
hos_id = get_hosid()
prov_id = get_prov_id()
prov_name = get_prov_name()
sub_prov_id = prov_id
settle_dept_id = None
distr_detail_id = get_id("select distr_detail_id from mcms_out_balance_detail where id='%s';" % id)
if check_distr_detail_id(distr_detail_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
hos_batch_id = get_id("select hos_batch_id from mcms_out_balance_detail where id='%s';" % id)
if check_batch_id(hos_batch_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
# 从文件中获取条码信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18')
list_a = info['list_a'] list_a = info['list_a']
print('list_a', list_a) bar_id = get_id("select bar_id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;" % (
sourceId = 'sourceId' pid))
for i in list_a: bar_code = get_id("select bar_code from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;" % (
for j in i: pid))
sourceId = j['sourceId'] from_id = get_id(
break "select from_id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;" % (pid))
# 从message13文件中获取信息 from_order_no = get_id(
info = FileUtils().r_info8('b5_spd3_core_business_flow', "验收单信息", 'message13') "select order_no from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
# print('info', info) hos_goods_id))
account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_user = account_user_id
create_time = get_create_time("select create_time from mcms_out_balance_detail where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_out_balance_detail where id='%s';" % id)
last_modified_user = create_user
# goods_code = get_goods_code1(hos_goods_id)
# charge_dept_id = settle_dept_id
# settle_month = get_id("select settle_month from mcms_out_balance where id='%s';" % id)
# year, month = dateUtils().get_year_month(dateUtils().get_current_time())
out_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
out_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
sub_prov_name = prov_name
account_date = get_account_date1("select account_date from mcms_out_balance_detail where id='%s';" % id)
un_settle_id = get_id(
"select id from mcms_out_un_balance where branch_id='%s' and from_kind='RK_YS' and hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, hos_goods_id))
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_out_balance_detail_1008_1', id,
pid, prov_id, prov_name, sub_prov_id, sub_prov_name, out_dept_id,
out_dept_name, account_date, from_id, from_order_no, hos_goods_id, bar_id,
bar_code, distr_detail_id, hos_batch_id, un_settle_id, create_user,
create_time, last_modified, last_modified_user, hos_id
)
# 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_out_balance_detail2(type=1, pid=""):
print('===检查结算数据子表======')
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
branch_id = get_branch_id()
sql = "select * from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % (
pid)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
# sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;" % (
# pid)
# id = get_id(sql)
sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % (
pid)
id = get_id(sql)
hos_id = get_hosid()
prov_id = get_prov_id()
prov_name = get_prov_name()
sub_prov_id = prov_id
settle_dept_id = None
distr_detail_id = get_id("select distr_detail_id from mcms_out_balance_detail where id='%s';" % id)
if check_distr_detail_id(distr_detail_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
hos_batch_id = get_id("select hos_batch_id from mcms_out_balance_detail where id='%s';" % id)
if check_batch_id(hos_batch_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
# 从文件中获取条码信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18')
list_a = info['list_a'] list_a = info['list_a']
print('list_a', list_a) bar_id = get_id("select bar_id from mcms_out_balance_detail where id='%s';" % (id))
sourceType = "sourceType" bar_code = get_id("select bar_code from mcms_out_balance_detail where id='%s';" % (id))
for i in list_a: from_id = get_id(
print('i', i) "select from_id from mcms_out_balance_detail where id='%s';" % (id))
for j in i: if check_batch_id(from_id) == True:
sourceType = j["sourceType"] print('ok')
break commonFuc().check_text_exist_result_text('success', 'success')
else:
request_body = commonFuc().get_business_data(module, "payload4", deptid1, areaCode, hosId, sourceId, sourceType) commonFuc().check_text_exist_result_text('error', 'success')
from_order_no = get_id(
print('request_body', 'd', request_body) "select order_no from mcms_psi_batch where id='%s';" % (from_id))
result = commonFuc().http_post(url, request_body, headers)
account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_user = account_user_id
create_time = get_create_time("select create_time from mcms_out_balance_detail where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_out_balance_detail where id='%s';" % id)
last_modified_user = create_user
out_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
out_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
sub_prov_name = prov_name
account_date = get_account_date1("select account_date from mcms_out_balance_detail where id='%s';" % id)
un_settle_id = get_id(
"select un_settle_id from mcms_out_balance_detail where id='%s';" % id)
if check_un_balance_id(un_settle_id):
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_out_balance_detail_1008_2', id,
pid, prov_id, prov_name, sub_prov_id, sub_prov_name, out_dept_id,
out_dept_name, account_date, from_id, from_order_no, hos_goods_id, bar_id,
bar_code, distr_detail_id, hos_batch_id, un_settle_id, create_user,
create_time, last_modified, last_modified_user, hos_id
)
# 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result) print('result', result)
# 将验收单详情写入文件 if actual_value2 == expected_value2:
data = commonFuc().analysis_json('data', result) print('ok')
list_a = [] commonFuc().check_text_exist_result_text('succees', 'succees')
list_b = [] else:
list_c = [] print('error')
list_a.append(data) commonFuc().check_text_exist_result_text('error', 'succees')
list_b.append(data)
list_c.append(data)
# print('list_a', len(list_a), list_a) def check_mcms_out_balance_approve_after(type=1, OBh_ID=""):
info = (list_a, list_b, list_c) print('===检查结算数据======')
titlename = ('list_a', 'list_b', 'list_c') if type == 1:
# 将验收单详细信息写入到文件中 hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '验收单库存详情信息', titlename, 'message17') elif type == 2:
time.sleep(6) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
# ============= # =============查看验收单详情================================================ else:
# ================================入库上架=================== hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "stock_detail_submit_url") branch_id = get_branch_id()
print(url) sql = "select * from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
viewId = 'viewId' branch_id)
shelfCode = 'shelfCode' # 获取实际值
sourceId = 'sourceId' actual = check_mcms_pur_plan_sql(sql)
sourceType = 'PSD' print('actual', actual)
sourceVersion = '0' sql = "select id from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
targetDeptId = deptid1 branch_id)
targetDeptName = 'targetDeptName' id = get_id(sql)
targetAreaCode = 'targetAreaCode' if id == OBh_ID:
targetAreaName = 'targetAreaName' print('ok')
# 从message17文件中获取信息 commonFuc().check_text_exist_result_text('success', 'success')
info = FileUtils().r_info8('b5_spd3_core_business_flow', "验收单库存详情信息", 'message17') else:
# print('info', info) commonFuc().check_text_exist_result_text('error', 'success')
order_no = get_id(
"select order_no from mcms_out_balance where branch_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id))
hos_id = get_hosid()
prov_id = get_prov_id()
prov_name = get_prov_name()
sub_prov_id = prov_id
settle_dept_id = None
distr_detail_id = get_id("select distr_detail_id from mcms_out_un_balance where id='%s';" % id)
if check_distr_detail_id(distr_detail_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
hos_batch_id = get_id("select hos_batch_id from mcms_out_un_balance where id='%s';" % id)
if check_batch_id(hos_batch_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
# 从文件中获取条码信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18')
list_a = info['list_a'] list_a = info['list_a']
print('list_a', list_a) bar_id = commonFuc().analysis_json('id', list_a)
for i in list_a: bar_code = commonFuc().analysis_json('pkgCodeSee', list_a)
print('i', i) from_id = get_id(
for j in i: "select id from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (hos_goods_id))
viewId = j["viewId"] from_order_no = get_id(
shelfCode = j['shelfCode'] "select order_no from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
sourceId = j['id'] hos_goods_id))
break settle_start_time = get_account_date1("select settle_start_time from mcms_out_balance where id='%s';" % id)
# 从message16文件中获取信息 settle_end_time = get_account_date1("select settle_end_time from mcms_out_balance where id='%s';" % id)
info = FileUtils().r_info8('b5_spd3_core_business_flow', "上架入库列表数据", 'message16') account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_user = account_user_id
create_time = get_create_time("select create_time from mcms_out_balance where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_out_balance where id='%s';" % id)
last_modified_user = create_user
goods_code = get_goods_code1(hos_goods_id)
charge_dept_id = settle_dept_id
settle_month = get_id("select settle_month from mcms_out_balance where id='%s';" % id)
year, month = dateUtils().get_year_month(dateUtils().get_current_time())
if month < 10:
month = "0" + str(month)
year_month = str(year) + str(month)
if year_month == settle_month:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
check_user = create_user
check_time = get_create_time("select check_time from mcms_out_balance where id='%s';" % id)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_out_balance_1009', id,
order_no, branch_id, hos_id, prov_id, prov_name, settle_month,
settle_start_time, settle_end_time, create_user, create_time,
last_modified, last_modified_user, check_user, check_time
)
# 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
# 检查结算表子表数据
check_mcms_out_balance_detail_approve_after(type, id)
check_mcms_out_balance_detail_approve_after2(type, id)
def check_mcms_out_balance_detail_approve_after(type=1, pid=""):
print('===检查结算数据子表======')
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
branch_id = get_branch_id()
sql = "select * from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;;" % (
pid)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;" % (
pid)
id = get_id(sql)
sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % (
pid)
id2 = get_id(sql)
hos_id = get_hosid()
prov_id = get_prov_id()
prov_name = get_prov_name()
sub_prov_id = prov_id
settle_dept_id = None
distr_detail_id = get_id("select distr_detail_id from mcms_out_balance_detail where id='%s';" % id)
if check_distr_detail_id(distr_detail_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
hos_batch_id = get_id("select hos_batch_id from mcms_out_balance_detail where id='%s';" % id)
if check_batch_id(hos_batch_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
# 从文件中获取条码信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18')
list_a = info['list_a'] list_a = info['list_a']
print('list_a', list_a) bar_id = get_id("select bar_id from mcms_out_balance_detail where id='%s';" % (
for i in list_a: id))
for j in i: bar_code = get_id("select bar_code from mcms_out_balance_detail where id='%s';" % (
sourceId = j['sourceId'] id))
targetAreaName = j['areaName'] # bar_id = commonFuc().analysis_json('id', list_a)
targetAreaCode = j['areaCode'] # bar_code = commonFuc().analysis_json('pkgCodeSee', list_a)
break # from_id = get_id(
request_body = commonFuc().get_business_data(module, "payload5", viewId, shelfCode, sourceId, sourceType, # "select id from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (hos_goods_id))
sourceVersion, targetDeptId, # from_order_no = get_id(
targetDeptName, targetAreaCode, targetAreaName) # "select order_no from mcms_psi_batch where hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
print('request_body', request_body) # hos_goods_id))
time.sleep(3) from_id = get_id(
result = commonFuc().http_post(url, request_body, headers) "select from_id from mcms_out_balance_detail where id='%s';" % (id))
from_order_no = get_id(
"select from_order_no from mcms_out_balance_detail where id='%s';" % (
id))
account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_user = account_user_id
create_time = get_create_time("select create_time from mcms_out_balance_detail where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_out_balance_detail where id='%s';" % id)
last_modified_user = create_user
# goods_code = get_goods_code1(hos_goods_id)
# charge_dept_id = settle_dept_id
# settle_month = get_id("select settle_month from mcms_out_balance where id='%s';" % id)
# year, month = dateUtils().get_year_month(dateUtils().get_current_time())
out_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
out_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
sub_prov_name = prov_name
account_date = get_account_date1("select account_date from mcms_out_balance_detail where id='%s';" % id)
un_settle_id = get_id(
"select id from mcms_out_un_balance where branch_id='%s' and from_kind='RK_YS' and hos_goods_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, hos_goods_id))
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_out_balance_detail_1009_1', id,
pid, prov_id, prov_name, sub_prov_id, sub_prov_name, out_dept_id,
out_dept_name, account_date, from_id, from_order_no, hos_goods_id, bar_id,
bar_code, distr_detail_id, hos_batch_id, un_settle_id, create_user,
create_time, last_modified, last_modified_user, hos_id
)
# 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result) print('result', result)
# ================================入库上架================================ if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
# def settle(): # 结算相关 else:
# # # 登录获取用户id等信息,使用创建的用户登录===========开始 print('error')
# info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3') commonFuc().check_text_exist_result_text('error', 'succees')
# # print(info)
# username = info['username1']
# password = commonFuc().get_business_data("b2_herp3_bs", "password") def check_mcms_out_balance_detail_approve_after2(type=1, pid=""):
# print('===检查结算数据子表======')
# print('username,password', username, password) if type == 1:
# # # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
# # # 获取token和projectCode elif type == 2:
# token, projectCode, uxid, corpId, info = login_system(username, password).get_token() hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
# # 登录获取用户id等信息,使用创建的用户登录============结束 else:
# headers = commonFuc().get_business_data(module, "json_headers2", hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
# commonFuc().get_business_data(module, "json_contentType"), token, branch_id = get_branch_id()
# projectCode) sql = "select * from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % (
# # ================生成结算单列表查询=================== pid)
# url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "mcmsOutUnBalance_listVoPage_url") # 获取实际值
# print(url) actual = check_mcms_pur_plan_sql(sql)
# branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"] print('actual', actual)
# hosId = branch_id[0:5] # sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1;" % (
# request_body = commonFuc().get_business_data(module, "payload7", hosId, hosId) # pid)
# result = commonFuc().http_post(url, request_body, headers) # id = get_id(sql)
# print('result', result) sql = "select id from mcms_out_balance_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % (
# data = commonFuc().analysis_json('data', result) pid)
# data1 = commonFuc().analysis_json('data', data) id = get_id(sql)
# # 取结算单id hos_id = get_hosid()
# list_a = [] prov_id = get_prov_id()
# for i in data1: prov_name = get_prov_name()
# id = commonFuc().analysis_json('id', i) sub_prov_id = prov_id
# list_a.append(id) settle_dept_id = None
# print(list_a) distr_detail_id = get_id("select distr_detail_id from mcms_out_balance_detail where id='%s';" % id)
# print(list_a[0], list_a[1], type(list_a[0])) if check_distr_detail_id(distr_detail_id) == True:
# # ===================生成结算单列表查询====================== print('ok')
# # ================== 生成结算单============================== commonFuc().check_text_exist_result_text('success', 'success')
# url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, else:
# "mcmsOutUnBalance_genBalanceBill_url") commonFuc().check_text_exist_result_text('error', 'success')
# print(url) hos_batch_id = get_id("select hos_batch_id from mcms_out_balance_detail where id='%s';" % id)
# request_body = commonFuc().get_business_data(module, "payload8", hosId, list_a[0], list_a[1], hosId) if check_batch_id(hos_batch_id) == True:
# print('request_body', request_body) print('ok')
# result = commonFuc().http_post(url, request_body, headers) commonFuc().check_text_exist_result_text('success', 'success')
# print('result', result) else:
# # ================== 生成结算单============================== commonFuc().check_text_exist_result_text('error', 'success')
# 从文件中获取条码信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "条码信息", 'message18')
list_a = info['list_a']
bar_id = get_id("select bar_id from mcms_out_balance_detail where id='%s';" % (id))
bar_code = get_id("select bar_code from mcms_out_balance_detail where id='%s';" % (id))
from_id = get_id(
"select from_id from mcms_out_balance_detail where id='%s';" % (id))
if check_batch_id(from_id) == True:
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
from_order_no = get_id(
"select order_no from mcms_psi_batch where id='%s';" % (from_id))
account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_user = account_user_id
create_time = get_create_time("select create_time from mcms_out_balance_detail where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_out_balance_detail where id='%s';" % id)
last_modified_user = create_user
out_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
out_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
sub_prov_name = prov_name
account_date = get_account_date1("select account_date from mcms_out_balance_detail where id='%s';" % id)
un_settle_id = get_id(
"select un_settle_id from mcms_out_balance_detail where id='%s';" % id)
if check_un_balance_id(un_settle_id):
print('ok')
commonFuc().check_text_exist_result_text('success', 'success')
else:
commonFuc().check_text_exist_result_text('error', 'success')
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_out_balance_detail_0919_2', id,
pid, prov_id, prov_name, sub_prov_id, sub_prov_name, out_dept_id,
out_dept_name, account_date, from_id, from_order_no, hos_goods_id, bar_id,
bar_code, distr_detail_id, hos_batch_id, un_settle_id, create_user,
create_time, last_modified, last_modified_user, hos_id
)
# 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_a7流程五_中心库入库结算_正结算3_内网验收入库结算.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_a7流程五_中心库入库结算_正结算3_内网验收入库结算.air')
from a_a7流程五_中心库入库结算_正结算3_内网验收入库结算 import check_accept_order,putaway
try: try:
# 验收 # # 验收
check_accept_order(1) # 低值 check_accept_order(3) # 试剂
time.sleep(6)
check_mcms_check(3)
time.sleep(3)
check_accept_order(2) # 高值 check_accept_order(2) # 高值
check_accept_order(3) # 试剂 time.sleep(6)
check_mcms_check(2)
time.sleep(3)
check_accept_order(1) # 低值
time.sleep(6)
check_mcms_check(1)
# 入库上架 # 入库上架
putaway() putaway()
time.sleep(6)
check_mcms_psi(1)
putaway() putaway()
time.sleep(6)
check_mcms_psi(2)
putaway() putaway()
time.sleep(6)
check_mcms_psi(3)
time.sleep(3)
OBD_ID = settle()# 生成结算单 OBD_ID = settle()# 生成结算单
# 调用审批结算单 print(OBD_ID)
time.sleep(6)
check_mcms_out_balance(1, OBD_ID) # 检查审批前的结算数据
# # 调用审批结算单
approval_center(OBD_ID) approval_center(OBD_ID)
time.sleep(6)
check_mcms_out_balance_approve_after(1, OBD_ID) # 检查审批后的结算数据
commonFuc().check_text_exist_result_text('succees', 'succees')
except Exception as e: except Exception as e:
print('脚本出现异常,请检查脚本或者数据') print('脚本出现异常,请检查脚本或者数据')
print("发生异常:", str(e)) print("发生异常:", str(e))
......
...@@ -4,6 +4,7 @@ import traceback ...@@ -4,6 +4,7 @@ import traceback
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from air_case.public1.public1.public1 import * from air_case.public1.public1.public1 import *
from common.dateUtils import dateUtils
from common.fileUtls import FileUtils from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command from common.run_cmd_script import execute_command
...@@ -26,365 +27,333 @@ import time ...@@ -26,365 +27,333 @@ import time
module = "b6_spd3_core_business_flow_database_check" module = "b6_spd3_core_business_flow_database_check"
def invoice(): def check_mcms_invoice():
# # 登录获取用户id等信息,使用创建的用户登录===========开始 print('检查发票数据')
info = FileUtils().r_info8('b5_spd3_core_business_flow', "供货关系申请2", 'message') prov_id = get_prov_id()
# print(info) # if type == 1:
username = info['e_username'] # hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
password = commonFuc().get_business_data("b2_herp3_bs", "password1") # elif type == 2:
token, projectCode, uxid, corpId, info = login(username, password) # hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
# print(token, projectCode, uxid, corpId, info) # else:
# 登录获取用户id等信息,使用创建的用户登录============结束 # hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
module = "a6_mdm3_si"
# 发票录入列表查询================================================= sql = "select * from mcms_invoice where prov_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "listGoodsPage_url") prov_id)
print('发票录入列表查询url', url) # 获取实际值
# 获取请求头信息 actual = check_mcms_pur_plan_sql(sql)
headers = commonFuc().get_business_data(module, "json_headers2", print('actual', actual)
commonFuc().get_business_data(module, "json_contentType"), token, sql = "select id from mcms_invoice where prov_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
projectCode) prov_id)
id = get_id(sql)
request_body = commonFuc().get_business_data(module, "payload2_1_1", get_hosid(), get_branch_id()) hos_id = get_hosid()
prov_name = get_prov_name()
# print('request_body',request_body)
# 发送请求 create_user = get_login_user_uxid_bydb(
i = 1 FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_username'])
while True: # create_user = account_user_id
time.sleep(6) create_time = get_create_time("select create_time from mcms_invoice where id='%s';" % id)
result = commonFuc().http_post(url, request_body, headers) last_modified = get_create_time("select last_modified from mcms_invoice where id='%s';" % id)
print('result', result) last_modified_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
try:
data = commonFuc().analysis_json('data', result) year, month = dateUtils().get_year_month(dateUtils().get_current_time())
total = commonFuc().analysis_json('total', data) if month < 10:
if total == 0: month = "0" + str(month)
print('数据暂时未同步过来,或者内网没有生成结算单') year_month = str(year) + str(month)
i = i + 1 settle_months = year_month
if i >= 100: invoice_date = get_account_date1("select invoice_date from mcms_invoice where id='%s';" % id)
print('600秒过去了,数据还未查询出来,调用一下内网结算函数') expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
settle() 'check_mcms_invoice_1009', id,
approval_center() hos_id, prov_id, prov_name, invoice_date, settle_months, create_user,
continue create_time, last_modified, last_modified_user
else: )
break
except: # 对比预期值和实际值是否一致
continue actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
# 将发票信息写入文件 actual_value2 = actual_value1.replace(" ", "")
data = commonFuc().analysis_json('data', result) expected_value2 = expected_value1.replace(" ", "")
data1 = commonFuc().analysis_json('data', data) # print('actual_value2',actual_value2)
list_a = [] print('expected_value2')
list_b = [] print(expected_value2)
list_c = [] print('actual_value2')
list_a.append(data1[0]) print(actual_value2)
list_b.append(data1[0]) result = (compare_text_index(actual_value2, expected_value2))
list_c.append(data1[0]) print('result', result)
# print('list_a', len(list_a), list_a) if actual_value2 == expected_value2:
info = (list_a, list_b, list_c) print('ok')
titlename = ('list_a', 'list_b', 'list_c') commonFuc().check_text_exist_result_text('succees', 'succees')
# 将发票信息写入文件 else:
FileUtils().w_info8(info, module, '结算开票信息', titlename, 'message') print('error')
# 发票录入列表查询================================================= commonFuc().check_text_exist_result_text('error', 'succees')
# ===========发票暂存======================================= # 检查发票子表数据
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "saveCacheBatch_url") check_mcms_invoice_detail(1, id)
print(url) # check_mcms_invoice_detail2(1, id)
# 从文件中获取必要信息
info = FileUtils().r_info8(module, "结算开票信息", 'message')
# print('info', info) def check_mcms_invoice_detail(type=1, pid=""):
list_a = info['list_a'] print('检查发票子表数据')
print('list_a', list_a, type(list_a), len(list_a)) if type == 1:
pid = 'pid' hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
settleMonth = "settleMonth" elif type == 2:
hosGoodsId = 'hosGoodsId' hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
batchCode = 'batchCode' else:
distrDetailId = 'distrDetailId' hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
distrId = 'distrId' branch_id = get_branch_id()
distrOrderNo = 'distrOrderNo' sql = "select * from mcms_invoice_detail where pid='%s' order by id LIMIT 1;" % (
settlePrice = 'settlePrice' pid)
maxSettleQty = 'maxSettleQty' # 获取实际值
maxSettleAmount = 'maxSettleAmount' actual = check_mcms_pur_plan_sql(sql)
curSettleQty = 'curSettleQty' print('actual', actual)
curSettleAmount = 'curSettleAmount' sql = "select id from mcms_invoice_detail where pid='%s' order by id LIMIT 1;" % (
leftSettleQty = 'leftSettleQty' pid)
leftSettleAmount = 'leftSettleAmount' id = get_id(sql)
hosId = 'hosId' hos_id = get_hosid()
provId = 'provId' prov_id = get_prov_id()
branchId = 'branchId' prov_name = get_prov_name()
balanceDetId = 'balanceDetId' sub_prov_id = prov_id
purMode = 'purMode' settle_dept_id = None
barCode = 'barCode' distr_detail_id = get_id("select distr_detail_id from mcms_out_balance_detail where id='%s';" % id)
viewId = 'viewId' if check_distr_detail_id(distr_detail_id) == True:
for i in list_a: print('ok')
pid = i['pid'] commonFuc().check_text_exist_result_text('success', 'success')
settleMonth = i['settleMonth'] else:
hosGoodsId = i['hosGoodsId'] commonFuc().check_text_exist_result_text('error', 'success')
detailList = i['detailList'] hos_batch_id = get_id("select hos_batch_id from mcms_out_balance_detail where id='%s';" % id)
for j in detailList: if check_batch_id(hos_batch_id) == True:
batchCode = j['batchCode'] print('ok')
distrDetailId = j['distrDetailId'] commonFuc().check_text_exist_result_text('success', 'success')
distrId = j['distrId'] else:
distrOrderNo = j['distrOrderNo'] commonFuc().check_text_exist_result_text('error', 'success')
settlePrice = j['settlePrice']
# maxSettleQty = j['leftSettleQty'] account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
# maxSettleAmount = j['leftSettleAmount'] create_user = get_login_user_uxid_bydb(
# curSettleQty = j['curSettleQty'] FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_username'])
# curSettleAmount = j['curSettleAmount'] create_time = get_create_time("select create_time from mcms_invoice_detail where id='%s';" % id)
# leftSettleQty = j['leftSettleQty'] last_modified = get_create_time("select last_modified from mcms_invoice_detail where id='%s';" % id)
leftSettleAmount = j['leftSettleAmount'] last_modified_user = create_user
hosId = j['hosId']
provId = j['provId'] year, month = dateUtils().get_year_month(dateUtils().get_current_time())
branchId = j['branchId'] if month < 10:
balanceDetId = j['balanceDetId'] month = "0" + str(month)
purMode = j['purMode'] settle_month = str(year) + str(month)
barCode = j['barCode'] hobd_id = get_id("select id from mcms_out_balance_detail where prov_id='%s' order by id desc LIMIT 1 OFFSET 1;" % (
viewId = j['viewId'] prov_id))
break expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
list2 = [] 'check_mcms_invoice_detail_1009_1', id,
detailList = None pid, hobd_id, branch_id, hos_goods_id, settle_month, create_user,
for i in list_a: create_time, last_modified, last_modified_user, hos_id
detailList = i['detailList'] )
list2 = detailList
for k in list2: # 对比预期值和实际值是否一致
maxSettleQty = k['leftSettleQty'] actual_value1 = get_process_list2(actual)
maxSettleAmount = k['settlePrice'] expected_value1 = get_process_list2(expected)
curSettleQty = k['curSettleQty'] actual_value2 = actual_value1.replace(" ", "")
curSettleAmount = k['curSettleAmount'] expected_value2 = expected_value1.replace(" ", "")
leftSettleQty = k['leftSettleQty'] # print('actual_value2',actual_value2)
print('expected_value2')
request_body = commonFuc().get_business_data(module, "payload3_1_1_1", pid, settleMonth, hosGoodsId, batchCode, print(expected_value2)
distrDetailId, distrId, distrOrderNo, settlePrice, maxSettleQty, print('actual_value2')
maxSettleAmount, curSettleQty, curSettleAmount, leftSettleQty, print(actual_value2)
leftSettleAmount, hosId, result = (compare_text_index(actual_value2, expected_value2))
provId, print('result', result)
branchId, balanceDetId, purMode, barCode, viewId) if actual_value2 == expected_value2:
print('request_body', request_body) print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
request_body_json = get_process_list(request_body) else:
result = commonFuc().http_post(url, request_body_json, headers) print('error')
print('发票暂存result', result) commonFuc().check_text_exist_result_text('error', 'succees')
# ===========发票暂存===============================================
# ==============发票缓存提交===========================================
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "submitCache_url") def check_mcms_invoice_detail2(type=1, pid=""):
hosVersion = 3 print('检查发票子表数据')
hosName = commonFuc().get_business_data(module, 'hosName') if type == 1:
invoiceQty = leftSettleQty hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
invoiceAmount = leftSettleAmount elif type == 2:
invoiceDate = timeUtils().get_time_hms(5) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
request_body = commonFuc().get_business_data(module, "payload3_2_2_2_1", hosName, invoiceQty, invoiceAmount, else:
invoiceDate, hosId, provId,hosVersion) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
print('发票缓存提交request_body', request_body) branch_id = get_branch_id()
# 发送请求 sql = "select * from mcms_invoice_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % (
result = commonFuc().http_post(url, request_body, headers) pid)
print('发票缓存提交result', result) # 获取实际值
VI_id = commonFuc().analysis_json('billIds', actual = check_mcms_pur_plan_sql(sql)
commonFuc().analysis_json('data', result)) print('actual', actual)
VI_id= ' '.join(VI_id) sql = "select id from mcms_invoice_detail where pid='%s' order by id LIMIT 1 OFFSET 1;" % (
print('VI_id',VI_id) pid)
# ==============发票缓存提交=========================================== id = get_id(sql)
# ===============预开票列表查询==================================== hos_id = get_hosid()
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "listVoPage_url1") prov_id = get_prov_id()
request_body = commonFuc().get_business_data(module, "payload3_3_1") prov_name = get_prov_name()
print('预开票列表查询request_body', request_body) sub_prov_id = prov_id
# 发送请求 settle_dept_id = None
result = commonFuc().http_post(url, request_body, headers) distr_detail_id = get_id("select distr_detail_id from mcms_out_balance_detail where id='%s';" % id)
print('预开票列表查询', 'result', result) if check_distr_detail_id(distr_detail_id) == True:
print('ok')
provName= commonFuc().analysis_json('provName', commonFuc().check_text_exist_result_text('success', 'success')
commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))) else:
sumAmount= commonFuc().analysis_json('sumAmount', commonFuc().check_text_exist_result_text('error', 'success')
commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))) hos_batch_id = get_id("select hos_batch_id from mcms_out_balance_detail where id='%s';" % id)
if check_batch_id(hos_batch_id) == True:
# ===============预开票列表查询==================================== print('ok')
# ===============预开票提交==================================== commonFuc().check_text_exist_result_text('success', 'success')
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "mcmsOutBalance_submitInvoice_url") else:
lastModified = timeUtils().get_time_hms(1) commonFuc().check_text_exist_result_text('error', 'success')
createTime = timeUtils().get_time_hms(1)
invoiceTitle = hosName account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
settleMonths=settleMonth create_user = get_login_user_uxid_bydb(
request_body = commonFuc().get_business_data(module, "payload3_3_2", VI_id, lastModified, createTime, uxid, FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_username'])
get_hosid(), provId, provName, invoiceAmount, invoiceDate, create_time = get_create_time("select create_time from mcms_invoice_detail where id='%s';" % id)
settleMonths, invoiceQty, hosName, invoiceTitle, sumAmount) last_modified = get_create_time("select last_modified from mcms_invoice_detail where id='%s';" % id)
print('预开票提交request_body', request_body) last_modified_user = create_user
# 发送请求
result = commonFuc().http_post(url, request_body, headers) year, month = dateUtils().get_year_month(dateUtils().get_current_time())
print('预开票提交', 'result', result) if month < 10:
# ===============预开票提交==================================== month = "0" + str(month)
# ===============发票确认列表查询 settle_month = str(year) + str(month)
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "listVoPage_url1") hobd_id = get_id("select id from mcms_out_balance_detail where prov_id='%s' order by id desc LIMIT 1;" % (
prov_id))
request_body = commonFuc().get_business_data(module, "payload3_3") expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_invoice_detail_0919_2', id,
# 发送请求 pid, hobd_id, branch_id, hos_goods_id, settle_month, create_user,
result = commonFuc().http_post(url, request_body, headers) create_time, last_modified, last_modified_user, hos_id
print('发票确认列表查询result', result) )
data = commonFuc().analysis_json('data', result)
data1 = commonFuc().analysis_json('data', data) # 对比预期值和实际值是否一致
id1 = commonFuc().analysis_json('id', data1[0]) actual_value1 = get_process_list2(actual)
print(id1) expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
# ===============发票确认列表查询 expected_value2 = expected_value1.replace(" ", "")
# ===============发票确认 # print('actual_value2',actual_value2)
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "invoiceUpdateStatus_url") print('expected_value2')
print(expected_value2)
request_body = commonFuc().get_business_data(module, "payload3_4", id1) print('actual_value2')
print(actual_value2)
# 发送请求 result = (compare_text_index(actual_value2, expected_value2))
result = commonFuc().http_post(url, request_body, headers)
print('发票确认result', result)
# ===============发票确认
# ==============内网发票核对============
module = "b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
username = info['username1']
password = commonFuc().get_business_data("b2_herp3_bs", "password")
print('username,password', username, password)
# # 获取token和projectCode
token, projectCode, uxid, corpId, info = login(username, password, 2)
# 登录获取用户id等信息,使用创建的用户登录============结束
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "mcmsInvoice_listVoPage_url")
print('url', url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload9", timeUtils().get_time_hms(5),
timeUtils().get_time_hms(5), get_hosid(), get_hosid())
print('request_body', request_body)
# 发送请求
i = 1
while True:
time.sleep(6)
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
try:
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
if total == 0:
print('数据暂时未同步过来')
i = i + 1
if i >= 100:
print('600秒过去了,数据还未查询出来,检查一下脚本或者被测软件')
continue
else:
break
except:
continue
print('result', '内网发票核对', result)
data1 = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))
VI_id = commonFuc().analysis_json('id', data1[0])
print('VI_id', VI_id)
# ==============发票列表查询
# ==============发票核对提交
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"mcmsInvoice_invoiceUpdateStatusList_url")
print('url', url)
request_body = commonFuc().get_business_data(module, "payload10", VI_id, get_hosid())
print('request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('result', result) print('result', result)
# ==============发票核对提交 if actual_value2 == expected_value2:
# ==============内网发票核对============ print('ok')
# ==============内网发票提交开始 commonFuc().check_text_exist_result_text('succees', 'succees')
# 列表查询
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"mcmsInvoice_listVoPage_url")
print('内网发票提交url', url)
request_body = commonFuc().get_business_data(module, "payload11", timeUtils().get_time_hms(5),
timeUtils().get_time_hms(5), get_hosid(), get_hosid())
print('内网发票提交request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('result', '内网发票提交列表查询结果', result)
data1 = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))
total = commonFuc().analysis_json('total', commonFuc().analysis_json('data', result))
VI_id2='VI_id2'
if total == 0:
print('检查被测程序,发票提交列表查询数据是否正确')
else: else:
for i in range(total): print('error')
VI_id2 = commonFuc().analysis_json('id', data1[i]) commonFuc().check_text_exist_result_text('error', 'succees')
if VI_id2 == VI_id:
break
print('VI_id2', VI_id2) def check_mcms_invoice_ext():
# ==============发票提交,下一步归档 print('检查付款单数据')
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, prov_id = get_prov_id()
"mcmsInvoice_invoiceUpdateStatusList_url") # if type == 1:
print('url', url) # hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
request_body = commonFuc().get_business_data(module, "payload12", VI_id, get_hosid()) # elif type == 2:
print('request_body', request_body) # hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
result = commonFuc().http_post(url, request_body, headers) # else:
print('result', '发票提交,下一步归档', result) # hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
# ==============发票提交,下一步归档
# ==============发票归档列表查询 sql = "select * from mcms_invoice_ext where prov_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, prov_id)
"mcmsInvoice_listVoPage_url") # 获取实际值
print('url', url) actual = check_mcms_pur_plan_sql(sql)
request_body = commonFuc().get_business_data(module, "payload13", timeUtils().get_time_hms(5), print('actual', actual)
timeUtils().get_time_hms(5), get_hosid(), get_hosid()) sql = "select id from mcms_invoice_ext where prov_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
print('request_body', request_body) prov_id)
result = commonFuc().http_post(url, request_body, headers) id = get_id(sql)
print('result', '发票归档列表查询', result) hos_id = get_hosid()
data1 = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result)) prov_name = get_prov_name()
total = commonFuc().analysis_json('total', commonFuc().analysis_json('data', result))
VI_id3='VI_id3' create_user = get_login_user_uxid_bydb(
if total == 0: FileUtils().r_info8("b5_spd3_core_business_flow", "供货关系申请2", 'message')['e_username'])
print('检查被测程序,发票归档列表查询查询数据是否正确') # create_user = account_user_id
create_time = get_create_time("select create_time from mcms_invoice_ext where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_invoice_ext where id='%s';" % id)
last_modified_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_user = last_modified_user
year, month = dateUtils().get_year_month(dateUtils().get_current_time())
if month < 10:
month = "0" + str(month)
year_month = str(year) + str(month)
settle_months = year_month
pay_date = get_account_date1("select pay_date from mcms_invoice_ext where id='%s';" % id)
pay_user = create_user
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_invoice_ext_1009', id,
hos_id, prov_id, prov_name, pay_date, create_user,
create_time, last_modified, last_modified_user, pay_user
)
# 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else: else:
for i in range(total): print('error')
VI_id3 = commonFuc().analysis_json('id', data1[i]) commonFuc().check_text_exist_result_text('error', 'succees')
if VI_id3 == VI_id2: # 检查子表数据
break check_mcms_invoice_ext_detail(1, id)
print('VI_id3', VI_id3)
# ==============发票归档列表查询
# ==================发票归档提交 def check_mcms_invoice_ext_detail(type=1, pid=""):
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, print('检查付款单子表数据')
"mcmsInvoice_invoiceUpdateStatusList_url") if type == 1:
print('url', url) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
request_body = commonFuc().get_business_data(module, "payload14", VI_id, get_hosid()) elif type == 2:
print('request_body', request_body) hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
result = commonFuc().http_post(url, request_body, headers)
print('result', '发票归档提交,下一步付款', result)
# ==================发票归档提交
# ==================付款单列表查询
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"mcmsInvoice_listVoPage_url")
print('url', url)
request_body = commonFuc().get_business_data(module, "payload15", get_hosid(), get_hosid())
print('request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('result', '付款单列表查询', result)
data1 = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))
total = commonFuc().analysis_json('total', commonFuc().analysis_json('data', result))
VI_id4='VI_id4'
if total == 0:
print('检查被测程序,发票归档列表查询查询数据是否正确')
else: else:
for i in range(total): hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
VI_id4 = commonFuc().analysis_json('id', data1[i]) branch_id = get_branch_id()
if VI_id4 == VI_id3: sql = "select * from mcms_invoice_ext_detail where pid='%s';" % (
break pid)
print('VI_id4', VI_id4) # 获取实际值
# ==================付款单列表查询 actual = check_mcms_pur_plan_sql(sql)
# ==================付款提交 print('actual', actual)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, sql = "select id from mcms_invoice_ext_detail where pid='%s';" % (
"mcmsInvoice_genPaymentBills_url") pid)
print('url', url) id = get_id(sql)
request_body = commonFuc().get_business_data(module, "payload16", VI_id, get_hosid()) hos_id = get_hosid()
print('request_body', request_body) prov_id = get_prov_id()
result = commonFuc().http_post(url, request_body, headers)
print('result', '付款提交', result) account_user_id = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
# 断言 create_user = account_user_id
code = commonFuc().analysis_json('code', result) create_time = get_create_time("select create_time from mcms_invoice_ext_detail where id='%s';" % id)
data = commonFuc().analysis_json('data', result) last_modified = get_create_time("select last_modified from mcms_invoice_ext_detail where id='%s';" % id)
if code == 0 and data == 1: last_modified_user = create_user
commonFuc().check_text_exist(0, result)
invoice_id = get_id("select id from mcms_invoice where prov_id='%s' order by CREATE_TIME desc LIMIT 1;" % (
prov_id))
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_invoice_ext_detail_0919_1', id,
pid, invoice_id, create_user, create_time, last_modified,
last_modified_user, hos_id
)
# 对比预期值和实际值是否一致
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else: else:
commonFuc().check_text_exist('error', result) print('error')
# ==================付款提交 commonFuc().check_text_exist_result_text('error', 'succees')
# ==============内网发票提交
# ================发票查询列表页面验证
# ================发票查询列表页面验证
try: try:
...@@ -393,6 +362,12 @@ try: ...@@ -393,6 +362,12 @@ try:
approval_center(OBH_ID) approval_center(OBH_ID)
from air_case.public1.public1.public1 import * from air_case.public1.public1.public1 import *
invoice(2,OBH_ID) invoice(2,OBH_ID)
time.sleep(6)
# 检查发票数据
check_mcms_invoice()
time.sleep(3)
# 检查付款单数据
check_mcms_invoice_ext()
except Exception as e: except Exception as e:
print('脚本出现异常,请检查脚本或者数据') print('脚本出现异常,请检查脚本或者数据')
print("发生异常:", str(e)) print("发生异常:", str(e))
......
...@@ -270,12 +270,13 @@ class delData(object): ...@@ -270,12 +270,13 @@ class delData(object):
print('内网供应关系删除成功 ') print('内网供应关系删除成功 ')
cursor.close() cursor.close()
def Del_reporter_data(self): def Del_reporter_data(self,type=1,branch_id='branch_id'):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023",
database="spd3_report_hospitaltest2", database="spd3_report_hospitaltest2",
charset="utf8") charset="utf8")
cursor = connection.cursor() cursor = connection.cursor()
branch_id = FileUtils().r_info8('b2_herp3_bs', "院区新增", 'message')['branch_id'] if type==1:
branch_id = FileUtils().r_info8('b2_herp3_bs', "院区新增", 'message')['branch_id']
sql = "delete from mcms_finance_daybook where branch_id= '%s';" % branch_id sql = "delete from mcms_finance_daybook where branch_id= '%s';" % branch_id
cursor.execute(sql) cursor.execute(sql)
cursor.execute("commit;") cursor.execute("commit;")
...@@ -299,14 +300,16 @@ class delData(object): ...@@ -299,14 +300,16 @@ class delData(object):
print('报表数据删除成功') print('报表数据删除成功')
cursor.close() cursor.close()
def Delete_business_Data(self): def Delete_business_Data(self,type=1,branch_id='branch_id'):
# 删除业务数据,包括采购,出入库,结算等 # 删除业务数据,包括采购,出入库,结算等
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023",
database="spd3_herp_test2", database="spd3_herp_test2",
charset="utf8") charset="utf8")
cursor = connection.cursor() cursor = connection.cursor()
branch_id = FileUtils().r_info8('b2_herp3_bs', "院区新增", 'message')['branch_id'] if type==1:
branch_id = FileUtils().r_info8('b2_herp3_bs', "院区新增", 'message')['branch_id']
hosGoodsId1 = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'] hosGoodsId1 = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId']
hosGoodsId2 = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'] hosGoodsId2 = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId']
hosGoodsId3 = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'] hosGoodsId3 = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId']
...@@ -320,9 +323,8 @@ class delData(object): ...@@ -320,9 +323,8 @@ class delData(object):
cursor.execute(sql2) cursor.execute(sql2)
cursor.execute(sql3) cursor.execute(sql3)
cursor.execute("commit;") cursor.execute("commit;")
# 批次 # 批次
sql = "delete from mcms_hos_batch where branch_id='%s'" % branch_id sql = "delete from mcms_hos_batch where branch_id='%s';" % branch_id
cursor.execute(sql) cursor.execute(sql)
cursor.execute("commit;") cursor.execute("commit;")
# 库存 # 库存
...@@ -462,7 +464,170 @@ class delData(object): ...@@ -462,7 +464,170 @@ class delData(object):
print('业务数据,包括采购,出入库,结算等数据删除成功') print('业务数据,包括采购,出入库,结算等数据删除成功')
cursor.close() cursor.close()
def Delete_business_Data_current_branch(self,type=1,branch_id='branch_id'):
# 删除业务数据,包括采购,出入库,结算等
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023",
database="spd3_herp_test2",
charset="utf8")
cursor = connection.cursor()
if type==1:
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("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 branch_id ='%s';" % branch_id
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
sql6 = "delete from mcms_psi where target_dept_name like '%国药集团公司_____';"
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(sql6)
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()
def Delete_yb_logic_stock(self): def Delete_yb_logic_stock(self):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023",
database="spd3_platform_test2", database="spd3_platform_test2",
...@@ -818,6 +983,27 @@ class delData(object): ...@@ -818,6 +983,27 @@ class delData(object):
cursor.execute("commit;") cursor.execute("commit;")
print('库区人员信息删除成功 ') print('库区人员信息删除成功 ')
cursor.close() cursor.close()
def get_branch_id_bydb(self,no_branch_id):
# 内网的
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
cursor = connection.cursor()
# 查询脚本创建的的院区
sql1 = "select id from mcms_branch_info where name like '%%东土城路院区%%' and id <>'%s';"%no_branch_id
cursor.execute(sql1)
# results = cursor.fetchone()
results = cursor.fetchall()
list_1=[]
for i in results:
str1 = str(i)
new_str1 = str1.replace(',)', '')
new_str1 = new_str1.replace('(', '')
new_str1 = new_str1.replace(',', '')
new_str1 = new_str1.replace("'", '')
list_1.append(new_str1)
# print(new_str1)
cursor.close()
return list_1
# delData().Delete_branch_by_id() # delData().Delete_branch_by_id()
# delData().Delete_goods_change_info() # delData().Delete_goods_change_info()
......
...@@ -402,8 +402,8 @@ ...@@ -402,8 +402,8 @@
#手工采购计划子表 #手工采购计划子表
"mcms_pur_plan_detail_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": %s, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 10, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "plan_pkg_qty": Decimal("100.00"), "plan_qty": Decimal("10000.00"), "pkg_qty": Decimal("0.00"), "price": Decimal("99.999900"), "qty": Decimal("0.00"), "in_settlement": 1, "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "contract_id": None, "remark": None, "close_status": 0, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "coding_type": 0}' "mcms_pur_plan_detail_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": %s, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 10, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "plan_pkg_qty": Decimal("100.00"), "plan_qty": Decimal("10000.00"), "pkg_qty": Decimal("0.00"), "price": Decimal("99.999900"), "qty": Decimal("0.00"), "in_settlement": 1, "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "contract_id": None, "remark": None, "close_status": 0, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "coding_type": 0}'
"mcms_pur_plan_detail2_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": %s, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 20, "pkg_def_id": None, "pkg_def_name": None, "pkg_def_qty": Decimal("1.00"), "plan_pkg_qty": Decimal("1.00"), "plan_qty": Decimal("100.00"), "pkg_qty": Decimal("0.00"), "price": Decimal("99.999900"), "qty": Decimal("0.00"), "in_settlement": 1, "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "contract_id": None, "remark": None, "close_status": 0, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "coding_type": 0}' "mcms_pur_plan_detail2_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": %s, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 20, "pkg_def_id": None, "pkg_def_name": None, "pkg_def_qty": Decimal("1.00"), "plan_pkg_qty": Decimal("100.00"), "plan_qty": Decimal("100.00"), "pkg_qty": Decimal("0.00"), "price": Decimal("99.999900"), "qty": Decimal("0.00"), "in_settlement": 1, "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "contract_id": None, "remark": None, "close_status": 0, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "coding_type": 0}'
"mcms_pur_plan_detail3_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": %s, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 60, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "plan_pkg_qty": Decimal("100.00"), "plan_qty": Decimal("1000.00"), "pkg_qty": Decimal("0.00"), "price": Decimal("99.999900"), "qty": Decimal("0.00"), "in_settlement": 1, "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "contract_id": None, "remark": None, "close_status": 0, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "coding_type": 0}' "mcms_pur_plan_detail3_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": %s, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 60, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "plan_pkg_qty": Decimal("100.00"), "plan_qty": Decimal("10000.00"), "pkg_qty": Decimal("0.00"), "price": Decimal("99.999900"), "qty": Decimal("0.00"), "in_settlement": 1, "supply_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "sub_prov_id": "%s", "sub_prov_name": "%s", "contract_id": None, "remark": None, "close_status": 0, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "coding_type": 0}'
#采购计划 #采购计划
"mcms_pur_plan_0927": '{"id": "%s", "order_no": "%s", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "create_type": "SG", "source_id": %s, "source_type": "", "rec_user": "%s", "rec_phone": "xhs", "rec_addr": "%s", "priority": 0, "bill_expdt_date": %s, "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s"}", "remark": "", "close_status": 0, "tb_status": 10, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "rec_type": "YND", "audit_remark": None}' "mcms_pur_plan_0927": '{"id": "%s", "order_no": "%s", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "create_type": "SG", "source_id": %s, "source_type": "", "rec_user": "%s", "rec_phone": "xhs", "rec_addr": "%s", "priority": 0, "bill_expdt_date": %s, "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s"}", "remark": "", "close_status": 0, "tb_status": 10, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "rec_type": "YND", "audit_remark": None}'
...@@ -412,11 +412,79 @@ ...@@ -412,11 +412,79 @@
#采购订单子表 #采购订单子表
"mcms_purchase_detail_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 10, "price": Decimal("99.999900"), "supply_id": "%s", "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "pkg_qty": Decimal("100.00"), "qty": Decimal("10000.00"), "con_pkg_qty": Decimal("0.00"), "con_qty": Decimal("0.00"), "up_pkg_qty": Decimal("0.00"), "up_qty": Decimal("0.00"), "check_pkg_qty": Decimal("0.00"), "check_qty": Decimal("0.00"), "distr_pkg_qty": Decimal("0.00"), "distr_qty": Decimal("0.00"), "not_send_qty": Decimal("0.00"), "not_send_pkg_qty": Decimal("0.00"), "in_settlement": 1, "close_type": 1, "detail_relation_json": "{"planBillId":"%s","planDetailId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":10,"goodsName":"%s"}", "remark": None, "tb_status": 10, "detail_up_status":None,"pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}' "mcms_purchase_detail_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 10, "price": Decimal("99.999900"), "supply_id": "%s", "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "pkg_qty": Decimal("100.00"), "qty": Decimal("10000.00"), "con_pkg_qty": Decimal("0.00"), "con_qty": Decimal("0.00"), "up_pkg_qty": Decimal("0.00"), "up_qty": Decimal("0.00"), "check_pkg_qty": Decimal("0.00"), "check_qty": Decimal("0.00"), "distr_pkg_qty": Decimal("0.00"), "distr_qty": Decimal("0.00"), "not_send_qty": Decimal("0.00"), "not_send_pkg_qty": Decimal("0.00"), "in_settlement": 1, "close_type": 1, "detail_relation_json": "{"planBillId":"%s","planDetailId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":10,"goodsName":"%s"}", "remark": None, "tb_status": 10, "detail_up_status":None,"pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"mcms_purchase_detail1_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 20, "price": Decimal("99.999900"), "supply_id": "%s", "pkg_def_id": %s, "pkg_def_name": null, "pkg_def_qty": Decimal("1.00"), "pkg_qty": Decimal("100.00"), "qty": Decimal("100.00"), "con_pkg_qty": Decimal("0.00"), "con_qty": Decimal("0.00"), "up_pkg_qty": Decimal("0.00"), "up_qty": Decimal("0.00"), "check_pkg_qty": Decimal("0.00"), "check_qty": Decimal("0.00"), "distr_pkg_qty": Decimal("0.00"), "distr_qty": Decimal("0.00"), "not_send_qty": Decimal("0.00"), "not_send_pkg_qty": Decimal("0.00"), "in_settlement": 1, "close_type": 1, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":20,"goodsName":"%s"}", "remark": None, "tb_status": 10, "detail_up_status":None,"pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}' "mcms_purchase_detail1_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 20, "price": Decimal("99.999900"), "supply_id": "%s", "pkg_def_id": %s, "pkg_def_name": null, "pkg_def_qty": Decimal("1.00"), "pkg_qty": Decimal("100.00"), "qty": Decimal("100.00"), "con_pkg_qty": Decimal("0.00"), "con_qty": Decimal("0.00"), "up_pkg_qty": Decimal("0.00"), "up_qty": Decimal("0.00"), "check_pkg_qty": Decimal("0.00"), "check_qty": Decimal("0.00"), "distr_pkg_qty": Decimal("0.00"), "distr_qty": Decimal("0.00"), "not_send_qty": Decimal("0.00"), "not_send_pkg_qty": Decimal("0.00"), "in_settlement": 1, "close_type": 1, "detail_relation_json": "{"planBillId":"%s","planDetailId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":20,"goodsName":"%s"}", "remark": None, "tb_status": 10, "detail_up_status":None,"pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"mcms_purchase_detail2_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 60, "price": Decimal("99.999900"), "supply_id": "%s", "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "pkg_qty": Decimal("100.00"), "qty": Decimal("10000.00"), "con_pkg_qty": Decimal("0.00"), "con_qty": Decimal("0.00"), "up_pkg_qty": Decimal("0.00"), "up_qty": Decimal("0.00"), "check_pkg_qty": Decimal("0.00"), "check_qty": Decimal("0.00"), "distr_pkg_qty": Decimal("0.00"), "distr_qty": Decimal("0.00"), "not_send_qty": Decimal("0.00"), "not_send_pkg_qty": Decimal("0.00"), "in_settlement": 1, "close_type": 1, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":60,"goodsName":"%s"}", "remark": None, "tb_status": 10,"detail_up_status":None,"pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}' "mcms_purchase_detail2_0927": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 60, "price": Decimal("99.999900"), "supply_id": "%s", "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "pkg_qty": Decimal("100.00"), "qty": Decimal("10000.00"), "con_pkg_qty": Decimal("0.00"), "con_qty": Decimal("0.00"), "up_pkg_qty": Decimal("0.00"), "up_qty": Decimal("0.00"), "check_pkg_qty": Decimal("0.00"), "check_qty": Decimal("0.00"), "distr_pkg_qty": Decimal("0.00"), "distr_qty": Decimal("0.00"), "not_send_qty": Decimal("0.00"), "not_send_pkg_qty": Decimal("0.00"), "in_settlement": 1, "close_type": 1, "detail_relation_json": "{"planBillId":"%s","planDetailId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":60,"goodsName":"%s"}", "remark": None, "tb_status": 10,"detail_up_status":None,"pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
#采购订单主表 #采购订单主表
"mcms_purchase_0927": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "xhs", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":10}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}' "mcms_purchase_0927": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "xhs", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":10}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}'
"mcms_purchase2_0927": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "YND", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "xhs", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":20}", "barcode_flag": 1, "pkg_flag": 0, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}' "mcms_purchase2_0927": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "YND", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "xhs", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":20}", "barcode_flag": 1, "pkg_flag": 0, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}'
"mcms_purchase3_0927": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "YND", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "xhs", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":60}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}' "mcms_purchase3_0927": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "YND", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "xhs", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":60}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}'
#手工采购计划_配送单子表
"hdi_distr_detail_0929": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "10", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "333", "expdt_date": %s, "product_date": %s, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("100.00"), "distr_qty": Decimal("10000.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":10,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"hdi_distr_detail2_0929": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "20", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "222", "expdt_date": %s, "product_date": %s, "pkg_def_id": %s, "pkg_def_name": null, "pkg_def_qty": Decimal("1.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("100.00"), "distr_qty": Decimal("100.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":20,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"hdi_distr_detail3_0929": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "60", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "4444", "expdt_date": %s, "product_date": %s, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("100.00"), "distr_qty": Decimal("10000.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":60,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
#手工采购计划_配送单
"hdi_distr_0929": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "source_id": "%s", "source_type": "CGD", "pur_bill_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "settlement": None, "pur_dept_id": "%s", "pur_dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "rec_user": "%s", "rec_phone": "xhs", "rec_addr": "设备科001", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s"}", "ext_info": "{"purMode":10,"confirmTime":"%s","confirmUser":"%s","epidemicFlag":0,"distrUser":"%s"}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "task_id": None, "convert_flag": 1, "convert_time": None, "convert_user_name": None, "reject_status": 0, "tb_status": 20, "create_user": "%s", "create_user_name": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "initial_order": None}'
"hdi_distr1_0929": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "YND", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "source_id": "%s", "source_type": "CGD", "pur_bill_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "settlement": None, "pur_dept_id": "%s", "pur_dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "rec_user": "%s", "rec_phone": "xhs", "rec_addr": "自动化测试", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s"}", "ext_info": "{"purMode":20,"confirmTime":"%s","confirmUser":"%s","epidemicFlag":0,"distrUser":"%s"}", "barcode_flag": 1, "pkg_flag": 0, "remark": "", "task_id": None, "convert_flag": 1, "convert_time": None, "convert_user_name": None, "reject_status": 0, "tb_status": 20, "create_user": "%s", "create_user_name": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "initial_order": None}'
"hdi_distr2_0929": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "YND", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "source_id": "%s", "source_type": "CGD", "pur_bill_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "settlement": None, "pur_dept_id": "%s", "pur_dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "rec_user": "%s", "rec_phone": "xhs", "rec_addr": "自动化测试", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s"}", "ext_info": "{"purMode":60,"confirmTime":"%s","confirmUser":"%s","epidemicFlag":0,"distrUser":"%s"}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "task_id": None, "convert_flag": 1, "convert_time": None, "convert_user_name": None, "reject_status": 0, "tb_status": 20, "create_user": "%s", "create_user_name": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "initial_order": None}'
#手工采购计划_验收单主表
"mcms_check_1008": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "hos_id": "%s", "branch_id": "%s", "source_id": "%s", "source_no": "%s", "source_type": "PSD", "tb_status": 10, "prov_id": "%s", "prov_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "dept_id": "%s", "dept_name": "%s", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "initial_order": None, "remark": ""}'
"mcms_check1_1008": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "hos_id": "%s", "branch_id": "%s", "source_id": "%s", "source_no": "%s", "source_type": "PSD", "tb_status": 10, "prov_id": "%s", "prov_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "dept_id": "%s", "dept_name": "%s", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "initial_order": None, "remark": ""}'
"mcms_check2_1008": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "hos_id": "%s", "branch_id": "%s", "source_id": "%s", "source_no": "%s", "source_type": "PSD", "tb_status": 10, "prov_id": "%s", "prov_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "dept_id": "%s", "dept_name": "%s", "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "initial_order": None, "remark": ""}'
#手工采购计划_验收单子表
"mcms_check_batch_1008": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "distr_detail_id": "%s", "pur_mode": 10, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "barcode_id": "%s", "sub_barcode_id": None, "qty": Decimal("100.00"), "reject_qty": Decimal("0.00"), "reject_reason": None, "settlement": 1, "tb_status": 1, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
"mcms_check_batch1_1008": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "distr_detail_id": "%s", "pur_mode": 20, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "barcode_id": "%s", "sub_barcode_id": None, "qty": Decimal("1.00"), "reject_qty": Decimal("0.00"), "reject_reason": None, "settlement": 1, "tb_status": 1, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
"mcms_check_batch2_1008": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_detail_id": "%s", "distr_detail_id": "%s", "pur_mode": 60, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "barcode_id": "%s", "sub_barcode_id": None, "qty": Decimal("100.00"), "reject_qty": Decimal("0.00"), "reject_reason": None, "settlement": 1, "tb_status": 1, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0}'
#手工采购计划_中心库入库单
"check_mcms_psi1_1008": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "YND", "psi_flag": 1, "psi_kind": "101", "stock_kind": "RK_YS", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "自动化测试", "source_id": "%s", "source_no": %s, "source_repl_id": %s, "source_corp_id": "%s", "source_branch_id": None, "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": None, "source_area_name": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%s"}", "reject_time": None, "reject_remark": None, "create_user": "%s","create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_user": None, "initial_order": None, "source_type": "SG", "reject_reason": None, "receipt_status": 0}'
"check_mcms_psi2_1008": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "YND", "psi_flag": 1, "psi_kind": "101", "stock_kind": "RK_YS", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "自动化测试", "source_id": "%s", "source_no": %s, "source_repl_id": %s, "source_corp_id": "%s", "source_branch_id": None, "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": None, "source_area_name": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%s"}", "reject_time": None, "reject_remark": None, "create_user": "%s","create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_user": None, "initial_order": None, "source_type": "SG", "reject_reason": None, "receipt_status": 0}'
"check_mcms_psi3_1008": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "YND", "psi_flag": 1, "psi_kind": "101", "stock_kind": "RK_YS", "target_corp_id": "%s", "target_branch_id": "%s", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "自动化测试", "source_id": "%s", "source_no": %s, "source_repl_id": %s, "source_corp_id": "%s", "source_branch_id": None, "source_dept_id": "%s", "source_dept_name": "%s", "source_stock_id": "%s", "source_area_code": None, "source_area_name": None, "remark": None, "tb_status": 30, "accounter": "%s", "account_date": %s, "bill_relation_json": "{"planBillId":"%s","planOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s","checkBillId":"%s","checkOrderNo":"%s","psiInBillId":"%s","psiInOrderNo":"%s"}", "reject_time": None, "reject_remark": None, "create_user": "%s","create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "reject_user": None, "initial_order": None, "source_type": "SG", "reject_reason": None, "receipt_status": 0}'
#手工采购计划入库_结算数据主表
"check_mcms_out_balance_1008": '{"id": "%s", "order_no": "%s", "branch_id": "%s", "hos_id": "%s", "prov_id": "%s", "prov_name": "%s", "settle_dept_id": None, "tb_status": 0, "sum_row": 2, "settle_amount": Decimal("19999.980000"), "settle_way": 0, "settle_month": "%s", "settle_start_time": %s, "settle_end_time": %s, "remark": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "check_msg": None, "settle_qty": Decimal("200.0000"), "check_user": None, "check_time": None}'
#手工采购计划入库_结算数据子表
"check_mcms_out_balance_detail_1008_1": '{"id": "%s", "pid": "%s", "prov_id": "%s", "prov_name": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "out_dept_id": "%s", "out_dept_name": "%s", "account_date": %s, "pur_mode": 10, "from_table": "mcms_psi_batch", "from_id": "%s", "from_order_no": "%s", "hos_goods_id": "%s", "bar_id": "%s", "bar_code": "%s", "distr_detail_id": "%s", "hos_batch_id": "%s", "tb_status": 10, "price": Decimal("99.999900"), "settle_qty": Decimal("100.00"), "invoice_qty": Decimal("0.00"), "settle_amount": Decimal("9999.9900"), "un_settle_id": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "settle_type": 1, "contract_id": None, "normal_contract_id": None, "temp_purchase": 0, "hos_id": "%s", "fcat_id": None, "invoice_price": Decimal("99.999900"), "online_kind": "10"}'
"check_mcms_out_balance_detail_1008_2": '{"id": "%s", "pid": "%s", "prov_id": "%s", "prov_name": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "out_dept_id": "%s", "out_dept_name": "%s", "account_date": %s, "pur_mode": 10, "from_table": "mcms_psi_batch", "from_id": "%s", "from_order_no": "%s", "hos_goods_id": "%s", "bar_id": "%s", "bar_code": "%s", "distr_detail_id": "%s", "hos_batch_id": "%s", "tb_status": 10, "price": Decimal("99.999900"), "settle_qty": Decimal("100.00"), "invoice_qty": Decimal("0.00"), "settle_amount": Decimal("9999.9900"), "un_settle_id": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "settle_type": 1, "contract_id": None, "normal_contract_id": None, "temp_purchase": 0, "hos_id": "%s", "fcat_id": None, "invoice_price": Decimal("99.999900"), "online_kind": "10"}'
#中心库退货出库_结算数据主表_审批后
"check_mcms_out_balance_1009": '{"id": "%s", "order_no": "%s", "branch_id": "%s", "hos_id": "%s", "prov_id": "%s", "prov_name": "%s", "settle_dept_id": None, "tb_status": 20, "sum_row": 2, "settle_amount": Decimal("19999.980000"), "settle_way": 0, "settle_month": "%s", "settle_start_time": %s, "settle_end_time": %s, "remark": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "check_msg": "22", "settle_qty": Decimal("200.0000"), "check_user": "%s", "check_time": %s}'
#中心库退货出库_结算数据子表_审批后
"check_mcms_out_balance_detail_1009_1": '{"id": "%s", "pid": "%s", "prov_id": "%s", "prov_name": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "out_dept_id": "%s", "out_dept_name": "%s", "account_date": %s, "pur_mode": 10, "from_table": "mcms_psi_batch", "from_id": "%s", "from_order_no": "%s", "hos_goods_id": "%s", "bar_id": "%s", "bar_code": "%s", "distr_detail_id": "%s", "hos_batch_id": "%s", "tb_status": 11, "price": Decimal("99.999900"), "settle_qty": Decimal("100.00"), "invoice_qty": Decimal("0.00"), "settle_amount": Decimal("9999.9900"), "un_settle_id": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "settle_type": 1, "contract_id": None, "normal_contract_id": None, "temp_purchase": 0, "hos_id": "%s", "fcat_id": None, "invoice_price": Decimal("99.999900"), "online_kind": "10"}'
"check_mcms_out_balance_detail_1009_2": '{"id": "%s", "pid": "%s", "prov_id": "%s", "prov_name": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "out_dept_id": "%s", "out_dept_name": "%s", "account_date": %s, "pur_mode": 10, "from_table": "mcms_psi_batch", "from_id": "%s", "from_order_no": "%s", "hos_goods_id": "%s", "bar_id": "%s", "bar_code": "%s", "distr_detail_id": "%s", "hos_batch_id": "%s", "tb_status": 11, "price": Decimal("99.999900"), "settle_qty": Decimal("100.00"), "invoice_qty": Decimal("0.00"), "settle_amount": Decimal("9999.9900"), "un_settle_id": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "settle_type": 1, "contract_id": None, "normal_contract_id": None, "temp_purchase": 0, "hos_id": "%s", "fcat_id": None, "invoice_price": Decimal("99.999900"), "online_kind": "10"}'
#中心库入库结算_正正结算_开票数据主表
"check_mcms_invoice_1009": '{"id": "%s", "hos_id": "%s", "branch_id": None, "invoice_code": "1", "invoice_number": "test", "invoice_num": 1, "prov_id": "%s", "prov_name": "%s", "invoice_amount": Decimal("9999.990000"), "tb_status": 50, "invoice_date": %s, "settle_months": "%s", "tax_amount": None, "payment_bill_id": None, "yxpt_order_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 6, "invoice_qty": Decimal("100.0000"), "remarks": "", "invoice_tag": None, "ext_info": None}'
#中心库入库结算_正结算_付款单主表
"check_mcms_invoice_ext_1009": '{"id": "%s", "hos_id": "%s", "prov_id": "%s", "prov_name": "%s", "payment_status": 20, "pay_channel": "YGPT", "pay_amount": Decimal("9999.9900"), "remain_pay_amount": Decimal("0.0000"), "remark": None, "pay_date": %s, "pay_count": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "pay_user": "%s"}'
#中心库入库结算_正结算_开票数据子表
"check_mcms_invoice_detail_1009_1": '{"id": "%s", "pid": "%s", "hobd_id": "%s", "branch_id": "%s", "hos_goods_id": "%s", "invoice_qty": Decimal("100.00"), "invoice_amount": Decimal("9999.990000"), "price": Decimal("99.999900"), "invoice_price": Decimal("99.999900"), "filing_time": 1, "settle_month": "%s", "confirm_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "hos_id": "%s", "ext_info": "{"purMode": 10, "oneFcatId": null, "onlineKind": null, "volumeFlag": null, "oneFcatName": null, "purModeText": "低值", "onlineKindText": null, "volumeFlagText": null}"}'
"check_mcms_invoice_detail_1009_2": '{"id": "%s", "pid": "%s", "hobd_id": "%s", "branch_id": "%s", "hos_goods_id": "%s", "invoice_qty": Decimal("100.00"), "invoice_amount": Decimal("9999.990000"), "price": Decimal("99.999900"), "invoice_price": Decimal("99.999900"), "filing_time": 1, "settle_month": "%s", "confirm_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "hos_id": "%s", "ext_info": "{"purMode": 10, "oneFcatId": null, "onlineKind": null, "volumeFlag": null, "oneFcatName": null, "purModeText": "低值", "onlineKindText": null, "volumeFlagText": null}"}'
#中心库入库结算_正结算_付款单主表
"check_mcms_invoice_ext_1009": '{"id": "%s", "hos_id": "%s", "prov_id": "%s", "prov_name": "%s", "payment_status": 20, "pay_channel": "YGPT", "pay_amount": Decimal("9999.9900"), "remain_pay_amount": Decimal("0.0000"), "remark": None, "pay_date": %s, "pay_count": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "pay_user": "%s"}'
#院区数据
"check_mcms_branch_info": '{"id": "%s", "hos_id": "%s", "name": "%s", "yb_flag": "0", "main_branch": 0, "address": "%s", "province": "11", "city": "1101", "area": "110101", "tb_status": 1, "remark": None, "version": 0, "short_name": None, "create_time": %s, "create_user": "%s", "last_modified": %s, "last_modified_user": "%s"}'
#科室数据
"check_dept_info0": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "科室004", "cname": "科室004", "dept_level": 4, "dept_type": "0", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 5, "ordinal": None, "short_pinyin": "ks004", "address": "三级科室004", "contact_way": "三级科室004", "scm_code": None, "erp_code": "004", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 0, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": None}'
"check_dept_info1": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "三级检测组003", "cname": "三级检测组003", "dept_level": 3, "dept_type": "0", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 7, "ordinal": None, "short_pinyin": "sjjcz003", "address": "三级检测组003", "contact_way": "12401003250", "scm_code": None, "erp_code": "003", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 0, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": None}'
"check_dept_info2": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "二级检验科002", "cname": "二级检验科002", "dept_level": 2, "dept_type": "0", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 7, "ordinal": None, "short_pinyin": "ejjyk002", "address": "二级检验科002", "contact_way": "13401003250", "scm_code": None, "erp_code": "002", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 0, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": None}'
"check_dept_info3": '{"id": "%s", "pid": "%s", "code": "%s", "self_code": None, "corp_id": "%s", "branch_id": "%s", "corp_kind": "1", "ename": "设备科001", "cname": "设备科001", "dept_level": 1, "dept_type": "1", "ext1": None, "ext2": None, "ext3": None, "ext4": None, "ext5": None, "dept_cate": 1, "dept_kind": 1, "ordinal": None, "short_pinyin": "sbk001", "address": "设备科001", "contact_way": "13401003250", "scm_code": None, "erp_code": "001", "remark": None, "node_kind": None, "flag": "1", "last_update_datetime": %s, "version": 1, "create_time": %s, "create_user": "%s", "last_modified_user": "%s", "last_modified": %s, "user_leader_id": "%s"}'
#库房数据
"check_mcms_stock_info0": '{"id": "%s", "hos_id": "%s", "pid": "%s", "branch_id": "%s", "stock_code": "%s", "stock_name": "三级检测组003库房", "stock_fzr": None, "stock_phone": "12401003250", "dept_id": "%s", "stock_level": "3", "short_pinyin": "sjjcz003", "address": "三级检测组003", "mgr_type": 1, "remark": None, "version": 1, "lock_flag": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "del_flag": 0, "ordinal": 99999999}'
"check_mcms_stock_info1": '{"id": "%s", "hos_id": "%s", "pid": "%s", "branch_id": "%s", "stock_code": "%s", "stock_name": "二级检验科002库房", "stock_fzr": None, "stock_phone": "13401003250", "dept_id": "%s", "stock_level": "2", "short_pinyin": "ejjyk002", "address": "二级检验科002", "mgr_type": 1, "remark": None, "version": 1, "lock_flag": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "del_flag": 0, "ordinal": 99999999}'
"check_mcms_stock_info2": '{"id": "%s", "hos_id": "%s", "pid": "%s", "branch_id": "%s", "stock_code": "%s", "stock_name": "东土城路院区wSIoT中心库房", "stock_fzr": None, "stock_phone": "13401003250", "dept_id": "%s", "stock_level": "1", "short_pinyin": "sbk001", "address": "设备科001", "mgr_type": 1, "remark": None, "version": 0, "lock_flag": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "del_flag": 0, "ordinal": 99999999}'
...@@ -8,7 +8,7 @@ import traceback ...@@ -8,7 +8,7 @@ import traceback
from air_case.public1.public1.public1 import approval_center, approval_center_all from air_case.public1.public1.public1 import approval_center, approval_center_all
from common.Logger_Utils import Logger from common.Logger_Utils import Logger
from common.timeUtils import timeUtils from common.timeUtils import timeUtils
from common.db.sql.sql_tools import *
curPath = os.path.abspath(os.path.dirname(__file__)) # 获取当前文件的所在目录的绝对路径 curPath = os.path.abspath(os.path.dirname(__file__)) # 获取当前文件的所在目录的绝对路径
# print('将路径中的/换成\\', curPath) # C:\Users\Administrator\Desktop\temp\dbshop99\main # print('将路径中的/换成\\', curPath) # C:\Users\Administrator\Desktop\temp\dbshop99\main
# # #将当前文件的所在目录的绝对路径进行分离,分离成 ('C:\\Users\\Administrator\\Desktop\\temp\\dbshop99', 'main'),存到元组中 # # #将当前文件的所在目录的绝对路径进行分离,分离成 ('C:\\Users\\Administrator\\Desktop\\temp\\dbshop99', 'main'),存到元组中
...@@ -292,6 +292,8 @@ def main_text(): ...@@ -292,6 +292,8 @@ def main_text():
root = tk.Tk() root = tk.Tk()
root.title("删除指定院区数据") root.title("删除指定院区数据")
# 设置窗口大小
root.geometry('200x200')
# 计算窗口居中时左上角的坐标 # 计算窗口居中时左上角的坐标
x = (window_width - root.winfo_width()) // 2 x = (window_width - root.winfo_width()) // 2
y = (window_height - root.winfo_height()) // 2 y = (window_height - root.winfo_height()) // 2
...@@ -299,13 +301,78 @@ def main_text(): ...@@ -299,13 +301,78 @@ def main_text():
root.geometry("+{}+{}".format(x, y)) root.geometry("+{}+{}".format(x, y))
root.resizable(False, False) root.resizable(False, False)
combo = ttk.Combobox(root) combo = ttk.Combobox(root)
combo["values"] = ("选项1", "选项2", "选项3") branch_id_list=delData().get_branch_id_bydb( FileUtils().r_info8('b2_herp3_bs', "院区新增", 'message')['branch_id'])
for i in branch_id_list:
combo["values"] = (i)
combo.current(0) # 设置默认选项
combo.bind("<<ComboboxSelected>>", dropdown_changed)
combo.pack()
button = tk.Button(root, text="删除此院区数据", command=lambda:button_clicked(i))
button.pack()
root.mainloop()
def button_clicked(branch_id):
result = confirm()
if result == True:
result1 = confirm1()
if result1 == True:
print(branch_id)
delData().Delete_goods_change_info()
delData().Delete_probeInfo_other(3, branch_id)
# delData().Del_supply_relation()
delData().Delete_business_Data(2, branch_id)
delData().Del_reporter_data(2, branch_id)
delData().Delete_business_Data_All()
delData().Delete_business_Data_All2()
delData().Delete_branch_by_id(3, branch_id)
print(branch_id, '删除完毕')
def del_current_brachdata():
import tkinter as tk
from tkinter import ttk
def dropdown_changed(event):
value = combo.get()
print(value)
root = tk.Tk()
root.title("删除当前院区数据")
# 设置窗口大小
root.geometry('200x200')
# 计算窗口居中时左上角的坐标
x = (window_width - root.winfo_width()) // 2
y = (window_height - root.winfo_height()) // 2
# 设置窗口左上角的坐标
root.geometry("+{}+{}".format(x, y))
root.resizable(False, False)
combo = ttk.Combobox(root)
branch_id = FileUtils().r_info8('b2_herp3_bs', "院区新增", 'message')['branch_id']
combo["values"] = (branch_id)
combo.current(0) # 设置默认选项 combo.current(0) # 设置默认选项
combo.bind("<<ComboboxSelected>>", dropdown_changed) combo.bind("<<ComboboxSelected>>", dropdown_changed)
combo.pack() combo.pack()
button = tk.Button(root, text="删除此院区数据", command=lambda: button_clicked_del_current_branch(branch_id))
button.pack()
root.mainloop() root.mainloop()
def button_clicked_del_current_branch(branch_id):
result = confirm()
if result == True:
result1 = confirm1()
if result1 == True:
print(branch_id)
delData().Delete_goods_change_info()
# delData().Delete_probeInfo_other(3, branch_id)
# delData().Del_supply_relation()
delData().Delete_business_Data_current_branch(2, branch_id)
delData().Del_reporter_data(2, branch_id)
# delData().Delete_business_Data_All()
# delData().Delete_business_Data_All2()
#只删除业务数据,不删除当前院区和库房数据
print(branch_id, '业务数据删除完毕')
def get_input(): def get_input():
import tkinter as tk import tkinter as tk
from tkinter import simpledialog from tkinter import simpledialog
...@@ -339,12 +406,14 @@ def main_text(): ...@@ -339,12 +406,14 @@ def main_text():
Button(root, text='流程十八\n中心库业务_拆包功能', anchor='center', width=16, height=8, command=flow18).grid(row=4, column=10) Button(root, text='流程十八\n中心库业务_拆包功能', anchor='center', width=16, height=8, command=flow18).grid(row=4, column=10)
Button(root, text='一键执行', anchor='center', width=8, height=2, command=flow0).grid(row=5, column=0) Button(root, text='一键执行', anchor='center', width=8, height=2, command=flow0).grid(row=5, column=0)
Button(root, text='删除指定\n院区数据', anchor='center', width=8, height=2, command=del_brachdata_from_brachid).grid(row=5, Button(root, text='删除指定\n院区数据', anchor='center', width=8, height=2, command=del_brachdata_from_brachid).grid(row=5,
column=0)
Button(root, text='删除当前\n院区业务\n数据', anchor='center', width=8, height=2, command=del_current_brachdata).grid(row=5,
column=2) column=2)
Button(root, text='流程五开始\n一键执行', anchor='center', width=8, height=2, command=flow5_flow18).grid(row=5, column=4) Button(root, text='流程五开始\n一键执行', anchor='center', width=8, height=2, command=flow5_flow18).grid(row=5, column=4)
Button(root, text='删除垃圾\n数据', anchor='center', width=8, height=2, command=del_data).grid(row=5, column=6) Button(root, text='删除垃圾\n数据', anchor='center', width=8, height=2, command=del_data).grid(row=5, column=6)
Button(root, text='流程十一开始\n一键执行', anchor='center', width=8, height=2, command=flow11_flow18).grid(row=5, column=8) Button(root, text='流程十一开始\n一键执行', anchor='center', width=8, height=2, command=flow11_flow18).grid(row=5, column=8)
Button(root, text='从jenkins\n下载data\n数据', anchor='center', width=8, height=2, command=download_data).grid(row=5, # Button(root, text='从jenkins\n下载data\n数据', anchor='center', width=8, height=2, command=download_data).grid(row=5,
column=10) # column=10)
Button(root, text='退 出', anchor='center', width=8, height=2, command=exit).grid(row=5, column=10) Button(root, text='退 出', anchor='center', width=8, height=2, command=exit).grid(row=5, column=10)
......
...@@ -77,7 +77,7 @@ setInterval(updateTime, 1000); // 每秒更新一次时间 ...@@ -77,7 +77,7 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分9</td> <td class='details-col-elapsed'>0分2</td>
<td class="details-col-elapsed">100.0%</td> <td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -93,9 +93,9 @@ setInterval(updateTime, 1000); // 每秒更新一次时间 ...@@ -93,9 +93,9 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/r_d4库房管理_库区设置_货位管理_添加货位/log.html' target='_blank'>r_d4库房管理_库区设置_货位管理_添加货位</a></td> <td class="details-col-elapsed"><a href='../log/a2_编辑医院信息/log.html' target='_blank'>a2_编辑医院信息</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">8.912</td> <td class="details-col-elapsed">1.984</td>
<td class="details-col-elapsed">xiaohesheng</td> <td class="details-col-elapsed">xiaohesheng</td>
</tr> </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