|
@@ -11,7 +11,6 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.eco.als.domain.*;
|
|
|
import org.eco.als.domain.bo.*;
|
|
|
import org.eco.als.domain.vo.AirConfigurationVo;
|
|
|
-import org.eco.als.domain.vo.DataImportVo;
|
|
|
import org.eco.als.domain.vo.ModelHttpVo;
|
|
|
import org.eco.als.domain.vo.ModelVo;
|
|
|
import org.eco.als.service.*;
|
|
@@ -62,8 +61,6 @@ public class AlgorithmService implements IAlgorithmService {
|
|
|
@Resource
|
|
|
private IFaultDiagnosisResultService faultDiagnosisResultService;
|
|
|
@Resource
|
|
|
- private IDataImportService dataImportService;
|
|
|
- @Resource
|
|
|
private IAirConfigurationService airConfigurationService;
|
|
|
@Resource
|
|
|
private ILifePredictionService lifePredictionService;
|
|
@@ -264,9 +261,6 @@ public class AlgorithmService implements IAlgorithmService {
|
|
|
@Transactional
|
|
|
public String executeEvaluation(AlgorithmBo algorithmBo) {
|
|
|
AirConfigurationVo airConfigurationVo = airConfigurationService.selectById(Long.valueOf(algorithmBo.getPartId()));
|
|
|
- DataImportBo dataImportBo = new DataImportBo();
|
|
|
- dataImportBo.setAircraftId(algorithmBo.getAircraftId());
|
|
|
- List<DataImportVo> dataImportVos = dataImportService.selectList(dataImportBo);
|
|
|
// 模型相关信息
|
|
|
ModelBo modelBo = new ModelBo();
|
|
|
modelBo.setPartId(algorithmBo.getPartId());
|
|
@@ -276,18 +270,14 @@ public class AlgorithmService implements IAlgorithmService {
|
|
|
if (ObjectUtil.isNull(modelVo)) {
|
|
|
throw new BusinessException("模型信息为空,请检查!");
|
|
|
}
|
|
|
- if (StrUtil.isBlank(modelVo.getColumnData())) {
|
|
|
- throw new BusinessException("参数列不能为空,请检查!");
|
|
|
- }
|
|
|
- algorithmBo.setColumnData(modelVo.getColumnData().split(","));
|
|
|
+
|
|
|
List<String> urls = new ArrayList<>();
|
|
|
- dataImportVos.forEach(el -> {
|
|
|
- algorithmBo.setOssId(el.getOssId());
|
|
|
- SysOssVo sysOssVo = getSysOssVo(algorithmBo);
|
|
|
- if (ObjectUtil.isNotNull(sysOssVo)) {
|
|
|
- urls.add(sysOssVo.getUrl());
|
|
|
+ for (Long ossId : algorithmBo.getOssIds()) {
|
|
|
+ SysOssVo sysOss = ossService.getById(ossId);
|
|
|
+ if (ObjectUtil.isNotNull(sysOss)) {
|
|
|
+ urls.add(sysOss.getUrl());
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
// 插入退化评估记录
|
|
|
LifePredictionBo lifePredictionBo = LifePredictionBo.builder()
|
|
|
.name(airConfigurationVo.getName())
|
|
@@ -301,7 +291,7 @@ public class AlgorithmService implements IAlgorithmService {
|
|
|
|
|
|
// 参数
|
|
|
Map<String, Object> map = StrUtil.isBlank(algorithmBo.getParam()) ? new HashMap<>() : new HashMap<>(JSONUtil.parseObj(algorithmBo.getParam()));
|
|
|
- map.put("url", urls.getFirst());
|
|
|
+ map.put("urls", urls);
|
|
|
// 请求
|
|
|
ModelHttpVo httpVo = sendHttp(modelVo, map);
|
|
|
if (httpVo != null && httpVo.getStatus() == 200) {
|