From 69bd5efa5e2849a560e604d0aa608d5492113915 Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期二, 12 十一月 2024 15:44:52 +0800
Subject: [PATCH] 模型运行输出配置

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java
index 828c7fd..a1bf58c 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictItemServiceImpl.java
@@ -127,8 +127,11 @@
         dmModuleItem.setItemid(predictItem.getId());
         dmModuleItemService.saveModuleItem(dmModuleItem);
 
-        MmItemOutputEntity mmItemOutput = mmPredictItemDto.getMmItemOutput();
-        mmItemOutput.setItemid(predictItem.getId());
+        List<MmItemOutputEntity> mmItemOutput = mmPredictItemDto.getMmItemOutputList();
+        mmItemOutput.forEach(e -> {
+            e.setId(UUID.randomUUID().toString());
+            e.setItemid(predictItem.getId());
+        });
         mmItemOutputService.saveMmItemOutput(mmItemOutput);
     }
 
@@ -162,10 +165,13 @@
         if (!"".equals(dmModuleItem.getId()) && dmModuleItem.getId() != null) {
             dmModuleItemService.update(dmModuleItem);
         }
-        MmItemOutputEntity mmItemOutput = mmPredictItemDto.getMmItemOutput();
-        if (!"".equals(mmItemOutput.getId()) && dmModuleItem.getId() != null) {
-            mmItemOutputService.update(mmItemOutput);
-        }
+        mmItemOutputService.deleteByItemId(predictItem.getId());
+        List<MmItemOutputEntity> mmItemOutput = mmPredictItemDto.getMmItemOutputList();
+        mmItemOutput.forEach(e -> {
+            e.setId(UUID.randomUUID().toString());
+            e.setItemid(predictItem.getId());
+        });
+        mmItemOutputService.saveMmItemOutput(mmItemOutput);
     }
 
     @DSTransactional(rollbackFor = Exception.class)
@@ -183,7 +189,7 @@
         MmPredictItemDTO mmPredictItemDto = BeanUtils.toBean(predictItem, MmPredictItemDTO.class);
         mmPredictItemDto.setMmPredictItem(predictItem);
         mmPredictItemDto.setDmModuleItem(dmModuleItemService.getByItemid(id));
-        mmPredictItemDto.setMmItemOutput(mmItemOutputService.getByItemid(id));
+        mmPredictItemDto.setMmItemOutputList(mmItemOutputService.getByItemid(id));
         MmItemTypeEntity itemType = mmItemTypeImpl.getById(predictItem.getItemtypeid());
         if (itemType != null && ItemTypeEnum.NORMAL_ITEM.getName().equals(itemType.getItemtypename())) {
             MmPredictModelEntity mmPredictModel = mmPredictModelService.getByItemid(id);

--
Gitblit v1.9.3