|
|
|
@ -42,6 +42,7 @@ import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.UNKNOWN; |
|
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
|
|
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; |
|
|
|
import static cn.iocoder.yudao.module.system.enums.LogRecordConstants.*; |
|
|
|
@ -73,6 +74,8 @@ public class InstantServiceImpl implements InstantService { |
|
|
|
@LogRecord(type = SYSTEM_INSTANT_TYPE, subType = SYSTEM_INSTANT_CREATE_SUB_TYPE, bizNo = "{{#role.id}}", |
|
|
|
success = SYSTEM_INSTANT_CREATE_SUCCESS) |
|
|
|
public List<String> createInstant(InstantSaveReqVO createReqVO, Integer type) throws IOException { |
|
|
|
|
|
|
|
try{ |
|
|
|
// 1. 校验角色
|
|
|
|
// validateRoleDuplicate(createReqVO.getName(), createReqVO.getCode(), null);
|
|
|
|
//根据modelversionid查询modelversion,录入instantcfg表的modelversion字段
|
|
|
|
@ -220,12 +223,18 @@ public class InstantServiceImpl implements InstantService { |
|
|
|
resultList.add(ss); |
|
|
|
} |
|
|
|
createWarn1(instant, createReqVO); |
|
|
|
log.info("模型实例创建成功,实例ID: {}", instant.getMpId()); |
|
|
|
return resultList; |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("模型实例创建失败,错误信息: ", e); |
|
|
|
throw exception(CREATE_INSTANT_ERROR,"模型实例创建失败: " + e.getMessage(), e); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void createWarn1(InstantTableDO instant, InstantSaveReqVO createReqVO) { |
|
|
|
try{ |
|
|
|
//调用预警表和评估报告表的mapper
|
|
|
|
// 从instant对象获取modelid和version字段
|
|
|
|
Long modelId = instant.getModelId(); |
|
|
|
@ -265,6 +274,10 @@ public class InstantServiceImpl implements InstantService { |
|
|
|
warnService.createWarn(warnSaveReqVO); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("模型实例创建失败,错误信息: ", e); |
|
|
|
throw exception(CREATE_INSTANT_ERROR,"模型实例创建失败: " + e.getMessage(), e); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|