Gaokun Wang 6 hónapja
szülő
commit
8ec4ee1843
16 módosított fájl, 141 hozzáadás és 607 törlés
  1. 12 0
      als-modules/agile-assurance/src/main/java/org/eco/als/controller/AlgorithmController.java
  2. 4 2
      als-modules/agile-assurance/src/main/java/org/eco/als/controller/LifePredictionController.java
  3. 0 121
      als-modules/agile-assurance/src/main/java/org/eco/als/controller/LifePredictionResultController.java
  4. 12 9
      als-modules/agile-assurance/src/main/java/org/eco/als/domain/LifePrediction.java
  5. 18 10
      als-modules/agile-assurance/src/main/java/org/eco/als/domain/bo/LifePredictionBo.java
  6. 0 65
      als-modules/agile-assurance/src/main/java/org/eco/als/domain/bo/LifePredictionResultBo.java
  7. 0 94
      als-modules/agile-assurance/src/main/java/org/eco/als/domain/vo/LifePredictionResultVo.java
  8. 17 14
      als-modules/agile-assurance/src/main/java/org/eco/als/domain/vo/LifePredictionVo.java
  9. 0 16
      als-modules/agile-assurance/src/main/java/org/eco/als/mapper/LifePredictionResultMapper.java
  10. 1 0
      als-modules/agile-assurance/src/main/java/org/eco/als/service/IAlgorithmService.java
  11. 0 86
      als-modules/agile-assurance/src/main/java/org/eco/als/service/ILifePredictionResultService.java
  12. 1 1
      als-modules/agile-assurance/src/main/java/org/eco/als/service/ILifePredictionService.java
  13. 60 8
      als-modules/agile-assurance/src/main/java/org/eco/als/service/impl/AlgorithmService.java
  14. 0 173
      als-modules/agile-assurance/src/main/java/org/eco/als/service/impl/LifePredictionResultServiceImpl.java
  15. 7 8
      als-modules/agile-assurance/src/main/java/org/eco/als/service/impl/LifePredictionServiceImpl.java
  16. 9 0
      als-start/src/main/resources/db/dm/V1_0_0_5__als-1212-ddl.sql

+ 12 - 0
als-modules/agile-assurance/src/main/java/org/eco/als/controller/AlgorithmController.java

@@ -65,6 +65,18 @@ public class AlgorithmController {
         return StrUtil.isBlank(result) ? CommonResult.fail() : CommonResult.success(result, "");
     }
 
+    /**
+     * 退化评估
+     *
+     * @param algorithmBo 入参
+     * @return org.eco.common.core.core.domain.CommonResult<java.lang.String> 结果
+     **/
+    @PostMapping("/execute/evaluation")
+    public CommonResult<String> executeEvaluation(@Validated @RequestBody AlgorithmBo algorithmBo) {
+        String result = algorithmService.executeEvaluation(algorithmBo);
+        return StrUtil.isBlank(result) ? CommonResult.fail() : CommonResult.success(result, "");
+    }
+
     /**
      * 执行任务管理
      *

+ 4 - 2
als-modules/agile-assurance/src/main/java/org/eco/als/controller/LifePredictionController.java

@@ -2,8 +2,10 @@ package org.eco.als.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
 import jakarta.annotation.Resource;
 import lombok.RequiredArgsConstructor;
+import org.eco.als.domain.LifePrediction;
 import org.eco.als.domain.bo.LifePredictionBo;
 import org.eco.als.domain.vo.LifePredictionVo;
 import org.eco.als.service.ILifePredictionService;
@@ -83,8 +85,8 @@ public class LifePredictionController extends BaseController {
     @RepeatSubmit()
     @PostMapping
     public CommonResult<Void> add(@Validated @RequestBody LifePredictionBo lifePredictionBo) {
-        boolean inserted = lifePredictionService.insert(lifePredictionBo);
-        if (!inserted) {
+        LifePrediction lifePrediction = lifePredictionService.insert(lifePredictionBo);
+        if (ObjectUtil.isNull(lifePrediction)) {
             return CommonResult.fail("新增寿命预测记录失败!");
         }
         return CommonResult.success();

+ 0 - 121
als-modules/agile-assurance/src/main/java/org/eco/als/controller/LifePredictionResultController.java

@@ -1,121 +0,0 @@
-package org.eco.als.controller;
-
-import cn.dev33.satoken.annotation.SaCheckPermission;
-import cn.hutool.core.collection.CollUtil;
-import jakarta.annotation.Resource;
-import lombok.RequiredArgsConstructor;
-import org.eco.als.domain.bo.LifePredictionResultBo;
-import org.eco.als.domain.vo.LifePredictionResultVo;
-import org.eco.als.service.ILifePredictionResultService;
-import org.eco.common.core.core.domain.CommonResult;
-import org.eco.common.core.core.domain.model.LoginUser;
-import org.eco.common.core.core.page.PageResult;
-import org.eco.common.log.annotation.Log;
-import org.eco.common.log.enums.BusinessType;
-import org.eco.common.security.utils.LoginHelper;
-import org.eco.common.web.annotation.RepeatSubmit;
-import org.eco.common.web.core.BaseController;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-
-/**
- * 寿命预测结果Controller
- *
- * @author wgk
- * @date 2024-07-26
- */
-@Validated
-@RequiredArgsConstructor
-@RestController
-@RequestMapping("/als/lifePredictionResult")
-public class LifePredictionResultController extends BaseController {
-    @Resource
-    private ILifePredictionResultService lifePredictionResultService;
-
-    /**
-     * 查询寿命预测结果列表
-     */
-    @SaCheckPermission("als:lifePredictionResult:list")
-    @GetMapping("/list")
-    public CommonResult<PageResult<LifePredictionResultVo>> list(LifePredictionResultBo lifePredictionResultBo) {
-        return CommonResult.success(lifePredictionResultService.selectPage(lifePredictionResultBo));
-    }
-
-    /**
-     * 导出寿命预测结果列表
-     */
-    @SaCheckPermission("als:lifePredictionResult:export")
-    @Log(title = "寿命预测结果", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public CommonResult<Void> export(LifePredictionResultBo lifePredictionResultBo) {
-        LoginUser loginUser = LoginHelper.getLoginUser();
-        List<LifePredictionResultVo> list = lifePredictionResultService.selectList(lifePredictionResultBo);
-        if (CollUtil.isEmpty(list)) {
-            return CommonResult.fail("导出列表为空");
-        }
-        lifePredictionResultService.asyncExport(list, "寿命预测结果", loginUser);
-        return CommonResult.success();
-    }
-
-    /**
-     * 获取寿命预测结果详细信息
-     */
-    @SaCheckPermission("als:lifePredictionResult:query")
-    @GetMapping(value = "/{id}")
-    public CommonResult<LifePredictionResultVo> getInfo(@PathVariable Long id) {
-        return CommonResult.success(lifePredictionResultService.selectById(id));
-    }
-
-    /**
-     * 新增寿命预测结果
-     */
-    @SaCheckPermission("als:lifePredictionResult:add")
-    @Log(title = "寿命预测结果", businessType = BusinessType.INSERT)
-    @RepeatSubmit()
-    @PostMapping
-    public CommonResult<Void> add(@Validated @RequestBody LifePredictionResultBo lifePredictionResultBo) {
-        boolean inserted = lifePredictionResultService.insert(lifePredictionResultBo);
-        if (!inserted) {
-            return CommonResult.fail("新增寿命预测结果记录失败!");
-        }
-        return CommonResult.success();
-    }
-
-    /**
-     * 修改寿命预测结果
-     */
-    @SaCheckPermission("als:lifePredictionResult:edit")
-    @Log(title = "寿命预测结果", businessType = BusinessType.UPDATE)
-    @RepeatSubmit()
-    @PutMapping
-    public CommonResult<Void> edit(@Validated @RequestBody LifePredictionResultBo lifePredictionResultBo) {
-        boolean updated = lifePredictionResultService.update(lifePredictionResultBo);
-        if (!updated) {
-            return CommonResult.fail("修改寿命预测结果记录失败!");
-        }
-        return CommonResult.success();
-    }
-
-    /**
-     * 删除寿命预测结果
-     */
-    @SaCheckPermission("als:lifePredictionResult:remove")
-    @Log(title = "寿命预测结果", businessType = BusinessType.DELETE)
-    @DeleteMapping("/{ids}")
-    public CommonResult<Void> remove(@PathVariable Long[] ids) {
-        boolean deleted = lifePredictionResultService.deleteByIds(ids);
-        if (!deleted) {
-            return CommonResult.fail("删除寿命预测结果记录失败!");
-        }
-        return CommonResult.success();
-    }
-}

+ 12 - 9
als-modules/agile-assurance/src/main/java/org/eco/als/domain/LifePrediction.java

@@ -32,6 +32,14 @@ public class LifePrediction extends BaseEntity {
      * 机号
      */
     private String aircraftId;
+    /**
+     * 机型
+     */
+    private String aircraftType;
+    /**
+     * 编号
+     */
+    private String code;
     /**
      * 部件名称
      */
@@ -42,25 +50,20 @@ public class LifePrediction extends BaseEntity {
      */
     private String model;
 
-    /**
-     * 所属系统
-     */
-    private String system;
-
     /**
      * 处理方式
      */
     private String methodType;
 
     /**
-     * 剩余时长(h
+     * 状态(1正常
      */
-    private String remainTiem;
+    private String status;
 
     /**
-     * 状态(1正常)
+     * 结果
      */
-    private String status;
+    private String resultContent;
 
     /**
      * 删除标识(1删除 0未删除)

+ 18 - 10
als-modules/agile-assurance/src/main/java/org/eco/als/domain/bo/LifePredictionBo.java

@@ -3,6 +3,7 @@ package org.eco.als.domain.bo;
 import io.github.linpeilie.annotations.AutoMapper;
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotNull;
+import lombok.Builder;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import org.eco.als.domain.LifePrediction;
@@ -14,6 +15,7 @@ import org.eco.common.orm.core.domain.BaseEntity;
  * @author wgk
  * @date 2024-07-26
  */
+@Builder
 @Data
 @EqualsAndHashCode(callSuper = true)
 @AutoMapper(target = LifePrediction.class, reverseConvertGenerate = false)
@@ -26,35 +28,41 @@ public class LifePredictionBo extends BaseEntity {
     /**
      * 机号Id
      */
-    @NotNull(message = "机号不能为空")
     private String aircraftId;
 
+    /**
+     * 机型
+     */
+    private String aircraftType;
+
+    /**
+     * 编码
+     */
+    private String code;
+
     /**
      * 部件名称
      */
-    @NotBlank(message = "部件名称不能为空")
     private String name;
 
     /**
      * 型号
      */
-    @NotBlank(message = "型号不能为空")
     private String model;
 
-    /**
-     * 所属系统
-     */
-    private String system;
-
     /**
      * 处理方式
      */
     private String methodType;
+    /**
+     * 状态
+     */
+    private String status;
 
     /**
-     * 剩余时长(h)
+     * 结果
      */
-    private String remainTiem;
+    private String resultContent;
 
 
 }

+ 0 - 65
als-modules/agile-assurance/src/main/java/org/eco/als/domain/bo/LifePredictionResultBo.java

@@ -1,65 +0,0 @@
-package org.eco.als.domain.bo;
-
-import io.github.linpeilie.annotations.AutoMapper;
-import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.NotNull;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.eco.als.domain.LifePredictionResult;
-import org.eco.common.orm.core.domain.BaseEntity;
-
-/**
- * 寿命预测结果业务对象 als_life_prediction_result_t
- *
- * @author wgk
- * @date 2024-07-26
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@AutoMapper(target = LifePredictionResult.class, reverseConvertGenerate = false)
-public class LifePredictionResultBo extends BaseEntity {
-    /**
-     * 编号
-     */
-    private Long id;
-
-    /**
-     * 寿命预测编号
-     */
-    @NotNull(message = "寿命预测编号不能为空")
-    private Long lifeId;
-
-    /**
-     * 机号Id
-     */
-    @NotNull(message = "机号不能为空")
-    private String aircraftId;
-
-    /**
-     * 部件名称
-     */
-    @NotBlank(message = "部件名称不能为空")
-    private String name;
-
-    /**
-     * 型号
-     */
-    private String model;
-
-    /**
-     * 所属系统
-     */
-    private String system;
-
-    /**
-     * 处理方式
-     */
-    private String methodType;
-
-    /**
-     * 剩余时长(h)
-     */
-    private String remainTiem;
-
-
-}

+ 0 - 94
als-modules/agile-assurance/src/main/java/org/eco/als/domain/vo/LifePredictionResultVo.java

@@ -1,94 +0,0 @@
-package org.eco.als.domain.vo;
-
-import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
-import com.alibaba.excel.annotation.ExcelProperty;
-import io.github.linpeilie.annotations.AutoMapper;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import org.eco.als.domain.LifePredictionResult;
-import org.eco.common.excel.annotation.ExcelDictFormat;
-import org.eco.common.excel.convert.ExcelDictConvert;
-import org.eco.common.orm.core.domain.BaseEntity;
-
-import java.io.Serial;
-import java.io.Serializable;
-
-/**
- * 寿命预测结果视图对象 als_life_prediction_result_t
- *
- * @author wgk
- * @date 2024-07-26
- */
-@Data
-@ExcelIgnoreUnannotated
-@EqualsAndHashCode(callSuper = true)
-@AutoMapper(target = LifePredictionResult.class)
-public class LifePredictionResultVo extends BaseEntity implements Serializable {
-
-    @Serial
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 编号
-     */
-    @ExcelProperty(value = "编号")
-    private Long id;
-
-    /**
-     * 寿命预测编号
-     */
-    @ExcelProperty(value = "寿命预测编号")
-    private Long lifeId;
-
-    /**
-     * 机号Id
-     */
-    private String aircraftId;
-
-
-    /**
-     * 部件名称
-     */
-    @ExcelProperty(value = "部件名称")
-    private String name;
-
-    /**
-     * 型号
-     */
-    @ExcelProperty(value = "型号")
-    private String model;
-
-    /**
-     * 所属系统
-     */
-    @ExcelProperty(value = "所属系统")
-    private String system;
-
-    /**
-     * 处理方式
-     */
-    @ExcelProperty(value = "处理方式", converter = ExcelDictConvert.class)
-    @ExcelDictFormat(dictType = "common_type")
-    private String methodType;
-
-    /**
-     * 剩余时长(h)
-     */
-    @ExcelProperty(value = "剩余时长", converter = ExcelDictConvert.class)
-    @ExcelDictFormat(readConverterExp = "h=")
-    private String remainTiem;
-
-    /**
-     * 状态(1正常)
-     */
-    @ExcelProperty(value = "状态(1正常)")
-    private String status;
-
-    /**
-     * 删除标识(1删除 0未删除)
-     */
-    @ExcelProperty(value = "删除标识(1删除 0未删除)")
-    private Integer delFlag;
-
-
-}

+ 17 - 14
als-modules/agile-assurance/src/main/java/org/eco/als/domain/vo/LifePredictionVo.java

@@ -39,6 +39,16 @@ public class LifePredictionVo extends BaseEntity implements Serializable {
      */
     private String aircraftId;
 
+    /**
+     * 机型
+     */
+    private String aircraftType;
+    /**
+     * 编号
+     */
+    @ExcelProperty(value = "部件编号")
+    private String code;
+
 
     /**
      * 部件名称
@@ -52,32 +62,25 @@ public class LifePredictionVo extends BaseEntity implements Serializable {
     @ExcelProperty(value = "型号")
     private String model;
 
-    /**
-     * 所属系统
-     */
-    @ExcelProperty(value = "所属系统")
-    private String system;
 
     /**
      * 处理方式
      */
-    @ExcelProperty(value = "处理方式", converter = ExcelDictConvert.class)
-    @ExcelDictFormat(dictType = "common_type")
+    @ExcelProperty(value = "处理方式")
     private String methodType;
 
-    /**
-     * 剩余时长(h)
-     */
-    @ExcelProperty(value = "剩余时长", converter = ExcelDictConvert.class)
-    @ExcelDictFormat(readConverterExp = "h=")
-    private String remainTiem;
-
     /**
      * 状态(1正常)
      */
     @ExcelProperty(value = "状态(1正常)")
     private String status;
 
+    /**
+     * 结果
+     */
+    @ExcelProperty(value = "结果")
+    private String resultContent;
+
     /**
      * 删除标识(1删除 0未删除)
      */

+ 0 - 16
als-modules/agile-assurance/src/main/java/org/eco/als/mapper/LifePredictionResultMapper.java

@@ -1,16 +0,0 @@
-package org.eco.als.mapper;
-
-import com.mybatisflex.core.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import org.eco.als.domain.LifePredictionResult;
-
-/**
- * 寿命预测结果Mapper接口
- *
- * @author wgk
- * @date 2024-07-26
- */
-@Mapper
-public interface LifePredictionResultMapper extends BaseMapper<LifePredictionResult> {
-
-}

+ 1 - 0
als-modules/agile-assurance/src/main/java/org/eco/als/service/IAlgorithmService.java

@@ -17,6 +17,7 @@ public interface IAlgorithmService {
     String executeFalseAlarm(AlgorithmBo algorithmBo);
 
     String executeFault(AlgorithmBo algorithmBo);
+    String executeEvaluation(AlgorithmBo algorithmBo);
 
     String batchExecute(TaskBo taskBo);
 

+ 0 - 86
als-modules/agile-assurance/src/main/java/org/eco/als/service/ILifePredictionResultService.java

@@ -1,86 +0,0 @@
-package org.eco.als.service;
-
-import org.eco.als.domain.LifePredictionResult;
-import org.eco.als.domain.bo.LifePredictionResultBo;
-import org.eco.als.domain.vo.LifePredictionResultVo;
-import org.eco.common.core.core.domain.model.LoginUser;
-import org.eco.common.core.core.page.PageResult;
-import org.eco.common.orm.core.service.IBaseService;
-import org.springframework.scheduling.annotation.Async;
-
-import java.util.List;
-
-/**
- * 寿命预测结果Service接口
- *
- * @author wgk
- * @date 2024-07-26
- */
-public interface ILifePredictionResultService extends IBaseService<LifePredictionResult> {
-    /**
-     * 查询寿命预测结果
-     *
-     * @param id 寿命预测结果主键
-     * @return 寿命预测结果
-     */
-    LifePredictionResultVo selectById(Long id);
-
-    /**
-     * 查询寿命预测结果列表
-     *
-     * @param lifePredictionResultBo 寿命预测结果Bo
-     * @return 寿命预测结果集合
-     */
-    List<LifePredictionResultVo> selectList(LifePredictionResultBo lifePredictionResultBo);
-
-    /**
-     * 分页查询寿命预测结果列表
-     *
-     * @param lifePredictionResultBo 寿命预测结果Bo
-     * @return 分页寿命预测结果集合
-     */
-    PageResult<LifePredictionResultVo> selectPage(LifePredictionResultBo lifePredictionResultBo);
-
-    /**
-     * 新增寿命预测结果
-     *
-     * @param lifePredictionResultBo 寿命预测结果Bo
-     * @return 结果:true 操作成功,false 操作失败
-     */
-    boolean insert(LifePredictionResultBo lifePredictionResultBo);
-
-    /**
-     * 新增寿命预测结果,前台提供主键值,一般用于导入的场合
-     *
-     * @param lifePredictionResultBo 寿命预测结果Bo
-     * @return 结果:true 操作成功,false 操作失败
-     */
-    boolean insertWithPk(LifePredictionResultBo lifePredictionResultBo);
-
-    /**
-     * 修改寿命预测结果
-     *
-     * @param lifePredictionResultBo 寿命预测结果Bo
-     * @return 结果:true 更新成功,false 更新失败
-     */
-    boolean update(LifePredictionResultBo lifePredictionResultBo);
-
-    /**
-     * 批量删除寿命预测结果
-     *
-     * @param ids 需要删除的寿命预测结果主键集合
-     * @return 结果:true 删除成功,false 删除失败
-     */
-    boolean deleteByIds(Long[] ids);
-
-    /**
-     * asyncExport 异步导出
-     *
-     * @param listVo    数据列表
-     * @param sheetName 文件名称
-     * @param user      上下文
-     */
-    @Async
-    void asyncExport(List<LifePredictionResultVo> listVo, String sheetName, LoginUser user);
-
-}

+ 1 - 1
als-modules/agile-assurance/src/main/java/org/eco/als/service/ILifePredictionService.java

@@ -47,7 +47,7 @@ public interface ILifePredictionService extends IBaseService<LifePrediction> {
      * @param lifePredictionBo 寿命预测Bo
      * @return 结果:true 操作成功,false 操作失败
      */
-    boolean insert(LifePredictionBo lifePredictionBo);
+    LifePrediction insert(LifePredictionBo lifePredictionBo);
 
     /**
      * 新增寿命预测,前台提供主键值,一般用于导入的场合

+ 60 - 8
als-modules/agile-assurance/src/main/java/org/eco/als/service/impl/AlgorithmService.java

@@ -8,11 +8,10 @@ import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
-import org.eco.als.domain.FalseAlarm;
-import org.eco.als.domain.FaultDiagnosis;
-import org.eco.als.domain.PreProcessing;
-import org.eco.als.domain.Warning;
+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.*;
@@ -29,10 +28,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.io.File;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @Description: AlgorithmService
@@ -64,6 +60,12 @@ public class AlgorithmService implements IAlgorithmService {
     private IFaultDiagnosisService faultDiagnosisService;
     @Resource
     private IFaultDiagnosisResultService faultDiagnosisResultService;
+    @Resource
+    private IDataImportService dataImportService;
+    @Resource
+    private IAirConfigurationService airConfigurationService;
+    @Resource
+    private ILifePredictionService lifePredictionService;
 
     @Resource
     private ITaskService taskService;
@@ -233,6 +235,7 @@ public class AlgorithmService implements IAlgorithmService {
             diagnosisBo.setResultContent(httpVo.getData());
             faultDiagnosisService.update(diagnosisBo);
             FaultDiagnosisResultBo resultBo = FaultDiagnosisResultBo.builder()
+                .diagnosisId(diagnosisBo.getId())
                 .aircraftId(diagnosisBo.getAircraftId())
                 .diagnosisId(diagnosisBo.getId())
                 .resultContent(httpVo.getData())
@@ -243,6 +246,55 @@ public class AlgorithmService implements IAlgorithmService {
         return httpVo != null ? httpVo.getData() : null;
     }
 
+    @Override
+    public String executeEvaluation(AlgorithmBo algorithmBo) {
+        AirConfigurationVo airConfigurationVo = airConfigurationService.selectById(algorithmBo.getDataId());
+        DataImportBo dataImportBo = new DataImportBo();
+        dataImportBo.setAircraftId(algorithmBo.getAircraftId());
+        List<DataImportVo> dataImportVos = dataImportService.selectList(dataImportBo);
+        // 模型相关信息
+        ModelVo modelVo = modelService.selectByPartId(algorithmBo.getPartId());
+        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 -> {
+            SysOssVo sysOssVo = getSysOssVo(algorithmBo);
+            if (ObjectUtil.isNotNull(sysOssVo)) {
+                urls.add(sysOssVo.getUrl());
+            }
+        });
+        // 插入退化评估记录
+        LifePredictionBo lifePredictionBo = LifePredictionBo.builder()
+            .name(airConfigurationVo.getName())
+            .model(airConfigurationVo.getSpecsModel())
+            .aircraftId(algorithmBo.getAircraftId())
+            .aircraftType(airConfigurationVo.getAircraftType())
+            .code(airConfigurationVo.getConCode())
+            .status("0")
+            .build();
+        LifePrediction lifePrediction = lifePredictionService.insert(lifePredictionBo);
+
+        // 参数
+        Map<String, Object> map = StrUtil.isBlank(algorithmBo.getParam()) ? new HashMap<>() : new HashMap<>(JSONUtil.parseObj(algorithmBo.getParam()));
+        map.put("url", urls.getFirst());
+        // 请求
+        ModelHttpVo httpVo = sendHttp(modelVo, map);
+        if (httpVo != null && httpVo.getStatus() == 200) {
+            // 更新退化评估状态
+            lifePredictionBo.setId(lifePrediction.getId());
+            lifePredictionBo.setStatus("1");
+            lifePredictionBo.setVersion(lifePrediction.getVersion());
+            lifePredictionBo.setResultContent(httpVo.getData());
+            lifePredictionService.update(lifePredictionBo);
+        }
+        return httpVo != null ? httpVo.getData() : null;
+    }
+
     private SysOssVo getSysOssVo(AlgorithmBo algorithmBo) {
         SysOssVo sysOss = ossService.getById(algorithmBo.getOssId());
         if (ObjectUtil.isNull(sysOss)) {

+ 0 - 173
als-modules/agile-assurance/src/main/java/org/eco/als/service/impl/LifePredictionResultServiceImpl.java

@@ -1,173 +0,0 @@
-package org.eco.als.service.impl;
-
-import cn.hutool.core.util.ObjectUtil;
-import com.mybatisflex.core.paginate.Page;
-import com.mybatisflex.core.query.QueryWrapper;
-import jakarta.annotation.Resource;
-import lombok.extern.slf4j.Slf4j;
-import org.eco.als.domain.LifePredictionResult;
-import org.eco.als.domain.bo.LifePredictionResultBo;
-import org.eco.als.domain.vo.LifePredictionResultVo;
-import org.eco.als.mapper.LifePredictionResultMapper;
-import org.eco.als.service.ILifePredictionResultService;
-import org.eco.common.core.core.domain.model.LoginUser;
-import org.eco.common.core.core.page.PageResult;
-import org.eco.common.core.utils.MapstructUtils;
-import org.eco.common.excel.entity.ExcelResultRes;
-import org.eco.common.excel.service.IExcelService;
-import org.eco.common.orm.core.page.PageQuery;
-import org.eco.common.orm.core.service.impl.BaseServiceImpl;
-import org.eco.system.service.IImportExportService;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static org.eco.als.domain.table.LifePredictionResultTableDef.LIFE_PREDICTION_RESULT;
-
-/**
- * 寿命预测结果Service业务层处理
- *
- * @author wgk
- * @date 2024-07-26
- */
-@Service
-@Slf4j
-public class LifePredictionResultServiceImpl extends BaseServiceImpl<LifePredictionResultMapper, LifePredictionResult> implements ILifePredictionResultService {
-    @Resource
-    private LifePredictionResultMapper lifePredictionResultMapper;
-
-    @Resource
-    private IExcelService excelService;
-
-    @Resource
-    private IImportExportService importExportService;
-
-    @Override
-    public QueryWrapper query() {
-        return super.query().from(LIFE_PREDICTION_RESULT);
-    }
-
-    private QueryWrapper buildQueryWrapper(LifePredictionResultBo lifePredictionResultBo) {
-        QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
-        queryWrapper.and(LIFE_PREDICTION_RESULT.LIFE_ID.eq
-            (lifePredictionResultBo.getLifeId()));
-        queryWrapper.and(LIFE_PREDICTION_RESULT.AIRCRAFT_ID.eq
-            (lifePredictionResultBo.getAircraftId()));
-        queryWrapper.and(LIFE_PREDICTION_RESULT.NAME.like
-            (lifePredictionResultBo.getName()));
-        queryWrapper.and(LIFE_PREDICTION_RESULT.MODEL.eq
-            (lifePredictionResultBo.getModel()));
-        queryWrapper.and(LIFE_PREDICTION_RESULT.SYSTEM.eq
-            (lifePredictionResultBo.getSystem()));
-        queryWrapper.and(LIFE_PREDICTION_RESULT.METHOD_TYPE.eq
-            (lifePredictionResultBo.getMethodType()));
-        queryWrapper.and(LIFE_PREDICTION_RESULT.REMAIN_TIEM.eq
-            (lifePredictionResultBo.getRemainTiem()));
-
-        return queryWrapper;
-    }
-
-    /**
-     * 查询寿命预测结果
-     *
-     * @param id 寿命预测结果主键
-     * @return 寿命预测结果
-     */
-    @Override
-    public LifePredictionResultVo selectById(Long id) {
-        return this.getOneAs(query().where(LIFE_PREDICTION_RESULT.ID.eq(id)), LifePredictionResultVo.class);
-
-    }
-
-
-    /**
-     * 查询寿命预测结果列表
-     *
-     * @param lifePredictionResultBo 寿命预测结果Bo
-     * @return 寿命预测结果集合
-     */
-    @Override
-    public List<LifePredictionResultVo> selectList(LifePredictionResultBo lifePredictionResultBo) {
-        QueryWrapper queryWrapper = buildQueryWrapper(lifePredictionResultBo);
-        return this.listAs(queryWrapper, LifePredictionResultVo.class);
-    }
-
-    /**
-     * 分页查询寿命预测结果列表
-     *
-     * @param lifePredictionResultBo 寿命预测结果Bo
-     * @return 分页寿命预测结果集合
-     */
-    @Override
-    public PageResult<LifePredictionResultVo> selectPage(LifePredictionResultBo lifePredictionResultBo) {
-        QueryWrapper queryWrapper = buildQueryWrapper(lifePredictionResultBo);
-        Page<LifePredictionResultVo> page = this.pageAs(PageQuery.build(), queryWrapper, LifePredictionResultVo.class);
-        return PageResult.build(page);
-    }
-
-    /**
-     * 新增寿命预测结果
-     *
-     * @param lifePredictionResultBo 寿命预测结果Bo
-     * @return 结果:true 操作成功,false 操作失败
-     */
-    @Override
-    public boolean insert(LifePredictionResultBo lifePredictionResultBo) {
-        LifePredictionResult lifePredictionResult = MapstructUtils.convert(lifePredictionResultBo, LifePredictionResult.class);
-
-        return this.save(lifePredictionResult);//使用全局配置的雪花算法主键生成器生成ID值
-    }
-
-    /**
-     * 新增寿命预测结果,前台提供主键值,一般用于导入的场合
-     *
-     * @param lifePredictionResultBo 寿命预测结果Bo
-     * @return 结果:true 操作成功,false 操作失败
-     */
-    @Override
-    public boolean insertWithPk(LifePredictionResultBo lifePredictionResultBo) {
-        LifePredictionResult lifePredictionResult = MapstructUtils.convert(lifePredictionResultBo, LifePredictionResult.class);
-
-
-        return lifePredictionResultMapper.insertWithPk(lifePredictionResult) > 0;//前台传来主键值
-    }
-
-    /**
-     * 修改寿命预测结果
-     *
-     * @param lifePredictionResultBo 寿命预测结果Bo
-     * @return 结果:true 更新成功,false 更新失败
-     */
-    @Override
-    public boolean update(LifePredictionResultBo lifePredictionResultBo) {
-        LifePredictionResult lifePredictionResult = MapstructUtils.convert(lifePredictionResultBo, LifePredictionResult.class);
-        if (ObjectUtil.isNotNull(lifePredictionResult) && ObjectUtil.isNotNull(lifePredictionResult.getId())) {
-            return this.updateById(lifePredictionResult);
-        }
-        return false;
-    }
-
-    @Override
-    public void asyncExport(List<LifePredictionResultVo> listVo, String sheetName, LoginUser loginUser) {
-        ExcelResultRes result = excelService.exportExcel(listVo, sheetName, LifePredictionResultVo.class);
-        boolean flag = importExportService.saveInfo(result, loginUser, "1");
-        if (flag) {
-            log.info("异步导出日志写入成功");
-        }
-    }
-
-    /**
-     * 批量删除寿命预测结果
-     *
-     * @param ids 需要删除的寿命预测结果主键集合
-     * @return 结果:true 删除成功,false 删除失败
-     */
-    @Transactional
-    @Override
-    public boolean deleteByIds(Long[] ids) {
-        return this.removeByIds(Arrays.asList(ids));
-    }
-
-}

+ 7 - 8
als-modules/agile-assurance/src/main/java/org/eco/als/service/impl/LifePredictionServiceImpl.java

@@ -58,15 +58,14 @@ public class LifePredictionServiceImpl extends BaseServiceImpl<LifePredictionMap
         }
         queryWrapper.and(LIFE_PREDICTION.NAME.like
             (lifePredictionBo.getName()));
+        queryWrapper.and(LIFE_PREDICTION.CODE.eq
+            (lifePredictionBo.getCode()));
+        queryWrapper.and(LIFE_PREDICTION.RESULT_CONTENT.like
+            (lifePredictionBo.getResultContent()));
         queryWrapper.and(LIFE_PREDICTION.MODEL.eq
             (lifePredictionBo.getModel()));
-        queryWrapper.and(LIFE_PREDICTION.SYSTEM.eq
-            (lifePredictionBo.getSystem()));
         queryWrapper.and(LIFE_PREDICTION.METHOD_TYPE.eq
             (lifePredictionBo.getMethodType()));
-        queryWrapper.and(LIFE_PREDICTION.REMAIN_TIEM.eq
-            (lifePredictionBo.getRemainTiem()));
-
         return queryWrapper;
     }
 
@@ -115,10 +114,10 @@ public class LifePredictionServiceImpl extends BaseServiceImpl<LifePredictionMap
      * @return 结果:true 操作成功,false 操作失败
      */
     @Override
-    public boolean insert(LifePredictionBo lifePredictionBo) {
+    public LifePrediction insert(LifePredictionBo lifePredictionBo) {
         LifePrediction lifePrediction = MapstructUtils.convert(lifePredictionBo, LifePrediction.class);
-
-        return this.save(lifePrediction);//使用全局配置的雪花算法主键生成器生成ID值
+        this.save(lifePrediction);
+        return lifePrediction;//使用全局配置的雪花算法主键生成器生成ID值
     }
 
     /**

+ 9 - 0
als-start/src/main/resources/db/dm/V1_0_0_5__als-1212-ddl.sql

@@ -0,0 +1,9 @@
+ALTER TABLE "lqbz"."als_life_prediction_t" ADD COLUMN "aircraft_type" VARCHAR2(255);
+ALTER TABLE "lqbz"."als_life_prediction_t" ADD COLUMN "code" VARCHAR2(255);
+ALTER TABLE "lqbz"."als_life_prediction_t" ADD COLUMN "result_content" VARCHAR2(4000);
+ALTER TABLE "lqbz"."als_life_prediction_t" MODIFY "aircraft_id" VARCHAR2(255) NULL;
+ALTER TABLE "lqbz"."als_life_prediction_t" DROP "SYSTEM";
+ALTER TABLE "lqbz"."als_life_prediction_t" DROP "remain_tiem";
+COMMENT ON COLUMN "lqbz"."als_life_prediction_t"."aircraft_type" IS '飞机型号';
+COMMENT ON COLUMN "lqbz"."als_life_prediction_t"."code" IS '编码';
+DROP TABLE "lqbz"."als_life_prediction_result_t";