浏览代码

feat: 寿命预测/寿命预测结果

wanggaokun 1 年之前
父节点
当前提交
2285d143fb
共有 16 个文件被更改,包括 1289 次插入0 次删除
  1. 121 0
      als-modules/agile-assurance/src/main/java/org/eco/als/controller/LifePredictionController.java
  2. 121 0
      als-modules/agile-assurance/src/main/java/org/eco/als/controller/LifePredictionResultController.java
  3. 73 0
      als-modules/agile-assurance/src/main/java/org/eco/als/domain/LifePrediction.java
  4. 78 0
      als-modules/agile-assurance/src/main/java/org/eco/als/domain/LifePredictionResult.java
  5. 59 0
      als-modules/agile-assurance/src/main/java/org/eco/als/domain/bo/LifePredictionBo.java
  6. 65 0
      als-modules/agile-assurance/src/main/java/org/eco/als/domain/bo/LifePredictionResultBo.java
  7. 108 0
      als-modules/agile-assurance/src/main/java/org/eco/als/domain/vo/LifePredictionResultVo.java
  8. 102 0
      als-modules/agile-assurance/src/main/java/org/eco/als/domain/vo/LifePredictionVo.java
  9. 16 0
      als-modules/agile-assurance/src/main/java/org/eco/als/mapper/LifePredictionMapper.java
  10. 16 0
      als-modules/agile-assurance/src/main/java/org/eco/als/mapper/LifePredictionResultMapper.java
  11. 86 0
      als-modules/agile-assurance/src/main/java/org/eco/als/service/ILifePredictionResultService.java
  12. 86 0
      als-modules/agile-assurance/src/main/java/org/eco/als/service/ILifePredictionService.java
  13. 173 0
      als-modules/agile-assurance/src/main/java/org/eco/als/service/impl/LifePredictionResultServiceImpl.java
  14. 171 0
      als-modules/agile-assurance/src/main/java/org/eco/als/service/impl/LifePredictionServiceImpl.java
  15. 7 0
      als-modules/agile-assurance/src/main/resources/mapper/als/LifePredictionMapper.xml
  16. 7 0
      als-modules/agile-assurance/src/main/resources/mapper/als/LifePredictionResultMapper.xml

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

@@ -0,0 +1,121 @@
+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.LifePredictionBo;
+import org.eco.als.domain.vo.LifePredictionVo;
+import org.eco.als.service.ILifePredictionService;
+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/lifePrediction")
+public class LifePredictionController extends BaseController {
+    @Resource
+    private ILifePredictionService lifePredictionService;
+
+    /**
+     * 查询寿命预测列表
+     */
+    @SaCheckPermission("als:lifePrediction:list")
+    @GetMapping("/list")
+    public CommonResult<PageResult<LifePredictionVo>> list(LifePredictionBo lifePredictionBo) {
+        return CommonResult.success(lifePredictionService.selectPage(lifePredictionBo));
+    }
+
+    /**
+     * 导出寿命预测列表
+     */
+    @SaCheckPermission("als:lifePrediction:export")
+    @Log(title = "寿命预测", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public CommonResult<Void> export(LifePredictionBo lifePredictionBo) {
+        LoginUser loginUser = LoginHelper.getLoginUser();
+        List<LifePredictionVo> list = lifePredictionService.selectList(lifePredictionBo);
+        if (CollUtil.isEmpty(list)) {
+            return CommonResult.fail("导出列表为空");
+        }
+        lifePredictionService.asyncExport(list, "寿命预测", loginUser);
+        return CommonResult.success();
+    }
+
+    /**
+     * 获取寿命预测详细信息
+     */
+    @SaCheckPermission("als:lifePrediction:query")
+    @GetMapping(value = "/{id}")
+    public CommonResult<LifePredictionVo> getInfo(@PathVariable Long id) {
+        return CommonResult.success(lifePredictionService.selectById(id));
+    }
+
+    /**
+     * 新增寿命预测
+     */
+    @SaCheckPermission("als:lifePrediction:add")
+    @Log(title = "寿命预测", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping
+    public CommonResult<Void> add(@Validated @RequestBody LifePredictionBo lifePredictionBo) {
+        boolean inserted = lifePredictionService.insert(lifePredictionBo);
+        if (!inserted) {
+            return CommonResult.fail("新增寿命预测记录失败!");
+        }
+        return CommonResult.success();
+    }
+
+    /**
+     * 修改寿命预测
+     */
+    @SaCheckPermission("als:lifePrediction:edit")
+    @Log(title = "寿命预测", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping
+    public CommonResult<Void> edit(@Validated @RequestBody LifePredictionBo lifePredictionBo) {
+        boolean updated = lifePredictionService.update(lifePredictionBo);
+        if (!updated) {
+            return CommonResult.fail("修改寿命预测记录失败!");
+        }
+        return CommonResult.success();
+    }
+
+    /**
+     * 删除寿命预测
+     */
+    @SaCheckPermission("als:lifePrediction:remove")
+    @Log(title = "寿命预测", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public CommonResult<Void> remove(@PathVariable Long[] ids) {
+        boolean deleted = lifePredictionService.deleteByIds(ids);
+        if (!deleted) {
+            return CommonResult.fail("删除寿命预测记录失败!");
+        }
+        return CommonResult.success();
+    }
+}

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

@@ -0,0 +1,121 @@
+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();
+    }
+}

+ 73 - 0
als-modules/agile-assurance/src/main/java/org/eco/als/domain/LifePrediction.java

@@ -0,0 +1,73 @@
+package org.eco.als.domain;
+
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.Table;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.eco.common.orm.core.domain.BaseEntity;
+
+import java.io.Serial;
+
+/**
+ * 寿命预测对象 als_life_prediction_t
+ *
+ * @author wgk
+ * @date 2024-07-26
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Table(value = "als_life_prediction_t")
+public class LifePrediction extends BaseEntity {
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    @Id
+    private Long id;
+
+    /**
+     * 机号
+     */
+    private String aircraftNo;
+
+    /**
+     * 部件名称
+     */
+    private String name;
+
+    /**
+     * 型号
+     */
+    private String model;
+
+    /**
+     * 所属系统
+     */
+    private String system;
+
+    /**
+     * 处理方式
+     */
+    private String methodType;
+
+    /**
+     * 剩余时长(h)
+     */
+    private String remainTiem;
+
+    /**
+     * 状态(1正常)
+     */
+    private String status;
+
+    /**
+     * 删除标识(1删除 0未删除)
+     */
+    @Column(isLogicDelete = true)
+    private Integer delFlag;
+
+
+}

+ 78 - 0
als-modules/agile-assurance/src/main/java/org/eco/als/domain/LifePredictionResult.java

@@ -0,0 +1,78 @@
+package org.eco.als.domain;
+
+import com.mybatisflex.annotation.Column;
+import com.mybatisflex.annotation.Id;
+import com.mybatisflex.annotation.Table;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.eco.common.orm.core.domain.BaseEntity;
+
+import java.io.Serial;
+
+/**
+ * 寿命预测结果对象 als_life_prediction_result_t
+ *
+ * @author wgk
+ * @date 2024-07-26
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Table(value = "als_life_prediction_result_t")
+public class LifePredictionResult extends BaseEntity {
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    @Id
+    private Long id;
+
+    /**
+     * 寿命预测编号
+     */
+    private Long lifeId;
+
+    /**
+     * 机号
+     */
+    private String aircraftNo;
+
+    /**
+     * 部件名称
+     */
+    private String name;
+
+    /**
+     * 型号
+     */
+    private String model;
+
+    /**
+     * 所属系统
+     */
+    private String system;
+
+    /**
+     * 处理方式
+     */
+    private String methodType;
+
+    /**
+     * 剩余时长(h)
+     */
+    private String remainTiem;
+
+    /**
+     * 状态(1正常)
+     */
+    private String status;
+
+    /**
+     * 删除标识(1删除 0未删除)
+     */
+    @Column(isLogicDelete = true)
+    private Integer delFlag;
+
+
+}

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

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

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

@@ -0,0 +1,65 @@
+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;
+
+    /**
+     * 机号
+     */
+    @NotBlank(message = "机号不能为空")
+    private String aircraftNo;
+
+    /**
+     * 部件名称
+     */
+    @NotBlank(message = "部件名称不能为空")
+    private String name;
+
+    /**
+     * 型号
+     */
+    private String model;
+
+    /**
+     * 所属系统
+     */
+    private String system;
+
+    /**
+     * 处理方式
+     */
+    private String methodType;
+
+    /**
+     * 剩余时长(h)
+     */
+    private String remainTiem;
+
+
+}

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

@@ -0,0 +1,108 @@
+package org.eco.als.domain.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.eco.common.mapper.annotation.FieldMapper;
+import com.eco.common.mapper.constant.MapperConstant;
+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;
+
+    /**
+     * 机号
+     */
+    @ExcelProperty(value = "机号")
+    private String aircraftNo;
+
+    /**
+     * 部件名称
+     */
+    @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;
+
+
+    /**
+     * 创建人名称
+     */
+    @FieldMapper(type = MapperConstant.USER_ID_TO_NAME, mapper = "createBy")
+    private String createByName;
+
+    /**
+     * 创建人名称
+     */
+    @FieldMapper(type = MapperConstant.USER_ID_TO_NAME, mapper = "updateBy")
+    private String updateByName;
+
+}

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

@@ -0,0 +1,102 @@
+package org.eco.als.domain.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.eco.common.mapper.annotation.FieldMapper;
+import com.eco.common.mapper.constant.MapperConstant;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.eco.als.domain.LifePrediction;
+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_t
+ *
+ * @author wgk
+ * @date 2024-07-26
+ */
+@Data
+@ExcelIgnoreUnannotated
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = LifePrediction.class)
+public class LifePredictionVo extends BaseEntity implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    @ExcelProperty(value = "编号")
+    private Long id;
+
+    /**
+     * 机号
+     */
+    @ExcelProperty(value = "机号")
+    private String aircraftNo;
+
+    /**
+     * 部件名称
+     */
+    @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;
+
+
+    /**
+     * 创建人名称
+     */
+    @FieldMapper(type = MapperConstant.USER_ID_TO_NAME, mapper = "createBy")
+    private String createByName;
+
+    /**
+     * 创建人名称
+     */
+    @FieldMapper(type = MapperConstant.USER_ID_TO_NAME, mapper = "updateBy")
+    private String updateByName;
+
+}

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

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

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

@@ -0,0 +1,16 @@
+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> {
+
+}

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

@@ -0,0 +1,86 @@
+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);
+
+}

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

@@ -0,0 +1,86 @@
+package org.eco.als.service;
+
+import org.eco.als.domain.LifePrediction;
+import org.eco.als.domain.bo.LifePredictionBo;
+import org.eco.als.domain.vo.LifePredictionVo;
+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 ILifePredictionService extends IBaseService<LifePrediction> {
+    /**
+     * 查询寿命预测
+     *
+     * @param id 寿命预测主键
+     * @return 寿命预测
+     */
+    LifePredictionVo selectById(Long id);
+
+    /**
+     * 查询寿命预测列表
+     *
+     * @param lifePredictionBo 寿命预测Bo
+     * @return 寿命预测集合
+     */
+    List<LifePredictionVo> selectList(LifePredictionBo lifePredictionBo);
+
+    /**
+     * 分页查询寿命预测列表
+     *
+     * @param lifePredictionBo 寿命预测Bo
+     * @return 分页寿命预测集合
+     */
+    PageResult<LifePredictionVo> selectPage(LifePredictionBo lifePredictionBo);
+
+    /**
+     * 新增寿命预测
+     *
+     * @param lifePredictionBo 寿命预测Bo
+     * @return 结果:true 操作成功,false 操作失败
+     */
+    boolean insert(LifePredictionBo lifePredictionBo);
+
+    /**
+     * 新增寿命预测,前台提供主键值,一般用于导入的场合
+     *
+     * @param lifePredictionBo 寿命预测Bo
+     * @return 结果:true 操作成功,false 操作失败
+     */
+    boolean insertWithPk(LifePredictionBo lifePredictionBo);
+
+    /**
+     * 修改寿命预测
+     *
+     * @param lifePredictionBo 寿命预测Bo
+     * @return 结果:true 更新成功,false 更新失败
+     */
+    boolean update(LifePredictionBo lifePredictionBo);
+
+    /**
+     * 批量删除寿命预测
+     *
+     * @param ids 需要删除的寿命预测主键集合
+     * @return 结果:true 删除成功,false 删除失败
+     */
+    boolean deleteByIds(Long[] ids);
+
+    /**
+     * asyncExport 异步导出
+     *
+     * @param listVo    数据列表
+     * @param sheetName 文件名称
+     * @param user      上下文
+     */
+    @Async
+    void asyncExport(List<LifePredictionVo> listVo, String sheetName, LoginUser user);
+
+}

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

@@ -0,0 +1,173 @@
+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_NO.eq
+            (lifePredictionResultBo.getAircraftNo()));
+        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));
+    }
+
+}

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

@@ -0,0 +1,171 @@
+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.LifePrediction;
+import org.eco.als.domain.bo.LifePredictionBo;
+import org.eco.als.domain.vo.LifePredictionVo;
+import org.eco.als.mapper.LifePredictionMapper;
+import org.eco.als.service.ILifePredictionService;
+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.LifePredictionTableDef.LIFE_PREDICTION;
+
+/**
+ * 寿命预测Service业务层处理
+ *
+ * @author wgk
+ * @date 2024-07-26
+ */
+@Service
+@Slf4j
+public class LifePredictionServiceImpl extends BaseServiceImpl<LifePredictionMapper, LifePrediction> implements ILifePredictionService {
+    @Resource
+    private LifePredictionMapper lifePredictionMapper;
+
+    @Resource
+    private IExcelService excelService;
+
+    @Resource
+    private IImportExportService importExportService;
+
+    @Override
+    public QueryWrapper query() {
+        return super.query().from(LIFE_PREDICTION);
+    }
+
+    private QueryWrapper buildQueryWrapper(LifePredictionBo lifePredictionBo) {
+        QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
+        queryWrapper.and(LIFE_PREDICTION.AIRCRAFT_NO.eq
+            (lifePredictionBo.getAircraftNo()));
+        queryWrapper.and(LIFE_PREDICTION.NAME.like
+            (lifePredictionBo.getName()));
+        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;
+    }
+
+    /**
+     * 查询寿命预测
+     *
+     * @param id 寿命预测主键
+     * @return 寿命预测
+     */
+    @Override
+    public LifePredictionVo selectById(Long id) {
+        return this.getOneAs(query().where(LIFE_PREDICTION.ID.eq(id)), LifePredictionVo.class);
+
+    }
+
+
+    /**
+     * 查询寿命预测列表
+     *
+     * @param lifePredictionBo 寿命预测Bo
+     * @return 寿命预测集合
+     */
+    @Override
+    public List<LifePredictionVo> selectList(LifePredictionBo lifePredictionBo) {
+        QueryWrapper queryWrapper = buildQueryWrapper(lifePredictionBo);
+        return this.listAs(queryWrapper, LifePredictionVo.class);
+    }
+
+    /**
+     * 分页查询寿命预测列表
+     *
+     * @param lifePredictionBo 寿命预测Bo
+     * @return 分页寿命预测集合
+     */
+    @Override
+    public PageResult<LifePredictionVo> selectPage(LifePredictionBo lifePredictionBo) {
+        QueryWrapper queryWrapper = buildQueryWrapper(lifePredictionBo);
+        Page<LifePredictionVo> page = this.pageAs(PageQuery.build(), queryWrapper, LifePredictionVo.class);
+        return PageResult.build(page);
+    }
+
+    /**
+     * 新增寿命预测
+     *
+     * @param lifePredictionBo 寿命预测Bo
+     * @return 结果:true 操作成功,false 操作失败
+     */
+    @Override
+    public boolean insert(LifePredictionBo lifePredictionBo) {
+        LifePrediction lifePrediction = MapstructUtils.convert(lifePredictionBo, LifePrediction.class);
+
+        return this.save(lifePrediction);//使用全局配置的雪花算法主键生成器生成ID值
+    }
+
+    /**
+     * 新增寿命预测,前台提供主键值,一般用于导入的场合
+     *
+     * @param lifePredictionBo 寿命预测Bo
+     * @return 结果:true 操作成功,false 操作失败
+     */
+    @Override
+    public boolean insertWithPk(LifePredictionBo lifePredictionBo) {
+        LifePrediction lifePrediction = MapstructUtils.convert(lifePredictionBo, LifePrediction.class);
+
+
+        return lifePredictionMapper.insertWithPk(lifePrediction) > 0;//前台传来主键值
+    }
+
+    /**
+     * 修改寿命预测
+     *
+     * @param lifePredictionBo 寿命预测Bo
+     * @return 结果:true 更新成功,false 更新失败
+     */
+    @Override
+    public boolean update(LifePredictionBo lifePredictionBo) {
+        LifePrediction lifePrediction = MapstructUtils.convert(lifePredictionBo, LifePrediction.class);
+        if (ObjectUtil.isNotNull(lifePrediction) && ObjectUtil.isNotNull(lifePrediction.getId())) {
+            return this.updateById(lifePrediction);
+        }
+        return false;
+    }
+
+    @Override
+    public void asyncExport(List<LifePredictionVo> listVo, String sheetName, LoginUser loginUser) {
+        ExcelResultRes result = excelService.exportExcel(listVo, sheetName, LifePredictionVo.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 - 0
als-modules/agile-assurance/src/main/resources/mapper/als/LifePredictionMapper.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.eco.als.mapper.LifePredictionMapper">
+
+</mapper>

+ 7 - 0
als-modules/agile-assurance/src/main/resources/mapper/als/LifePredictionResultMapper.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.eco.als.mapper.LifePredictionResultMapper">
+
+</mapper>