Commit 020c4d61 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增流程十数据库验证脚本

parent 4f72b5cd
......@@ -128,9 +128,10 @@ def check_mcms_dept_buy():
goodsCode = commonFuc().analysis_json('goodsCode', list_a)
pkgDefId = commonFuc().analysis_json('pkgDefId', list_a)
pkgDefName = commonFuc().analysis_json('pkgDefName', list_a)
target_stock_id = '边仓id,从边仓表获取'
bill_expdt_date = '从数据获取'
rec_user = 'rec_user';
#获取边仓id
target_stock_id = get_id("select logic_id FROM yb_direct WHERE branch_id ='%s';"%branch_id)
bill_expdt_date = get_expdt_date("select bill_expdt_date from mcms_dept_buy where branch_id='%s' and bill_mode='16' order by create_time desc LIMIT 1;" % branch_id)
rec_user = get_login_user_uxid()
create_user = 'create_user'
create_time = 'create_time';
last_modified = 'last_modified'
......
......@@ -3332,3 +3332,18 @@ def dept_goods_distribute(detpid): # 科室添加产品信息(产品是从外
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
def get_login_user_uxid():
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()
return uxid1
\ No newline at end of file
......@@ -127,6 +127,17 @@ def get_create_time(sql):
# print(new_str1)
cursor.close()
return new_str1
def get_expdt_date(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
results = cursor.fetchone()
str1 = str(results)
new_str1 = str1.replace(',)', '')
new_str1 = new_str1.replace('(date', 'date')
# new_str1 = new_str1.replace(',', '')
# print(new_str1)
cursor.close()
return new_str1
def get_id(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
......
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