Эх сурвалжийг харах

档案系统并卷逻辑优化

lvy 1 өдөр өмнө
parent
commit
7170ec2e2c

+ 8 - 2
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveFileAutoController.java

@@ -250,8 +250,14 @@ ArchiveFileAutoController extends BladeController {
                     if (archivesAuto!= null && (archivesAuto.getActionType() == 1 || archivesAuto.getActionType() == 2)) {
                         throw new ServiceException("【" + archivesAuto.getName() + "】案卷已正在并卷或重组,请稍后再试!");
                     }
-                    archive.setActionType(null);
-                    archivesAutoService.updateById(archive);
+                    archivesAuto = new ArchivesAuto();
+                    archivesAuto.setId(archive.getId());
+                    archivesAuto.setName(archive.getName());
+                    archivesAuto.setFileNumber(archive.getFileNumber());
+                    archivesAuto.setUnit(archive.getUnit());
+                    archivesAuto.setStorageTime(archive.getStorageTime());
+                    archivesAuto.setRemark(archive.getRemark());
+                    archivesAutoService.updateById(archivesAuto);
                 }
             }
         } catch (NumberFormatException e) {

+ 13 - 0
blade-service/blade-archive/src/main/java/org/springblade/archive/controller/ArchiveFileController.java

@@ -390,6 +390,19 @@ public class ArchiveFileController extends BladeController {
     @ApiOperation(value = "修改基础信息")
     public R<Boolean> batchUpdateInfo(@RequestBody ArchiveFileVO vo) {
         try {
+            List<ArchiveFileVO> list = vo.getList();
+            if (list != null && !list.isEmpty()) {
+                List<ArchiveFileVO> newList = new ArrayList<>();
+                for (ArchiveFileVO fileVO : list) {
+                    ArchiveFileVO newVo = new ArchiveFileVO();
+                    newVo.setId(fileVO.getId());
+                    newVo.setFileName(fileVO.getFileName());
+                    newVo.setFileNumber(fileVO.getFileNumber());
+                    newVo.setFileTime(fileVO.getFileTime());
+                    newVo.setDutyUser(fileVO.getDutyUser());
+                }
+                vo.setList(newList);
+            }
             this.archiveFileClient.batchUpdateInfo(vo);
         } catch (Exception e) {
             e.printStackTrace();

+ 6 - 3
blade-service/blade-archive/src/main/java/org/springblade/archive/service/impl/ArchivesAutoServiceImpl.java

@@ -4844,7 +4844,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			}
 		}
 		if (!updates.isEmpty()) {
-			return this.updateBatchById(archivesAutos);
+			return this.updateBatchById(updates);
 		}
 		return true;
 	}
@@ -5207,6 +5207,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 				List<ArchiveFile>archiveFileList=archiveFileClient.getArchiveFileByArchiveIds(id+"");
 				//设置案卷页码和四要素
 				if (archiveFileList != null && !archiveFileList.isEmpty()) {
+					archivesAuto.setActionType(null);
 					this.reCreateArchiveAuto(archivesAuto, archiveFileList);
 				}
 				this.update(Wrappers.<ArchivesAuto>lambdaUpdate().set(ArchivesAuto::getActionType, 0).eq(ArchivesAuto::getId, id));
@@ -5264,14 +5265,15 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 			}
 			archiveFileClient.updateArchiveFile(waitArchiveFiles);
 			archivesAuto.setName(name);
+			archivesAuto.setActionType(null);
 			//删除其他案卷
 			archivesAutoList.remove(archivesAuto);
 			this.deleteLogic(archivesAutoList.stream().map(o->o.getId()).collect(Collectors.toList()));
 			this.reCreateArchiveAuto(archivesAuto, archiveFileList);
-			this.update(Wrappers.<ArchivesAuto>lambdaUpdate().set(ArchivesAuto::getActionType, 0).in(ArchivesAuto::getId, ids));
+			this.update(Wrappers.<ArchivesAuto>lambdaUpdate().set(ArchivesAuto::getActionType, 0).in(ArchivesAuto::getId, longList));
 		} catch (Exception e) {
 			log.error("案卷并卷失败," + "案卷Ids:" + ids, e);
-			this.update(Wrappers.<ArchivesAuto>lambdaUpdate().set(ArchivesAuto::getActionType, -1).in(ArchivesAuto::getId, ids));
+			this.update(Wrappers.<ArchivesAuto>lambdaUpdate().set(ArchivesAuto::getActionType, -1).in(ArchivesAuto::getId, Func.toLongList(ids)));
 		}
 
 	}
@@ -5517,6 +5519,7 @@ public class ArchivesAutoServiceImpl extends BaseServiceImpl<ArchivesAutoMapper,
 					List<ArchiveFile>archiveFileList=archiveFileClient.getArchiveFileByArchiveIds(archivesAuto.getId()+"");
 					//设置案卷页码和四要素
 					if (archiveFileList != null && !archiveFileList.isEmpty()) {
+						archivesAuto.setActionType(null);
 						this.reCreateArchiveAuto(archivesAuto, archiveFileList);
 					}
 					this.update(Wrappers.<ArchivesAuto>lambdaUpdate().set(ArchivesAuto::getActionType, 0).eq(ArchivesAuto::getId, archivesAuto.getId()));