|
@@ -456,6 +456,43 @@ public class DataAugmentationServiceImpl extends BaseServiceImpl<DataAugmentatio
|
|
|
map.put("outFileCount", out_fileCount);
|
|
|
return map;
|
|
|
}
|
|
|
+ public CommonResult pause(Long id) {
|
|
|
+ DataAugmentation dataAugmentation = getById(id);
|
|
|
+// SysDictDataBo sysDictDataBo = new SysDictDataBo();
|
|
|
+// sysDictDataBo.setDictLabel(dataAugmentation.getTaskType() + "停止url");
|
|
|
+// sysDictDataBo.setDictType("biz_data_augmentation");
|
|
|
+// List<SysDictDataVo> sysDictDataVos = iSysDictDataService.selectDictDataList(sysDictDataBo);
|
|
|
+// if (sysDictDataVos.size() == 0) {
|
|
|
+// return CommonResult.fail("未设置数据增强算法停止推理的url!请在数据字典中设置该算法的停止推理地址!");
|
|
|
+// }
|
|
|
+// String data_augmentation_stop_url = sysDictDataVos.get(0).getDictValue();
|
|
|
+ //从通用算法配置表中获取停止api
|
|
|
+// CommonAlgorithmConfigBo commonAlgorithmConfigBo = new CommonAlgorithmConfigBo();
|
|
|
+// commonAlgorithmConfigBo.setAlgorithmName(dataAugmentation.getTaskType());
|
|
|
+//
|
|
|
+// List<CommonAlgorithmConfigVo> commonAlgorithmConfigVos = commonAlgorithmConfigService.selectList(commonAlgorithmConfigBo);
|
|
|
+ QueryWrapper queryWrapper = new QueryWrapper();
|
|
|
+ queryWrapper.eq("algorithm_name", dataAugmentation.getTaskType());
|
|
|
+ List<CommonAlgorithmConfig> list = commonAlgorithmConfigService.list(queryWrapper);
|
|
|
+ if (list.isEmpty()) {
|
|
|
+ return CommonResult.fail("通用算法配置表中无" + dataAugmentation.getTaskType() + "算法配置");
|
|
|
+ }
|
|
|
+ CommonAlgorithmConfig commonAlgorithmConfig = list.get(0);
|
|
|
+ String data_augmentation_stop_url = commonAlgorithmConfig.getPauseApi();
|
|
|
+ //设置传输对象
|
|
|
+ TransmissionObject transmissionObject = new TransmissionObject();
|
|
|
+ transmissionObject.setBizId(dataAugmentation.getId());
|
|
|
+ transmissionObject.setBizType(dataAugmentation.getTaskType());
|
|
|
+ transmissionObject.setLogPath(dataAugmentation.getAlgorithmPath());
|
|
|
+ HttpResponseEntity responseEntity = sendPostMsg(data_augmentation_stop_url, transmissionObject);
|
|
|
+ if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
|
|
|
+ dataAugmentation.setStatus(BizConstant.ModelStatus.INTERRUPTED);
|
|
|
+ updateById(dataAugmentation);
|
|
|
+ return CommonResult.success("暂停任务成功");
|
|
|
+ } else {
|
|
|
+ return CommonResult.fail("暂停任务失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public CommonResult stop(Long id) {
|
|
@@ -481,9 +518,6 @@ public class DataAugmentationServiceImpl extends BaseServiceImpl<DataAugmentatio
|
|
|
return CommonResult.fail("通用算法配置表中无" + dataAugmentation.getTaskType() + "算法配置");
|
|
|
}
|
|
|
CommonAlgorithmConfig commonAlgorithmConfig = list.get(0);
|
|
|
- if (commonAlgorithmConfig == null) {
|
|
|
- return CommonResult.fail("通用算法配置表中无" + dataAugmentation.getTaskType() + "算法配置");
|
|
|
- }
|
|
|
String data_augmentation_stop_url = commonAlgorithmConfig.getTerminateApi();
|
|
|
//设置传输对象
|
|
|
TransmissionObject transmissionObject = new TransmissionObject();
|
|
@@ -492,7 +526,7 @@ public class DataAugmentationServiceImpl extends BaseServiceImpl<DataAugmentatio
|
|
|
transmissionObject.setLogPath(dataAugmentation.getAlgorithmPath());
|
|
|
HttpResponseEntity responseEntity = sendPostMsg(data_augmentation_stop_url, transmissionObject);
|
|
|
if (ObjectUtil.isNotNull(responseEntity) && responseEntity.getStatus() == 200) {
|
|
|
- dataAugmentation.setStatus(BizConstant.ModelStatus.INTERRUPTED);
|
|
|
+ dataAugmentation.setStatus(BizConstant.ModelStatus.FAILED);
|
|
|
updateById(dataAugmentation);
|
|
|
return CommonResult.success("终止任务成功");
|
|
|
} else {
|