Commit c7406b1d authored by 肖 和生's avatar 肖 和生
Browse files

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

parents ebb62d7d 72a51632
......@@ -348,10 +348,10 @@ def purchase_module_process():
closeStatus = commonFuc().analysis_json('closeStatus', data1)
id2 = commonFuc().analysis_json('id', data1)
inSettlement = 1
planPkgQty = commonFuc().analysis_json('planPkgQty', data1)
planPkgQty = int(float(planPkgQty))
pkgDefQty = commonFuc().analysis_json('pkgDefQty', data1)
pkgDefQty = int(float(pkgDefQty))
# planPkgQty = commonFuc().analysis_json('planPkgQty', data1)
# planPkgQty = int(float(planPkgQty))
# pkgDefQty = commonFuc().analysis_json('pkgDefQty', data1)
# pkgDefQty = int(float(pkgDefQty))
provId = commonFuc().analysis_json('provId', data1)
provName = commonFuc().analysis_json('provName', data1)
subProvId = commonFuc().analysis_json('subProvId', data1)
......
......@@ -6,7 +6,9 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_
from air_case.public1.public1.public1 import *
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_tools import get_create_time, check_mcms_dept_buy_car_sql, get_dept_buy_id, \
check_mcms_dept_buy_sql, get_mdm_goods_code, get_expdt_date, check_mcms_pur_plan_sql, check_in_check_mcms_purchase
check_mcms_dept_buy_sql, get_mdm_goods_code, get_expdt_date, check_mcms_pur_plan_sql, check_in_check_mcms_purchase, \
get_expdt_date1, process_date, get_mdm_goods_code1, get_goods_code1, get_goods_name, get_goods_gg, \
get_goods_mfrs_id, get_supply_id, check_mcms_pur_sql, check_source_id, get_pkg_def_id
from common.db.sql.sql_tools_out import check_out_check_mcms_purchase
from common.fileUtls import FileUtils
......@@ -32,7 +34,7 @@ def check_mcms_dept_buy_car(type=1):
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的值
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))
......@@ -47,6 +49,7 @@ def check_mcms_dept_buy_car(type=1):
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']
......@@ -516,10 +519,14 @@ def check_mcms_mcms_pur_plan(type=16):
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a']
area_code = commonFuc().analysis_json('shelfCode', list_a)
area_name = '默认库区'
sql1 = "select area_name from mcms_pur_plan where branch_id='%s' and source_id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1)
area_name = process_tuple(get_id(sql1))
source_id = id1
rec_user = get_login_user_uxid()
rec_addr = '自动化测试'
sql1 = "select rec_addr from mcms_pur_plan where branch_id='%s' and source_id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1)
rec_addr = process_tuple(get_id(sql1))
sql = "select bill_expdt_date from mcms_pur_plan where branch_id='%s' and source_id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1)
print(sql)
......@@ -590,6 +597,10 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo):
sql = "select id from mcms_pur_plan_detail where pid='%s' order by create_time desc LIMIT 1;" % (
id)
id2 = process_tuple(get_dept_buy_id(sql)) # 采购计划单子表主键
# # 将采购计划子表主键写入文件中
# info = (id2, id2)
# titlename = ("id2", 'id2')
# FileUtils().w_info8(info, 'b6_spd3_core_business_flow_database_check', '采购计划单子表主键', titlename, 'message')
sql = "select order_no from mcms_pur_plan where id='%s' order by create_time desc LIMIT 1;" % (
id2)
PLAN_order_no = process_tuple(get_dept_buy_id(sql)) # 采购计划单子表order_no
......@@ -614,16 +625,16 @@ def check_mcms_mcms_pur_plan_detail(id, type, planOrderNo):
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
mdm_goods_code = process_tuple(
get_id("select mdm_goods_code from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
hos_goods_id, id2)))
# print(mdm_goods_code)
goods_code = process_tuple(
get_id("select goods_code from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
hos_goods_id, id2)))
pkg_def_id = process_tuple(
get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id))
supply_id = process_tuple(
get_id("select supply_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
hos_goods_id, id2)))
prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
sub_prov_id = prov_id
......@@ -764,11 +775,14 @@ def check_mcms_purchase(type=16):
info = FileUtils().r_info8("b5_spd3_core_business_flow", "库区信息", 'message22')
list_a = info['list_a']
area_code = commonFuc().analysis_json('shelfCode', list_a)
area_name = '默认库区'
sql1 = "select area_name from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1)
area_name = process_tuple(get_id(sql1))
rec_user = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')['username1']
# rec_user = get_login_user_uxid()
rec_addr = '自动化测试'
sql1 = "select rec_addr from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1)
rec_addr = process_tuple(get_id(sql1))
sql = "select bill_expdt_date from mcms_pur_plan where branch_id='%s' and source_id='%s' order by create_time desc LIMIT 1;" % (
branch_id, buyBillId)
print(sql)
......@@ -782,14 +796,14 @@ def check_mcms_purchase(type=16):
"select last_modified from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1))
last_modified_user = create_user
last_auditor=rec_user
last_audit_time= get_create_time(
last_auditor = rec_user
last_audit_time = get_create_time(
"select last_audit_time from mcms_purchase where branch_id='%s' and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, id1))
if type == 16:
# 验证子表数据
# check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
check_mcms_purchase_detail(id1, type, order_no)
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
planBillId = process_tuple(
get_id(
......@@ -812,7 +826,7 @@ def check_mcms_purchase(type=16):
close_date = get_create_time(
"select close_date from mcms_purchase where id='%s';" % (
id1))
source_id=planBillId
source_id = planBillId
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_purchase', id1, order_no, hos_id,
get_branch_id(), dept_id1, dept_name1, rec_org_id, rec_org_name,
......@@ -824,7 +838,8 @@ def check_mcms_purchase(type=16):
)
elif type == 20:
# check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
#检查采购订单子表
check_mcms_purchase_detail(id1, type, order_no)
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
planBillId = process_tuple(
get_id(
......@@ -858,7 +873,8 @@ def check_mcms_purchase(type=16):
create_time, last_modified, last_auditor, last_audit_time
)
elif type == 66:
# check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
#检查采购订单子表数据
check_mcms_purchase_detail(id1, type, order_no)
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
planBillId = process_tuple(
get_id(
......@@ -912,20 +928,20 @@ def check_mcms_purchase(type=16):
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_purchase_detail(id, type, planOrderNo):
def check_mcms_purchase_detail(id, type, OrderNo):
branch_id = get_branch_id()
# 根据采购计划主表的id获取采购计划单子表主键
sql = "select id from mcms_pur_plan_detail where pid='%s' order by create_time desc LIMIT 1;" % (
# 根据采购订单主表的id获取采购订单子表主键
sql = "select id from mcms_purchase_detail where pid='%s' order by create_time desc LIMIT 1;" % (
id)
detail_main_key = process_tuple(get_dept_buy_id(sql)) # 采购订单单子表主键
sql = "select order_no from mcms_purchase_detail where pid='%s' order by create_time desc LIMIT 1;" % (
id)
id2 = process_tuple(get_dept_buy_id(sql)) # 采购计划单子表主键
sql = "select order_no from mcms_pur_plan where id='%s' order by create_time desc LIMIT 1;" % (
id2)
PLAN_order_no = process_tuple(get_dept_buy_id(sql)) # 采购计划单子表order_no
# 要验证的数据sql
sql1 = "select * from mcms_pur_plan_detail where id='%s' order by create_time desc LIMIT 1;" % (
id2)
sql1 = "select * from mcms_purchase_detail where pid='%s' order by create_time desc LIMIT 1;" % (
id)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql1)
actual = check_mcms_pur_sql(sql1)
print('actual', actual)
hos_id = get_hosid()
dept_id1 = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
......@@ -940,102 +956,66 @@ def check_mcms_purchase_detail(id, type, planOrderNo):
pid = id
if type == 16:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
mdm_goods_code = process_tuple(
get_id("select mdm_goods_code from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
# print(mdm_goods_code)
goods_code = process_tuple(
get_id("select goods_code from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
pkg_def_id = process_tuple(
get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id))
supply_id = process_tuple(
get_id("select supply_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
sub_prov_id = prov_id
create_time = get_create_time(
"select create_time from mcms_pur_plan_detail where id='%s';" % (
id2))
last_modified = create_time
sub_prov_name = prov_name
source_id = process_tuple(
get_id("select source_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pur_plan_detail', id2, pid, planOrderNo, source_id, hos_goods_id,
mdm_goods_code, goods_code, pkg_def_id, supply_id, prov_id, prov_name,
sub_prov_id, sub_prov_name,
create_user, create_time, last_modified, last_modified_user
)
elif type == 20:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
mdm_goods_code = process_tuple(
get_id("select mdm_goods_code from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
# print(mdm_goods_code)
goods_code = process_tuple(
get_id("select goods_code from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
# pkg_def_id = process_tuple(
# get_id("select pkg_def_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
# hos_goods_id, id2)))
supply_id = process_tuple(
get_id("select supply_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
sub_prov_id = prov_id
create_time = get_create_time(
"select create_time from mcms_pur_plan_detail where id='%s';" % (
id2))
last_modified = create_time
sub_prov_name = prov_name
source_id = process_tuple(
get_id("select source_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
source_id=get_id("select source_id from mcms_purchase_detail where pid='%s' order by create_time desc LIMIT 1;"%id)
if check_source_id(hos_goods_id,source_id)==True:
commonFuc().check_text_exist_result_text('succees', 'succees')
else:
commonFuc().check_text_exist_result_text('error', 'succees')
mdm_goods_code=get_mdm_goods_code1(hos_goods_id)
goods_code=get_goods_code1(hos_goods_id)
supply_id=get_supply_id(hos_goods_id)
pkg_def_id=get_pkg_def_id(hos_goods_id)
planBillId = process_tuple(
get_id(
"select pid from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
sql = "select id from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
get_branch_id(), type)
print(sql)
buyBillId = process_tuple(get_dept_buy_id(sql))
buyDetailId = get_id(
"select id from mcms_dept_buy_detail where pid='%s';" % buyBillId)
planDetailId = get_id(
"select id from spd3_herp_test2.mcms_pur_plan_detail where pid='%s';" % planBillId)
source_id=planDetailId
goodsGg=get_goods_gg(hos_goods_id)
goodsCode=get_goods_code1(hos_goods_id)
goodsName=get_goods_name(hos_goods_id)
create_user=get_login_user_uxid()
create_time=get_create_time("select create_time from mcms_purchase_detail where id='%s';"%detail_main_key)
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_pur_plan_detail2', id2, pid, planOrderNo, source_id,
'mcms_purchase_detail', detail_main_key, pid, OrderNo, source_id, hos_goods_id,
mdm_goods_code, goods_code, supply_id,pkg_def_id, planBillId, buyDetailId,planDetailId,
goodsGg, goodsCode,goodsName,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_purchase_detail1', detail_main_key, pid, OrderNo, source_id,
hos_goods_id,
mdm_goods_code, goods_code, supply_id, prov_id, prov_name,
sub_prov_id, sub_prov_name,
create_user, create_time, last_modified, last_modified_user
mdm_goods_code, goods_code, supply_id, pkg_def_id, planBillId,
buyDetailId, planDetailId,
goodsGg, goodsCode, goodsName, create_user, create_time, last_modified,
last_modified_user
)
else:
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
mdm_goods_code = process_tuple(
get_id("select mdm_goods_code from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
# print(mdm_goods_code)
goods_code = process_tuple(
get_id("select goods_code from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
pkg_def_id = process_tuple(
get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id))
supply_id = process_tuple(
get_id("select supply_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
sub_prov_id = prov_id
create_time = get_create_time(
"select create_time from mcms_pur_plan_detail where id='%s';" % (
id2))
last_modified = create_time
sub_prov_name = prov_name
source_id = process_tuple(
get_id("select source_id from mcms_pur_plan_detail where hos_goods_id='%s' and id='%s';" % (
hos_goods_id, id2)))
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_pur_plan_detail3', id2, pid, planOrderNo, source_id,
'mcms_purchase_detail2', detail_main_key, pid, OrderNo, source_id,
hos_goods_id,
mdm_goods_code, goods_code, pkg_def_id, supply_id, prov_id, prov_name,
sub_prov_id, sub_prov_name,
create_user, create_time, last_modified, last_modified_user
)
mdm_goods_code, goods_code, supply_id, pkg_def_id, planBillId,
buyDetailId, planDetailId,
goodsGg, goodsCode, goodsName, create_user, create_time, last_modified,
last_modified_user)
actual_value1 = get_process_list2(actual)
expected_value1 = get_process_list2(expected)
......@@ -1054,20 +1034,22 @@ def check_mcms_purchase_detail(id, type, planOrderNo):
else:
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_mcms_purchase_out_and_in(type=1):
if type==1:
sql="select * from mcms_purchase order by create_time desc LIMIT 3;"
if type == 1:
sql = "select * from mcms_purchase order by create_time desc LIMIT 3;"
else:
sql = "select * from mcms_purchase_detail order by create_time desc LIMIT 3;"
result_in=check_in_check_mcms_purchase(sql)
result_out=check_out_check_mcms_purchase(sql)
result_in = check_in_check_mcms_purchase(sql)
result_out = check_out_check_mcms_purchase(sql)
result = (compare_text_index(result_in, result_out))
print(result)
print(result_in)
print(result_out)
i=0
i = 0
while True:
if i==1000:
if i == 1000:
print('采购订单同步到外网已经过去16分钟未完成,请检查同步是否出现问题')
commonFuc().check_text_exist_result_text('error', 'succees')
break
......@@ -1083,101 +1065,208 @@ def check_mcms_purchase_out_and_in(type=1):
i = 1 + 10
continue
def check_hdi_distr(type=16):
from common.db.sql.sql_tools_out import check_mcms_pur_plan_sql, get_id
branch_id = get_branch_id()
#验证配送单主表
sql="select * from hdi_distr where branch_id = '%s' and bill_mode='%s'order by create_time desc LIMIT 1;"%(branch_id,type)
# 验证配送单主表
sql = "select * from hdi_distr where branch_id = '%s' and bill_mode='%s'order by create_time desc LIMIT 1;" % (
branch_id, type)
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
hos_id = get_hosid()
# 获取采购订单id
purchase_id = get_id(
"select id from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
# 查询配送单主键
distr_main_key = get_id(
"select id from hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
# 查询配送单order_no
distr_order_no = get_id(
"select order_no from hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
distr_main_key, type))
# 从采购订单获取source_id
source_id = get_id(
"select id from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
pur_bill_id = source_id
info = FileUtils().r_info8('b2_herp3_bs', "用户名信息", 'message3')
rec_user = info['username1']
sql = "select id from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
buyBillId = process_tuple(get_dept_buy_id(sql))
bill_relation_json = get_id(
"select bill_relation_json from hdi_distr a where id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
distr_main_key, type))
print(bill_relation_json)
purBillDate = reGetString(bill_relation_json, r'purBillDate":"', r'""distrBillId')
# purBillDate = get_expdt_date(
# "select create_time from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
# branch_id, type))
# process_date(purBillDate)
distrBillId = distr_main_key
distrOrderNo = distr_order_no
distrUser = get_login_user_uxid2()
create_user = distrUser
create_user_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
create_time = get_create_time(
"select create_time from hdi_distr where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type))
last_modified_user = distrUser
if type == 16:
# 验证子表数据
# check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
#获取采购订单id
purchase_id=get_id("select id from mcms_purchase where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"%(branch_id,type))
#查询配送单主键
distr_main_key=get_id("select id from hdi_distr a where branch_id = '%s' and bill_mode='%s' order by create_time desc LIMIT 1;"%(branch_id,type))
check_hdi_distr_detail(distr_main_key, type, purchase_id)
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
planBillId = process_tuple(
get_id(
"select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
planOrderNo = process_tuple(
get_id(
"select order_no from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
sql = "select order_no from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
buyOrderNo = process_tuple(get_dept_buy_id(sql))
sql = "select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
id1 = process_tuple(get_dept_buy_id(sql))
sql = "select order_no from mcms_purchase where branch_id='%s' and bill_mode='%s'and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, type, id1)
print(sql)
purOrderNo = process_tuple(get_dept_buy_id(sql))
purBillId = id1
prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
exe_prov_id = prov_id
exe_prov_name = prov_name
pur_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
pur_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
rec_org_id = process_tuple(
get_id("select id from spd3_herp_test2.sys_org where branch_id='%s' and ename='%s';" % (
branch_id, FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'])))
rec_org_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
last_modified = create_time
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_purchase', id1, order_no, hos_id,
get_branch_id(), dept_id1, dept_name1, rec_org_id, rec_org_name,
area_code, area_name, bill_expdt_date, source_id, rec_user,
rec_addr, prov_id, prov_name, exe_prov_id, exe_prov_name, buyBillId,
planBillId, planOrderNo,
buyOrderNo, purOrderNo, purBillId, close_date, create_user,
create_time, last_modified, last_auditor, last_audit_time
'hdi_distr', distr_main_key, distr_order_no, hos_id, get_hosname(),
get_branch_id(), source_id, pur_bill_id, prov_id, prov_name,
exe_prov_id, exe_prov_name, pur_dept_id, pur_dept_name, rec_org_id,
rec_org_name, rec_user, buyBillId, planBillId, planOrderNo, buyOrderNo,
purOrderNo, purBillId, purBillDate, distrBillId, distrOrderNo,
distrUser, create_user, create_user_name, create_time, last_modified,
last_modified_user
)
elif type == 20:
# check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
# 验证子表数据
check_hdi_distr_detail(distr_main_key, type, purchase_id)
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message1')["hosGoodsId"]
planBillId = process_tuple(
get_id(
"select pid from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
"select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
planOrderNo = process_tuple(
get_id(
"select order_no from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
"select order_no from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
sql = "select order_no from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
sql = "select order_no from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
buyOrderNo = process_tuple(get_dept_buy_id(sql))
purOrderNo = order_no
sql = "select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
id1 = process_tuple(get_dept_buy_id(sql))
sql = "select order_no from mcms_purchase where branch_id='%s' and bill_mode='%s'and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, type, id1)
print(sql)
purOrderNo = process_tuple(get_dept_buy_id(sql))
purBillId = id1
prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
exe_prov_id = prov_id
exe_prov_name = prov_name
close_date = get_create_time(
"select close_date from mcms_purchase where id='%s';" % (
id1))
source_id = planBillId
pur_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
pur_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
rec_org_id = process_tuple(
get_id("select id from spd3_herp_test2.sys_org where branch_id='%s' and ename='%s';" % (
branch_id, FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'])))
rec_org_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
last_modified = create_time
# import pdb
# pdb.set_trace()
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_purchase2', id1, order_no, hos_id,
get_branch_id(), dept_id1, dept_name1, rec_org_id, rec_org_name,
area_code, area_name, bill_expdt_date, source_id, rec_user,
rec_addr, prov_id, prov_name, exe_prov_id, exe_prov_name, buyBillId,
planBillId, planOrderNo,
buyOrderNo, purOrderNo, purBillId, close_date, create_user,
create_time, last_modified, last_auditor, last_audit_time
'hdi_distr1', distr_main_key, distr_order_no, hos_id, get_hosname(),
get_branch_id(), source_id, pur_bill_id, prov_id, prov_name,
exe_prov_id, exe_prov_name, pur_dept_id, pur_dept_name, rec_org_id,
rec_org_name, rec_user, buyBillId, planBillId, planOrderNo, buyOrderNo,
purOrderNo, purBillId, purBillDate, distrBillId, distrOrderNo,
distrUser, create_user, create_user_name, create_time, last_modified,
last_modified_user
)
elif type == 66:
# check_mcms_mcms_pur_plan_detail(id2, type, planOrderNo)
# 验证子表数据
check_hdi_distr_detail(distr_main_key, type, purchase_id)
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message3')["hosGoodsId"]
planBillId = process_tuple(
get_id(
"select pid from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
"select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
planOrderNo = process_tuple(
get_id(
"select order_no from mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
"select order_no from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
sql = "select order_no from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
sql = "select order_no from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
buyOrderNo = process_tuple(get_dept_buy_id(sql))
purOrderNo = order_no
sql = "select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
branch_id, type)
print(sql)
id1 = process_tuple(get_dept_buy_id(sql))
sql = "select order_no from mcms_purchase where branch_id='%s' and bill_mode='%s'and id='%s' order by create_time desc LIMIT 1;" % (
branch_id, type, id1)
print(sql)
purOrderNo = process_tuple(get_dept_buy_id(sql))
purBillId = id1
prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
exe_prov_id = prov_id
exe_prov_name = prov_name
close_date = get_create_time(
"select close_date from mcms_purchase where id='%s';" % (
id1))
source_id = planBillId
pur_dept_id = FileUtils().r_info8("b2_herp3_bs", "所有科室id", 'message6')['deptid1']
pur_dept_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid1']
rec_org_id = process_tuple(
get_id("select id from spd3_herp_test2.sys_org where branch_id='%s' and ename='%s';" % (
branch_id, FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2'])))
rec_org_name = FileUtils().r_info8("b2_herp3_bs", "所有科室name", 'message6')['deptid2']
last_modified = create_time
# import pdb
# pdb.set_trace()
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'mcms_purchase3', id1, order_no, hos_id,
get_branch_id(), dept_id1, dept_name1, rec_org_id, rec_org_name,
area_code, area_name, bill_expdt_date, source_id, rec_user,
rec_addr, prov_id, prov_name, exe_prov_id, exe_prov_name, buyBillId,
planBillId, planOrderNo,
buyOrderNo, purOrderNo, purBillId, close_date, create_user,
create_time, last_modified, last_auditor, last_audit_time
'hdi_distr2', distr_main_key, distr_order_no, hos_id, get_hosname(),
get_branch_id(), source_id, pur_bill_id, prov_id, prov_name,
exe_prov_id, exe_prov_name, pur_dept_id, pur_dept_name, rec_org_id,
rec_org_name, rec_user, buyBillId, planBillId, planOrderNo, buyOrderNo,
purOrderNo, purBillId, purBillDate, distrBillId, distrOrderNo,
distrUser, create_user, create_user_name, create_time, last_modified,
last_modified_user
)
else:
expected = None
actual_value1 = get_process_list2(actual)
......@@ -1198,13 +1287,139 @@ def check_hdi_distr(type=16):
print('error')
commonFuc().check_text_exist_result_text('error', 'succees')
def check_hdi_distr_detail(distr_main_key, type, purchase_id):
sql = "select * from hdi_distr_detail where pid = '%s';" % distr_main_key
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
# 获取子表主键
distr_detail_main_key = get_id(
"select id from hdi_distr_detail where pid = '%s';" % (
distr_main_key))
source_id = purchase_id
source_detail_id = get_id("select id from mcms_purchase_detail where pid='%s'" % purchase_id)
pur_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)
goods_name = get_goods_name(hos_goods_id)
goods_gg = get_goods_gg(hos_goods_id)
mfrs_id = get_goods_mfrs_id(hos_goods_id)
expdt_date = get_expdt_date(
"select expdt_date from hdi_distr_detail where pid = '%s';" % (
distr_main_key))
product_date = get_expdt_date(
"select product_date from hdi_distr_detail where pid = '%s';" % (
distr_main_key))
pkg_def_id = process_tuple(
get_id("select pkg_def_id from mcms_pkg where hos_goods_id='%s' LIMIT 1;" % hos_goods_id))
supply_id = get_supply_id(hos_goods_id)
sub_prov_id = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_corpId"]
sub_prov_name = FileUtils().r_info8('b5_spd3_core_business_flow', '供货关系申请2', 'message')["e_username"]
planBillId = process_tuple(
get_id(
"select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
hos_goods_id)))
sql = "select id from spd3_herp_test2.mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
get_branch_id(), type)
print(sql)
buyBillId = process_tuple(get_dept_buy_id(sql))
buyDetailId = get_id(
"select id from mcms_dept_buy_detail where pid='%s';" % buyBillId)
# planBillId = process_tuple(
# get_id(
# "select pid from spd3_herp_test2.mcms_pur_plan_detail where hos_goods_id='%s' order by create_time desc LIMIT 1;" % (
# hos_goods_id)))
planDetailId = get_id(
"select id from spd3_herp_test2.mcms_pur_plan_detail where pid='%s';" % planBillId)
purDetailId = pur_detail_id
sql = "select id from mcms_purchase where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % (
get_branch_id(), type)
print(sql)
id1 = process_tuple(get_dept_buy_id(sql))
purBillId = id1
distrDetailId = distr_detail_main_key
distrBillId = distr_main_key
erpCode = mdm_goods_code#11661563
create_user = get_login_user_uxid2()
create_time = get_create_time(
"select create_time from hdi_distr_detail where id = '%s';" % (
distr_detail_main_key))
last_modified=create_time
last_modified_user=create_user
if type == 16:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'hdi_distr_detail', distr_detail_main_key, distr_main_key, source_id,
source_detail_id, pur_detail_id
, hos_goods_id, mdm_goods_code, goods_code, goods_name, goods_gg,
mfrs_id, expdt_date, product_date
, pkg_def_id, supply_id, sub_prov_id, sub_prov_name, planBillId,
buyDetailId, planDetailId, purDetailId, purBillId, distrDetailId,
distrBillId, goods_gg, goods_code, goods_name, erpCode,create_user,create_time,last_modified,last_modified_user)
elif type==20:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'hdi_distr_detail2', distr_detail_main_key, distr_main_key, source_id,
source_detail_id, pur_detail_id
, hos_goods_id, mdm_goods_code, goods_code, goods_name, goods_gg,
mfrs_id, expdt_date, product_date
, pkg_def_id, supply_id, sub_prov_id, sub_prov_name, planBillId,
buyDetailId, planDetailId, purDetailId, purBillId, distrDetailId,
distrBillId, goods_gg, goods_code, goods_name, erpCode, create_user,
create_time, last_modified, last_modified_user)
elif type==66:
expected = commonFuc().get_business_data('b6_spd3_core_business_flow_database_check',
'hdi_distr_detail3', distr_detail_main_key, distr_main_key, source_id,
source_detail_id, pur_detail_id
, hos_goods_id, mdm_goods_code, goods_code, goods_name, goods_gg,
mfrs_id, expdt_date, product_date
, pkg_def_id, supply_id, sub_prov_id, sub_prov_name, planBillId,
buyDetailId, planDetailId, purDetailId, purBillId, distrDetailId,
distrBillId, goods_gg, goods_code, goods_name, erpCode, create_user,
create_time, last_modified, last_modified_user)
else:
expected=None
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')
def check_mcms_check(type=1):
print('检查验收单数据库写值')
check_no=FileUtils().r_info8('b5_spd3_core_business_flow', '验收单号', 'message15')
sql = "select * from mcms_check where id = '%s';" % check_no
# 获取实际值
actual = check_mcms_pur_plan_sql(sql)
print('actual', actual)
try:
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_b4流程十一请领业务流_二级库向直送.air')
using(pro_path + r'//air_case/b5_spd3_core_business_flow/a_b4流程十一请领业务流_二级库向直送.air')
updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
from a_b4流程十一请领业务流_二级库向直送 import goods_move2
......@@ -1215,6 +1430,7 @@ try:
from a_b4流程十一请领业务流_二级库向直送 import check_accept_order
for i in range(1):
# updateUserLoginDefaultRange(get_listUserMgrRangePage(2)) # 设置登录账号默认权限是二级库
# goods_move2() # 设置产品出库渠道为直送
# # # 低值
# second_dept_Request(FileUtils().r_info8("b5_spd3_core_business_flow", "产品审核信息", 'message2')['hosGoodsId'], 1)
......@@ -1247,25 +1463,31 @@ try:
#
# for i in range(3): # 三个单据共审批3次
# approval_center()
# 上面暂时注释=========================================
list_data = ['16', '20', '66']
for i in list_data:
check_mcms_purchase(int(i))
#检查同步到外网的采购订单数据跟内网的是否一致
check_mcms_purchase_out_and_in(1)
check_mcms_purchase_out_and_in(2)
order_dp(1) # 1低值
order_dp(2) # 2高值
order_dp(3) # 3试剂
list_data = ['16', '20', '66']
for i in list_data:
check_hdi_distr(int(i))
# check_accept_order(1) # 低值
#
# list_data = ['16', '20', '66']
# for i in list_data:
# check_mcms_purchase(int(i))
# check_mcms_check(1)#调用函数检查验收单数据库写值
#
# #检查同步到外网的采购订单数据跟内网的是否一致
# check_mcms_purchase_out_and_in(1)
# check_mcms_purchase_out_and_in(2)
# order_dp(1) # 1低值
# order_dp(2) # 2高值
# order_dp(3) # 3试剂
# 上面暂时注释=========================================
check_hdi_distr()
check_accept_order(1) # 低值
check_accept_order(2) # 高值
check_accept_order(3) # 试剂
second_dept_one_key_in()
second_dept_one_key_in()
second_dept_one_key_in()
# check_accept_order(2) # 高值
# check_accept_order(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 Exception as e:
# 打印错误信息
......
......@@ -3449,4 +3449,19 @@ def get_login_user_uxid():
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token1, projectCode1, uxid1, corpId1, info1 = login_system(username, password).get_token()
return uxid1
def get_login_user_uxid2():
module = "b5_spd3_core_business_flow"
# 登录获取用户id等信息,使用创建的用户登录===========开始
info = FileUtils().r_info8(module, "供货关系申请2", 'message')
print(info)
username1 = info['e_username']
username = username1
## print('医院名称',username)
password = commonFuc().get_business_data(module, "password1")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token1, projectCode1, uxid1, corpId1, info1 = login(username, password,1)
return uxid1
\ No newline at end of file
......@@ -122,6 +122,12 @@ def check_mcms_pur_plan_sql(sql):
print('res_dict', res_dict)
cursor.close()
return res_dict
def check_mcms_pur_sql(sql):
db, cursor = get_sql_conn()
res_dict = get_dict_data_sql(cursor, sql)
print('res_dict', res_dict)
cursor.close()
return res_dict
def get_create_time(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
......@@ -144,6 +150,11 @@ def get_expdt_date(sql):
# print(new_str1)
cursor.close()
return new_str1
def get_expdt_date1(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
results = cursor.fetchone()
return results
def get_id(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
......@@ -169,13 +180,72 @@ def process_tuple(tuple1):
new_str1 = new_str1.replace(',', '')
new_str1 = new_str1.replace("'", '')
return new_str1
def get_mdm_goods_code1(hos_goods_id):
db, cursor = get_sql_conn()
cursor.execute("select mdm_goods_code from mcms_goods_info where id='%s'"%hos_goods_id)
results = cursor.fetchall()
cursor.close()
return process_tuple(results)
def get_goods_code1(hos_goods_id):
db, cursor = get_sql_conn()
cursor.execute("select hos_goods_code from mcms_goods_info where id='%s'"%hos_goods_id)
results = cursor.fetchall()
cursor.close()
return process_tuple(results)
def get_goods_name(hos_goods_id):
db, cursor = get_sql_conn()
cursor.execute("select goods_name from mcms_goods_info where id='%s'"%hos_goods_id)
results = cursor.fetchall()
cursor.close()
return process_tuple(results)
def get_goods_gg(hos_goods_id):
db, cursor = get_sql_conn()
cursor.execute("select goods_spec from mcms_goods_info where id='%s'"%hos_goods_id)
results = cursor.fetchall()
cursor.close()
return process_tuple(results)
def get_supply_id(hos_goods_id):
db, cursor = get_sql_conn()
cursor.execute("select id from supply_prov_hos_goods where hos_goods_id='%s'" % hos_goods_id)
results = cursor.fetchall()
cursor.close()
return process_tuple(results)
def get_pkg_def_id(hos_goods_id):
db, cursor = get_sql_conn()
cursor.execute("select pkg_def_id from mcms_pkg where hos_goods_id='%s'" % hos_goods_id)
results = cursor.fetchone()
cursor.close()
return process_tuple(results)
def get_goods_name1(hos_goods_id):
db, cursor = get_sql_conn()
cursor.execute("select goods_name from mcms_goods_info where id='%s'" % hos_goods_id)
results = cursor.fetchall()
cursor.close()
return process_tuple(results)
def get_mdm_goods_code(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
results = cursor.fetchall()
cursor.close()
return results
def get_goods_mfrs_id(hos_goods_id):
db, cursor = get_sql_conn()
cursor.execute("select goods_mfrs_id from mcms_goods_info where id='%s'" % hos_goods_id)
results = cursor.fetchall()
cursor.close()
return process_tuple(results)
def check_source_id(hos_goods_id,source_id):
db, cursor = get_sql_conn()
cursor.execute("select hos_goods_id from mcms_pur_plan_detail where id='%s'" % (source_id))
results1 = cursor.fetchall()
cursor.close()
hos_goods_id2= process_tuple(results1)
if hos_goods_id2==hos_goods_id:
return True
else:
return False
def check_in_check_mcms_purchase(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
......@@ -188,5 +258,33 @@ def check_in_check_mcms_purchase(sql):
# print(new_str1)
cursor.close()
return new_str1
def process_date(str1):
# str1 = "datetime.datetime(2024, 9, 17, 15, 32, 58)"
str2 = str1.replace('datetime.datetime(', "")
str3 = str2.replace(')', "")
result = str3.split(",")
result.pop(3)
result.pop(4)
result.pop(3)
print(result)
b = [int(x) for x in result]
print(type(b), b)
date_list = b
#
from datetime import datetime
# # 假设我们有一个列表,包含年、月、日
# date_list = [2023, 3, 14]
# print(type(date_list),date_list)
#
# # 使用列表元素构造字符串
date_string = '-'.join(map(str, date_list))
#
# # 使用datetime.strptime将字符串转换为日期
date = datetime.strptime(date_string, '%Y-%m-%d').date()
#
print(date) # 输出: 2023-03-14
return date
# hos_goods_id = 'h034700004220'
# main2(hos_goods_id)
\ No newline at end of file
......@@ -113,7 +113,11 @@ def process_tuple(tuple1):
new_str1 = new_str1.replace(',', '')
new_str1 = new_str1.replace("'", '')
return new_str1
def get_expdt_date1(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
results = cursor.fetchone()
return results
def get_mdm_goods_code(sql):
db, cursor = get_sql_conn()
cursor.execute(sql)
......
import logging
import warnings
# 忽略所有 UserWarning 警告
warnings.filterwarnings("ignore", category=UserWarning)
# 1、设置全局的日志格式和级别
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',
datefmt='%m/%d/%Y %H:%M:%S',
level=logging.INFO)
# 2、获取logger (给日志器起个名字 "__name__")
logger = logging.getLogger(__name__)# __name__内置变量模块名称,轻松地识别出哪个模块产生了哪些日志消息(主程序模块)
# 3、创建文件处理器,指定日志文件和日志级别(局部)---文件输出FileHandle(输出到指定文件)
file_handler = logging.FileHandler('application.log') #指定日志文件名application.log,默认在当前目录下创建
file_handler.setLevel(logging.INFO) # 设置日志级别(只输出对应级别INFO的日志信息)
# 设置日志格式
file_handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s', '%m/%d/%Y %H:%M:%S'))
# 4、添加文件处理器到logger
logger.addHandler(file_handler)
# 训练模型的代码
epoch = 7
# 记录日志信息
logger.info("Get better performance at epoch {}".format(epoch))
# 在主类中编写日志代码
# 判断当前程序是否为主程序,确保 main() 函数只在直接运行该Python文件时执行,如果文件被其他模块导入,则不执行 main()
# 主程序内置变量 __name__
......@@ -40,4 +40,15 @@
"mcms_purchase2": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "HDI", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":20}", "barcode_flag": 1, "pkg_flag": 0, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}'
"mcms_purchase3": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "HDI", "hos_id": "%s", "branch_id": "%s", "dept_id": "%s", "dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "area_code": "%s", "area_name": "%s", "bill_expdt_date": %s, "source_id": "%s", "source_type": "CGJH", "in_settlement": None, "rec_user": "%s", "rec_phone": "None", "rec_addr": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":60}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "priority": 0, "close_status": 0, "close_date": %s, "up_status": 0, "tb_status": 30, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": None, "version": 0, "del_flag": 0, "last_auditor": "%s", "last_audit_time": %s}'
"hdi_distr": '{"id": "PSh0347202407160001", "order_no": "PSh0347202407160001", "bill_mode": "16", "rec_type": "YND", "hos_id": "h0347", "hos_name": "邹城市人民医院(test)", "branch_id": "h0347-3755", "source_id": "Ch034720240716000007", "source_type": "CGD", "pur_bill_id": "Ch034720240716000007", "prov_id": "p1e35e", "prov_name": "国药集团公司S57ui", "sub_send_flag": 10, "exe_prov_id": "p1e35e", "exe_prov_name": "国药集团公司S57ui", "settlement": None, "pur_dept_id": "63c734f07fcc422ea80f49ca8e5bbd95", "pur_dept_name": "设备科001", "rec_org_id": "63c734f07fcc422ea80f49ca8e5bbd95", "rec_org_name": "设备科001", "rec_user": "自动化测试w&vqF", "rec_phone": "xhs", "rec_addr": "自动化测试", "bill_relation_json": "{"planBillId":"Ph034720240716029565","planOrderNo":"PLAN2024071632920","purOrderNo":"CG2024071621454","purBillId":"Ch034720240716000007","purBillDate":"2024-07-16 08:11:19","distrBillId":"PSh0347202407160001","distrOrderNo":"PSh0347202407160001"}", "ext_info": "{"epidemicFlag":0,"purMode":10,"distrUser":"p1e35e:UID-052165"}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "task_id": None, "convert_flag": 1, "convert_time": None, "convert_user_name": None, "reject_status": 40, "tb_status": 25, "create_user": "p1e35e:UID-052165", "create_user_name": "国药集团公司S57ui", "create_time": datetime.datetime(2024, 7, 16, 8, 11, 42), "last_modified": datetime.datetime(2024, 7, 16, 8, 12, 53), "last_modified_user": "h0347_UID-051420", "version": 2, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "initial_order": None}'
\ No newline at end of file
"mcms_purchase_detail": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 10, "price": Decimal("99.999900"), "supply_id": "%s", "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "pkg_qty": Decimal("1.00"), "qty": Decimal("100.00"), "con_pkg_qty": Decimal("0.00"), "con_qty": Decimal("0.00"), "up_pkg_qty": Decimal("0.00"), "up_qty": Decimal("0.00"), "check_pkg_qty": Decimal("0.00"), "check_qty": Decimal("0.00"), "distr_pkg_qty": Decimal("0.00"), "distr_qty": Decimal("0.00"), "not_send_qty": Decimal("0.00"), "not_send_pkg_qty": Decimal("0.00"), "in_settlement": 1, "close_type": 1, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":10,"goodsName":"%s"}", "remark": None, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"mcms_purchase_detail1": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 20, "price": Decimal("99.999900"), "supply_id": "%s", "pkg_def_id": %s, "pkg_def_name": null, "pkg_def_qty": Decimal("1.00"), "pkg_qty": Decimal("1.00"), "qty": Decimal("1.00"), "con_pkg_qty": Decimal("0.00"), "con_qty": Decimal("0.00"), "up_pkg_qty": Decimal("0.00"), "up_qty": Decimal("0.00"), "check_pkg_qty": Decimal("0.00"), "check_qty": Decimal("0.00"), "distr_pkg_qty": Decimal("0.00"), "distr_qty": Decimal("0.00"), "not_send_qty": Decimal("0.00"), "not_send_pkg_qty": Decimal("0.00"), "in_settlement": 1, "close_type": 1, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":20,"goodsName":"%s"}", "remark": None, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"mcms_purchase_detail2": '{"id": "%s", "pid": "%s", "order_no": "%s", "source_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "pur_mode": 60, "price": Decimal("99.999900"), "supply_id": "%s", "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "pkg_qty": Decimal("1.00"), "qty": Decimal("100.00"), "con_pkg_qty": Decimal("0.00"), "con_qty": Decimal("0.00"), "up_pkg_qty": Decimal("0.00"), "up_qty": Decimal("0.00"), "check_pkg_qty": Decimal("0.00"), "check_qty": Decimal("0.00"), "distr_pkg_qty": Decimal("0.00"), "distr_qty": Decimal("0.00"), "not_send_qty": Decimal("0.00"), "not_send_pkg_qty": Decimal("0.00"), "in_settlement": 1, "close_type": 1, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":60,"goodsName":"%s"}", "remark": None, "tb_status": 10, "pur_task_id": None, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"hdi_distr": '{"id": "%s", "order_no": "%s", "bill_mode": "16", "rec_type": "HDI", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "source_id": "%s", "source_type": "CGD", "pur_bill_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "settlement": None, "pur_dept_id": "%s", "pur_dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "rec_user": "%s", "rec_phone": "None", "rec_addr": "设备科001", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":10,"distrUser":"%s"}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "task_id": None, "convert_flag": 1, "convert_time": None, "convert_user_name": None, "reject_status": 0, "tb_status": 20, "create_user": "%s", "create_user_name": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "initial_order": None}'
"hdi_distr1": '{"id": "%s", "order_no": "%s", "bill_mode": "20", "rec_type": "HDI", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "source_id": "%s", "source_type": "CGD", "pur_bill_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "settlement": None, "pur_dept_id": "%s", "pur_dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "rec_user": "%s", "rec_phone": "None", "rec_addr": "设备科001", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":20,"distrUser":"%s"}", "barcode_flag": 1, "pkg_flag": 0, "remark": "", "task_id": None, "convert_flag": 1, "convert_time": None, "convert_user_name": None, "reject_status": 0, "tb_status": 20, "create_user": "%s", "create_user_name": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "initial_order": None}'
"hdi_distr2": '{"id": "%s", "order_no": "%s", "bill_mode": "66", "rec_type": "HDI", "hos_id": "%s", "hos_name": "%s", "branch_id": "%s", "source_id": "%s", "source_type": "CGD", "pur_bill_id": "%s", "prov_id": "%s", "prov_name": "%s", "sub_send_flag": 10, "exe_prov_id": "%s", "exe_prov_name": "%s", "settlement": None, "pur_dept_id": "%s", "pur_dept_name": "%s", "rec_org_id": "%s", "rec_org_name": "%s", "rec_user": "%s", "rec_phone": "None", "rec_addr": "设备科001", "bill_relation_json": "{"buyBillId":"%s","planBillId":"%s","planOrderNo":"%s","buyOrderNo":"%s","purOrderNo":"%s","purBillId":"%s","purBillDate":"%s","distrBillId":"%s","distrOrderNo":"%s"}", "ext_info": "{"epidemicFlag":0,"purMode":60,"distrUser":"%s"}", "barcode_flag": 1, "pkg_flag": 1, "remark": "", "task_id": None, "convert_flag": 1, "convert_time": None, "convert_user_name": None, "reject_status": 0, "tb_status": 20, "create_user": "%s", "create_user_name": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 1, "del_flag": 0, "last_auditor": None, "last_audit_time": None, "initial_order": None}'
"hdi_distr_detail": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "10", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "333", "expdt_date": %s, "product_date": %s, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("1.00"), "distr_qty": Decimal("100.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":10,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"hdi_distr_detail2": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "20", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "222", "expdt_date": %s, "product_date": %s, "pkg_def_id": %s, "pkg_def_name": null, "pkg_def_qty": Decimal("1.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("1.00"), "distr_qty": Decimal("1.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":20,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
"hdi_distr_detail3": '{"id": "%s", "pid": "%s", "source_id": "%s", "source_detail_id": "%s", "pur_detail_id": "%s", "hos_goods_id": "%s", "mdm_goods_code": "%s", "goods_code": "%s", "goods_name": "%s", "goods_gg": "%s", "pur_mode": "60", "mfrs_id": "%s", "mfrs_name": "德国歌德公司 Geuder AG", "made": "德国", "unit": "支", "pur_price": Decimal("99.999900"), "batch_code": "4444", "expdt_date": %s, "product_date": %s, "pkg_def_id": "%s", "pkg_def_name": "100", "pkg_def_qty": Decimal("100.00"), "supply_id": "%s", "sub_prov_id": "%s", "sub_prov_name": "%s", "sub_price": Decimal("99.9999"), "distr_price": Decimal("99.9999"), "distr_pkg_qty": Decimal("1.00"), "distr_qty": Decimal("100.00"), "settlement": 1, "certificate_code": "", "product_cert_code": None, "detail_relation_json": "{"planBillId":"%s","buyDetailId":"%s","planDetailId":"%s","purDetailId":"%s","purBillId":"%s","distrDetailId":"%s","distrBillId":"%s"}", "ext_info": "{"goodsGg":"%s","goodsCode":"%s","purMode":60,"goodsName":"%s","ygptCode":"","transCond":"","storageCond":"","erpCode":"%s","ybDefId":""}", "tb_status": 0, "create_user": "%s", "create_time": %s, "last_modified": %s, "last_modified_user": "%s", "version": 0, "del_flag": 0}'
......@@ -76,9 +76,9 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分8</td>
<td class="details-col-elapsed">100.0%</td>
<td class='details-col-elapsed'>0</td>
<td class='details-col-elapsed'>0分55</td>
<td class="details-col-elapsed">0.0%</td>
</tr>
</table>
......@@ -93,9 +93,9 @@ setInterval(updateTime, 1000); // 每秒更新一次时间
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/r_b8库房管理_库区设置_同步库房信息/log.html' target='_blank'>r_b8库房管理_库区设置_同步库房信息</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">8.311</td>
<td class="details-col-elapsed"><a href='../log/a_b4流程十一请领业务流_二级库向直送_数据库验证/log.html' target='_blank'>a_b4流程十一请领业务流_二级库向直送_数据库验证</a></td>
<td class="fail">失败</td>
<td class="details-col-elapsed">55.354</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment