From 1205f84f732610763d46935c0ec31757005376f4 Mon Sep 17 00:00:00 2001
From: Jay <csj123456>
Date: 星期二, 15 十月 2024 08:38:27 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ProjectModelServiceImpl.java |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ProjectModelServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ProjectModelServiceImpl.java
index 943aa45..0c6802f 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ProjectModelServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ProjectModelServiceImpl.java
@@ -1,18 +1,21 @@
 package com.iailab.module.model.mpk.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.iailab.framework.common.service.impl.BaseServiceImpl;
 import com.iailab.framework.common.service.impl.CrudServiceImpl;
 import com.iailab.framework.common.util.object.ConvertUtils;
 import com.iailab.module.model.mpk.dao.ProjectModelDao;
+import com.iailab.module.model.mpk.dto.MpkFileDTO;
 import com.iailab.module.model.mpk.dto.ProjectModelDTO;
 import com.iailab.module.model.mpk.entity.ProjectModelEntity;
 import com.iailab.module.model.mpk.service.ProjectModelService;
-import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 /**
  * @description:
@@ -20,7 +23,7 @@
  * @date: 2024/8/22 14:41
  **/
 @Service
-public class ProjectModelServiceImpl extends CrudServiceImpl<ProjectModelDao, ProjectModelEntity, ProjectModelDTO> implements ProjectModelService {
+public class ProjectModelServiceImpl extends BaseServiceImpl<ProjectModelDao, ProjectModelEntity> implements ProjectModelService {
     @Override
     public List<ProjectModelDTO> list(Map<String, Object> params) {
         List<ProjectModelEntity> entityList = baseDao.selectList(getWrapper(params));
@@ -34,6 +37,18 @@
     }
 
     @Override
+    public void create(List<MpkFileDTO> models, String projectId) {
+        List<ProjectModelEntity> list = new ArrayList<>(models.size());
+        for (MpkFileDTO model : models) {
+            ProjectModelEntity projectModel = new ProjectModelEntity();
+            projectModel.setId(UUID.randomUUID().toString());
+            projectModel.setProjectId(projectId);
+            projectModel.setModelId(model.getId());
+            list.add(projectModel);
+        }
+        baseDao.insert(list);
+    }
+
     public QueryWrapper<ProjectModelEntity> getWrapper(Map<String, Object> params){
         String id = (String)params.get("id");
         String projectId = (String)params.get("projectId");

--
Gitblit v1.9.3