|
|
|
@ -1208,23 +1208,26 @@ public class MaterialController { |
|
|
|
// 获取条形码与物料的映射
|
|
|
|
MaterialAndBarCode materialByBarCode = materialService.findMaterialByBarCode(qrCode); |
|
|
|
if (materialByBarCode != null) { |
|
|
|
for (int j = 0; j < depositoryByAdminorg.size(); j++) { |
|
|
|
for (Depository depository : depositoryByAdminorg) { |
|
|
|
List<PlaceP> placePList = new ArrayList<>(); |
|
|
|
Boolean isExist = false; |
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
param.put("depositoryId", depositoryByAdminorg.get(j).getId()); |
|
|
|
param.put("depositoryId", depository.getId()); |
|
|
|
param.put("mcode", materialByBarCode.getMcode()); |
|
|
|
List<InventoryP> inventory = materialService.findInventory(param); |
|
|
|
if (inventory.size() > 0) { |
|
|
|
// 如果存在该物料
|
|
|
|
InventoryP materialP = inventory.get(0); |
|
|
|
materialByBarCode.setMid(materialP.getId()); |
|
|
|
List<PlaceP> placeByMidAndDid = placeService.findPlaceByMidAndDid(materialP.getId(), depositoryByAdminorg.get(j).getId()); |
|
|
|
List<PlaceP> placeByMidAndDid = placeService.findPlaceByMidAndDid(materialP.getId(), depository.getId()); |
|
|
|
placePList.addAll(placeByMidAndDid); |
|
|
|
isExist = true; |
|
|
|
} |
|
|
|
if (isExist) { |
|
|
|
materialByBarCode.setPlacePList(placePList); |
|
|
|
Inventory inventoryById = materialService.findInventoryById(materialByBarCode.getMid()); |
|
|
|
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(inventoryById.getMid()); |
|
|
|
materialByBarCode.setSplitInfoList(splitInfoByMid); |
|
|
|
return new RestResponse(materialByBarCode); |
|
|
|
} |
|
|
|
} |
|
|
|
|