|
|
|
@ -1480,7 +1480,6 @@ public class MaterialController { |
|
|
|
@PostMapping("/findMaterialForTaking") |
|
|
|
public RestResponse findMaterialForTaking(@RequestBody Map<String, Object> map, HttpServletRequest request) { |
|
|
|
String placeId = (String) map.get("placeId"); |
|
|
|
|
|
|
|
// 用于查询物料
|
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
param.put("mname", map.get("mname")); |
|
|
|
@ -1488,7 +1487,26 @@ public class MaterialController { |
|
|
|
List<InventoryP> inventory = materialService.findInventory(param); |
|
|
|
if ("0".equals(placeId)) { |
|
|
|
// 如果是默认库位
|
|
|
|
if (inventory.size() > 1) { |
|
|
|
return new RestResponse(inventory, materialService.findInventoryCount(param), 200); |
|
|
|
} else { |
|
|
|
// 获取当前物料
|
|
|
|
InventoryP materialP = inventory.get(0); |
|
|
|
MaterialAndPlace pm = placeService.findPlaceAndMaterialByMidAndPid(0, materialP.getId()); |
|
|
|
if(pm!=null) { |
|
|
|
Map<String, Object> paramForCode = new HashMap<>(); |
|
|
|
paramForCode.put("mcode", materialP.getCode()); |
|
|
|
paramForCode.put("codeFlag", 1); |
|
|
|
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(paramForCode); |
|
|
|
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(materialP.getMid()); |
|
|
|
materialP.setSplitInfoList(splitInfoByMid); |
|
|
|
materialP.setMaterialAndBarCodeList(materialByBarCodeByCondition); |
|
|
|
materialP.setBaseUnitQuantity(pm.getQuantity()); |
|
|
|
return new RestResponse(materialP, 1, 200); |
|
|
|
}else { |
|
|
|
return new RestResponse("", 0, 200); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 如果不是默认库位
|
|
|
|
// 获取当前库位
|
|
|
|
|