|
@@ -91,28 +91,17 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
|
|
|
private QueryWrapper buildQueryWrapper(ToInfraredBo toInfraredBo) {
|
|
|
QueryWrapper queryWrapper = super.buildBaseQueryWrapper();
|
|
|
- queryWrapper.and(TO_INFRARED.NAME.like
|
|
|
- (toInfraredBo.getName()));
|
|
|
- queryWrapper.and(TO_INFRARED.STATUS.eq
|
|
|
- (toInfraredBo.getStatus()));
|
|
|
- queryWrapper.and(TO_INFRARED.START_TIME.eq
|
|
|
- (toInfraredBo.getStartTime()));
|
|
|
- queryWrapper.and(TO_INFRARED.END_TIME.eq
|
|
|
- (toInfraredBo.getEndTime()));
|
|
|
- queryWrapper.and(TO_INFRARED.COST_SECOND.eq
|
|
|
- (toInfraredBo.getCostSecond()));
|
|
|
- queryWrapper.and(TO_INFRARED.LOG.eq
|
|
|
- (toInfraredBo.getLog()));
|
|
|
- queryWrapper.and(TO_INFRARED.REMARKS.eq
|
|
|
- (toInfraredBo.getRemarks()));
|
|
|
- queryWrapper.and(TO_INFRARED.URL.eq
|
|
|
- (toInfraredBo.getUrl()));
|
|
|
- queryWrapper.and(TO_INFRARED.INPUT_OSS_ID.eq
|
|
|
- (toInfraredBo.getInputOssId()));
|
|
|
- queryWrapper.and(TO_INFRARED.INPUT_PATH.eq
|
|
|
- (toInfraredBo.getInputPath()));
|
|
|
- queryWrapper.and(TO_INFRARED.OUTPUT_PATH.eq
|
|
|
- (toInfraredBo.getOutputPath()));
|
|
|
+ queryWrapper.and(TO_INFRARED.NAME.like(toInfraredBo.getName()));
|
|
|
+ queryWrapper.and(TO_INFRARED.STATUS.eq(toInfraredBo.getStatus()));
|
|
|
+ queryWrapper.and(TO_INFRARED.START_TIME.eq(toInfraredBo.getStartTime()));
|
|
|
+ queryWrapper.and(TO_INFRARED.END_TIME.eq(toInfraredBo.getEndTime()));
|
|
|
+ queryWrapper.and(TO_INFRARED.COST_SECOND.eq(toInfraredBo.getCostSecond()));
|
|
|
+ queryWrapper.and(TO_INFRARED.LOG.eq(toInfraredBo.getLog()));
|
|
|
+ queryWrapper.and(TO_INFRARED.REMARKS.eq(toInfraredBo.getRemarks()));
|
|
|
+ queryWrapper.and(TO_INFRARED.URL.eq(toInfraredBo.getUrl()));
|
|
|
+ queryWrapper.and(TO_INFRARED.INPUT_OSS_ID.eq(toInfraredBo.getInputOssId()));
|
|
|
+ queryWrapper.and(TO_INFRARED.INPUT_PATH.eq(toInfraredBo.getInputPath()));
|
|
|
+ queryWrapper.and(TO_INFRARED.OUTPUT_PATH.eq(toInfraredBo.getOutputPath()));
|
|
|
|
|
|
return queryWrapper;
|
|
|
}
|
|
@@ -490,7 +479,7 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
Path statisticsResultPath = outputPath.resolve(BizConstant.RESULT_JSON_NAME);
|
|
|
|
|
|
List<Dict> resultMap = parseJsonMapList(statisticsResultPath);
|
|
|
- if(ObjectUtil.isEmpty(resultMap)) {
|
|
|
+ if (ObjectUtil.isEmpty(resultMap)) {
|
|
|
return CommonResult.fail("获取结果文件失败");
|
|
|
}
|
|
|
|
|
@@ -502,7 +491,7 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
String jsonString = new String(Files.readAllBytes(path));
|
|
|
List<Dict> dicts = JsonUtils.parseArrayMap(jsonString);
|
|
|
return dicts;
|
|
|
- }catch (Exception e) {
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return null;
|
|
|
}
|
|
@@ -514,17 +503,23 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
List<String> inputImageList = calculateImagePath(urlPrefix, inputPath);
|
|
|
List<String> outputImageList = calculateImagePath(urlPrefix, outputPath);
|
|
|
|
|
|
- HashMap<String,String> nameToUrl1 = new HashMap<>();
|
|
|
+ HashMap<String, String> nameToUrl1 = new HashMap<>();
|
|
|
|
|
|
- for (String imageUrl : inputImageList) {
|
|
|
- String name = imageUrl.substring(imageUrl.lastIndexOf("/") + 1);
|
|
|
- nameToUrl1.put(name, imageUrl);
|
|
|
+ if (ObjectUtil.isNotNull(inputImageList)) {
|
|
|
+ for (String imageUrl : inputImageList) {
|
|
|
+ String name = imageUrl.substring(imageUrl.lastIndexOf("/") + 1);
|
|
|
+ nameToUrl1.put(name, imageUrl);
|
|
|
+ }
|
|
|
}
|
|
|
- HashMap<String,String> nameToUrl2 = new HashMap<>();
|
|
|
- for (String imageUrl : outputImageList) {
|
|
|
- String name = imageUrl.substring(imageUrl.lastIndexOf("/") + 1);
|
|
|
- nameToUrl2.put(name, imageUrl);
|
|
|
+
|
|
|
+ HashMap<String, String> nameToUrl2 = new HashMap<>();
|
|
|
+ if (ObjectUtil.isNotNull(outputImageList)) {
|
|
|
+ for (String imageUrl : outputImageList) {
|
|
|
+ String name = imageUrl.substring(imageUrl.lastIndexOf("/") + 1);
|
|
|
+ nameToUrl2.put(name, imageUrl);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
List<String> inputImageNames = new ArrayList<>(nameToUrl1.keySet());
|
|
|
|
|
|
inputImageNames.sort(Comparator.naturalOrder());
|
|
@@ -565,10 +560,7 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
}
|
|
|
|
|
|
org.springframework.core.io.Resource resource = new FileSystemResource(file);
|
|
|
- return ResponseEntity.ok()
|
|
|
- .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName() + "\"")
|
|
|
- .header(HttpHeaders.CONTENT_TYPE, "application/octet-stream")
|
|
|
- .body(resource);
|
|
|
+ return ResponseEntity.ok().header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getName() + "\"").header(HttpHeaders.CONTENT_TYPE, "application/octet-stream").body(resource);
|
|
|
}
|
|
|
|
|
|
public ResponseEntity<org.springframework.core.io.Resource> getLastModelFile(ToInfrared toInfrared) {
|
|
@@ -591,10 +583,7 @@ public class ToInfraredServiceImpl extends BaseServiceImpl<ToInfraredMapper, ToI
|
|
|
File returnFile = modelFiles[modelFiles.length - 1];
|
|
|
|
|
|
org.springframework.core.io.Resource resource = new FileSystemResource(returnFile);
|
|
|
- return ResponseEntity.ok()
|
|
|
- .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + returnFile.getName() + "\"")
|
|
|
- .header(HttpHeaders.CONTENT_TYPE, "application/octet-stream")
|
|
|
- .body(resource);
|
|
|
+ return ResponseEntity.ok().header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + returnFile.getName() + "\"").header(HttpHeaders.CONTENT_TYPE, "application/octet-stream").body(resource);
|
|
|
}
|
|
|
|
|
|
// @Override
|