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

优化脚本

parent 92a9440f
...@@ -11,7 +11,7 @@ __author__ = "xiaohesheng" ...@@ -11,7 +11,7 @@ __author__ = "xiaohesheng"
""" """
case_tag:api,spd_core,a_a7流程五_中心库入库结算_正结算3_内网验收入库结算,id2302,id2302-7,sit,on case_tag:api,spd_core,a_a7流程五_中心库入库结算_正结算3_内网验收入库结算,id2302,id2302-7,sit,on
主数据平台:a_a7流程五_中心库入库结算_正结算3_内网验收入库结算 主数据平台:a_a7流程五_中心库入库结算_正结算3_内网验收入库结算
python runner_test.py tag id2302-6 debug mdm3 python runner_test.py tag id2302-7 debug mdm3
""" """
from common.common_func import commonFuc from common.common_func import commonFuc
...@@ -214,33 +214,46 @@ def putaway(): ...@@ -214,33 +214,46 @@ def putaway():
commonFuc().get_business_data(module, "json_contentType"), token, commonFuc().get_business_data(module, "json_contentType"), token,
projectCode) projectCode)
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "stock_in_page_url") 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"] branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"]
hosId = branch_id[0:5] hosId = branch_id[0:5]
request_body = commonFuc().get_business_data(module, "payload6", branch_id, hosId) request_body = commonFuc().get_business_data(module, "payload6", branch_id, hosId)
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print('result', result) print('result', result)
# 将上架入库列表数据写入文件 data=commonFuc().analysis_json('data', result)
data = commonFuc().analysis_json('data', result) total=commonFuc().analysis_json('total', data)
data1= commonFuc().analysis_json('data', data) if total>=1:
list_a = [] # 将上架入库列表数据写入文件
list_b = [] data = commonFuc().analysis_json('data', result)
list_c = [] data1= commonFuc().analysis_json('data', data)
list_a.append(data1) list_a = []
list_b.append(data1) list_b = []
list_c.append(data1) list_c = []
# print('list_a', len(list_a), list_a) list_a.append(data1)
info = (list_a, list_b, list_c) list_b.append(data1)
titlename = ('list_a', 'list_b', 'list_c') list_c.append(data1)
# 将验收单详细信息写入到文件中 # print('list_a', len(list_a), list_a)
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '上架入库列表数据', titlename, 'message16') info = (list_a, list_b, list_c)
titlename = ('list_a', 'list_b', 'list_c')
# 将验收单详细信息写入到文件中
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '上架入库列表数据', titlename, 'message16')
# =====================上架入库列表查询========================== # =====================上架入库列表查询==========================
# =============查看验收单详情======================== # =============查看验收单详情========================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "stock_detail_url") url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "stock_detail_url")
print(url)
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"] deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
areaCode = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["shelfCode"] areaCode = FileUtils().r_info8('b2_herp3_bs', 'shelfinfo', 'message7')["shelfCode"]
branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"] branch_id = FileUtils().r_info('b2_herp3_bs', '院区新增')["branch_id"]
hosId = branch_id[0:5] hosId = branch_id[0:5]
sourceId = FileUtils().r_info8('b5_spd3_core_business_flow', '验收单号', 'message15')["CHECK_NO1"] # 从message16文件中获取信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "上架入库列表数据", 'message16')
list_a = info['list_a']
print('list_a', list_a)
sourceId='sourceId'
for i in list_a:
for j in i:
sourceId = j['sourceId']
break
# 从message13文件中获取信息 # 从message13文件中获取信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "验收单信息", 'message13') info = FileUtils().r_info8('b5_spd3_core_business_flow', "验收单信息", 'message13')
# print('info', info) # print('info', info)
...@@ -275,15 +288,16 @@ def putaway(): ...@@ -275,15 +288,16 @@ def putaway():
# ============= # =============查看验收单详情================================================ # ============= # =============查看验收单详情================================================
# ================================入库上架=================== # ================================入库上架===================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "stock_detail_submit_url") url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "stock_detail_submit_url")
viewId = 'h03470000306444442024-10-30100支/100' print(url)
shelfCode = 'areah03471250-2-01-01' viewId = 'viewId'
sourceId = 'CHECKh03472024042300019' shelfCode = 'shelfCode'
sourceId = 'sourceId'
sourceType = 'PSD' sourceType = 'PSD'
sourceVersion = '0' sourceVersion = '0'
targetDeptId = deptid1 targetDeptId = deptid1
targetDeptName = '设备科001' targetDeptName = 'targetDeptName'
targetAreaCode = areaCode targetAreaCode = 'targetAreaCode'
targetAreaName = '自动化测试' targetAreaName = 'targetAreaName'
# 从message17文件中获取信息 # 从message17文件中获取信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "验收单库存详情信息", 'message17') info = FileUtils().r_info8('b5_spd3_core_business_flow', "验收单库存详情信息", 'message17')
# print('info', info) # print('info', info)
...@@ -303,22 +317,27 @@ def putaway(): ...@@ -303,22 +317,27 @@ def putaway():
for i in list_a: for i in list_a:
for j in i: for j in i:
sourceId = j['sourceId'] sourceId = j['sourceId']
targetAreaName= j['areaName']
targetAreaCode= j['areaCode']
break break
request_body = commonFuc().get_business_data(module, "payload5", viewId, shelfCode, sourceId, sourceType, request_body = commonFuc().get_business_data(module, "payload5", viewId, shelfCode, sourceId, sourceType,
sourceVersion, targetDeptId, sourceVersion, targetDeptId,
targetDeptName, targetAreaCode, targetAreaName) targetDeptName, targetAreaCode, targetAreaName)
print('request_body',request_body) print('request_body',request_body)
time.sleep(3)
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print('result', result) print('result', result)
# ================================入库上架 # ================================入库上架================================
try: try:
check_accept_order(1) check_accept_order(1)#低值
check_accept_order(2) check_accept_order(2)#高值
check_accept_order(3) check_accept_order(3)#试剂
putaway()
putaway()
putaway() putaway()
except Exception as e: except Exception as e:
print('请检查脚本或者数据') print('验收入库上架脚本出现异常,请检查脚本或者数据')
print("发生异常:", str(e)) print("发生异常:", str(e))
traceback.print_exc() traceback.print_exc()
else: else:
......
企业信息: 企业信息:
e_id: CR202404230258 e_id: CR202404240057
cname: 国药集团公司2pCeJ cname: 国药集团公司BJong
医院信息: 医院信息:
h_id: 湖南省人民医院X@n8x h_id: 湖南省人民医院9n8tw
h_name: 湖南省人民医院X@n8x h_name: 湖南省人民医院9n8tw
产品审核信息: 产品审核信息:
MSPid: MSP2404230059_1 MSPid: MSP2404240017_1
hosId: h0347 hosId: h0347
hosGoodsId: h034700003066 hosGoodsId: h034700003083
provGoodsid: provGood-99220175 provGoodsid: provGood-99220192
goodsAuditBillId: MSP2404230059 goodsAuditBillId: MSP2404240017
targetId: MSP2404230059_1 targetId: MSP2404240017_1
院区新增: 院区新增:
branch_id: h0347-3514 branch_id: h0347-3516
branch_name: 东土城路院区Ma7zU branch_name: 东土城路院区W%SH#
科室信息: 科室信息:
dept2_id: 9d4bd32c2cc449a4ac3dd0ab99a66b47 dept2_id: 6060ec04938e4c7181bb51fb04a7f7da
dept2_name: 二级检验科002 dept2_name: 二级检验科002
...@@ -25,4 +25,4 @@ json_headers2: { ...@@ -25,4 +25,4 @@ json_headers2: {
"payload3": {"billMode":"%s","branchId":"%s","checkAll":1,"deptId":"%s","deptName":"%s","hosId":"%s","provId":"%s","provName":"%s","recOrgId":"%s","recOrgName":"%s","resendStatus":null,"rejectReason":null,"sourceId":"%s","sourceVersion":"%s","sourceType":"%s","tbStatus":"%s","createUser":"%s","sourceNo":"%s","sterilizeList":[],"remark":"","rejectFlag":0,"detailList":[{"id":"%s","viewId":"%s","settlement":"%s","checkQty":100,"recTemperature":"%s","recHumidity":"%s"}]} "payload3": {"billMode":"%s","branchId":"%s","checkAll":1,"deptId":"%s","deptName":"%s","hosId":"%s","provId":"%s","provName":"%s","recOrgId":"%s","recOrgName":"%s","resendStatus":null,"rejectReason":null,"sourceId":"%s","sourceVersion":"%s","sourceType":"%s","tbStatus":"%s","createUser":"%s","sourceNo":"%s","sterilizeList":[],"remark":"","rejectFlag":0,"detailList":[{"id":"%s","viewId":"%s","settlement":"%s","checkQty":100,"recTemperature":"%s","recHumidity":"%s"}]}
"payload4": {"targetDeptId":"%s","targetAreaCode":"%s","hosId":"%s","sourceId":"%s","sourceType":"%s","pkgTaskId":null} "payload4": {"targetDeptId":"%s","targetAreaCode":"%s","hosId":"%s","sourceId":"%s","sourceType":"%s","pkgTaskId":null}
"payload5": {"batchList":[{"viewId":"%s","shelfCode":"%s"}],"sourceId":"%s","sourceType":"%s","sourceVersion":"%s","targetDeptId":"%s","targetDeptName":"%s","targetAreaCode":"%s","targetAreaName":"%s","pkgTaskId":null} "payload5": {"batchList":[{"viewId":"%s","shelfCode":"%s"}],"sourceId":"%s","sourceType":"%s","sourceVersion":"%s","targetDeptId":"%s","targetDeptName":"%s","targetAreaCode":"%s","targetAreaName":"%s","pkgTaskId":null}
"payload6": {"pageNum":1,"pageSize":50,"orderBy":"","queryObject":{"branchId":"%s","taskType":0,"stockKind":"","sourceOrgName":"","hosId":"%s"}} "payload6": {"pageNum":1,"pageSize":50,"orderBy":"","queryObject":{"branchId":"%s","taskType":0,"stockKind":"","sourceOrgName":"","hosId":"%s"}}
\ No newline at end of file
...@@ -54,10 +54,10 @@ ...@@ -54,10 +54,10 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>2</td>
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分8秒</td> <td class='details-col-elapsed'>1</td>
<td class="details-col-elapsed">50.0%</td> <td class='details-col-elapsed'>8分42秒</td>
<td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -72,16 +72,9 @@ ...@@ -72,16 +72,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/r_b9库房管理_库区设置_库房查询_查询全部/log.html' target='_blank'>r_b9库房管理_库区设置_库房查询_查询全部</a></td> <td class="details-col-elapsed"><a href='../log/a_a7流程五_中心库入库结算_正结算3_内网验收入库结算/log.html' target='_blank'>a_a7流程五_中心库入库结算_正结算3_内网验收入库结算</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">2.129</td> <td class="details-col-elapsed">521.851</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/r_c3库房管理_库区设置_新增库区/log.html' target='_blank'>r_c3库房管理_库区设置_新增库区</a></td>
<td class="fail">失败</td>
<td class="details-col-elapsed">5.917</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