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

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

# Conflicts:
#	air_case/b5_spd3_core_business_flow/a_a2_流程二供货关系申请提交审批.air/a_a2_流程二供货关系申请提交审批.py
parents d5b1e889 481b1458
......@@ -570,7 +570,6 @@ def main():
# ===============上面调通了================================
commonFuc().check_text_exist_result_text('succees', 'succees')
print('================流程十六执行完毕===================')
except:
commonFuc().check_text_exist_result_text('error', '1')
main()
\ No newline at end of file
......@@ -4,6 +4,9 @@ import traceback
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from air_case.public1.public1.public1 import *
from common.db.sql.sql_tools import get_create_time, check_mcms_dept_buy_car_sql, get_mdm_goods_code1, get_dept_buy_id, \
check_mcms_dept_buy_sql, get_mdm_goods_code, get_expdt_date, get_buyBillId, get_goods_code1, get_pkg_def_id, \
get_login_user_uxid_bydb, get_buyOrderNo
from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command
......@@ -21,413 +24,494 @@ python runner_test.py tag id2303-12 debug mdm3
如果二级库请领了,在中心库生成拣货单无法成功,原因是中心库没库存了
脚本存在上下游的关系,下面的业务会修改出库渠道,如果调试脚本,注意这个因素的影响
"""
def second_dept_Request(hosGoodsId, type):
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_queryGoodsInfoPage_url")
print('我要请领_手工请领_列表查询=================', url)
def check_mcms_dept_buy_car(type=1):
hos_goods_id = 'hos_goods_id'
if type == 1:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
elif type == 3:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
branch_id = get_branch_id()
# 获取create_time的值
create_time = get_create_time(
"select create_time from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s'order by create_time desc LIMIT 1;" % (
branch_id, hos_goods_id))
print('create_time', create_time)
id = get_id(
"select id from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
branch_id, hos_goods_id))
print('id', id)
create_user = get_id(
"select create_user from mcms_dept_buy_car where branch_id='%s'and hos_goods_id='%s' order by create_time desc LIMIT 1;;" % (
branch_id, hos_goods_id))
print('create_time', create_time, 'id', id)
sql = """select * from mcms_dept_buy_car where branch_id='%s' and hos_goods_id='%s' order by create_time desc LIMIT 1;
""" % (branch_id, hos_goods_id)
# 要验证的sql,取自数据库的表中
actual_value1 = check_mcms_dept_buy_car_sql(sql)
print(actual_value1)
deptid2 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
deptname2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
# 高值
# hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '')
areaCode = get_stockAreaId_new(deptid2, deptname2, 2)
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)
print('我要请领_手工请领_列表查询,result', result)
data1 = commonFuc().analysis_json('data', commonFuc().analysis_json('data', result))
goodsName = commonFuc().analysis_json('goodsName', data1)
goodsSpec = commonFuc().analysis_json('goodsSpec', data1)
mdmGoodsCode = commonFuc().analysis_json('mdmGoodsCode', data1)
goodsCode = commonFuc().analysis_json('goodsCode', data1)
unit = commonFuc().analysis_json('unit', data1)
purMode = commonFuc().analysis_json('purMode', data1)
goodsMfrsName = commonFuc().analysis_json('goodsMfrsName', data1)
unitName = commonFuc().analysis_json('unitName', data1)
price = commonFuc().analysis_json('price', data1)
deptId = commonFuc().analysis_json('deptId', data1)
# areaCode=commonFuc().analysis_json('areaCode',data1)
areaCode = get_stockAreaId_new_fromDb(deptname2, 2)
areaName = '默认库区'
targetDeptId = commonFuc().analysis_json('targetDeptId', data1)
targetDeptName = commonFuc().analysis_json('targetDeptName', data1)
targetStockId = commonFuc().analysis_json('targetStockId', data1)
targetStockName = commonFuc().analysis_json('targetStockName', data1)
purModeText = commonFuc().analysis_json('purModeText', data1)
goodsGeneralName = commonFuc().analysis_json('goodsGeneralName', data1)
provName = commonFuc().analysis_json('provName', data1)
pkgDefId = commonFuc().analysis_json('pkgDefId', data1)
# 信息写入文件
list_a = []
list_b = []
list_c = []
list_a.append(data1)
list_b.append(data1)
list_c.append(data1)
# print('list_a', len(list_a), list_a)
info = (list_a, list_b, list_c)
titlename = ('list_a', 'list_b', 'list_c')
FileUtils().w_info8(info, module, '二级库请领产品信息', titlename, 'message21')
# 我要请领_手工请领_列表查询===========================
# 添加到请领车=============================================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_buy_createBuyCar_url")
print('添加到请领车=================', url)
if type == 1:
request_body = commonFuc().get_business_data(module, "payload40", hosGoodsId, goodsName, goodsSpec,
mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, pkgDefId, unitName, price,
deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName)
# 读取文件中的信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
list_a = info['list_a']
mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
pur_mode = commonFuc().analysis_json('purMode', list_a)
goodsCode = commonFuc().analysis_json('goodsCode', list_a)
pkgDefId = commonFuc().analysis_json('pkgDefId', list_a)
pkgDefName = commonFuc().analysis_json('pkgDefName', list_a)
last_modified_user = create_user
last_modified = create_time
# print('actual_value1',actual_value1)
actual_value2 = get_process_list2(actual_value1)
# print('actual_value2')
# print( actual_value2)
# prov_hos_goods_id = '8d6273b7bca84dd8aace12b9422d7fd6'
expected_value2 = 'expected_value2'
if type == 1 or type == 3:
expected_value2 = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_dept_buy_car_low_value', id, get_hosid(), branch_id,
deptid2,
deptname2, areaCode, areaName, hos_goods_id, mdm_goods_code,
goodsCode, pur_mode, pkgDefId, pkgDefName
, create_user, create_time, last_modified, last_modified_user)
elif type == 2:
request_body = commonFuc().get_business_data(module, "payload41", hosGoodsId, goodsName, goodsSpec,
mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, unitName, price, deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName)
elif type == 3:
request_body = commonFuc().get_business_data(module, "payload42", hosGoodsId, goodsName, goodsSpec,
mdmGoodsCode,
goodsCode, unit, purMode, goodsMfrsName, pkgDefId, unitName, price,
deptId,
areaCode, areaName, targetDeptId, targetDeptName, targetStockId,
targetStockName, purModeText, goodsGeneralName, provName)
request_body = get_process_list(request_body)
print('添加到请领车', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('添加到请领车,result', result)
# 添加到请领车=============================================
expected_value2 = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'check_mcms_dept_buy_car_high_value', id, get_hosid(),
branch_id,
deptid2,
deptname2, areaCode, areaName, hos_goods_id, mdm_goods_code,
goodsCode, pur_mode,
create_user, create_time, last_modified, last_modified_user)
# print('expected_value2', expected_value2)
# expected_value2=get_process_list2(expected_value2)
actual_value2 = actual_value2.replace(" ", "")
expected_value2 = expected_value2.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
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)
# 检查二级库请领单审批前的主表数据
def check_mcms_dept_buy(type=16):
branch_id = get_branch_id()
sql = """select * from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;
""" % (branch_id, type)
actual = check_mcms_dept_buy_sql(sql)
print(actual)
# 获取主键id
sql = "select id from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
id1 = get_dept_buy_id(sql)
# 获取order_no
sql1 = "select order_no from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
order_no1 = get_dept_buy_id(sql1)
print(process_tuple(id1), process_tuple(order_no1))
id1 = process_tuple(id1)
order_no1 = process_tuple(order_no1)
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)
target_stock_name = get_branch_name() + "中心库房"
# target_dept_id=FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
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)
# area_code = get_stockAreaId_new(deptid2, deptname2, 2)
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a']
area_code = get_stockAreaId_new_fromDb(deptname2, 2)
area_name = '默认库区'
# 读取文件中的信息
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
list_a = info['list_a']
target_dept_id = commonFuc().analysis_json('targetDeptId', list_a)
target_dept_name = commonFuc().analysis_json('targetDeptName', list_a)
pur_mode = commonFuc().analysis_json('purMode', list_a)
goodsCode = commonFuc().analysis_json('goodsCode', list_a)
pkgDefId = commonFuc().analysis_json('pkgDefId', list_a)
pkgDefName = commonFuc().analysis_json('pkgDefName', list_a)
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])
bill_expdt_date = get_expdt_date(
"select bill_expdt_date from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
rec_user = get_login_user_uxid()
# rec_addr='二级检验科002'
create_user = rec_user
create_time = get_create_time(
"select create_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
last_modified = get_create_time(
"select last_modified from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
last_modified_user = rec_user
last_auditor = rec_user
last_audit_time = get_create_time(
"select last_audit_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
rec_addr = deptname2
dept_id1 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
stock_name = get_branch_name() + "中心库房"
target_stock_id = get_stockId_fromdb(stock_name)
if type == 16:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_dept_buy1', id1, order_no1, get_hosid(), branch_id,
deptid2,
deptname2, area_code, area_name, target_dept_id, target_dept_name,
target_stock_id, target_stock_name, bill_expdt_date, rec_user,
rec_addr, create_user, create_time,
last_modified, last_modified_user)
elif type == 20:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_dept_buy2', id1, order_no1, get_hosid(),
branch_id, deptid2,
deptname2, area_code, area_name, target_dept_id, target_dept_name,
target_stock_id, target_stock_name, bill_expdt_date, rec_user,
rec_addr, create_user, create_time,
last_modified, last_modified_user)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_dept_buy3', id1, order_no1, get_hosid(),
branch_id, deptid2,
deptname2, area_code, area_name, target_dept_id, target_dept_name,
target_stock_id, target_stock_name, bill_expdt_date, rec_user,
rec_addr, create_user, create_time,
last_modified, last_modified_user)
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)
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
print(compare_text_index(actual_value2, expected_value2))
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
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")
# 检查二级库请领单审批前的子表数据
def mcms_dept_buy_detail(type=16):
branch_id = get_branch_id()
# 获取主表主键
sql = "select id from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
id1 = process_tuple(get_dept_buy_id(sql))
# 获取order_no
sql1 = "select order_no from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
order_no1 = get_dept_buy_id(sql1)
order_no1 = process_tuple(order_no1)
# 子表sql
sql1 = "select * from mcms_dept_buy_detail where pid='%s';" % id1
# 从数据库中获取实际值
actual = check_mcms_dept_buy_sql(sql1)
print('actual', actual)
if type == 16:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 20:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
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(hos_goods_id,process_tuple(hos_goods_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)
print('remark',remark)
if remark==None:
break
#生成拣货单===============================================
while True:
result1 = commonFuc().http_post(url1, request_body1, headers)
# import pdb
# pdb.set_trace()
print('result1',result1)
total2 = commonFuc().analysis_json('total', commonFuc().analysis_json('data', result1))
print('total2', total2,'total1',total1)
if total1-total2==1:
print('==================生成拣货单完成============================')
break
# 获取子表id
detail_id = get_id("select id from mcms_dept_buy_detail where pid='%s';" % id1)
print('detail_id', detail_id)
info = FileUtils().r_info8('b5_spd3_core_business_flow', "二级库请领产品信息", 'message21')
list_a = info['list_a']
mdm_goods_code = process_tuple(
get_mdm_goods_code("select mdm_goods_code from mcms_goods_info where id='%s';" % hos_goods_id))
goods_code = process_tuple(
get_mdm_goods_code("select hos_goods_code from mcms_goods_info where id='%s';" % hos_goods_id))
pkg_def_id = process_tuple(
get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id))
if pkg_def_id == 'None':
print(pkg_def_id)
pkg_def_id = pkg_def_id.replace("'", "")
print(pkg_def_id)
pkg_def_name = process_tuple(
get_id("select pkg_def_name from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id))
create_user = get_login_user_uxid()
create_time = get_create_time("select create_time from mcms_dept_buy_detail where pid='%s';" % id1)
last_modified = create_time
last_modified_user = create_user
if type == 16:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_dept_buy_detail', detail_id, id1, order_no1, hos_goods_id,
mdm_goods_code, goods_code, pkg_def_id, pkg_def_name, create_user,
create_time, last_modified, last_modified_user)
elif type == 20:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_dept_buy_detail1', detail_id, id1, order_no1, hos_goods_id,
mdm_goods_code, goods_code, pkg_def_id, pkg_def_name, create_user,
create_time, last_modified, last_modified_user)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_dept_buy_detail2', detail_id, id1, order_no1, hos_goods_id,
mdm_goods_code, goods_code, pkg_def_id, pkg_def_name, create_user,
create_time, last_modified, last_modified_user)
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")
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
result = (compare_text_index(actual_value2, expected_value2))
print('result', result)
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
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
def pick_execute(GoodsId,type=1):
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_pickPage_url")
print('拣货执行列表页面=================', url1)
request_body1 = commonFuc().get_business_data(module, "payload48",GoodsId)
def check_mcms_pick_detail(pid,type,order_no):
branch_id = get_branch_id()
print('拣货单子表检查')
sql = " select * from mcms_pick_detail where pid='%s';" % (
pid)
actual = check_mcms_dept_buy_sql(sql)
print(actual)
id=get_id("select id from mcms_pick_detail where pid='%s';" % ( pid))
source_id=get_buyBillId(branch_id,type)
if type == 16:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 20:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
mdm_goods_code=get_mdm_goods_code1(hos_goods_id)
goods_code=get_goods_code1(hos_goods_id)
pkg_def_id=get_pkg_def_id(hos_goods_id)
picker_name=None
picker=None
create_user=get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time=get_create_time("select create_time from mcms_pick_detail where pid='%s';" % (pid))
last_modified=get_create_time("select last_modified from mcms_pick_detail where pid='%s';" % (pid))
last_modified_user=None
if type == 16:
print('拣货执行列表页面', 'request_body', request_body1)
result1 = commonFuc().http_post(url1, request_body1, headers)
print('拣货执行列表页面,result1', result1)
#获取id
PICK_ID=commonFuc().analysis_json('id',commonFuc().analysis_json('data',commonFuc().analysis_json('data',result1)))
version=commonFuc().analysis_json('version',commonFuc().analysis_json('data',commonFuc().analysis_json('data',result1)))
# 生成拣货单列表查询===============================================
# 生成拣货单列表锁定===============================================
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick_center_detail1', id,pid,order_no,source_id,hos_goods_id
,mdm_goods_code,goods_code,pkg_def_id,picker,picker_name,
create_user,create_time,last_modified,last_modified_user
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_BuyPick_updateLock_url")
print('生成拣货单列表锁定=================', url)
# version=int(version)+1
request_body = commonFuc().get_business_data(module, "payload49", PICK_ID,version)
)
elif type == 20:
pkg_def_id=None
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick_center_detail2', id,pid,order_no,source_id,hos_goods_id
,mdm_goods_code,goods_code,pkg_def_id,picker,picker_name,
create_user,create_time,last_modified,last_modified_user
print('生成拣货单列表锁定', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('生成拣货单列表锁定,result1', result)
# 生成拣货单列表锁定===============================================
#拣货==============================
if type==1:
udi_code=get_udi1(1) #获取条码 低值1 高值2 试剂3
elif type==2:
udi_code = get_udi1(2) # 获取条码 低值1 高值2 试剂3
elif type==3:
udi_code = get_udi1(3) # 获取条码 低值1 高值2 试剂3
)
else:
udi_code='udi_code'
print('udi_code',udi_code)
pickScan(PICK_ID,udi_code,type)
#提交拣货执行单
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_BuyPick_updateStatus_url")
url=url+PICK_ID
print('提交拣货执行单=================', url)
request_body = commonFuc().get_business_data(module, "payload51",PICK_ID)
print('提交拣货执行单', 'request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('提交拣货执行单,result1', result)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick_center_detail3', id,pid,order_no,source_id,hos_goods_id
,mdm_goods_code,goods_code,pkg_def_id,picker,picker_name,
create_user,create_time,last_modified,last_modified_user
#拣货===================================
#复核===================================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_hdiBarcode_scan_url")
url = url + udi_code
print('复核=================', url)
result = commonFuc().http_get(url, headers)
print('复核,result1', result)
result = commonFuc().http_get(url, headers)
print('扫码复核result', result)
data = commonFuc().analysis_json('data', result)
UT_id = commonFuc().analysis_json('id', data)
createTime = commonFuc().analysis_json('createTime', data)
snCode = commonFuc().analysis_json('snCode', data)
tagType = commonFuc().analysis_json('tagType', data)
goodsDi = commonFuc().analysis_json('goodsDi', data)
hosId= commonFuc().analysis_json('hosId', data)
stockId= commonFuc().analysis_json('stockId', data)
areaCode= commonFuc().analysis_json('areaCode', data)
areaName= commonFuc().analysis_json('areaName', data)
shelfCode= commonFuc().analysis_json('shelfCode', data)
codeType= commonFuc().analysis_json('codeType', data)
mdmGoodsCode= commonFuc().analysis_json('mdmGoodsCode', data)
goodsCode= commonFuc().analysis_json('goodsCode', data)
barName= commonFuc().analysis_json('barName', data)
batchCode= commonFuc().analysis_json('batchCode', data)
expdtDate= commonFuc().analysis_json('expdtDate', data)
productDate= commonFuc().analysis_json('productDate', data)
pkgCode= commonFuc().analysis_json('pkgCode', data)
pkgCodeSee= commonFuc().analysis_json('pkgCodeSee', data)
ssccCode= commonFuc().analysis_json('ssccCode', data)
tbStatus= commonFuc().analysis_json('tbStatus', data)
purMode= commonFuc().analysis_json('purMode', data)
goodsMfrsName= commonFuc().analysis_json('goodsMfrsName', data)
goodsSpec= commonFuc().analysis_json('goodsSpec', data)
unit= commonFuc().analysis_json('unit', data)
goodsName= commonFuc().analysis_json('goodsName', data)
made= commonFuc().analysis_json('made', data)
hosGoodsCode= commonFuc().analysis_json('hosGoodsCode', data)
distrBillId = commonFuc().analysis_json('distrBillId', commonFuc().analysis_json('ext', data))
purBillId = commonFuc().analysis_json('purBillId', commonFuc().analysis_json('ext', data))
distrDetailId = commonFuc().analysis_json('distrDetailId', commonFuc().analysis_json('ext', data))
pkgDefId = commonFuc().analysis_json('pkgDefId', commonFuc().analysis_json('ext', data))
pkgDefQty = commonFuc().analysis_json('pkgDefQty', commonFuc().analysis_json('ext', data))
pkgDefName =commonFuc().analysis_json('pkgDefName', commonFuc().analysis_json('ext', data))
print(UT_id)
# ========================扫码复核
# ========出库复核提交==========
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_review_pass_submit_url")
)
print('url', url)
# sourceId = ' '.join(PICK_ID)
sourceId = PICK_ID
# 请求体
request_body = commonFuc().get_business_data(module, "payload52", UT_id, createTime, snCode, hosId, stockId,
areaCode, areaName, shelfCode, codeType, tagType, hosGoodsId,
mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate,
productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus, distrDetailId,
distrBillId, purBillId, pkgDefQty, pkgDefId, pkgDefName, purMode,
goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty,
pkgDefName, made, hosGoodsCode, sourceId)
print('request_body', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('herpService_stock_review_pass_submit_urlresult', result)
#复核===================================
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')['deptid3'],FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid3'],3)
# 设置库区联系人
set_stockShelf_Linkman()
# 低值
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
print(compare_text_index(actual_value2, expected_value2))
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_pick(type=16):
branch_id = get_branch_id()
print('拣货单验证')
sql = " select * from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type)
actual = check_mcms_dept_buy_sql(sql)
print(actual)
id = get_id(
"select id from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type))
order_no = get_id(
"select order_no from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type))
source_id = get_buyBillId(branch_id, type)
dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_id = get_stockId_fromdb(get_branch_name() + '中心库房')
area_code = get_stockAreaId_new_fromDb(dept_name, 1)
target_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2']
target_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
target_stock_id = get_stockId_fromdb(target_dept_name + '库房')
target_area_code = get_stockAreaId_new_fromDb(target_dept_name, 2)
username = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
reviewer = None
review_date = None
buyBillId = get_buyBillId(branch_id, type)
pickOrderNo = order_no
buyOrderNo = get_buyOrderNo(branch_id, type)
pickBillId = id
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_expdt_date(
"select create_time from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type))
last_modified = get_expdt_date(
"select last_modified from mcms_pick where branch_id='%s' and bill_mode='%s' order by CREATE_TIME desc LIMIT 1;" % (
branch_id, type))
last_modified_user=create_user
picker = None
picker_name = None
if type == 16:
#检查拣货单子表
check_mcms_pick_detail(id,type,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick_center1', id, get_hosid(), get_branch_id(), order_no, source_id,
dept_id,
dept_name, stock_id, area_code, target_dept_id, target_dept_name,
target_stock_id, target_area_code, reviewer,
review_date, buyBillId, pickOrderNo, buyOrderNo, pickBillId,
create_user, create_time, last_modified, last_modified_user,picker, picker_name
)
elif type == 20:
# 检查拣货单子表
check_mcms_pick_detail(id,type,order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick_center2', id, get_hosid(), get_branch_id(), order_no, source_id,
dept_id,
dept_name, stock_id, area_code, target_dept_id, target_dept_name,
target_stock_id, target_area_code, reviewer,
review_date, buyBillId, pickOrderNo, buyOrderNo, pickBillId,
create_user, create_time, last_modified, last_modified_user,picker, picker_name
)
else:
# 检查拣货单子表
check_mcms_pick_detail(id, type, order_no)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pick_center3', id, get_hosid(), get_branch_id(), order_no, source_id,
dept_id,
dept_name, stock_id, area_code, target_dept_id, target_dept_name,
target_stock_id, target_area_code, reviewer,
review_date, buyBillId, pickOrderNo, buyOrderNo, pickBillId,
create_user, create_time, last_modified, last_modified_user,picker, picker_name
)
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
print(compare_text_index(actual_value2, expected_value2))
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
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)
pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_b2流程九请领业务流_二级库向中心库.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b2流程九请领业务流_二级库向中心库.air')
from a_b2流程九请领业务流_二级库向中心库 import goods_move3, second_dept_Request, BuyCarSubmit, get_centeStock_pick_list_counts, \
centeStock_pick,pick_execute
BuyCarSubmit() # 请领车提交
for i in range(6): # 三个单据共审批6次
approval_center()
updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) #设置登录账号默认权限是中心库
#获取拣货单列表个数
for i in range(get_centeStock_pick_list_counts()):
centeStock_pick()#中心库拣货
#低值拣货执行
try:
# updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
# goods_move3()
# # 二级库区信息写入文件
# get_stockAreaId_new(FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid2'],
# FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'], 2)
# deptName2 = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
# # 设置库区联系人
# set_stockShelf_Linkman(FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"],
# get_stockAreaId2_new_fromDb(deptName2, 2))
# # 低值
# second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
# check_mcms_dept_buy_car(1)
# # 高值
# second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId'], 2)
# check_mcms_dept_buy_car(2)
# # 试剂
# second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId'], 3)
# check_mcms_dept_buy_car(3)
# BuyCarSubmit() # 请领车提交
#
# time.sleep(6)
# list_data = ['16', '20', '66']
# for i in list_data:
# check_mcms_dept_buy(int(i))
# mcms_dept_buy_detail(int(i))
# """
# 这里的审批跟审批流的设置有关
# """
# for i in range(6): # 三个单据共审批6次
# approval_center()
# updateUserLoginDefaultRange(get_listUserMgrRangePage(1)) # 设置登录账号默认权限是中心库
# # 获取拣货单列表个数
# for i in range(get_centeStock_pick_list_counts()):
# centeStock_pick() # 中心库拣货
# 检查拣货单表数据
list_data = ['16', '20', '66']
for i in list_data:
check_mcms_pick(int(i))
# 低值拣货执行
hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '')
pick_execute(GoodsId,1)
pick_execute(hosGoodsId, GoodsId, 1)
# 高值拣货执行
hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message1')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '')
pick_execute(GoodsId,2)
pick_execute(hosGoodsId, GoodsId, 2)
# 试剂拣货执行
hosGoodsId = FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message3')['hosGoodsId']
GoodsId = hosGoodsId.replace(get_hosid(), '')
pick_execute(GoodsId, 3)
pick_execute(hosGoodsId, GoodsId, 3)
second_dept_one_key_in()
second_dept_one_key_in()
second_dept_one_key_in()
commonFuc().check_text_exist_result_text('succees', 'succees')
except:
commonFuc().check_text_exist_result_text('error', '1')
print('==========================流程九结束==============================')
except Exception as e:
# 打印错误信息
print(f"发生错误: {e}")
commonFuc().check_text_exist_result_text('error', 'succees')
......@@ -5,6 +5,9 @@ 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 check_mcms_dept_buy_sql, get_pick_detail_id, get_mdm_goods_code1, get_goods_code1, \
get_pkg_def_id, get_login_user_uxid_bydb, check_batch_id, check_barcode_id, get_create_time, get_PICK_id, \
get_buyBillId, get_PICK_order_no, get_buyOrderNo, get_qty, get_source_id
from common.fileUtls import FileUtils
from common.run_cmd_script import execute_command
......@@ -18,356 +21,328 @@ case_tag:api,b6_spd3_core_business_flow_database_check,a_c1流程十八中心库
核心业务流:a_c1流程十八中心库业务_拆包功能
python runner_test.py tag id2303-21 debug mdm3
"""
def check_mcms_psi_dept_batch(DR_ID,type,order_no):
branch_id = get_branch_id()
sql = " select * from mcms_psi_dept_batch where pid='%s';" % (
DR_ID)
actual = check_mcms_dept_buy_sql(sql)
print('actual', actual)
batch_main_key = get_id("select id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
pid = DR_ID
# order_no = get_id("select order_no from mcms_psi_dept_batch where pid='%s';" % DR_ID)
source_detail_id = get_pick_detail_id(branch_id,type)
pick_detail_id=source_detail_id
if type == 16:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 20:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
mdm_goods_code = get_mdm_goods_code1(hos_goods_id)
goods_code = get_goods_code1(hos_goods_id)
pkg_def_id = get_pkg_def_id(hos_goods_id)
picker_name = FileUtils().r_info8("b2_herp3_bs", "用户名信息", 'message3')['username1']
picker = get_login_user_uxid_bydb(picker_name)
source_batch_id=get_id("select source_batch_id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
target_batch_id=source_batch_id
if check_batch_id(source_batch_id)==True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
barcode_id=get_id("select barcode_id from mcms_psi_dept_batch where pid='%s';" % DR_ID)
if check_barcode_id(barcode_id)==True:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
dept_name=FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
shelf_code= get_stockAreaId_new_fromDb(dept_name, 2)
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_psi_dept_batch where pid='%s';" % DR_ID)
last_modified = get_create_time("select last_modified from mcms_psi_dept_batch where pid='%s';" % DR_ID)
last_modified_user = create_user
if type == 16:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch1', batch_main_key, pid, order_no,source_detail_id
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id,
target_batch_id,barcode_id,shelf_code,create_user,create_time,last_modified,
last_modified_user
def center_Stock_unpack(type): # 扫码发放(高值不能扫码发放)
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"))
)
elif type == 20:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch2', batch_main_key, pid, order_no,source_detail_id
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id,
target_batch_id,barcode_id,shelf_code,create_user,create_time,last_modified,
last_modified_user
if type == 1:
print('低值耗材扫码发放')
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等信息,使用创建的用户登录============结束
# 到库房明细查询,查询产品的udi码
udi_code = get_udi1(1)
# 扫码====================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_pick_scan_url")
# 从message18文件中获取信息
info = FileUtils().r_info8(module, "条码信息", 'message18')
# print('info', info)
list_a = info['list_a']
stockId = commonFuc().analysis_json('stockId', list_a)
stockName = commonFuc().analysis_json('stockName', list_a)
areaCode = commonFuc().analysis_json('areaCode', list_a)
areaName = commonFuc().analysis_json('areaName', list_a)
deptId2 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"]
targetDeptId = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
deptName = get_branch_name()
targetStockId = get_stockId(deptName + '中心库房', 1)
)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept_batch3_1',batch_main_key, pid, order_no,source_detail_id
,pick_detail_id,hos_goods_id,mdm_goods_code,goods_code,source_batch_id,
target_batch_id,barcode_id,shelf_code,create_user,create_time,last_modified,
last_modified_user
request_body = commonFuc().get_business_data(module, "payload67", udi_code, stockId, stockName, areaCode,
areaName
)
print('request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('扫码发放result', result)
price = commonFuc().analysis_json('price', commonFuc().analysis_json('data', result))
createTime = commonFuc().analysis_json('createTime', commonFuc().analysis_json('data', result))
hosId = commonFuc().analysis_json('hosId', commonFuc().analysis_json('data', result))
tbStatus = commonFuc().analysis_json('tbStatus', commonFuc().analysis_json('data', result))
printNum = commonFuc().analysis_json('printNum', commonFuc().analysis_json('data', result))
# 扫码=======================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_centCbSubmit_url")
print('url', url)
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
)
# 从文件中获取必要信息
info = FileUtils().r_info8(module, "条码信息", 'message18')
# print('info', info)
list_a = info['list_a']
# print('list_a', list_a[0], type(list_a), len(list_a))
UTid = 'UT'
areaCode = 'areaCode'
# createTime = 'createTime'
hosId = 'hosId'
stockId = 'stockId'
areaCode = 'areaCode'
areaName = 'areaName'
shelfCode = 'shelfCode'
codeType = 'codeType'
# tagType = 'tagType'
hosGoodsId = 'hosGoodsId'
mdmGoodsCode = 'mdmGoodsCode'
goodsCode = 'goodsCode'
goodsDi = 'goodsDi'
barName = 'barName'
batchCode = 'batchCode'
expdtDate = 'expdtDate'
productDate = 'productDate'
pkgCode = 'pkgCode'
pkgCodeSee= 'pkgCodeSee'
ssccCode= 'ssccCode'
pkgDefId= 'pkgDefId'
pkgDefQty= 'pkgDefQty'
purBillId= 'purBillId'
pkgDefName= 'pkgDefName'
distrBillId= 'distrBillId'
inStockTime= 'inStockTime'
distrDetailId= 'distrDetailId'
purMode= 'purMode'
goodsMfrsName= 'goodsMfrsName'
goodsSpec= 'goodsSpec'
unit= 'unit'
goodsName= 'goodsName'
made= 'made'
unitName= 'unitName'
hosGoodsCode= 'hosGoodsCode'
purModeText= 'purModeText'
for i in list_a:
print(i)
UTid = i['id']
areaCode = i['areaCode']
# createTime = i['createTime']
# hosId = i['hosId']
stockId = i['stockId']
areaCode = i['areaCode']
areaName = i['areaName']
shelfCode = i['shelfCode']
codeType = i['codeType']
# tagType = i['tagType']
hosGoodsId = i['hosGoodsId']
# mdmGoodsCode = i['mdmGoodsCode']
goodsCode = i['goodsCode']
# goodsDi = i['goodsDi']
barName = i['barName']
batchCode = i['batchCode']
expdtDate = i['expdtDate']
productDate = i['productDate']
# pkgCode = i['pkgCode']
pkgCodeSee = i['pkgCodeSee']
ssccCode = i['ssccCode']
# tbStatus = i['tbStatus']
onlyKey = i['hosGoodsId']
ext = i['extInfo']
print('ext', ext)
distrDetailId = reGetString(ext, r'distrDetailId": "', r'", ')
distrBillId = reGetString(ext, r'distrBillId": "', r'", ')
purBillId = reGetString(ext, r'purBillId": "', r'", ')
pkgDefQty = reGetString(ext, r'pkgDefQty": "', r'", ')
pkgDefId = reGetString(ext, r'pkgDefId": "', r'", ')
pkgDefName = reGetString(ext, r'pkgDefName": "', r'", ')
purMode = i['purMode']
goodsMfrsName = i['goodsMfrsName']
goodsSpec = i['goodsSpec']
unit = i['unit']
goodsName = i['goodsName']
pkgDefId = i['pkgDefId']
pkgDefQty = i['pkgDefQty']
pkgDefName = i['pkgDefName']
# printNum = i['printNum']
made = i['made']
# provId = i['provId']
# provName = i['provName']
# subProvId = i['subProvId']
# subProvName = i['subProvName']
hosGoodsCode = i['hosGoodsCode']
# subSendFlag = i['subSendFlag']
areaName = i['areaName']
# hosId = i['hosId']
unitName = i['unitName']
purModeText = i['purModeText']
extInfo = i['extInfo']
inStockTime = reGetString(extInfo, r'inStockTime": "', r'",')
break
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
deptName = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid1"]
# # 请求体
request_body = commonFuc().get_business_data(module, "payload68", stockId, stockName, areaCode, areaName, UTid,
createTime, UTid, hosId,
stockId,
areaCode, areaName, shelfCode, codeType, hosGoodsId,
mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate,
productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus, pkgDefId,
pkgDefQty,
purBillId, pkgDefName, distrBillId, inStockTime,distrDetailId,
purMode, price,
goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty,
pkgDefName, printNum, made, unitName, hosGoodsCode, purModeText,tbStatus)
print('request_body', 'ccccccc', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
print(compare_text_index(actual_value2, expected_value2))
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_psi_data(type1=10):
branch_id = get_branch_id()
source_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_id = get_stockId_fromdb(get_branch_name() + '中心库房')
elif type == 3:
print('试剂产品扫码发放')
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等信息,使用创建的用户登录============结束
# 到库房明细查询,查询产品的udi码
udi_code = get_udi1(3)
# 扫码====================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module,
"herpService_stock_pick_scan_url")
# 从message18文件中获取信息
info = FileUtils().r_info8(module, "条码信息", 'message18')
# print('info', info)
list_a = info['list_a']
stockId = commonFuc().analysis_json('stockId', list_a)
stockName = commonFuc().analysis_json('stockName', list_a)
areaCode = commonFuc().analysis_json('areaCode', list_a)
areaName = commonFuc().analysis_json('areaName', list_a)
deptId2 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid2"]
targetDeptId = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
deptName = get_branch_name()
targetStockId = get_stockId(deptName + '中心库房', 1)
if type1==10:
sql = " select * from mcms_stockpile where branch_id='%s' and stock_id='%s' and pur_mode='%s' and barcode_flag='1' order by last_modified desc LIMIT 1;" % (
branch_id,stock_id,type1)
else:
sql = " select * from mcms_stockpile where branch_id='%s' and stock_id='%s' and pur_mode='%s' and barcode_flag='1' order by last_modified desc LIMIT 1;" % (
branch_id, stock_id, type1)
actual = check_mcms_dept_buy_sql(sql)
print(actual)
request_body = commonFuc().get_business_data(module, "payload67", udi_code, stockId, stockName, areaCode,
areaName
)
print('request_body', request_body)
result = commonFuc().http_post(url, request_body, headers)
print('扫码发放result', result)
price = commonFuc().analysis_json('price', commonFuc().analysis_json('data', result))
createTime = commonFuc().analysis_json('createTime', commonFuc().analysis_json('data', result))
hosId = commonFuc().analysis_json('hosId', commonFuc().analysis_json('data', result))
tbStatus = commonFuc().analysis_json('tbStatus', commonFuc().analysis_json('data', result))
printNum = commonFuc().analysis_json('printNum', commonFuc().analysis_json('data', result))
# 扫码=======================
url = commonFuc().get_api_add_port_url() + commonFuc().get_business_data(module, "herpService_centCbSubmit_url")
print('url', url)
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
XH_ID=get_id(" select id from mcms_stockpile where branch_id='%s' and stock_id='%s' and pur_mode='%s' and barcode_flag='1' order by last_modified desc LIMIT 1;" % (
branch_id, stock_id,type1))
hos_id= get_hosid()
dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_id = get_stockId_fromdb(get_branch_name() + '中心库房')
stock_name=dept_name
area_code = get_stockAreaId_new_fromDb(dept_name, 1)
if type1 == 10:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 20:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
goods_code=get_goods_code1(hos_goods_id)
expdt_date=get_create_time("select expdt_date from mcms_stockpile where id='%s';" % XH_ID)
hos_batch_id=get_id("select hos_batch_id from mcms_stockpile where id='%s';" % XH_ID)
qty=get_qty("select qty from mcms_stockpile where id='%s';" % XH_ID)
version=get_id("select version from mcms_stockpile where id='%s';" % XH_ID)
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_stockpile where id='%s';" % XH_ID)
last_modified = get_create_time("select last_modified from mcms_stockpile where id='%s';" % XH_ID)
last_modified_user = create_user
if type1 == 10:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_cb1', XH_ID, hos_id, branch_id, dept_id,
dept_name, stock_id, stock_name,area_code,hos_goods_id,
goods_code,expdt_date,hos_batch_id,qty,create_user,create_time,last_modified,last_modified_user,version
)
elif type1 == 20:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept5', XH_ID, hos_id, branch_id, dept_id,
dept_name, stock_id, stock_name,area_code,hos_goods_id,
goods_code,expdt_date,hos_batch_id,qty,create_user,create_time,last_modified,last_modified_user,version
)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_cb2',XH_ID, hos_id, branch_id, dept_id,
dept_name, stock_id, stock_name,area_code,hos_goods_id,
goods_code,expdt_date,hos_batch_id,qty,create_user,create_time,last_modified,last_modified_user,version
)
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
print(compare_text_index(actual_value2, expected_value2))
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_task(type1=16,flag=False):
branch_id = get_branch_id()
dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
if type1==16:
sql = " select * from mcms_task where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id,type1)
else:
type1=16
flag=True
sql = " select * from mcms_task where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type1)
actual = check_mcms_dept_buy_sql(sql)
print(actual)
JG_ID=get_id(" select id from mcms_task where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type1))
task_no=get_id(" select task_no from mcms_task where id='%s';" % (
JG_ID))
hos_id= get_hosid()
# dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
# dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
stock_id = get_stockId_fromdb(get_branch_name() + '中心库房')
stock_name=dept_name
area_code = get_stockAreaId_new_fromDb(dept_name, 1)
start_time=get_create_time("select start_time from mcms_task where id='%s';" % JG_ID)
# expdt_date=get_create_time("select expdt_date from mcms_task where id='%s';" % JG_ID)
# hos_batch_id=get_id("select hos_batch_id from mcms_task where id='%s';" % JG_ID)
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_task where id='%s';" % JG_ID)
last_modified = get_create_time("select last_modified from mcms_task where id='%s';" % JG_ID)
last_modified_user = create_user
if flag==True:
type1 = 60
if type1 == 16:
mcms_task_detail(type1,JG_ID)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_task1', JG_ID, task_no,hos_id, branch_id, dept_id,
dept_name, stock_id,area_code,start_time,
create_user,create_time,last_modified,last_modified_user
)
elif type1 == 20:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept5', JG_ID, task_no,hos_id, branch_id, dept_id,
dept_name, stock_id, stock_name,area_code,
create_user,create_time,last_modified,last_modified_user
)
else:
mcms_task_detail(type1, JG_ID)
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_task2', JG_ID, task_no,hos_id, branch_id, dept_id,
dept_name, stock_id,area_code,start_time,
create_user,create_time,last_modified,last_modified_user
)
print('expected', expected)
print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
print(compare_text_index(actual_value2, expected_value2))
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def mcms_task_detail(type,task_id):
branch_id = get_branch_id()
dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
sql = "select * from mcms_task_detail where task_id='%s';"%task_id
actual = check_mcms_dept_buy_sql(sql)
print(actual)
id = get_id("select id from mcms_task_detail where task_id='%s';" % task_id)
if type == 16:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
elif type == 2:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
goods_code=get_goods_code1(hos_goods_id)
source_id=get_source_id(branch_id,hos_goods_id)
hos_id = get_hosid()
# dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
# dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
target_stock_id = get_stockId_fromdb(get_branch_name() + '中心库房')
stock_name = dept_name
target_area_code = get_stockAreaId_new_fromDb(dept_name, 1)
# expdt_date=get_create_time("select expdt_date from mcms_task where id='%s';" % JG_ID)
# hos_batch_id=get_id("select hos_batch_id from mcms_task where id='%s';" % JG_ID)
create_user = get_login_user_uxid_bydb(FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1'])
create_time = get_create_time("select create_time from mcms_task_detail where id='%s';" % id)
last_modified = get_create_time("select last_modified from mcms_task_detail where id='%s';" % id)
last_modified_user = create_user
target_shelf_code=target_area_code
if type == 16:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_task_detail1', id, task_id, source_id, hos_goods_id, goods_code,
create_user, create_time, last_modified, last_modified_user,
target_stock_id, target_area_code, target_shelf_code
)
elif type == 20:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_psi_dept5', id, task_id, source_id, hos_goods_id, goods_code,
create_user, create_time, last_modified, last_modified_user,
target_stock_id, target_area_code, target_shelf_code
)
else:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_task_detail2', id, task_id, source_id, hos_goods_id, goods_code,
create_user, create_time, last_modified, last_modified_user,
target_stock_id, target_area_code, target_shelf_code
)
print('aaaaaaaaaaaaaaaaa')
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
actual_value2 = actual_value1.replace(" ", "")
expected_value2 = expected_value1.replace(" ", "")
# print('actual_value2',actual_value2)
print('expected_value2')
print(expected_value2)
print('actual_value2')
print(actual_value2)
print(compare_text_index(actual_value2, expected_value2))
if actual_value2 == expected_value2:
print('ok')
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
pro_path = commonFuc().get_pro_path2()
print('pro_path', pro_path)
sys.path.append(pro_path + r'/air_case/b5_spd3_core_business_flow/a_c1流程十八中心库业务_拆包功能.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_c1流程十八中心库业务_拆包功能.air')
from a_c1流程十八中心库业务_拆包功能 import center_Stock_unpack
# 从文件中获取必要信息
info = FileUtils().r_info8(module, "条码信息", 'message18')
# print('info', info)
list_a = info['list_a']
# print('list_a', list_a[0], type(list_a), len(list_a))
UTid = 'UT'
areaCode = 'areaCode'
# createTime = 'createTime'
hosId = 'hosId'
stockId = 'stockId'
areaCode = 'areaCode'
areaName = 'areaName'
shelfCode = 'shelfCode'
codeType = 'codeType'
# tagType = 'tagType'
hosGoodsId = 'hosGoodsId'
mdmGoodsCode = 'mdmGoodsCode'
goodsCode = 'goodsCode'
goodsDi = 'goodsDi'
barName = 'barName'
batchCode = 'batchCode'
expdtDate = 'expdtDate'
productDate = 'productDate'
pkgCode = 'pkgCode'
pkgCodeSee = 'pkgCodeSee'
ssccCode = 'ssccCode'
pkgDefId = 'pkgDefId'
pkgDefQty = 'pkgDefQty'
purBillId = 'purBillId'
pkgDefName = 'pkgDefName'
distrBillId = 'distrBillId'
inStockTime = 'inStockTime'
distrDetailId = 'distrDetailId'
purMode = 'purMode'
goodsMfrsName = 'goodsMfrsName'
goodsSpec = 'goodsSpec'
unit = 'unit'
goodsName = 'goodsName'
made = 'made'
unitName = 'unitName'
hosGoodsCode = 'hosGoodsCode'
purModeText = 'purModeText'
for i in list_a:
print(i)
UTid = i['id']
areaCode = i['areaCode']
# createTime = i['createTime']
# hosId = i['hosId']
stockId = i['stockId']
areaCode = i['areaCode']
areaName = i['areaName']
shelfCode = i['shelfCode']
codeType = i['codeType']
# tagType = i['tagType']
hosGoodsId = i['hosGoodsId']
# mdmGoodsCode = i['mdmGoodsCode']
goodsCode = i['goodsCode']
# goodsDi = i['goodsDi']
barName = i['barName']
batchCode = i['batchCode']
expdtDate = i['expdtDate']
productDate = i['productDate']
# pkgCode = i['pkgCode']
pkgCodeSee = i['pkgCodeSee']
ssccCode = i['ssccCode']
# tbStatus = i['tbStatus']
onlyKey = i['hosGoodsId']
ext = i['extInfo']
print('ext', ext)
distrDetailId = reGetString(ext, r'distrDetailId": "', r'", ')
distrBillId = reGetString(ext, r'distrBillId": "', r'", ')
purBillId = reGetString(ext, r'purBillId": "', r'", ')
pkgDefQty = reGetString(ext, r'pkgDefQty": "', r'", ')
pkgDefId = reGetString(ext, r'pkgDefId": "', r'", ')
pkgDefName = reGetString(ext, r'pkgDefName": "', r'", ')
purMode = i['purMode']
goodsMfrsName = i['goodsMfrsName']
goodsSpec = i['goodsSpec']
unit = i['unit']
goodsName = i['goodsName']
pkgDefId = i['pkgDefId']
pkgDefQty = i['pkgDefQty']
pkgDefName = i['pkgDefName']
# printNum = i['printNum']
made = i['made']
# provId = i['provId']
# provName = i['provName']
# subProvId = i['subProvId']
# subProvName = i['subProvName']
hosGoodsCode = i['hosGoodsCode']
# subSendFlag = i['subSendFlag']
areaName = i['areaName']
# hosId = i['hosId']
unitName = i['unitName']
purModeText = i['purModeText']
extInfo = i['extInfo']
inStockTime = reGetString(extInfo, r'inStockTime": "', r'",')
break
deptid1 = FileUtils().r_info8('b2_herp3_bs', '所有科室id', 'message6')["deptid1"]
deptName = FileUtils().r_info8('b2_herp3_bs', '所有科室name', 'message6')["deptid1"]
# # 请求体
request_body = commonFuc().get_business_data(module, "payload69", stockId, stockName, areaCode, areaName, UTid,
createTime, UTid, hosId,
stockId,
areaCode, areaName, shelfCode, codeType, hosGoodsId,
mdmGoodsCode, goodsCode, goodsDi, barName, batchCode, expdtDate,
productDate, pkgCode, pkgCodeSee, ssccCode, tbStatus, pkgDefId,
pkgDefQty,
purBillId, pkgDefName, distrBillId, inStockTime, distrDetailId,
purMode, price,
goodsMfrsName, goodsSpec, unit, goodsName, pkgDefId, pkgDefQty,
pkgDefName, printNum, made, unitName, hosGoodsCode, purModeText,tbStatus)
print('request_body', 'ccccccc', request_body)
# # # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
try:
updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) # 设置登录账号默认权限是级库
updateUserLoginDefaultRange(get_listUserMgrRangePage1(1)) # 设置登录账号默认权限是1级库
center_Stock_unpack(1) # 低值耗材扫码发放
check_mcms_psi_data(10) # 检查库存数据(低值)
check_mcms_task(16)#检查加工单数据
time.sleep(6)
center_Stock_unpack(3) # 试剂耗材扫码发放
time.sleep(6)
check_mcms_psi_data(60) # 检查库存数据(试剂值)
check_mcms_task(60) # 检查加工单数据
commonFuc().check_text_exist_result_text('succees', 'succees')
except Exception as e:
# 打印错误信息
......
......@@ -203,6 +203,20 @@ def set_goods_coding_type(branch_id): # 设置科室产品为赋码管理0为
cursor.close()
db.close()
def get_qty(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
results = cursor.fetchone()
str1 = str(results)
new_str1 = str1.replace(',)', '')
new_str1 = new_str1.replace('(D', 'D')
new_str1 = new_str1.replace(',', '')
# new_str1 = new_str1.replace("'", '')
# print(new_str1)
cursor.close()
db.close()
return new_str1
def get_id(sql):
db, cursor = get_sql_conn()
......@@ -290,6 +304,13 @@ def get_mdm_goods_code1(hos_goods_id):
db.close()
return process_tuple(results)
def get_source_id(branch_id,hos_goods_id):
db, cursor = get_sql_conn()
cursor.execute("select id from branch_goods_pkg_def where hos_goods_id='%s' and BRANCH_ID='%s';" %(hos_goods_id,branch_id) )
results = cursor.fetchall()
cursor.close()
db.close()
return process_tuple(results)
def get_goods_code1(hos_goods_id):
db, cursor = get_sql_conn()
......
......@@ -26,8 +26,7 @@ json_headers3: {
"Content-Type": "%s",
"token": "%s",
"X-APP-CODE":"%s",
"X-JS-HASH":"%s",
"Host":"spdtest.cmic.com.cn"
"X-JS-HASH":"%s"
}
"payload1": {
"id": "%s",
......
......@@ -19,7 +19,7 @@
"mcms_dept_buy_detail_approval_after1": '{"id": "%s", "pid": "%s", "order_no": "%s", "order_num": 1, "source_id": None, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "price": Decimal("99.999900"), "pur_mode": 20, "pkg_def_id": %s, "pkg_def_name": %s, "pkg_def_qty": Decimal("1.00"), "buy_pkg_qty": Decimal("1.00"), "buy_qty": Decimal("1.00"), "send_pkg_qty": "0", "send_qty": "0", "rec_pkg_qty": "0", "rec_qty": "0", "tb_status": 40, "close_type": 0, "remark": None, "close_remark": None, "close_time": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "re_order_no": None, "coding_type": 0}'
"mcms_dept_buy_detail_approval_after2": '{"id": "%s", "pid": "%s", "order_no": "%s", "order_num": 1, "source_id": None, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "price": Decimal("99.999900"), "pur_mode": 60, "pkg_def_id": "%s", "pkg_def_name": "%s", "pkg_def_qty": Decimal("100.00"), "buy_pkg_qty": Decimal("1.00"), "buy_qty": Decimal("100.00"), "send_pkg_qty": "0", "send_qty": "0", "rec_pkg_qty": "0", "rec_qty": "0", "tb_status": 40, "close_type": 0, "remark": None, "close_remark": None, "close_time": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "re_order_no": None, "coding_type": 0}'
#配送
#二级库请领
"mcms_dept_buy_direct_sending": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "3", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None,"create_from":"SPD"}'
"mcms_dept_buy_direct_sending2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "3", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 0, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None,"create_from":"SPD"}'
"mcms_dept_buy_direct_sending3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "3", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None,"create_from":"SPD"}'
......@@ -233,4 +233,38 @@
#中心库退供应商主表拣货单主表
"mcms_pick1_1": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": null, "bill_mode": "16", "create_type": "SG", "pick_type": "TH", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "自动化测试", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": %s, "target_area_name": null, "receiver": None, "reason_kind": "1", "barcode_flag": 1, "pkg_flag": 1, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 40, "reviewer": "%s", "review_date": %s, "bill_relation_json": "{"pickOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "picker": "%s", "picker_name": "%s"}'
"mcms_pick2_1": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": null, "bill_mode": "20", "create_type": "SG", "pick_type": "TH", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "自动化测试", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": %s, "target_area_name": null, "receiver": None, "reason_kind": "1", "barcode_flag": 1, "pkg_flag": 0, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 40, "reviewer": "%s", "review_date": %s, "bill_relation_json": "{"pickOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "picker": "%s", "picker_name": "%s"}'
"mcms_pick3_1": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": null, "bill_mode": "66", "create_type": "SG", "pick_type": "TH", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "自动化测试", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": %s, "target_area_name": null, "receiver": None, "reason_kind": "1", "barcode_flag": 1, "pkg_flag": 1, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 40, "reviewer": "%s", "review_date": %s, "bill_relation_json": "{"pickOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "picker": "%s", "picker_name": "%s"}'
\ No newline at end of file
"mcms_pick3_1": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": null, "bill_mode": "66", "create_type": "SG", "pick_type": "TH", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "自动化测试", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": %s, "target_area_name": null, "receiver": None, "reason_kind": "1", "barcode_flag": 1, "pkg_flag": 1, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 40, "reviewer": "%s", "review_date": %s, "bill_relation_json": "{"pickOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "last_auditor": None, "last_audit_time": None, "picker": "%s", "picker_name": "%s"}'
#中心库拆包库存数据
"mcms_psi_cb1": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "stock_name": "%s", "area_code": "%s", "area_name": "自动化测试", "pur_mode": 10, "hos_goods_id": "%s", "goods_code": "%s", "batch_code": "333", "expdt_date": %s, "hos_batch_id": "%s", "batch_price": Decimal("99.999900"), "qty": %s, "shelf_code": None, "barcode_flag": 1, "pkg_flag": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": %s}'
"mcms_psi_cb2": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "stock_name": "%s", "area_code": "%s", "area_name": "自动化测试", "pur_mode": 60, "hos_goods_id": "%s", "goods_code": "%s", "batch_code": "4444", "expdt_date": %s, "hos_batch_id": "%s", "batch_price": Decimal("99.999900"), "qty": %s, "shelf_code": None, "barcode_flag": 1, "pkg_flag": 1, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": %s}'
#加工单
"mcms_task1": '{"id": "%s", "task_no": "%s", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "自动化测试", "task_type": "CB", "bill_mode": 16, "source_id": None, "start_time": %s, "end_time": None, "sum_num": 1, "finish_num": 1, "tb_status": 4, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "create_type": "SG", "change_type": "PKG_BULK"}'
"mcms_task2": '{"id": "%s", "task_no": "%s", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "自动化测试", "task_type": "CB", "bill_mode": 16, "source_id": None, "start_time": %s, "end_time": None, "sum_num": 1, "finish_num": 1, "tb_status": 4, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "create_type": "SG", "change_type": "PKG_BULK"}'
#加工单子表
"mcms_task_detail1": '{"id": "%s", "task_id": "%s", "source_id": "%s", "source_def_name": "100", "source_def_qty": Decimal("100.00"), "source_qty": Decimal("1.00"), "target_def_id": None, "target_def_name": "散件", "target_def_qty": Decimal("1.00"), "target_qty": Decimal("100.00"), "exe_pkg_qty": Decimal("1.00"), "hos_goods_id": "%s", "goods_code": "%s", "tb_status": 2, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "target_stock_id": "%s", "target_area_code": "%s", "target_shelf_code": "%s-2-01-01"}'
"mcms_task_detail2": '{"id": "%s", "task_id": "%s", "source_id": "%s", "source_def_name": "100", "source_def_qty": Decimal("100.00"), "source_qty": Decimal("1.00"), "target_def_id": None, "target_def_name": "散件", "target_def_qty": Decimal("1.00"), "target_qty": Decimal("100.00"), "exe_pkg_qty": Decimal("1.00"), "hos_goods_id": "%s", "goods_code": "%s", "tb_status": 2, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "target_stock_id": "%s", "target_area_code": "%s", "target_shelf_code": "%s-2-01-01"}'
#二级库向中心库请领单
"mcms_dept_buy1": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "1", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None,"create_from":"SPD"}'
"mcms_dept_buy2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "1", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 0, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None,"create_from":"SPD"}'
"mcms_dept_buy3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "area_code": "%s", "area_name": "%s", "source_id": None, "buy_way": "1", "create_type": "SG", "buy_kind": "QL", "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_stock_name": "%s", "bill_expdt_date": %s, "bill_expect_date": None, "priority": 0, "buy_priority": 0, "barcode_flag": 1, "pkg_flag": 1, "remark": "", "dept_audit_remark": None, "audit_remark": None, "close_remark": None, "srv_id": None, "srv_name": None, "gen_status": 0, "close_status": 0, "tb_status": 10, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "close_time": None, "old_order_no": None,"create_from":"SPD"}'
#中心库拣货单
"mcms_pick_center1": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": "%s", "bill_mode": "16", "create_type": "ZD", "pick_type": "KS", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "自动化测试", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "receiver": None, "reason_kind": None, "barcode_flag": 1, "pkg_flag": 1, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 10, "reviewer": %s, "review_date": %s, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "last_auditor": None, "last_audit_time": None, "picker": %s, "picker_name": %s}'
"mcms_pick_center2": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": "%s", "bill_mode": "20", "create_type": "ZD", "pick_type": "KS", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "自动化测试", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "receiver": None, "reason_kind": None, "barcode_flag": 1, "pkg_flag": 0, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 10, "reviewer": %s, "review_date": %s, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "last_auditor": None, "last_audit_time": None, "picker": %s, "picker_name": %s}'
"mcms_pick_center3": '{"id": "%s", "hos_id": "%s", "branch_id": "%s", "order_no": "%s", "source_id": "%s", "bill_mode": "66", "create_type": "ZD", "pick_type": "KS", "dept_id": "%s", "dept_name": "%s", "stock_id": "%s", "area_code": "%s", "area_name": "自动化测试", "area_mgr_id": None, "target_dept_id": "%s", "target_dept_name": "%s", "target_stock_id": "%s", "target_area_code": "%s", "target_area_name": "默认库区", "receiver": None, "reason_kind": None, "barcode_flag": 1, "pkg_flag": 1, "patient_id": None, "patient_name": None, "remark": "", "tb_status": 10, "reviewer": %s, "review_date": %s, "bill_relation_json": "{"buyBillId":"%s","pickOrderNo":"%s","buyOrderNo":"%s","pickBillId":"%s"}", "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "last_auditor": None, "last_audit_time": None, "picker": %s, "picker_name": %s}'
#中心库拣货单子表拣货执行前
"mcms_pick_center_detail1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s0001", "pur_mode": 10, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("0.00"), "picker": %s, "picker_name": %s, "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": %s, "version": 0, "plan_flag": None}'
"mcms_pick_center_detail2": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s0001", "pur_mode": 20, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": %s, "pkg_def_name": None, "pkg_def_qty": Decimal("1.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("0.00"), "picker": %s, "picker_name": %s, "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": %s, "version": 0, "plan_flag": None}'
"mcms_pick_center_detail3": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s0001", "pur_mode": 60, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("0.00"), "picker": %s, "picker_name": %s, "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": %s, "version": 0, "plan_flag": None}'
#中心库拣货单子表拣货执行后
"mcms_pick_center_detail4": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s0001", "pur_mode": 10, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_center_detail5": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s0001", "pur_mode": 20, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": %s, "pkg_def_name": None, "pkg_def_qty": Decimal("1.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
"mcms_pick_center_detail6": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s0001", "pur_mode": 60, "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pkg_def_type": None, "pkg_base_mirror": None, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "apply_qty": Decimal("1.00"), "qty": Decimal("1.00"), "picked_qty": Decimal("1.00"), "picker": "%s", "picker_name": "%s", "tb_status": 20, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 2, "plan_flag": None}'
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