Commit 9edba208 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

流程八脚本编写

parent d2db8cc3
......@@ -214,7 +214,7 @@ def invoice():
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),
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)
# 发送请求
......@@ -257,7 +257,7 @@ def invoice():
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),
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)
......@@ -285,8 +285,8 @@ def invoice():
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, "payload13", timeUtils.get_time_hms(5),
timeUtils.get_time_hms(5), get_hosid(), get_hosid())
request_body = commonFuc().get_business_data(module, "payload13", 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)
......
......@@ -49,8 +49,8 @@ def operationApply(): # 高值跟台申请
print('url', url)
stockAreaId = get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],
FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'], 2)
expireDate = timeUtils.get_time_add(1, 2)
operDate = timeUtils.get_time_add(1, 2)
expireDate = timeUtils().get_time_add(1, 2)
operDate = timeUtils().get_time_add(1, 2)
# 从文件中获取必要信息
info = FileUtils().r_info8(module, "产品信息", 'message19')
# print('info', info)
......@@ -196,7 +196,7 @@ def second_dept_in_warehouse():
"dept_stock_out_submit_url")
print('跟台消耗提交,url', url)
chargeDeptId = deptid
operDate = timeUtils.get_time_add(3, 2)
operDate = timeUtils().get_time_add(3, 2)
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库条码信息", 'message20')
list_a = info['list_a']
stockId = commonFuc().analysis_json('stockId', list_a)
......
......@@ -97,7 +97,7 @@ def second_dept_Request(hosGoodsId, type):
goodsCode, unit, purMode, goodsMfrsName, unitName, price, deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName)
elif type==3:
elif type == 3:
request_body = commonFuc().get_business_data(module, "payload42", hosGoodsId, goodsName, goodsSpec,
mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, pkgDefId, unitName, price,
......@@ -111,19 +111,171 @@ def second_dept_Request(hosGoodsId, type):
# 添加到请领车=============================================
def BuyCarSubmit():
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等信息,使用创建的用户登录============结束
# 我要请领_手工请领_列表查询===========================
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# 请领车查询===============================================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_buy_queryBuyCarPage_url")
print('请领车查询=================', url)
deptid2 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
deptname2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
areaCode = get_stockAreaId_new(deptid2, deptname2, 2)
request_body = commonFuc().get_business_data(module, "payload43", areaCode, get_hosid(), deptid2)
print('请领车查询', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('请领车查询,result', result)
data = commonFuc().analysis_json('data', result)
list_id = []
for i in data:
id = commonFuc().analysis_json('id', i)
list_id.append(id)
# 请领车查询===============================================
# 请领车提交===============================================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_buy_validBuyCarSubmit_url")
print('请领车提交=================', url)
billExpdtDate = timeUtils().get_time_add(30, 2)
print('billExpdtDate', billExpdtDate)
request_body = commonFuc().get_business_data(module, "payload44", billExpdtDate, get_branch_id(), list_id[0],
list_id[1], list_id[2])
print('请领车提交', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('请领车提交,result', result)
# 请领车提交===============================================
# 创建领车交易=================================================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_buy_createBuyBill_url")
print('创建领车交易=================', url)
billExpdtDate = timeUtils().get_time_add(30, 2)
request_body = commonFuc().get_business_data(module, "payload44", billExpdtDate, get_branch_id(), list_id[0],
list_id[1], list_id[2])
print('创建领车交易', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('创建领车交易,result', result)
currentTaskList = commonFuc().analysis_json('currentTaskList', commonFuc().analysis_json('data', result))
# 创建领车交易=================================================
# 一键审批=================================================
# url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
# "herpService_approvalBatch_url")
# print('一键审批=================', url)
#
# request_body = commonFuc().get_business_data(module, "payload45", currentTaskList)
#
# print('一键审批', 'request_body', request_body)
# result = commonFuc().http_post(url, request_body, headers)
# print('一键审批,result', result)
# 一键审批=================================================
def centeStock_pick():
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等信息,使用创建的用户登录============结束
# 我要请领_手工请领_列表查询===========================
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# 生成拣货单列表查询===============================================
url1 = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_BuyPick_buyPage_url")
print('生成拣货单列表查询=================', url1)
request_body1 = commonFuc().get_business_data(module, "payload46")
print('生成拣货单列表查询', 'request_body', request_body1)
result1 = commonFuc().http_post(url1, request_body1, headers)
print('生成拣货单列表查询,result1', result1)
total1=commonFuc().analysis_json('total',commonFuc().analysis_json('data',result1))
Bh_id=commonFuc().analysis_json('id',commonFuc().analysis_json('data',commonFuc().analysis_json('data',result1)))
# 生成拣货单列表查询===============================================
#生成拣货单===============================================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_BuyPick_savePick_url")
print('生成拣货单=================', url)
request_body = commonFuc().get_business_data(module, "payload47",Bh_id)
print('生成拣货单', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('生成拣货单,result', result)
while True:
result = commonFuc().http_post(url, request_body, headers)
remark=commonFuc().analysis_json('remark',commonFuc().analysis_json('data',result))
time.sleep(3)
if remark==None:
break
#生成拣货单===============================================
while True:
result1 = commonFuc().http_post(url1, request_body1, headers)
total2 = commonFuc().analysis_json('total', commonFuc().analysis_json('data', result1))
if total1-total2==1:
print('==================生成拣货单完成============================')
break
def get_centeStock_pick_list_counts():
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等信息,使用创建的用户登录============结束
# 生成拣货单列表查询===============================================
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
url1 = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_BuyPick_buyPage_url")
print('生成拣货单列表查询=================', url1)
request_body1 = commonFuc().get_business_data(module, "payload46")
print('生成拣货单列表查询', 'request_body', request_body1)
result1 = commonFuc().http_post(url1, request_body1, headers)
print('生成拣货单列表查询,result1', result1)
total1 = commonFuc().analysis_json('total', commonFuc().analysis_json('data', result1))
return total1
try:
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
#二级库区信息写入文件
get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'],2)
# 二级库区信息写入文件
get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],
FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'], 2)
# get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid3'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid3'],3)
# 设置库区联系人
set_stockShelf_Linkman()
# 低值
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
# 高值
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'],2)
#试剂
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'],3)
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'], 2)
# 试剂
second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
BuyCarSubmit() # 请领车提交
for i in range(6): # 三个单据共审批6次
approval_center()
updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) #设置登录账号默认权限是中心库
#获取拣货单列表个数
for i in range(get_centeStock_pick_list_counts()):
centeStock_pick()#中心库拣货
commonFuc().check_text_exist_result_text('succees', 'succees')
except:
......
企业信息:
e_id: CR202405140038
cname: 国药集团公司blW&H
e_id: CR202405150038
cname: 国药集团公司f2x6H
医院信息:
h_id: 湖南省人民医院Pq)@k
h_name: 湖南省人民医院Pq)@k
h_id: 湖南省人民医院OEtAe
h_name: 湖南省人民医院OEtAe
产品审核信息:
MSPid: MSP2405140011_1
MSPid: MSP2405150011_1
hosId: h0347
hosGoodsId: h034700003553
provGoodsid: provGood-99220676
goodsAuditBillId: MSP2405140011
targetId: MSP2405140011_1
hosGoodsId: h034700003594
provGoodsid: provGood-99220717
goodsAuditBillId: MSP2405150011
targetId: MSP2405150011_1
院区新增:
branch_id: h0347-3596
branch_name: 东土城路院区y4sex
branch_id: h0347-3598
branch_name: 东土城路院区kBHT$
科室信息:
dept2_id: d66483c489de46ada9e882a1c9066ca7
dept2_id: 99b554c1ec7646c2a15e14895c6aa355
dept2_name: 二级检验科002
......@@ -41,6 +41,13 @@
"herpService_out_return_confirm_url": "/api/herpService/stock/out/return/gt/confirm"
"herpService_buy_queryGoodsInfoPage_url": "/api/herpService/buy/queryGoodsInfoPage"
"herpService_buy_createBuyCar_url": "/api/herpService/buy/createBuyCar"
"herpService_buy_queryBuyCarPage_url": "/api/herpService/buy/queryBuyCarPage"
"herpService_buy_validBuyCarSubmit_url": "/api/herpService/buy/validBuyCarSubmit"
"herpService_buy_createBuyBill_url": "/api/herpService/buy/createBuyBill"
"herpService_approvalBatch_url": "/api/herpService/apprCenter/approvalBatch"
"herpService_BuyPick_buyPage_url": "/api/herpService/BuyPick/buyPage"
"herpService_BuyPick_savePick_url": "/api/herpService/BuyPick/savePick"
"username": "xhs1009"
"password": "1qaz!QAZ"
......@@ -99,4 +106,8 @@ json_headers2: {
"payload40": {"id":null,"hosGoodsId":"%s","goodsName":"%s","goodsSpec":"%s","mdmGoodsCode":"%s","goodsCode":"%s","unit":"%s","purMode":"%s","goodsMfrsName":"%s","miDjmc":"","miCode":"","pkgDefName":"100","pkgDefQty":100,"pkgQty":null,"qty":0,"goodsImg":[],"pkgDefId":"%s","buyPkgQty":1,"unitName":"%s","price":"%s","hosId":null,"branchId":null,"deptId":"%s","deptName":null,"areaCode":"%s","areaName":"%s","targetDeptId":"%s","targetDeptName":"%s","targetStockId":"%s","targetStockName":"%s","purchaseFlag":1,"tempFlag":0,"grantWay":1,"deptGoodsStatus":null,"codingType":null,"purModeText":"%s","goodsGeneralName":"%s","provName":"%s","noRecPkgQty":0,"noRecQty":0,"buyQty":100}
"payload41": {"id":null,"hosGoodsId":"%s","goodsName":"%s","goodsSpec":"%s","mdmGoodsCode":"%s","goodsCode":"%s","unit":"%s","purMode":"%s","goodsMfrsName":"%s","miDjmc":"","miCode":"","pkgDefName":null,"pkgDefQty":1,"pkgQty":null,"qty":0,"goodsImg":[],"pkgDefId":null,"buyPkgQty":1,"unitName":"%s","price":"%s","hosId":null,"branchId":null,"deptId":"%s","deptName":null,"areaCode":"%s","areaName":"%s","targetDeptId":"%s","targetDeptName":"%s","targetStockId":"%s","targetStockName":"%s","purchaseFlag":1,"tempFlag":0,"grantWay":1,"deptGoodsStatus":null,"codingType":0,"purModeText":"%s","goodsGeneralName":"%s","provName":"%s","noRecPkgQty":0,"noRecQty":0,"buyQty":1}
"payload42": {"id":null,"hosGoodsId":"%s","goodsName":"%s","goodsSpec":"%s","mdmGoodsCode":"%s","goodsCode":"%s","unit":"%s","purMode":"%s","goodsMfrsName":"%s","miDjmc":"","miCode":"","pkgDefName":"100","pkgDefQty":100,"pkgQty":null,"qty":0,"goodsImg":[],"pkgDefId":"%s","buyPkgQty":1,"unitName":"%s","price":"%s","hosId":null,"branchId":null,"deptId":"%s","deptName":null,"areaCode":"%s","areaName":"%s","targetDeptId":"%s","targetDeptName":"%s","targetStockId":"%s","targetStockName":"%s","purchaseFlag":1,"tempFlag":0,"grantWay":1,"deptGoodsStatus":null,"codingType":null,"purModeText":"%s","goodsGeneralName":"%s","provName":"%s","noRecPkgQty":0,"noRecQty":0,"buyQty":100}
"payload43": {"areaCode":"%s","goodsName":"","goodsSpec":"","purModes":[],"hosId":"%s","deptId":"%s"}
"payload44": {"billExpdtDate":"%s","billExpectDate":"","priority":"0","remark":"","branchId":"%s","buyCarIds":["%s","%s","%s"]}
"payload45": {"dtos":"%s","opinion":1}
"payload46": {"pageNum":1,"pageSize":50,"queryObject":{"deptId":"","auditStartTime":null,"auditEndTime":null,"startBillExpectDate":null,"endBillExpectDate":null,"priorityList":[],"orderNo":"","keyword":"","goodsSpec":"","shelfName":"","address":""}}
"payload47": {"generateAll":false,"ids":["%s"]}
\ No newline at end of file
......@@ -56,7 +56,7 @@
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分25</td>
<td class='details-col-elapsed'>1分33</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
</table>
......@@ -74,7 +74,7 @@
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_b2流程九请领业务流_二级库向中心库/log.html' target='_blank'>a_b2流程九请领业务流_二级库向中心库</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">25.22</td>
<td class="details-col-elapsed">93.751</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