|
@@ -1,6 +1,7 @@
|
1
|
1
|
package com.unis.module.coding.service.crkxx;
|
2
|
2
|
|
3
|
3
|
import cn.hutool.core.collection.CollectionUtil;
|
|
4
|
+import cn.hutool.core.util.ObjectUtil;
|
4
|
5
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
5
|
6
|
import com.github.yitter.idgen.YitIdHelper;
|
6
|
7
|
import com.unis.framework.common.util.collection.CollectionUtils;
|
|
@@ -126,15 +127,16 @@ public class CrkxxServiceImpl implements CrkxxService {
|
126
|
127
|
crkxxDOPageResult.getList().forEach(dos -> {
|
127
|
128
|
//获取文件id
|
128
|
129
|
String fileIds = dos.getFileIds();
|
129
|
|
- fileIds = fileIds.replaceAll(Pattern.quote("["), "").replaceAll(Pattern.quote("]"), "");
|
130
|
|
- String[] parts = fileIds.split(",");
|
131
|
130
|
List<Long> longList = new ArrayList<>();
|
132
|
|
-
|
133
|
|
- for (String part : parts) {
|
134
|
|
- try {
|
135
|
|
- longList.add(Long.parseLong(part.trim()));
|
136
|
|
- } catch (NumberFormatException e) {
|
137
|
|
- System.err.println("无法将 " + part + " 转换为 Long 类型: " + e.getMessage());
|
|
131
|
+ if(ObjectUtil.isNotEmpty(fileIds)){
|
|
132
|
+ fileIds = fileIds.replaceAll(Pattern.quote("["), "").replaceAll(Pattern.quote("]"), "");
|
|
133
|
+ String[] parts = fileIds.split(",");
|
|
134
|
+ for (String part : parts) {
|
|
135
|
+ try {
|
|
136
|
+ longList.add(Long.parseLong(part.trim()));
|
|
137
|
+ } catch (NumberFormatException e) {
|
|
138
|
+ System.err.println("无法将 " + part + " 转换为 Long 类型: " + e.getMessage());
|
|
139
|
+ }
|
138
|
140
|
}
|
139
|
141
|
}
|
140
|
142
|
List<FileDO> files = new ArrayList<>();
|
|
@@ -156,16 +158,20 @@ public class CrkxxServiceImpl implements CrkxxService {
|
156
|
158
|
public CrkxxRespVO getCrkxxFiles(CrkxxDO dos) {
|
157
|
159
|
//获取文件id
|
158
|
160
|
String fileIds = dos.getFileIds();
|
159
|
|
- fileIds = fileIds.replaceAll(Pattern.quote("["), "").replaceAll(Pattern.quote("]"), "");
|
160
|
|
- String[] parts = fileIds.split(",");
|
|
161
|
+
|
161
|
162
|
List<Long> longList = new ArrayList<>();
|
162
|
|
- for (String part : parts) {
|
163
|
|
- try {
|
164
|
|
- longList.add(Long.parseLong(part.trim()));
|
165
|
|
- } catch (NumberFormatException e) {
|
166
|
|
- System.err.println("无法将 " + part + " 转换为 Long 类型: " + e.getMessage());
|
|
163
|
+ if(ObjectUtil.isNotEmpty(fileIds)){
|
|
164
|
+ fileIds = fileIds.replaceAll(Pattern.quote("["), "").replaceAll(Pattern.quote("]"), "");
|
|
165
|
+ String[] parts = fileIds.split(",");
|
|
166
|
+ for (String part : parts) {
|
|
167
|
+ try {
|
|
168
|
+ longList.add(Long.parseLong(part.trim()));
|
|
169
|
+ } catch (NumberFormatException e) {
|
|
170
|
+ System.err.println("无法将 " + part + " 转换为 Long 类型: " + e.getMessage());
|
|
171
|
+ }
|
167
|
172
|
}
|
168
|
173
|
}
|
|
174
|
+
|
169
|
175
|
//循环获取文件信息
|
170
|
176
|
List<FileDO> files = new ArrayList<>();
|
171
|
177
|
if (CollectionUtil.isNotEmpty(longList)) {
|