Ver Fonte

迁移仓库

Gaokun Wang há 6 meses atrás
pai
commit
cead49089b

+ 20 - 25
als-modules/agile-assurance/src/main/java/org/eco/als/controller/WarningController.java

@@ -7,10 +7,12 @@ import lombok.RequiredArgsConstructor;
 import org.eco.als.domain.bo.WarningBo;
 import org.eco.als.domain.vo.WarningImportVo;
 import org.eco.als.domain.vo.WarningVo;
+import org.eco.als.listener.WarningImportListener;
 import org.eco.als.service.IWarningService;
 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.excel.core.ExcelResult;
 import org.eco.common.excel.utils.ExcelUtil;
 import org.eco.common.log.annotation.Log;
 import org.eco.common.log.enums.BusinessType;
@@ -18,18 +20,11 @@ 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 org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.io.IOException;
 import java.util.ArrayList;
-import java.util.List;
 
 /**
  * 警告信息Controller
@@ -54,20 +49,20 @@ public class WarningController extends BaseController {
         return CommonResult.success(warningService.selectPage(warningBo));
     }
 
-    /**
-     * 导出警告信息列表
-     */
-    @SaCheckPermission("als:warning:export")
-    @Log(title = "警告信息", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public CommonResult<Void> export(HttpServletResponse response, WarningBo warningBo) {
-        LoginUser loginUser = LoginHelper.getLoginUser();
-        List<WarningVo> list = warningService.selectList(warningBo);
-        warningService.asyncExport(list, "警告信息", loginUser);
-        return CommonResult.success();
-    }
+//    /**
+//     * 导出警告信息列表
+//     */
+//    @SaCheckPermission("als:warning:export")
+//    @Log(title = "警告信息", businessType = BusinessType.EXPORT)
+//    @PostMapping("/export")
+//    public CommonResult<Void> export(HttpServletResponse response, WarningBo warningBo) {
+//        LoginUser loginUser = LoginHelper.getLoginUser();
+//        List<WarningVo> list = warningService.selectList(warningBo);
+////        warningService.asyncExport(list, "警告信息", loginUser);
+//        return CommonResult.success();
+//    }
 
-    @SaCheckPermission("als:warning:import")
+//    @SaCheckPermission("als:warning:import")
     @PostMapping("/importTemplate")
     public void importTemplate(HttpServletResponse response) {
         ExcelUtil.exportExcel(new ArrayList<>(), "警告信息", WarningImportVo.class, response);
@@ -79,10 +74,10 @@ public class WarningController extends BaseController {
     @Log(title = "警告信息", businessType = BusinessType.IMPORT)
     @SaCheckPermission("als:warning:import")
     @PostMapping("/importData")
-    public CommonResult<Void> importData(MultipartFile file, boolean updateSupport) {
+    public CommonResult<Void> importData(MultipartFile file, boolean updateSupport, String sortieNo) throws IOException {
         LoginUser loginUser = LoginHelper.getLoginUser();
-        warningService.asyncImportData(file, updateSupport, loginUser);
-        return CommonResult.success();
+        ExcelResult<WarningImportVo> result = ExcelUtil.importExcel(file.getInputStream(), WarningImportVo.class, new WarningImportListener(updateSupport, loginUser, sortieNo));
+        return CommonResult.success(result.getAnalysis().getLogInfo());
     }
 
     /**

+ 2 - 0
als-modules/agile-assurance/src/main/java/org/eco/als/domain/Model.java

@@ -53,6 +53,8 @@ public class Model extends BaseEntity {
      */
     private String columnData;
 
+    private String partId;
+
     /**
      * 状态
      */

+ 1 - 1
als-modules/agile-assurance/src/main/java/org/eco/als/domain/bo/DataImportBo.java

@@ -52,7 +52,7 @@ public class DataImportBo extends BaseEntity {
     /**
      * 飞行日期
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date flightDate;
 
     /**

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

@@ -45,6 +45,11 @@ public class ModelBo extends BaseEntity {
      */
     private String param;
 
+    /**
+     * 参数
+     */
+    private String partId;
+
     /**
      * 数据列
      */

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

@@ -64,6 +64,8 @@ public class ModelVo extends BaseEntity implements Serializable {
     @ExcelProperty(value = "数据列")
     private String columnData;
 
+    private String partId;
+
     /**
      * 状态
      */

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

@@ -25,13 +25,6 @@ public class WarningImportVo implements Serializable {
     @Serial
     private static final long serialVersionUID = 1L;
 
-
-    /**
-     * 架次号
-     */
-    @ExcelProperty(value = "架次号")
-    private String sortieNo;
-
     /**
      * 机号
      */
@@ -59,8 +52,6 @@ public class WarningImportVo implements Serializable {
     /**
      * 状态
      */
-    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
-    @ExcelDictFormat(dictType = "common_type")
     private String status;
 
     /**

+ 4 - 4
als-modules/agile-assurance/src/main/java/org/eco/als/listener/WarningImportListener.java

@@ -28,16 +28,18 @@ public class WarningImportListener extends AnalysisEventListener<WarningImportVo
     private final IWarningService warningService;
 
     private final Boolean isUpdateSupport;
+    private final String sortieNo;
     private final LoginUser loginUser;
     private final StringBuilder successMsg = new StringBuilder();
     private final StringBuilder failureMsg = new StringBuilder();
     private int successNum = 0;
     private int failureNum = 0;
 
-    public WarningImportListener(Boolean isUpdateSupport, LoginUser loginUser) {
+    public WarningImportListener(Boolean isUpdateSupport, LoginUser loginUser, String sortieNo) {
         this.warningService = SpringUtils.getBean(IWarningService.class);
         this.isUpdateSupport = isUpdateSupport;
         this.loginUser = loginUser;
+        this.sortieNo = sortieNo;
     }
 
     @Override
@@ -46,14 +48,11 @@ public class WarningImportListener extends AnalysisEventListener<WarningImportVo
 
             WarningBo warningBo = BeanUtil.toBean(warningVo, WarningBo.class);
             WarningVo warningVo1 = null;
-
-            //warningVo1 = warningService.selectBySomefield(warningVo.getSomefield());
             if (ObjectUtil.isNull(warningVo1)) {
                 //不存在就新增
                 setBo(warningBo);
                 ValidatorUtils.validate(warningBo);
                 boolean inserted = warningService.insert(warningBo);
-
                 if (inserted) {
                     successNum++;
                     successMsg.append("<br/>").append(successNum).append("、警告信息 记录导入成功");
@@ -84,6 +83,7 @@ public class WarningImportListener extends AnalysisEventListener<WarningImportVo
 
     private void setBo(WarningBo warningBo) {
         warningBo.setVersion(0);
+        warningBo.setSortieNo(sortieNo);
         warningBo.setCreateBy(loginUser.getUserId());
         warningBo.setUpdateBy(loginUser.getUserId());
         warningBo.setTenantId(loginUser.getTenantId());

+ 0 - 23
als-modules/agile-assurance/src/main/java/org/eco/als/service/IWarningService.java

@@ -3,11 +3,8 @@ package org.eco.als.service;
 import org.eco.als.domain.Warning;
 import org.eco.als.domain.bo.WarningBo;
 import org.eco.als.domain.vo.WarningVo;
-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 org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 
@@ -74,24 +71,4 @@ public interface IWarningService extends IBaseService<Warning> {
      */
     boolean deleteByIds(Long[] ids);
 
-    /**
-     * 异步导入
-     *
-     * @param file          导入的文件
-     * @param updateSupport 是否覆盖
-     * @param user          用户上下文信息
-     */
-    @Async
-    void asyncImportData(MultipartFile file, boolean updateSupport, LoginUser user);
-
-    /**
-     * asyncExport 异步导出
-     *
-     * @param listVo    数据列表
-     * @param sheetName 文件名称
-     * @param user      上下文
-     */
-    @Async
-    void asyncExport(List<WarningVo> listVo, String sheetName, LoginUser user);
-
 }

+ 2 - 1
als-modules/agile-assurance/src/main/java/org/eco/als/service/impl/ModelServiceImpl.java

@@ -59,7 +59,8 @@ public class ModelServiceImpl extends BaseServiceImpl<ModelMapper, Model> implem
             (modelBo.getName()));
         queryWrapper.and(MODEL.TYPE.eq
             (modelBo.getType()));
-
+        queryWrapper.and(MODEL.PART_ID.eq
+            (modelBo.getPartId()));
         return queryWrapper;
     }
 

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

@@ -7,25 +7,19 @@ import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
 import org.eco.als.domain.Warning;
 import org.eco.als.domain.bo.WarningBo;
-import org.eco.als.domain.vo.WarningImportVo;
 import org.eco.als.domain.vo.WarningVo;
-import org.eco.als.listener.WarningImportListener;
 import org.eco.als.mapper.WarningMapper;
 import org.eco.als.service.IWarningService;
-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.core.utils.StringUtils;
-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 org.springframework.web.multipart.MultipartFile;
 
-import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
 
@@ -152,30 +146,6 @@ public class WarningServiceImpl extends BaseServiceImpl<WarningMapper, Warning>
         return false;
     }
 
-    @Override
-    public void asyncImportData(MultipartFile file, boolean updateSupport, LoginUser loginUser) {
-        ExcelResultRes result;
-        try {
-            String name = file.getOriginalFilename();
-            result = excelService.importExcel(file.getInputStream(), name, WarningImportVo.class, new WarningImportListener(updateSupport, loginUser));
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
-        boolean flag = importExportService.saveInfo(result, loginUser, "0");
-        if (flag) {
-            log.info("异步导入日志写入成功");
-        }
-    }
-
-    @Override
-    public void asyncExport(List<WarningVo> listVo, String sheetName, LoginUser loginUser) {
-        ExcelResultRes result = excelService.exportExcel(listVo, sheetName, WarningVo.class);
-        boolean flag = importExportService.saveInfo(result, loginUser, "1");
-        if (flag) {
-            log.info("异步导出日志写入成功");
-        }
-    }
-
     /**
      * 批量删除警告信息
      *

+ 8 - 4
als-start/src/main/resources/application-dev.yml

@@ -40,9 +40,12 @@ mybatis-flex:
       #DM8数据库
       driver-class-name: dm.jdbc.driver.DmDriver
 #      url: jdbc:dm://192.168.0.103:5236?schema=lqbz&useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
-      url: jdbc:dm://127.0.0.1:5236?schema=lqbz&useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
+      url: jdbc:dm://101.126.133.7:11000?schema=lqbz&useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
+#      url: jdbc:dm://127.0.0.1:5236?schema=als&useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
+#      url: jdbc:dm://127.0.0.1:5236?schema=lqbz&useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
       username: SYSDBA
-      password: SYSDBA123
+#      password: SYSDBA123
+      password: GIUgeTfer3FD3216F
 #    # 数据源-2
 #    ds2:
 #      # 指定为HikariDataSource
@@ -62,13 +65,14 @@ mybatis-flex:
 spring.data:
   redis:
     # 地址
-    host: localhost
+    host: 101.126.133.7
+#    host: localhost
     # 端口,默认为6379
     port: 6379
     # 数据库索引
     database: 0
     # 密码(如没有密码请注释掉)
-    # password: CWwYsGjafmv8Sr7g
+    password: Z;G4AS:Vor'YF#p?
     # 连接超时时间
     timeout: 10s
     # 是否开启ssl

+ 1 - 1
als-start/src/main/resources/application.yml

@@ -113,7 +113,7 @@ spring:
   devtools:
     restart:
       # 热部署开关
-      enabled: true
+      enabled: false
 
 # PageHelper分页插件
 pagehelper:

+ 4 - 0
als-start/src/main/resources/db/dm/V1_0_0_4__als-ddl.sql

@@ -0,0 +1,4 @@
+alter table "lqbz"."als_data_import_t" modify "flight_date" TIMESTAMP(6);
+alter table "lqbz"."als_data_import_t" modify "aircraft_id" VARCHAR2(255);
+alter table "lqbz"."als_fault_diagnosis_result_t" modify "aircraft_id" VARCHAR2(255);
+ALTER TABLE "lqbz"."als_model_t" ADD COLUMN "part_id" VARCHAR2(255);