|
|
@@ -1,9 +1,12 @@ |
|
|
package com.ruoyi.platform.service.impl; |
|
|
package com.ruoyi.platform.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON; |
|
|
import com.ruoyi.common.security.utils.SecurityUtils; |
|
|
import com.ruoyi.common.security.utils.SecurityUtils; |
|
|
import com.ruoyi.platform.constant.Constant; |
|
|
import com.ruoyi.platform.constant.Constant; |
|
|
|
|
|
import com.ruoyi.platform.domain.ActiveLearn; |
|
|
import com.ruoyi.platform.domain.AssetWorkflow; |
|
|
import com.ruoyi.platform.domain.AssetWorkflow; |
|
|
import com.ruoyi.platform.domain.CodeConfig; |
|
|
import com.ruoyi.platform.domain.CodeConfig; |
|
|
|
|
|
import com.ruoyi.platform.domain.Ray; |
|
|
import com.ruoyi.platform.mapper.ActiveLearnDao; |
|
|
import com.ruoyi.platform.mapper.ActiveLearnDao; |
|
|
import com.ruoyi.platform.mapper.AssetWorkflowDao; |
|
|
import com.ruoyi.platform.mapper.AssetWorkflowDao; |
|
|
import com.ruoyi.platform.mapper.CodeConfigDao; |
|
|
import com.ruoyi.platform.mapper.CodeConfigDao; |
|
|
@@ -18,6 +21,7 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
import java.util.Date; |
|
|
import java.util.Date; |
|
|
|
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@@ -94,7 +98,19 @@ public class CodeConfigServiceImpl implements CodeConfigService { |
|
|
throw new Exception("该代码配置被流水线:" + workflows + "使用,不能删除,请先删除流水线。"); |
|
|
throw new Exception("该代码配置被流水线:" + workflows + "使用,不能删除,请先删除流水线。"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// rayDao.queryByCodeConfig() |
|
|
|
|
|
|
|
|
HashMap<String, String> map = new HashMap<>(); |
|
|
|
|
|
map.put("code_path", codeConfig.getGitUrl()); |
|
|
|
|
|
List<Ray> rayList = rayDao.queryByCodeConfig(JSON.toJSONString(map)); |
|
|
|
|
|
if (rayList != null && !rayList.isEmpty()) { |
|
|
|
|
|
String rays = String.join(",", rayList.stream().map(Ray::getName).collect(Collectors.toSet())); |
|
|
|
|
|
throw new Exception("该代码配置被超参数自动寻优:" + rays + "使用,不能删除,请先删除超参数自动寻优。"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<ActiveLearn> activeLearnList = activeLearnDao.queryByCodeConfig(JSON.toJSONString(map)); |
|
|
|
|
|
if (activeLearnList != null && !activeLearnList.isEmpty()) { |
|
|
|
|
|
String activeLearns = String.join(",", activeLearnList.stream().map(ActiveLearn::getName).collect(Collectors.toSet())); |
|
|
|
|
|
throw new Exception("该代码配置被主动学习:" + activeLearns + "使用,不能删除,请先删除主动学习。"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
LoginUser loginUser = SecurityUtils.getLoginUser(); |
|
|
String username = loginUser.getUsername(); |
|
|
String username = loginUser.getUsername(); |
|
|
|