feat: scc流程生成数据 优化到2秒
This commit is contained in:
+1
-1
@@ -133,7 +133,7 @@ public class ProcessStandardComplianceCheckController extends JeroController<Pro
|
||||
@AutoLog(value = "法规符合性排查流程-上传车型文件")
|
||||
@ApiOperation(value = "法规符合性排查流程-上传车型文件", notes = "法规符合性排查流程-上传车型文件")
|
||||
@PostMapping("/uploadModelFile")
|
||||
public Result<OSSFile> uploadModelFile(@RequestBody HttpServletRequest request) {
|
||||
public Result<OSSFile> uploadModelFile(HttpServletRequest request) {
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK), sccService.uploadModelFile(request));
|
||||
}
|
||||
|
||||
|
||||
+12
-8
@@ -503,9 +503,17 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
return null;
|
||||
});
|
||||
|
||||
CompletableFuture<MultipartFile> modelFileFuture = CompletableFuture.supplyAsync(() ->
|
||||
this.getFileById(scc.getModelFile())
|
||||
);
|
||||
// 从redis上获取数据,获取不到再去obs上取文件
|
||||
List<ModelExcelVO> modelExcelVOList;
|
||||
modelExcelVOList = (List<ModelExcelVO>) redisUtil.get(MODEL_EXCEL_VO_LIST_KEY + scc.getModelFile());
|
||||
if (CollUtil.isEmpty(modelExcelVOList)) {
|
||||
CompletableFuture<MultipartFile> modelFileFuture = CompletableFuture.supplyAsync(() ->
|
||||
this.getFileById(scc.getModelFile())
|
||||
);
|
||||
// 等待模型文件获取完成并进行文件内容转换
|
||||
MultipartFile modelFile = modelFileFuture.get(); // 等待获取的文件完成
|
||||
modelExcelVOList = this.getModelExcelData(modelFile);
|
||||
}
|
||||
|
||||
// 获取拆分数据
|
||||
List<ProcessStandardComplianceCheckDetail> detailInfoList;
|
||||
@@ -526,10 +534,6 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
}
|
||||
}
|
||||
|
||||
// 等待模型文件获取完成并进行文件内容转换
|
||||
MultipartFile modelFile = modelFileFuture.get(); // 等待获取的文件完成
|
||||
List<ModelExcelVO> modelExcelVOList = this.getModelExcelData(modelFile);
|
||||
|
||||
// 根据主表数据和车型文件生成子表数据并保存
|
||||
return this.saveAllDetailData(modelExcelVOList, detailInfoList);
|
||||
}
|
||||
@@ -776,7 +780,7 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
OSSFile result = ossFileService.outUpload(request).getResult();
|
||||
// 等待模型文件获取完成并进行文件内容转换
|
||||
List<ModelExcelVO> modelExcelVOList = this.getModelExcelData(modelFile);
|
||||
if (CollUtil.isEmpty(modelExcelVOList)) {
|
||||
if (CollUtil.isNotEmpty(modelExcelVOList)) {
|
||||
// 存入Redis
|
||||
redisUtil.set(MODEL_EXCEL_VO_LIST_KEY + result.getId(), modelExcelVOList, 60 * 60 * 24 * 7);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user