Commit 0c76f1a8 authored by 肖 和生's avatar 肖 和生
Browse files

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

# Conflicts:
#	data/b5_spd3_core_business_flow/message
#	data/b5_spd3_core_business_flow/message1
#	data/b5_spd3_core_business_flow/message2
parents e1f6b4a1 6a7ec89d
......@@ -163,7 +163,8 @@ def BuyCarSubmit():
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)
# areaCode = get_stockAreaId_new(deptid2, deptname2, 2)
areaCode = get_stockAreaId_new_fromDb(deptname2, 2)
request_body = commonFuc().get_business_data(module, "payload43", areaCode, get_hosid(), deptid2)
print('请领车查询', 'request_body', request_body)
......
......@@ -194,7 +194,8 @@ def BuyCarSubmit():
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)
# areaCode = get_stockAreaId_new(deptid2, deptname2, 2)
areaCode = get_stockAreaId_new_fromDb(deptname2, 2)
request_body = commonFuc().get_business_data(module, "payload43", areaCode, get_hosid(), deptid2)
print('请领车查询', 'request_body', request_body)
......
......@@ -5,7 +5,7 @@ import traceback
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from air_case.public1.public1.public1 import *
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_tools import process_tuple, get_id
from common.db.sql.sql_tools import process_tuple, get_id, get_last_auditor
from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command
......@@ -102,7 +102,8 @@ def second_dept_Request(hosGoodsId, type):
# hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '')
# areaCode = get_stockAreaId_new(deptid2, deptname2, 2)
areaCode =process_tuple(get_id("select shelf_code from mcms_stock_shelf where address='二级检验科002'and shelf_name='默认库区'order by create_time desc LIMIT 1;"))
areaCode = process_tuple(get_id(
"select shelf_code from mcms_stock_shelf where address='二级检验科002'and shelf_name='默认库区'order by create_time desc LIMIT 1;"))
request_body = commonFuc().get_business_data(module, "payload39", GoodsId, get_hosid(), deptid2, areaCode)
print('我要请领_手工请领_列表查询', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
......@@ -128,7 +129,7 @@ def second_dept_Request(hosGoodsId, type):
goodsGeneralName = commonFuc().analysis_json('goodsGeneralName', data1)
provName = commonFuc().analysis_json('provName', data1)
pkgDefId = commonFuc().analysis_json('pkgDefId', data1)
pkgDefName= commonFuc().analysis_json('pkgDefName', data1)
pkgDefName = commonFuc().analysis_json('pkgDefName', data1)
# 信息写入文件
list_a = []
list_b = []
......@@ -194,7 +195,7 @@ def BuyCarSubmit():
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)
areaCode = get_stockAreaId_new_fromDb(deptname2, 2)
request_body = commonFuc().get_business_data(module, "payload43", areaCode, get_hosid(), deptid2)
print('请领车查询', 'request_body', request_body)
......@@ -771,7 +772,7 @@ def check_accept_order(type=1):
print('result', result2)
data = commonFuc().analysis_json('data', result2)
code = commonFuc().analysis_json('code', result2)
msg= commonFuc().analysis_json('msg', result2)
msg = commonFuc().analysis_json('msg', result2)
print(code)
if code == 0 and len(data) >= 1:
break
......@@ -822,12 +823,11 @@ def check_accept_order(type=1):
time.sleep(6)
continue
info = (CHECK_NO, CHECK_NO)
titlename = ('CHECK_NO1', 'CHECK_NO2')
FileUtils().w_info8(info, 'b5_spd3_core_business_flow', '验收单号', titlename, 'message15')
def main():
try:
# add_dept2() # 新增一个二级科室
......@@ -842,21 +842,38 @@ def main():
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
for i in range(6):
# # 低值
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", "产品审核信息", '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", "产品审核信息", '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", "产品审核信息", 'message3')['hosGoodsId'],
3)
BuyCarSubmit() # 请领车提交
for i in range(6): # 三个单据共审批6次
approval_center()
# 采购模块处理
purchase_module_process()
# 三个单据共审批3次
approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号试剂', 'message12'))
approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号', 'message7'))
approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号高值', 'message11'))
# 三个单据共审批3次
while True:
try:
approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号试剂', 'message12'))
approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号', 'message7'))
approval_center(FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号高值', 'message11'))
except:
print('审批流程可能被修改,等待手工审批')
if get_last_auditor(
FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号试剂', 'message12')) \
and get_last_auditor(
FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号试剂', 'message7'))\
and get_last_auditor(
FileUtils().r_info8('b5_spd3_core_business_flow', '采购计划单号试剂', 'message11'))!= None:
break
else:
continue
else:
break
order_dp(1) # 1低值
order_dp(2) # 2高值
order_dp(3) # 3试剂
......@@ -870,4 +887,4 @@ def main():
print('==========================流程十一结束==============================')
except:
commonFuc().check_text_exist_result_text('error', '1')
main()
\ No newline at end of file
# main()
......@@ -118,7 +118,10 @@ def approval_center(OBH_ID='OBhxxxxxxxxxxxxxxx'):
data1 = commonFuc().analysis_json('data', data)
commonFuc().check_text_exist(0, result)
taskId = commonFuc().analysis_json('taskId', data1[0])
if total>0:
taskId = commonFuc().analysis_json('taskId', data1[0])
else:
return
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "approvalBatch_url")
......@@ -652,6 +655,7 @@ def get_udi1(type=1): # 库存明细查询获取条码
result = commonFuc().http_post(url, request_body, headers)
data1 = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))
total = commonFuc().analysis_json('total', commonFuc().analysis_json('data', result))
if total >= 1:
# pkgcode = data1['pkgCodeSee']
# pkgcode1 = pkgcode[0:20]
......
......@@ -471,5 +471,18 @@ def process_date(str1):
#
print(date) # 输出: 2023-03-14
return date
def get_last_auditor(order_no):
db, cursor = get_sql_conn()
cursor.execute("select last_auditor from mcms_pur_plan where order_no='%s';"%order_no)
results = cursor.fetchone()
str1 = str(results)
new_str1 = str1.replace(',)', '')
new_str1 = new_str1.replace('(', '')
new_str1 = new_str1.replace(',', '')
new_str1 = new_str1.replace("'", '')
# print(new_str1)
cursor.close()
return new_str1
# hos_goods_id = 'h034700004220'
# main2(hos_goods_id)
\ No newline at end of file
......@@ -8,28 +8,29 @@
taskType: 1
sourceOrgId: p1e37e
sourceOrgName: 国药集团公司sya!$
sourceOrderNo: PSh0347202408020011
billMode: '25'
sourceOrderNo: PSh0347202408020021
billMode: '66'
stockKind:
purMode:
sourceId: PSh0347202408020011
sourceId: PSh0347202408020021
sourceDetailId:
sourceType: PSD
sourceTypeName: 配送单
sourceVersion: 1
planOrderNo: SSSQ202408020369
purOrderNo: SSTZ202408020347
planOrderNo: PLAN2024080234264
purOrderNo: CG2024080222473
recOrgId: ea59fe790acd41719499e7278b8bb50b
recOrgName: 二级检验科002
billRelationJson: '{"operationApplyOrderNo":"SSSQ202408020369","operationNoticeBillId":"Nh034720240802000002","distrBillId":"PSh0347202408020011","operationNoticeOrderNo":"SSTZ202408020347","distrOrderNo":"PSh0347202408020011","operationApplyBillId":"Oh034720240802000002"}'
taskDate: '2024-08-02 14:09:04'
billRelationJson: '{"buyBillId":"Bh03472024080200034","planBillId":"Ph034720240802030909","planOrderNo":"PLAN2024080234264","buyOrderNo":"BUY2024080210275","purOrderNo":"CG2024080222473","purBillId":"Ch034720240802000049","purBillDate":"2024-08-02
15:54:23","distrBillId":"PSh0347202408020021","distrOrderNo":"PSh0347202408020021"}'
taskDate: '2024-08-02 15:55:08'
taskDateStart:
taskDateEnd:
billModeList:
viewIdList:
supplierFlag: false
supplierFlag: true
tbStatus: 20
remark:
remark: ''
pdaFlag:
list_b:
- *id001
......
验收单号:
CHECK_NO1: CHECKh03472024080200010
CHECK_NO2: CHECKh03472024080200010
CHECK_NO1: CHECKh03472024080200021
CHECK_NO2: CHECKh03472024080200021
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