|
@@ -335,9 +335,15 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
i.setDelFlag(0);
|
|
i.setDelFlag(0);
|
|
i.setUrl(item.getUrl());
|
|
i.setUrl(item.getUrl());
|
|
//文件类型处理
|
|
//文件类型处理
|
|
- List<String> strings = Arrays.asList(item.getName().split("\\."));
|
|
|
|
- if (CollectionUtils.isNotEmpty(strings)) {
|
|
|
|
- i.setType(strings.get(1));
|
|
|
|
|
|
+ String fileName = item.getName();
|
|
|
|
+ List<String> strings = Arrays.asList(fileName.split("\\."));
|
|
|
|
+ // 检查文件名是否有后缀
|
|
|
|
+ if (CollectionUtil.isNotEmpty(strings) && strings.size() > 1) {
|
|
|
|
+ // 获取最后一个部分作为文件类型
|
|
|
|
+ i.setType(strings.get(strings.size() - 1));
|
|
|
|
+ } else {
|
|
|
|
+ // 如果没有后缀或文件名无效,设置一个默认类型或空
|
|
|
|
+ i.setType("");
|
|
}
|
|
}
|
|
i.setAttachmentId(report.getId());
|
|
i.setAttachmentId(report.getId());
|
|
i.setAttachmentName(item.getName());
|
|
i.setAttachmentName(item.getName());
|
|
@@ -482,9 +488,15 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
i.setDelFlag(0);
|
|
i.setDelFlag(0);
|
|
i.setUrl(item.getUrl());
|
|
i.setUrl(item.getUrl());
|
|
//文件类型处理
|
|
//文件类型处理
|
|
- List<String> strings = Arrays.asList(item.getName().split("\\."));
|
|
|
|
- if (CollectionUtils.isNotEmpty(strings)) {
|
|
|
|
- i.setType(strings.get(1));
|
|
|
|
|
|
+ String fileName = item.getName();
|
|
|
|
+ List<String> strings = Arrays.asList(fileName.split("\\."));
|
|
|
|
+ // 检查文件名是否有后缀
|
|
|
|
+ if (CollectionUtil.isNotEmpty(strings) && strings.size() > 1) {
|
|
|
|
+ // 获取最后一个部分作为文件类型
|
|
|
|
+ i.setType(strings.get(strings.size() - 1));
|
|
|
|
+ } else {
|
|
|
|
+ // 如果没有后缀或文件名无效,设置一个默认类型或空
|
|
|
|
+ i.setType("");
|
|
}
|
|
}
|
|
i.setAttachmentId(report.getId());
|
|
i.setAttachmentId(report.getId());
|
|
i.setAttachmentName(item.getName());
|
|
i.setAttachmentName(item.getName());
|
|
@@ -520,9 +532,15 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
i.setDelFlag(0);
|
|
i.setDelFlag(0);
|
|
i.setUrl(item.getUrl());
|
|
i.setUrl(item.getUrl());
|
|
//文件类型处理
|
|
//文件类型处理
|
|
- List<String> strings = Arrays.asList(item.getName().split("\\."));
|
|
|
|
- if (CollectionUtils.isNotEmpty(strings)) {
|
|
|
|
- i.setType(strings.get(1));
|
|
|
|
|
|
+ String fileName = item.getName();
|
|
|
|
+ List<String> strings = Arrays.asList(fileName.split("\\."));
|
|
|
|
+ // 检查文件名是否有后缀
|
|
|
|
+ if (CollectionUtil.isNotEmpty(strings) && strings.size() > 1) {
|
|
|
|
+ // 获取最后一个部分作为文件类型
|
|
|
|
+ i.setType(strings.get(strings.size() - 1));
|
|
|
|
+ } else {
|
|
|
|
+ // 如果没有后缀或文件名无效,设置一个默认类型或空
|
|
|
|
+ i.setType("");
|
|
}
|
|
}
|
|
i.setAttachmentId(report.getId());
|
|
i.setAttachmentId(report.getId());
|
|
i.setAttachmentName(item.getName());
|
|
i.setAttachmentName(item.getName());
|
|
@@ -4036,9 +4054,15 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
i.setDelFlag(0);
|
|
i.setDelFlag(0);
|
|
i.setUrl(dto.getUrl());
|
|
i.setUrl(dto.getUrl());
|
|
//文件类型处理
|
|
//文件类型处理
|
|
- List<String> strings = Arrays.asList(dto.getName().split("\\."));
|
|
|
|
- if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
|
|
|
|
- i.setType(strings.get(1));
|
|
|
|
|
|
+ String fileName = dto.getName();
|
|
|
|
+ List<String> strings = Arrays.asList(fileName.split("\\."));
|
|
|
|
+ // 检查文件名是否有后缀
|
|
|
|
+ if (CollectionUtil.isNotEmpty(strings) && strings.size() > 1) {
|
|
|
|
+ // 获取最后一个部分作为文件类型
|
|
|
|
+ i.setType(strings.get(strings.size() - 1));
|
|
|
|
+ } else {
|
|
|
|
+ // 如果没有后缀或文件名无效,设置一个默认类型或空
|
|
|
|
+ i.setType("");
|
|
}
|
|
}
|
|
i.setAttachmentId(id);
|
|
i.setAttachmentId(id);
|
|
i.setAttachmentName(dto.getName());
|
|
i.setAttachmentName(dto.getName());
|
|
@@ -4118,10 +4142,16 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
i.setDelFlag(0);
|
|
i.setDelFlag(0);
|
|
i.setUrl(dto.getUrl());
|
|
i.setUrl(dto.getUrl());
|
|
//文件类型处理
|
|
//文件类型处理
|
|
- List<String> strings = Arrays.asList(dto.getName().split("\\."));
|
|
|
|
- if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
|
|
|
|
- i.setType(strings.get(1));
|
|
|
|
- }
|
|
|
|
|
|
+ String fileName = dto.getName();
|
|
|
|
+ List<String> strings = Arrays.asList(fileName.split("\\."));
|
|
|
|
+ // 检查文件名是否有后缀
|
|
|
|
+ if (CollectionUtil.isNotEmpty(strings) && strings.size() > 1) {
|
|
|
|
+ // 获取最后一个部分作为文件类型
|
|
|
|
+ i.setType(strings.get(strings.size() - 1));
|
|
|
|
+ } else {
|
|
|
|
+ // 如果没有后缀或文件名无效,设置一个默认类型或空
|
|
|
|
+ i.setType("");
|
|
|
|
+ }
|
|
i.setAttachmentId(id);
|
|
i.setAttachmentId(id);
|
|
i.setAttachmentName(dto.getName());
|
|
i.setAttachmentName(dto.getName());
|
|
i.setAttachmentFlag("cwReportSignature");
|
|
i.setAttachmentFlag("cwReportSignature");
|