|
|
@@ -811,7 +811,8 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
|
|
|
|
|
|
private Map<String, Object> getFtlDrill(CoreDrillTaskDetailVo task) {
|
|
|
Map<String, Object> data = new HashMap<>();
|
|
|
-
|
|
|
+ String prefixPath = RemoteCallHandlerExecutor.executeRemoteCall(() -> fileService.getLocalPathPrefix(), ErrorMsgConstants.QUERY_FILE_PATH_ERROR);
|
|
|
+ String staticsPath = RemoteCallHandlerExecutor.executeRemoteCall(() -> fileService.getStaticPathPrefix(), ErrorMsgConstants.QUERY_FILE_PATH_ERROR);
|
|
|
String orgName = task.getOrgName();
|
|
|
String drillSite = task.getDrillSite();
|
|
|
String imageData = task.getImageList();
|
|
|
@@ -829,7 +830,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
|
|
|
data.put("drillTime", StringUtils.isNotEmpty(drillTime) ? drillTime : StringUtil.EMPTY_STRING);
|
|
|
data.put("hostName", StringUtils.isNotEmpty(hostName) ? hostName : StringUtil.EMPTY_STRING);
|
|
|
data.put("typeText", StringUtils.isNotEmpty(typeText) ? typeText : StringUtil.EMPTY_STRING);
|
|
|
- data.put("imageData", StringUtils.isNotEmpty(imageData) ? Arrays.asList(imageData.split(",")) : StringUtil.EMPTY_STRING);
|
|
|
+ data.put("imageData", getFileRealPath(Arrays.asList(task.getImageList().split(",")), prefixPath, staticsPath));
|
|
|
data.put("recorderName", StringUtils.isNotEmpty(recorderName) ? recorderName : StringUtil.EMPTY_STRING);
|
|
|
data.put("presetCase", StringUtils.isNotEmpty(presetCase) ? "预设案由: " + presetCase : StringUtil.EMPTY_STRING);
|
|
|
data.put("drillSituation", StringUtils.isNotEmpty(drillSituation) ? "演练情况: " + drillSituation : StringUtil.EMPTY_STRING);
|
|
|
@@ -837,23 +838,35 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
|
|
|
if (ObjectUtil.isEmpty(taskUserList)) {
|
|
|
data.put("image", new ArrayList<>());
|
|
|
} else {
|
|
|
- String prefixPath = RemoteCallHandlerExecutor.executeRemoteCall(() -> fileService.getLocalPathPrefix(), ErrorMsgConstants.QUERY_FILE_PATH_ERROR);
|
|
|
- String staticsPath = RemoteCallHandlerExecutor.executeRemoteCall(() -> fileService.getStaticPathPrefix(), ErrorMsgConstants.QUERY_FILE_PATH_ERROR);
|
|
|
List<String> collect = taskUserList.stream().filter(item -> item.getType() == 1 && ObjectUtil.isNotEmpty(item.getSignImage())).map(CoreDrillTaskToUser::getSignImage).collect(Collectors.toList());
|
|
|
- List<String> list = new ArrayList<>();
|
|
|
- for (String path : collect) {
|
|
|
- if (path.contains(staticsPath)) {
|
|
|
- //删除 /statics 前缀路径
|
|
|
- path = path.replace(staticsPath, StringUtil.EMPTY_STRING);
|
|
|
- }
|
|
|
- list.add(prefixPath + path);
|
|
|
- }
|
|
|
-
|
|
|
- data.put("image", list);
|
|
|
+ data.put("image", getFileRealPath(collect, prefixPath, staticsPath));
|
|
|
}
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取文件真实地址
|
|
|
+ *
|
|
|
+ * @param fileList 文件数组
|
|
|
+ * @param prefixPath 真实磁盘路径,配置于yml中 D:xxx/xxx
|
|
|
+ * @param staticsPath 转发路径 /statics
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<String> getFileRealPath(List<String> fileList, String prefixPath, String staticsPath) {
|
|
|
+
|
|
|
+ List<String> list = new ArrayList<>();
|
|
|
+ if (ObjectUtil.isEmpty(fileList)) {
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ for (String path : fileList) {
|
|
|
+ if (path.contains(staticsPath)) {
|
|
|
+ //删除 /statics 前缀路径
|
|
|
+ path = path.replace(staticsPath, StringUtil.EMPTY_STRING);
|
|
|
+ }
|
|
|
+ list.add(prefixPath + path);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public String buildDrillTask(Integer cycle, Date date) {
|