|
|
@ -127,7 +127,7 @@ class DataStdService: |
|
|
|
try: |
|
|
|
# 创建新的 page_object 实例,避免修改原始对象 |
|
|
|
new_page_object = DataStdCodeModel(**page_object.model_dump(by_alias=True)) |
|
|
|
new_page_object.cd_val_stat="9" |
|
|
|
new_page_object.cd_val_stat="1" |
|
|
|
# 调用 DAO 方法插入数据 |
|
|
|
await DataStdDao.add_std_code(query_db, new_page_object) |
|
|
|
return CrudResponseModel(is_success=True, message='新增标准代码成功') |
|
|
@ -240,7 +240,7 @@ class DataStdService: |
|
|
|
std_code_appr.compareId = last_appr.onum |
|
|
|
std_code_appr.oldInstId = data_std_no.onum |
|
|
|
std_code_appr.approStatus = "waiting" |
|
|
|
std_code_appr.cd_val_stat = "9" |
|
|
|
std_code_appr.cd_val_stat = "1" |
|
|
|
std_code_appr.flowId = flow_id |
|
|
|
std_code_appr.onum=str(uuid.uuid4()) |
|
|
|
std_code_appr.create_by = current_user.user.user_name |
|
|
@ -260,7 +260,7 @@ class DataStdService: |
|
|
|
appr_item.compareId = last_appr_item.onum |
|
|
|
appr_item.oldInstId = appr_item.onum |
|
|
|
appr_item.approStatus = "waiting" |
|
|
|
appr_item.cd_val_stat = "9" |
|
|
|
appr_item.cd_val_stat = "1" |
|
|
|
appr_item.flowId = flow_id |
|
|
|
appr_item.onum=str(uuid.uuid4()) |
|
|
|
appr_item.create_by = current_user.user.user_name |
|
|
@ -368,7 +368,7 @@ class DataStdService: |
|
|
|
appr_model.changeType = "add" |
|
|
|
appr_model.compareId = code.onum |
|
|
|
appr_model.oldInstId = code.onum |
|
|
|
appr_model.cd_val_stat="9" |
|
|
|
appr_model.cd_val_stat="1" |
|
|
|
appr_model.approStatus = "waiting" |
|
|
|
appr_model.flowId = str(uuid.uuid4()) # 新生成 Flow ID |
|
|
|
|
|
|
@ -632,7 +632,7 @@ class DataStdService: |
|
|
|
raise ServiceException(message=f"数据字典{page_object.data_dict_no}已存在") |
|
|
|
# 创建新的 page_object 实例,避免修改原始对象 |
|
|
|
new_page_object = DataStdDictModel(**page_object.model_dump(by_alias=True)) |
|
|
|
new_page_object.data_dict_stat="9" |
|
|
|
new_page_object.data_dict_stat="1" |
|
|
|
new_page_object.onum=str(uuid.uuid4()) |
|
|
|
# 调用 DAO 方法插入数据 |
|
|
|
await DataStdDao.add_std_dict(query_db, new_page_object) |
|
|
@ -1182,7 +1182,7 @@ class DataStdService: |
|
|
|
if not await cls.check_std_num_unique(query_db, model): |
|
|
|
raise ServiceException(message=f"标准编号 {model.data_std_no} 已存在") |
|
|
|
model.onum=str(uuid.uuid4()) |
|
|
|
model.std_status="9" |
|
|
|
model.std_status="1" |
|
|
|
model.belt_data_std_content=2 |
|
|
|
await DataStdDao.add_std_main(query_db, model) |
|
|
|
return CrudResponseModel(is_success=True, message='新增标准成功') |
|
|
@ -1203,7 +1203,7 @@ class DataStdService: |
|
|
|
if not await cls.check_std_num_unique(query_db, model): |
|
|
|
raise ServiceException(message=f"标准编号 {model.data_std_no} 已存在") |
|
|
|
model.onum=str(uuid.uuid4()) |
|
|
|
model.std_status="9" |
|
|
|
model.std_status="1" |
|
|
|
model.belt_data_std_content=2 |
|
|
|
# 将 DataStdMainModel 转换为 DataStdMainApprModel,保留字段原始名 |
|
|
|
apprModel = DataStdMainApprModel(**model.model_dump(exclude_unset=True, by_alias=True)) |
|
|
@ -1224,7 +1224,7 @@ class DataStdService: |
|
|
|
if not await cls.check_dict_unique_services(query_db, model): |
|
|
|
raise ServiceException(message=f"字典编号 {model.data_dict_no} 已存在") |
|
|
|
model.onum=str(uuid.uuid4()) |
|
|
|
model.data_dict_stat="9" |
|
|
|
model.data_dict_stat="1" |
|
|
|
# 将 DataStdMainModel 转换为 DataStdMainApprModel,保留字段原始名 |
|
|
|
apprModel = DataStdDictApprModel(**model.model_dump(exclude_unset=True, by_alias=True)) |
|
|
|
apprModel.changeType="add" |
|
|
@ -1243,7 +1243,7 @@ class DataStdService: |
|
|
|
async def edit_std_main_appr(cls, query_db: AsyncSession, model: DataStdMainModel): |
|
|
|
if not await cls.check_std_num_unique(query_db, model): |
|
|
|
raise ServiceException(message=f"标准编号 {model.data_std_no} 已存在") |
|
|
|
model.std_status="9" |
|
|
|
model.std_status="1" |
|
|
|
# 将 DataStdMainModel 转换为 DataStdMainApprModel,保留字段原始名 |
|
|
|
|
|
|
|
watingList=await DataStdDao.check_std_main_waiting(model.onum, query_db) |
|
|
@ -1268,7 +1268,7 @@ class DataStdService: |
|
|
|
async def edit_std_dict_appr(cls, query_db: AsyncSession, model: DataStdDictModel): |
|
|
|
if not await cls.check_dict_unique_services(query_db, model): |
|
|
|
raise ServiceException(message=f"字典编号 {model.c} 已存在") |
|
|
|
model.data_dict_stat="9" |
|
|
|
model.data_dict_stat="1" |
|
|
|
|
|
|
|
watingList=await DataStdDao.check_std_dict_waiting(model.onum, query_db) |
|
|
|
if len(watingList)>0 : # 如果 watingList 存在,意味着标准正在审批中 |
|
|
|