Kaynağa Gözat

试验-规范管理-文件管理批量更新只更新一条问题处理

LHB 2 ay önce
ebeveyn
işleme
ff475ab603

+ 4 - 5
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/PrivateStandardServiceImpl.java

@@ -241,9 +241,9 @@ public class PrivateStandardServiceImpl extends ServiceImpl<PrivateStandardMappe
             for (PrivateStandardDTO dto : data) {
                 // 获取当前对象需要的文件数量
                 int fileCount = dto.getFilesCount();
-                if(allFiles != null && allFiles.length > 0){
-                    if(fileCount > 0 && fileIndex < allFiles.length){
-                        dto.setFile(allFiles[fileIndex++]);
+                if(files != null && files.size() > 0){
+                    if(fileCount > 0 && fileIndex < files.size()){
+                        dto.setFile(files.get(fileIndex++));
                     }
                     //先上传文件,上传成功在执行添加
                     if(dto.getFile() != null){
@@ -286,9 +286,8 @@ public class PrivateStandardServiceImpl extends ServiceImpl<PrivateStandardMappe
                 PrivateStandard privateStandard = BeanUtil.copyProperties(dto, PrivateStandard.class);
                 //修改
                 baseMapper.updateById(privateStandard);
-                return true;
             }
-            return false;
+            return true;
         } catch (Exception e) {
             //删除之前上传的文件
             if(CollectionUtils.isNotEmpty(standardFiles)){