|
|
|
@ -427,7 +427,7 @@ class DataStdService: |
|
|
|
item.upd_time = datetime.now() |
|
|
|
item.src_sys = '公司级' if 'company' == item.cd_type else item.src_sys |
|
|
|
item.parent_id = appr_model.onum # 设置父级 ID |
|
|
|
|
|
|
|
|
|
|
|
# 校验代码项是否已存在于正式表中 |
|
|
|
if not await cls.check_code_unique_services(query_db, item): |
|
|
|
raise ServiceException(message=f'代码项{item.cd_no}已经存在于正式表中,无法新增') |
|
|
|
@ -439,7 +439,8 @@ class DataStdService: |
|
|
|
item_appr_model.oldInstId = item.onum |
|
|
|
item_appr_model.approStatus = "waiting" |
|
|
|
item_appr_model.flowId = appr_model.flowId # 使用相同的 Flow ID |
|
|
|
|
|
|
|
item_appr_model.oldParentId = item.parent_id |
|
|
|
|
|
|
|
await DataStdDao.add_std_code_appr(query_db, item_appr_model) |
|
|
|
|
|
|
|
# 创建审批申请 |
|
|
|
@ -562,6 +563,7 @@ class DataStdService: |
|
|
|
item_appr_model.changeType = "update" |
|
|
|
item_appr_model.compareId = last_item_appr.onum |
|
|
|
item_appr_model.parent_id = appr_model.onum |
|
|
|
item_appr_model.oldParentId = item.parent_id |
|
|
|
item_appr_model.oldInstId = item.onum |
|
|
|
item_appr_model.approStatus = "waiting" |
|
|
|
item_appr_model.flowId = appr_model.flowId |
|
|
|
@ -584,6 +586,7 @@ class DataStdService: |
|
|
|
item_appr_model.approStatus = "waiting" |
|
|
|
item_appr_model.flowId = appr_model.flowId |
|
|
|
item_appr_model.parent_id = appr_model.onum |
|
|
|
item_appr_model.oldParentId = item.parent_id |
|
|
|
|
|
|
|
await DataStdDao.add_std_code_appr(query_db, item_appr_model) |
|
|
|
for old_item in code_item_list_old: |
|
|
|
@ -598,7 +601,7 @@ class DataStdService: |
|
|
|
delete_appr_model.flowId = appr_model.flowId |
|
|
|
delete_appr_model.onum = str(uuid.uuid4()) |
|
|
|
delete_appr_model.parent_id = appr_model.onum |
|
|
|
|
|
|
|
delete_appr_model.oldParentId = item.onum |
|
|
|
delete_appr_model.create_by = current_user.user.user_name |
|
|
|
delete_appr_model.create_time = datetime.now() |
|
|
|
|
|
|
|
@ -2288,6 +2291,7 @@ class DataStdService: |
|
|
|
parent_appr.flowId = batch_flow_id |
|
|
|
await DataStdDao.add_std_code_appr(query_db, parent_appr) |
|
|
|
parent_appr_onum = parent_appr.onum |
|
|
|
Old_parent_appr_onum = exist_parent.onum |
|
|
|
else: |
|
|
|
# 父级新增审批 |
|
|
|
parent_model.onum = str(uuid.uuid4()) |
|
|
|
@ -2302,7 +2306,7 @@ class DataStdService: |
|
|
|
parent_appr.flowId = batch_flow_id |
|
|
|
await DataStdDao.add_std_code_appr(query_db, parent_appr) |
|
|
|
parent_appr_onum = parent_appr.onum |
|
|
|
|
|
|
|
Old_parent_appr_onum = parent_appr.onum |
|
|
|
# 处理代码项(组内每行) |
|
|
|
for row_idx, row in group.iterrows(): |
|
|
|
row_display = int(row_idx) + 2 |
|
|
|
@ -2343,6 +2347,7 @@ class DataStdService: |
|
|
|
item_appr.compareId = last_item_appr.onum if last_item_appr else item_model.onum |
|
|
|
item_appr.oldInstId = item_model.onum |
|
|
|
item_appr.parent_id = parent_appr_onum |
|
|
|
item_appr.oldParentId = Old_parent_appr_onum |
|
|
|
item_appr.approStatus = "waiting" |
|
|
|
item_appr.flowId = batch_flow_id |
|
|
|
await DataStdDao.add_std_code_appr(query_db, item_appr) |
|
|
|
@ -2357,6 +2362,7 @@ class DataStdService: |
|
|
|
item_appr.compareId = item_model.onum |
|
|
|
item_appr.oldInstId = item_model.onum |
|
|
|
item_appr.parent_id = parent_appr_onum |
|
|
|
item_appr.oldParentId = Old_parent_appr_onum |
|
|
|
item_appr.approStatus = "waiting" |
|
|
|
item_appr.flowId = batch_flow_id |
|
|
|
await DataStdDao.add_std_code_appr(query_db, item_appr) |
|
|
|
|