From 654bb8ad298b716628b7d05963313fc3ae9f5d1a Mon Sep 17 00:00:00 2001 From: xia Date: Mon, 1 Aug 2022 15:32:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=8C=81=E6=9C=BAbu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/archives/controller/StorageController.java | 8 ++++---- .../archives/service/impl/ArchivesCaseServiceImpl.java | 10 +++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/archives/src/main/java/com/storeroom/modules/archives/controller/StorageController.java b/archives/src/main/java/com/storeroom/modules/archives/controller/StorageController.java index a4fc08a..f31c2aa 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/controller/StorageController.java +++ b/archives/src/main/java/com/storeroom/modules/archives/controller/StorageController.java @@ -222,12 +222,12 @@ public class StorageController { @ApiOperation("手持机-出库") @AnonymousPostMapping("/rfidGrant") public ApiResponse rfidGrant( - @Validated @RequestBody List caseIds + @Validated @RequestBody List dtos ){ - for(String caseId:caseIds){ - caseService.grant(false,caseId); + for(CollectDTO dto:dtos){ + caseService.grant(false,dto.getCaseId()); } - return ApiResponse.success(caseIds.size()); + return ApiResponse.success(dtos.size()); } // 第一版本 出库 防止业务回滚 注释不删 diff --git a/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesCaseServiceImpl.java b/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesCaseServiceImpl.java index 0813074..a701111 100644 --- a/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesCaseServiceImpl.java +++ b/archives/src/main/java/com/storeroom/modules/archives/service/impl/ArchivesCaseServiceImpl.java @@ -518,10 +518,11 @@ public class ArchivesCaseServiceImpl implements ArchivesCaseService { Optional optional = deviceArchivesTagRepository.findById(dto.getShelfId()); if(!optional.isPresent()) break; + DeviceArchivesTag tag = optional.get(); ArchivesCase archivesCase = caseRepository.findCaseById(dto.getCaseId()); archivesCase.setShelfId(dto.getShelfId()); - archivesCase.setFolderLocation(dto.getPosition()); - archivesCase.setFolderLocationDetails(dto.getPositionName()); + archivesCase.setFolderLocation(tag.getPosition()); + archivesCase.setFolderLocationDetails(tag.getPosition_name()); archivesCase.setStorageType(2); cases.add(archivesCase); @@ -602,7 +603,10 @@ public class ArchivesCaseServiceImpl implements ArchivesCaseService { @Transactional public Integer grant(boolean isCallback, String caseId) { ArchivesCase archivesCase = caseRepository.findById(caseId).get(); - Integer deviceType = archivesCase.getFolderLocation().split("-").length == 5?1:2; + Integer deviceType = 1; + if(archivesCase.getFolderLocation() != null){ + deviceType = archivesCase.getFolderLocation().split("-").length == 5?1:2; + } if(isCallback){ archivesCase.setStorageType(3); }else{