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

优化调整脚本

parent 5fd41d00
...@@ -188,11 +188,11 @@ def check_mcms_dept_buy(type=16): ...@@ -188,11 +188,11 @@ def check_mcms_dept_buy(type=16):
actual = check_mcms_dept_buy_sql(sql) actual = check_mcms_dept_buy_sql(sql)
print(actual) print(actual)
# 获取主键id # 获取主键id
sql = "select id from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( sql = "select id from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS'order by create_time desc LIMIT 1;" % (
branch_id, type) branch_id, type)
id1 = get_dept_buy_id(sql) id1 = get_dept_buy_id(sql)
# 获取order_no # 获取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;" % ( sql1 = "select order_no from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;" % (
branch_id, type) branch_id, type)
order_no1 = get_dept_buy_id(sql1) order_no1 = get_dept_buy_id(sql1)
print(process_tuple(id1), process_tuple(order_no1)) print(process_tuple(id1), process_tuple(order_no1))
...@@ -217,23 +217,23 @@ def check_mcms_dept_buy(type=16): ...@@ -217,23 +217,23 @@ def check_mcms_dept_buy(type=16):
pkgDefId = commonFuc().analysis_json('pkgDefId', list_a) pkgDefId = commonFuc().analysis_json('pkgDefId', list_a)
pkgDefName = commonFuc().analysis_json('pkgDefName', list_a) pkgDefName = commonFuc().analysis_json('pkgDefName', list_a)
# 获取边仓id # 获取边仓id
target_stock_id = get_id("select logic_id FROM yb_direct WHERE branch_id ='%s';" % branch_id) target_stock_id = get_id("select logic_id FROM yb_direct WHERE branch_id ='%s' order by create_time desc LIMIT 1;" % branch_id)
bill_expdt_date = get_expdt_date( 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;" % ( "select bill_expdt_date from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;" % (
branch_id, type)) branch_id, type))
rec_user = get_login_user_uxid() rec_user = get_login_user_uxid()
# rec_addr='二级检验科002' # rec_addr='二级检验科002'
create_user = rec_user create_user = rec_user
create_time = get_create_time( 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;" % ( "select create_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;" % (
branch_id, type)) branch_id, type))
last_modified = get_create_time( 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;" % ( "select last_modified from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;" % (
branch_id, type)) branch_id, type))
last_modified_user = rec_user last_modified_user = rec_user
last_auditor = rec_user last_auditor = rec_user
last_audit_time = get_create_time( 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;" % ( "select last_audit_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;" % (
branch_id, type)) branch_id, type))
target_stock_name = '自动化测试12345' target_stock_name = '自动化测试12345'
# target_stock_name=get_branch_name()+'中心库房' # target_stock_name=get_branch_name()+'中心库房'
...@@ -282,16 +282,16 @@ def check_mcms_dept_buy(type=16): ...@@ -282,16 +282,16 @@ def check_mcms_dept_buy(type=16):
def check_mcms_dept_buy_approval_after(type=16): def check_mcms_dept_buy_approval_after(type=16):
branch_id = get_branch_id() 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; sql = """select * from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;
""" % (branch_id, type) """ % (branch_id, type)
actual = check_mcms_dept_buy_sql(sql) actual = check_mcms_dept_buy_sql(sql)
print(actual) print(actual)
# 获取主键id # 获取主键id
sql = "select id from mcms_dept_buy where branch_id='%s' and bill_mode='%s' order by create_time desc LIMIT 1;" % ( sql = "select id from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;" % (
branch_id, type) branch_id, type)
id1 = get_dept_buy_id(sql) id1 = get_dept_buy_id(sql)
# 获取order_no # 获取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;" % ( sql1 = "select order_no from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;" % (
branch_id, type) branch_id, type)
order_no1 = get_dept_buy_id(sql1) order_no1 = get_dept_buy_id(sql1)
print(process_tuple(id1), process_tuple(order_no1)) print(process_tuple(id1), process_tuple(order_no1))
...@@ -318,21 +318,21 @@ def check_mcms_dept_buy_approval_after(type=16): ...@@ -318,21 +318,21 @@ def check_mcms_dept_buy_approval_after(type=16):
# 获取边仓id # 获取边仓id
target_stock_id = get_id("select logic_id FROM yb_direct WHERE branch_id ='%s';" % branch_id) target_stock_id = get_id("select logic_id FROM yb_direct WHERE branch_id ='%s';" % branch_id)
bill_expdt_date = get_expdt_date( 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;" % ( "select bill_expdt_date from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;" % (
branch_id, type)) branch_id, type))
rec_user = get_login_user_uxid() rec_user = get_login_user_uxid()
# rec_addr='二级检验科002' # rec_addr='二级检验科002'
create_user = rec_user create_user = rec_user
create_time = get_create_time( 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;" % ( "select create_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;" % (
branch_id, type)) branch_id, type))
last_modified = get_create_time( 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;" % ( "select last_modified from mcms_dept_buy where branch_id='%s' and bill_mode='%s' and buy_kind='KS' order by create_time desc LIMIT 1;" % (
branch_id, type)) branch_id, type))
last_modified_user = rec_user last_modified_user = rec_user
last_auditor = rec_user last_auditor = rec_user
last_audit_time = get_create_time( 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;" % ( "select last_audit_time from mcms_dept_buy where branch_id='%s' and bill_mode='%s'and buy_kind='KS' order by create_time desc LIMIT 1;" % (
branch_id, type)) branch_id, type))
target_stock_name = '自动化测试12345' target_stock_name = '自动化测试12345'
# target_stock_name = get_branch_name() + '中心库房' # target_stock_name = get_branch_name() + '中心库房'
...@@ -504,6 +504,7 @@ def main(): ...@@ -504,6 +504,7 @@ def main():
for i in range(6): # 三个单据共审批6次 for i in range(6): # 三个单据共审批6次
approval_center() approval_center()
# ==================上面暂时注释=================================== # ==================上面暂时注释===================================
time.sleep(6)
list_data = ['16', '20', '66'] list_data = ['16', '20', '66']
for i in list_data: for i in list_data:
check_mcms_dept_buy_approval_after(int(i)) check_mcms_dept_buy_approval_after(int(i))
......
院区新增: 院区新增:
branch_id: h0347-3755 branch_id: h0347-3757
branch_name: 东土城路院区7R4&E branch_name: 东土城路院区1Joce
科室信息: 科室信息:
dept2_id: b12c7c6ca56e4b46b418b319cbadbea5 dept2_id: c913da28183b4b34a3ad567a345f4df6
dept2_name: 二级检验科002 dept2_name: 二级检验科002
供货关系申请2: 供货关系申请2:
e_corpId: p1e332 e_corpId: p1e37a
h_corpId: h0347 h_corpId: h0347
e_username: 国药集团公司L1slG e_username: 国药集团公司D1cRP
h_name: test001 h_name: test001
产品审核信息: 产品审核信息:
MSPid: MSP2407090007_1 MSPid: MSP2408010015_1
hosId: h0347 hosId: h0347
hosGoodsId: h034700004510 hosGoodsId: h034700004744
provGoodsid: provGood-99221706 provGoodsid: provGood-99221978
goodsAuditBillId: MSP2407090007 goodsAuditBillId: MSP2408010015
targetId: MSP2407090007_1 targetId: MSP2408010015_1
...@@ -3,27 +3,27 @@ ...@@ -3,27 +3,27 @@
- &id001 - &id001
- id: - id:
hosId: h0347 hosId: h0347
branchId: h0347-3738 branchId: h0347-3757
deptId: deptId:
taskType: 1 taskType: 1
sourceOrgId: p1e35e sourceOrgId: p1e37a
sourceOrgName: 国药集团公司S57ui sourceOrgName: 国药集团公司D1cRP
sourceOrderNo: PSh0347202408010065 sourceOrderNo: PSh0347202408010093
billMode: '66' billMode: '66'
stockKind: stockKind:
purMode: purMode:
sourceId: PSh0347202408010065 sourceId: PSh0347202408010093
sourceDetailId: sourceDetailId:
sourceType: PSD sourceType: PSD
sourceTypeName: 配送单 sourceTypeName: 配送单
sourceVersion: 1 sourceVersion: 1
planOrderNo: PLAN2024080134122 planOrderNo: PLAN2024080134156
purOrderNo: CG2024080122381 purOrderNo: CG2024080122414
recOrgId: 63c734f07fcc422ea80f49ca8e5bbd95 recOrgId: c913da28183b4b34a3ad567a345f4df6
recOrgName: 设备科001 recOrgName: 二级检验科002
billRelationJson: '{"planBillId":"Ph034720240801030767","planOrderNo":"PLAN2024080134122","purOrderNo":"CG2024080122381","purBillId":"Ch034720240801000099","purBillDate":"2024-08-01 billRelationJson: '{"buyBillId":"Bh03472024080100038","planBillId":"Ph034720240801030801","planOrderNo":"PLAN2024080134156","buyOrderNo":"BUY2024080110209","purOrderNo":"CG2024080122414","purBillId":"Ch034720240801000132","purBillDate":"2024-08-01
15:14:28","distrBillId":"PSh0347202408010065","distrOrderNo":"PSh0347202408010065"}' 16:50:33","distrBillId":"PSh0347202408010093","distrOrderNo":"PSh0347202408010093"}'
taskDate: '2024-08-01 15:15:04' taskDate: '2024-08-01 16:51:04'
taskDateStart: taskDateStart:
taskDateEnd: taskDateEnd:
billModeList: billModeList:
......
验收单号: 验收单号:
CHECK_NO1: CHECKh03472024080100056 CHECK_NO1: CHECKh03472024080100084
CHECK_NO2: CHECKh03472024080100056 CHECK_NO2: CHECKh03472024080100084
产品审核信息: 产品审核信息:
MSPid: MSP2407090008_1 MSPid: MSP2408010016_1
hosId: h0347 hosId: h0347
hosGoodsId: h034700004511 hosGoodsId: h034700004745
provGoodsid: provGood-99221707 provGoodsid: provGood-99221979
goodsAuditBillId: MSP2407090008 goodsAuditBillId: MSP2408010016
targetId: MSP2407090008_1 targetId: MSP2408010016_1
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