Commit 3e11f33e authored by xiao-hesheng's avatar xiao-hesheng
Browse files

流程十四脚本编写

parent 0c3a1c80
......@@ -30,10 +30,12 @@ import sys
# commonFuc().check_text_exist_result_text('error', 'succees')
#第二种方式
hos_goods_id = 'h034700004220'
actual_value2=main2(hos_goods_id)
print('actual_value2',actual_value2)
expected_value2=commonFuc().get_business_data('b5_spd3_core_business_flow','expected_value2')
expected_value2=get_process_list(expected_value2)
actual_value1=main2(hos_goods_id)
print('actual_value2',actual_value1)
actual_value2=get_process_list2(actual_value1)
expected_value1=commonFuc().get_business_data('b5_spd3_core_business_flow','expected_value2')
expected_value2=get_process_list(expected_value1)
print('expected_value2',expected_value2)
if actual_value2==expected_value2:
print('ok')
......
......@@ -25,6 +25,17 @@ def get_process_list(request_body):
return request_body_json
def get_process_list2(request_body):
request_body = str(request_body)
print('request_body', request_body)
new_request_body = request_body.replace("'", '"')
new_request_body1 = new_request_body.replace("\\", '\\\\')
new_request_body2 = new_request_body1.replace("None", 'null')
print(new_request_body2)
request_body_json = json.loads(new_request_body2, encoding='utf-8')
return request_body_json
def get_branch_id():
return FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"]
......@@ -626,17 +637,17 @@ def get_udi2(type=1): # 二级科室库存明细查询获取条码
GoodsId = hosGoodsId.replace(get_hosid(), '')
request_body = commonFuc().get_business_data(module, "payload17_2_2", GoodsId, get_branch_id(), deptid2)
elif type == 4:#试剂单瓶条码
elif type == 4: # 试剂单瓶条码
hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '')
request_body = commonFuc().get_business_data(module, "payload17_3",GoodsId, get_branch_id(), deptid2)
request_body = commonFuc().get_business_data(module, "payload17_3", GoodsId, get_branch_id(), deptid2)
print('getudi_request_body', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
# import pdb
# pdb.set_trace()
print('aaaaaaaaaaaaaaaaresult',result)
print('aaaaaaaaaaaaaaaaresult', result)
data1 = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))
print('条码库存result', result)
......@@ -662,6 +673,7 @@ def get_udi2(type=1): # 二级科室库存明细查询获取条码
break
return pkgCodeSee
def get_udi(type=1): # 退货出库扫条码
# type=1低值 2高值 3试剂
module = "b5_spd3_core_business_flow"
......@@ -2504,6 +2516,7 @@ def pickScan2(PICK_ID, udi_code, type=1): # 二级库出库拣货扫码
print('result', result)
return areaCode, pickerId
def pickScan4(udi_code): # 二级库扫码 只扫码不发放
module = "b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始
......@@ -2533,6 +2546,7 @@ def pickScan4(udi_code): # 二级库扫码 只扫码不发放
data1 = commonFuc().analysis_json('data', result)
return data1
def pickScan3(udi_code, type=1): # 二级库扫码发放(高值产品不能扫码发放)
module = "b5_spd3_core_business_flow"
# # 登录获取用户id等信息,使用创建的用户登录===========开始
......@@ -2607,16 +2621,16 @@ def pickScan3(udi_code, type=1): # 二级库扫码发放(高值产品不能扫
version = commonFuc().analysis_json('version', data1)
unitName = commonFuc().analysis_json('unitName', data1)
# ==============================获取条码信息
#从message18文件中获取信息
# 从message18文件中获取信息
info = FileUtils().r_info8(module, "条码信息", 'message18')
# print('info', info)
list_a = info['list_a']
extInfo=commonFuc().analysis_json('extInfo',list_a)
print('extInfo',extInfo)
extInfo = commonFuc().analysis_json('extInfo', list_a)
print('extInfo', extInfo)
# inStockTime = commonFuc().analysis_json('inStockTime', extInfo)
inStockTime=reGetString(extInfo,'inStockTime\"\: \"','\"\, \"distrDetailId')
print('inStockTime',inStockTime)
#从message18文件中获取信息
inStockTime = reGetString(extInfo, 'inStockTime\"\: \"', '\"\, \"distrDetailId')
print('inStockTime', inStockTime)
# 从message18文件中获取信息
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"dept_stock_out_submit_url")
......@@ -2627,7 +2641,7 @@ def pickScan3(udi_code, type=1): # 二级库扫码发放(高值产品不能扫
request_body = "request_body"
mgrCorpName = get_hosname()
mgrRangeId = deptid2
mgrRangeName =deptName2
mgrRangeName = deptName2
extStr1 = get_branch_name()
extStr3 = get_branch_name()
snCode = UTid
......@@ -2635,13 +2649,14 @@ def pickScan3(udi_code, type=1): # 二级库扫码发放(高值产品不能扫
cname = username
orgCode1 = get_orgCode()
orgName1 = get_orgName()
print(orgCode1,orgName1)
print(orgCode1, orgName1)
# # 请求体
if type == 1:
request_body = commonFuc().get_business_data(module, "payload50_1_2", stockId, stockName2, areaCode, areaName,
uxid, userLoginCode, cname, get_hosid(), get_branch_id(), deptid1,
orgCode1, orgName1, get_hosid(), get_hosid(), mgrCorpName,get_branch_id(),
orgCode1, orgName1, get_hosid(), get_hosid(), mgrCorpName,
get_branch_id(),
get_branch_name(), mgrRangeId, mgrRangeName, extStr1, extStr3,
get_hosid(), stockId,
stockName2, areaCode, areaName, UTid, createTime, snCode,
......@@ -2651,7 +2666,7 @@ def pickScan3(udi_code, type=1): # 二级库扫码发放(高值产品不能扫
tbStatus, pkgDefId, pkgDefQty, purBillId, pkgDefName, distrBillId,
inStockTime, distrDetailId, purMode, price, goodsMfrsName,
goodsSpec, unit, goodsName, pkgDefId, pkgDefQty, unitName,
hosGoodsCode,purModeText)
hosGoodsCode, purModeText)
elif type == 3:
request_body = commonFuc().get_business_data(module, "payload50_1_2", stockId, stockName2, areaCode, areaName,
......@@ -2675,15 +2690,18 @@ def pickScan3(udi_code, type=1): # 二级库扫码发放(高值产品不能扫
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
return data1
def get_branch_name():
return FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_name"]
def get_hosname():
return "邹城市人民医院(test)"
def get_orgCode():
str=delData().get_orgCode()
str = delData().get_orgCode()
str = str.replace('(', '')
str = str.replace(',)', '')
str = str.replace("'", '')
......@@ -2692,7 +2710,7 @@ def get_orgCode():
def get_orgName():
str=delData().get_orgName()
str = delData().get_orgName()
str = str.replace('(', '')
str = str.replace(',)', '')
str = str.replace("'", '')
......
......@@ -102,7 +102,7 @@ def main2(hos_goods_id):
use_frequency,
charge_unit FROM mcms_goods_info WHERE id ='%s';""" % hos_goods_id
res_dict = get_dict_data_sql(cursor, sql)
print(res_dict)
print('res_dict',res_dict)
return res_dict
......
......@@ -445,13 +445,4 @@ json_headers2: {
}
"expected_value": "('00004220', 'h0347', 'p1e2ba', '22f19044b8ae40f08aa5e170dcedc66e', None, '11661168', '11661168', '11661168', '一次性注射器_低值2^p7l', '一次性注射器', 'mfrs-11229', '德国歌德公司 Geuder AG', '', None, '', 'ycxzsq_dz2^p7l', None, '支', 'G-31891', Decimal('1.000000'), 2, '3', 10, None, None, '', None, Decimal('99.9999'), None, '德国', None, None, '', 1, None, 0, None, 0, '', '', None, None, 1, 0, 1, 'p1e2ba:UID-051933', datetime.datetime(2024, 6, 23, 7, 0, 59), 'p1e2ba:UID-051933', 0, 0, 1, None)"
"expected_value2": "{'hos_goods_code': '00004220', 'hos_id': 'h0347', 'prov_id': 'p1e2ba', 'prov_hos_goods_id': '22f19044b8ae40f08aa5e170dcedc66e', 'srv_i
d': None, 'mdm_goods_code': '11661168', 'mdm_goods_spec_code': '11661168', 'spd_goods_code': '11661168', 'goods_name': '一次性注射器_低值2^p7l', 'goo
ds_general_name': '一次性注射器', 'goods_mfrs_id': 'mfrs-11229', 'goods_mfrs_name': '德国歌德公司 Geuder AG', 'goods_reg_cert': '', 'goods_agent_mfrs
_id': None, 'brand': '', 'short_pinyin': 'ycxzsq_dz2^p7l', 'kind_sixtyeight_code': None, 'unit': '支', 'goods_spec': 'G-31891', 'goods_package': Deci
mal('1.000000'), 'bar_code_mng': 2, 'unique_code_strategy': '3', 'pur_mode': 10, 'sub_pur_mode': None, 'erp_code': None, 'herp_code': '', 'hrp': None
, 'price': Decimal('99.9999'), 'abroad_flag': None, 'made': '德国', 'property': None, 'mgr_level': None, 'goods_desc': '', 'charge_flag': 1, 'focus_c
ontrol_type': None, 'temp_flag': 0, 'official_status': None, 'focus_control': 0, 'storage_conditions': '', 'transport_conditions': '', 'into_cost_fla
g': None, 'rfid_flag': None, 'purchase_flag': 1, 'tb_status': 0, 'version': 1, 'create_user': 'p1e2ba:UID-051933', 'create_time': datetime.datetime(2
024, 6, 23, 7, 0, 59), 'last_modified_user': 'p1e2ba:UID-051933', 'sterilize_flag': 0, 'multi_charge_flag': 0, 'use_frequency': 1, 'charge_unit': Non
e}"
\ No newline at end of file
"expected_value2": "{'hos_goods_code': '00004220', 'hos_id': 'h0347', 'prov_id': 'p1e2ba', 'prov_hos_goods_id': '22f19044b8ae40f08aa5e170dcedc66e', 'srv_id': None, 'mdm_goods_code': '11661168', 'mdm_goods_spec_code': '11661168', 'spd_goods_code': '11661168', 'goods_name': '一次性注射器_低值2^p7l', 'goods_general_name': '一次性注射器', 'goods_mfrs_id': 'mfrs-11229', 'goods_mfrs_name': '德国歌德公司 Geuder AG', 'goods_reg_cert': '', 'goods_agent_mfrs_id': None, 'brand': '', 'short_pinyin': 'ycxzsq_dz2^p7l', 'kind_sixtyeight_code': None, 'unit': '支', 'goods_spec': 'G-31891', 'goods_package': Decimal('1.000000'), 'bar_code_mng': 2, 'unique_code_strategy': '3', 'pur_mode': 10, 'sub_pur_mode': None, 'erp_code': None, 'herp_code': '', 'hrp': None, 'price': Decimal('99.9999'), 'abroad_flag': None, 'made': '德国', 'property': None, 'mgr_level': None, 'goods_desc': '', 'charge_flag': 1, 'focus_control_type': None, 'temp_flag': 0, 'official_status': None, 'focus_control': 0, 'storage_conditions': '', 'transport_conditions': '', 'into_cost_flag': None, 'rfid_flag': None, 'purchase_flag': 1, 'tb_status': 0, 'version': 1, 'create_user': 'p1e2ba:UID-051933', 'create_time': datetime.datetime(2024, 6, 23, 7, 0, 59), 'last_modified_user': 'p1e2ba:UID-051933', 'sterilize_flag': 0, 'multi_charge_flag': 0, 'use_frequency': 1, 'charge_unit': None}"
\ No newline at end of file
......@@ -95,7 +95,7 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
<tr width="600">
<td class="details-col-elapsed"><a href='../log/产品检查/log.html' target='_blank'>产品检查</a></td>
<td class="fail">失败</td>
<td class="details-col-elapsed">0.348</td>
<td class="details-col-elapsed">0.118</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment