|
|
|
@ -90,13 +90,13 @@ public class InstantServiceImpl implements InstantService { |
|
|
|
// validateRoleDuplicate(createReqVO.getName(), createReqVO.getCode(), null);
|
|
|
|
//根据modelversionid查询modelversion,录入instantcfg表的modelversion字段
|
|
|
|
String modelVersion = versionMapper.selectById(createReqVO.getModelVersionId()).getVersion(); |
|
|
|
createReqVO.setModelVersion(modelVersion); |
|
|
|
createReqVO.setVersion(modelVersion); |
|
|
|
|
|
|
|
|
|
|
|
//插入除instantInfo外的所有数据,获取到id
|
|
|
|
// 2. 插入到数据库-status、visible默认值
|
|
|
|
InstantTableDO instant = BeanUtils.toBean(createReqVO, InstantTableDO.class) |
|
|
|
.setInstantStatus(ObjUtil.defaultIfNull(createReqVO.getInstantStatus(), 1L)) |
|
|
|
.setStatus(ObjUtil.defaultIfNull(createReqVO.getStatus(), 1L)) |
|
|
|
.setVisible(ObjUtil.defaultIfNull(createReqVO.getVisible(), 1L)); |
|
|
|
|
|
|
|
instantTableMapper.insert(instant); |
|
|
|
@ -118,6 +118,8 @@ public class InstantServiceImpl implements InstantService { |
|
|
|
List<String> timePointInfoList = new ArrayList<>(); |
|
|
|
List<String> biasPointInfoList = new ArrayList<>(); |
|
|
|
List<String> faultVariablePointList = new ArrayList<>(); |
|
|
|
//表示ANN算法的输入还是输出,null表示输入,true表示输出。默认填充null
|
|
|
|
List<Boolean> typeList = new ArrayList<>(Collections.nCopies(pointInfoList.size(), null)); |
|
|
|
|
|
|
|
List<Point> InstantPointList = new ArrayList<>(); |
|
|
|
Point point = new Point(); |
|
|
|
@ -126,6 +128,10 @@ public class InstantServiceImpl implements InstantService { |
|
|
|
inputInfoList.add(pointInfoList.get(i).getPointId()); |
|
|
|
inputNameList.add(pointInfoList.get(i).getDescription()); |
|
|
|
unitList.add(pointInfoList.get(i).getUnit()); |
|
|
|
|
|
|
|
// "type":[null,true,null,null]--表示第二个是输出
|
|
|
|
typeList.set(i,pointInfoList.get(i).getType()); |
|
|
|
|
|
|
|
// 如果pointInfoList.get(i)有type字段,或者createReqVO对象中的算法是PCA就加一些重构值、时间值、偏差值
|
|
|
|
if (pointInfoList.get(i).getType() != null || Objects.equals(createReqVO.getAlgorithmId(), "1") |
|
|
|
|| createReqVO.getAlgorithmId().equals(1L)) { |
|
|
|
@ -177,8 +183,8 @@ public class InstantServiceImpl implements InstantService { |
|
|
|
|
|
|
|
|
|
|
|
createReqVO.setMpId(insertId); |
|
|
|
|
|
|
|
createReqVO.setInstantStatus(instant.getInstantStatus()); |
|
|
|
createReqVO.setId(insertId); |
|
|
|
createReqVO.setStatus(instant.getStatus()); |
|
|
|
createReqVO.setVisible(instant.getVisible()); |
|
|
|
createReqVO.setInputInfo(inputInfoList); |
|
|
|
createReqVO.setInputName(inputNameList); |
|
|
|
@ -188,6 +194,12 @@ public class InstantServiceImpl implements InstantService { |
|
|
|
createReqVO.setBiasPointInfo(biasPointInfoList); |
|
|
|
createReqVO.setFaultVariablePointInfo(faultVariablePointList); |
|
|
|
|
|
|
|
//如果是神经网络算法,就加入typeList,其他不需要这个字段
|
|
|
|
if (Objects.equals(createReqVO.getAlgorithmId(), "2") |
|
|
|
|| createReqVO.getAlgorithmId().equals(2L)) { |
|
|
|
createReqVO.setType(typeList); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//构建模型实例ste值-没有unit参数
|
|
|
|
outpoint = HEAD + "M" + String.format("%04d", insertId) + "_ste"; |
|
|
|
@ -212,7 +224,7 @@ public class InstantServiceImpl implements InstantService { |
|
|
|
InstantPointList.add(point); |
|
|
|
|
|
|
|
|
|
|
|
//更新instantInfo字段
|
|
|
|
//更新instantInfo字段
|
|
|
|
InstantSaveReqVO updateReqVO = new InstantSaveReqVO(); |
|
|
|
updateReqVO.setMpId(instant.getMpId()); |
|
|
|
updateReqVO.setInstantInfo(JsonUtils.toJsonString(createReqVO)); |
|
|
|
|