Commit 57d92a64 zshaohui

1.转库bug修改,一个库位不可以重复分

1 个父辈 0f5ffa54
......@@ -1652,6 +1652,7 @@ public class LiteOrderCache {
}
List<DataLog> dataLogList = new ArrayList<>();
List<String> newPosIdList = new ArrayList<>();
for (LiteOrderItem orderItem : cacheOrder.getOrderItems()) {
int remainNum = orderItem.getNeedNum() - orderItem.getTotalOutNum();
......@@ -1696,6 +1697,11 @@ public class LiteOrderCache {
excludePosIds.add(dataLog.getId());
}
}
if (newPosIdList != null && !newPosIdList.isEmpty()){
for (String newPosId : newPosIdList) {
excludePosIds.add(newPosId);
}
}
//查找符合条件的库位
Criteria c = Criteria.where("barcode.partNumber").is(pn)
......@@ -1737,14 +1743,27 @@ public class LiteOrderCache {
task.setWarehouseCode(targetWarhouseCode);
barcode.setWarehouseCode(targetWarhouseCode);
StoragePos newPos = taskService.findEmptyPosForPutIn(storageList, barcode, "", "");
Storage storage = null;
for (Storage stor : dataCache.getAllStorage().values()) {
if (!stor.isVirtual()){
storage = stor;
break;
}
}
StoragePos newPos = storagePosManager.getEmptyPosByStorage(storage, barcode,excludePosIds,"");
if (newPos == null) {
barcode.setModelFamily("");
newPos = taskService.findEmptyPosForPutIn(storageList, barcode, "", "");
newPos = storagePosManager.getEmptyPosByStorage(storage, barcode,excludePosIds,"");
}
if (newPos == null) {
throw new ValidateException("", "料号:" + pn + ",库别:" + warehouseCode + "未找到目的库别:" + targetWarhouseCode + "的可用库位");
}
excludePosIds.add(newPos.getId());
excludePosIds.add(pos.getId());
newPosIdList.add(newPos.getId());
task.setLoc(newPos.getPosName());
task.updateExtraDataMap("targetPos", newPos.getPosName());
task.setOperator(SecurityUtils.getLoginUsername()+"单据转库");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!