|
@@ -5,13 +5,18 @@ import jakarta.annotation.Resource;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.eco.als.domain.bo.WarningBo;
|
|
|
+import org.eco.als.domain.vo.DataImportVo;
|
|
|
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.IDataImportService;
|
|
|
import org.eco.als.service.IWarningService;
|
|
|
+import org.eco.als.utils.CsvUtils;
|
|
|
+import org.eco.common.core.constant.Constants;
|
|
|
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.core.utils.StringUtils;
|
|
|
import org.eco.common.excel.core.ExcelResult;
|
|
|
import org.eco.common.excel.utils.ExcelUtil;
|
|
|
import org.eco.common.log.annotation.Log;
|
|
@@ -19,12 +24,15 @@ 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.eco.system.domain.vo.SysOssVo;
|
|
|
+import org.eco.system.service.ISysOssService;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
|
|
|
/**
|
|
|
* 警告信息Controller
|
|
@@ -40,6 +48,12 @@ public class WarningController extends BaseController {
|
|
|
@Resource
|
|
|
private IWarningService warningService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private IDataImportService dataImportService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ISysOssService sysOssService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询警告信息列表
|
|
|
*/
|
|
@@ -62,7 +76,7 @@ public class WarningController extends BaseController {
|
|
|
// 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);
|
|
@@ -132,4 +146,17 @@ public class WarningController extends BaseController {
|
|
|
}
|
|
|
return CommonResult.success();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取警告信息对应的参数详细信息
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/{code}/{sortieNo}")
|
|
|
+ public CommonResult<WarningVo> getInfoByHmc(@PathVariable String code, @PathVariable String sortieNo) {
|
|
|
+ String columnData = "时间,发动机排气温度";
|
|
|
+ DataImportVo dataImportVo = dataImportService.selectBySortieNo(sortieNo);
|
|
|
+ SysOssVo ossVo = sysOssService.getById(dataImportVo.getOssId());
|
|
|
+ // 数据库资源地址
|
|
|
+ String path = StringUtils.substringAfter(ossVo.getFileName(), Constants.RESOURCE_PREFIX);
|
|
|
+ return CommonResult.success(String.valueOf(CsvUtils.getPlaybackByHeaders(path, Arrays.asList(columnData.split(",")), null)));
|
|
|
+ }
|
|
|
}
|