From 0a2b23ad3f30dfb01c5d590fb98f39e93bfe1932 Mon Sep 17 00:00:00 2001
From: dongyukun <1208714201@qq.com>
Date: 星期二, 31 十二月 2024 18:35:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelOutServiceImpl.java |   75 +++++++++++++++++++++++++++++++++++++
 1 files changed, 75 insertions(+), 0 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelOutServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelOutServiceImpl.java
new file mode 100644
index 0000000..fb781d1
--- /dev/null
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelOutServiceImpl.java
@@ -0,0 +1,75 @@
+package com.iailab.module.model.mcs.sche.service.impl;
+
+
+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.api.mcs.dto.StScheduleModelOutDTO;
+import com.iailab.module.model.api.mcs.dto.StScheduleSchemeDTO;
+import com.iailab.module.model.mcs.sche.dao.StScheduleModelOutDao;
+import com.iailab.module.model.mcs.sche.entity.StScheduleModelOutEntity;
+import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity;
+import com.iailab.module.model.mcs.sche.service.StScheduleModelOutService;
+import com.iailab.module.model.mpk.service.MethodSettingService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * @description:
+ * @author: dyk
+ * @date: 2024/12/30 17:43
+ **/
+@Slf4j
+@Service
+public class StScheduleModelOutServiceImpl extends BaseServiceImpl<StScheduleModelOutDao, StScheduleModelOutEntity> implements StScheduleModelOutService {
+
+    @Autowired
+    private MethodSettingService methodSettingService;
+
+    @Override
+    public void deleteByMap(Map<String, Object> map) {
+        baseDao.delete(getWrapper(map));
+    }
+
+    private QueryWrapper<StScheduleModelOutEntity> getWrapper(Map<String, Object> params) {
+        String mpkFileId = (String) params.get("modelId");
+
+        QueryWrapper<StScheduleModelOutEntity> wrapper = new QueryWrapper<>();
+        wrapper.eq(StringUtils.isNotBlank(mpkFileId), "mpk_file_id", mpkFileId);
+
+        return wrapper;
+    }
+
+    @Override
+    public void insertList(List<StScheduleModelOutEntity> list, String modelId) {
+        for (int i = 0; i < list.size(); i++) {
+            StScheduleModelOutEntity entity = ConvertUtils.sourceToTarget(list.get(i), StScheduleModelOutEntity.class);
+            entity.setId(UUID.randomUUID().toString());
+            entity.setModelId(modelId);
+            entity.setSort(i);
+            baseDao.insert(entity);
+        }
+    }
+
+    @Override
+    public void deleteScheduleModelOut(String modelId) {
+        Map<String,Object> map = new HashMap<>();
+        map.put("model_id", modelId);
+        baseDao.deleteByMap(map);
+    }
+
+    @Override
+    public List<StScheduleModelOutDTO> list(String modelId) {
+        QueryWrapper<StScheduleModelOutEntity> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("model_id", modelId);
+        List<StScheduleModelOutEntity> list = baseDao.selectList(queryWrapper);
+        return ConvertUtils.sourceToTarget(list, StScheduleModelOutDTO.class);
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.3