From 94c169d9c7809ae78927608ef55c61d24459fdab Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期四, 12 十二月 2024 10:47:59 +0800
Subject: [PATCH] 项目打包bug

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ModelMethodServiceImpl.java |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ModelMethodServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ModelMethodServiceImpl.java
index d4f4038..5552838 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ModelMethodServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ModelMethodServiceImpl.java
@@ -2,14 +2,23 @@
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.iailab.framework.common.service.impl.BaseServiceImpl;
+import com.iailab.framework.common.util.object.ConvertUtils;
 import com.iailab.module.model.mpk.dao.ModelMethodDao;
+import com.iailab.module.model.mpk.dto.ModelMethodDTO;
 import com.iailab.module.model.mpk.entity.ModelMethodEntity;
+import com.iailab.module.model.mpk.service.MethodSettingService;
 import com.iailab.module.model.mpk.service.ModelMethodService;
+import com.iailab.module.model.mpk.service.SettingSelectService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 /**
  * @description:
@@ -20,6 +29,8 @@
 @Service
 public class ModelMethodServiceImpl extends BaseServiceImpl<ModelMethodDao, ModelMethodEntity> implements ModelMethodService {
 
+    @Autowired
+    private MethodSettingService methodSettingService;
 
     @Override
     public void deleteByMap(Map<String, Object> map) {
@@ -34,4 +45,25 @@
 
         return wrapper;
     }
+
+    @Override
+    public void insertList(List<ModelMethodDTO> list, String fileId) {
+        for (int i = 0; i < list.size(); i++) {
+            ModelMethodEntity entity = ConvertUtils.sourceToTarget(list.get(i), ModelMethodEntity.class);
+            entity.setId(UUID.randomUUID().toString());
+            entity.setMpkFileId(fileId);
+            entity.setSort(i);
+            baseDao.insert(entity);
+            if (!CollectionUtils.isEmpty(list.get(i).getMethodSettings())) {
+                methodSettingService.insertList(list.get(i).getMethodSettings(), entity.getId());
+            }
+        }
+    }
+
+    @Override
+    public void deleteModelMethod(String mpkId) {
+        Map<String,Object> map = new HashMap<>();
+        map.put("mpk_file_id", mpkId);
+        baseDao.deleteByMap(map);
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3