Commit 37910285 zshaohui

1.是最后一盘的优先出库

1 个父辈 5314df7b
...@@ -276,6 +276,31 @@ public class XLRBoxHandler extends BaseDeviceHandler { ...@@ -276,6 +276,31 @@ public class XLRBoxHandler extends BaseDeviceHandler {
} }
//是治具的优先出 //是治具的优先出
DataLog finalTask = null;
for (DataLog task : dataLogList) {
if (cid.equals(task.getCid()) && task.isCheckOutTask() && task.isWait()) {
String posName = task.getPosName();
if (!Strings.isNullOrEmpty(posName)) {//有库位号
Boolean hasReel = task.getAppendData("hasReel");
if (hasReel == null) {
hasReel = true;
}
if (!hasReel) {
//单盘优先出库
if (finalTask == null || task.getCreateDate().before(finalTask.getCreateDate())) {
finalTask = task;
}
}
}
}
}
if (finalTask != null) {
log.info("分配优先最后一盘物料的出库任务" + finalTask.getBarcode() + "[" + finalTask.getPosName() + "]到 " + cid);
return finalTask;
}
//是治具的优先出
DataLog boxTask = null; DataLog boxTask = null;
for (DataLog task : dataLogList) { for (DataLog task : dataLogList) {
if (cid.equals(task.getCid()) && task.isCheckOutTask() && task.isWait()) { if (cid.equals(task.getCid()) && task.isCheckOutTask() && task.isWait()) {
...@@ -313,7 +338,12 @@ public class XLRBoxHandler extends BaseDeviceHandler { ...@@ -313,7 +338,12 @@ public class XLRBoxHandler extends BaseDeviceHandler {
if (isBox == null) { if (isBox == null) {
isBox = false; isBox = false;
} }
if (StringUtils.isNotEmpty(export) && !isBox) { //判断是否去ng口的
Boolean hasReel = dataLog.getAppendData("hasReel");
if (hasReel == null){
hasReel = true;
}
if (StringUtils.isNotEmpty(export) && !isBox && hasReel) {
boxTaskListToExecute.add(dataLog); boxTaskListToExecute.add(dataLog);
} }
} }
......
...@@ -1036,6 +1036,14 @@ public class LiteOrderCache { ...@@ -1036,6 +1036,14 @@ public class LiteOrderCache {
+ "]是否为料盒[" + barcode.isBox() + "]是否为料盒[" + barcode.isBox()
); );
//再用相同条件查一次工单出库,判断是否为最后一盘
boolean hasReel = true;
excludePosIds.add(pos.getId());
StoragePos finallyPos = storagePosManager.findPartNumberInStorages(availableStorageIds, partNumber, excludePosIds, checkoutType);
if (finallyPos == null) {
hasReel = false;
}
DataLog task = newTask(pos); DataLog task = newTask(pos);
task.setSourceId(cacheOrder.getId()); task.setSourceId(cacheOrder.getId());
task.setSourceName(cacheOrder.getOrderNo()); task.setSourceName(cacheOrder.getOrderNo());
...@@ -1052,6 +1060,7 @@ public class LiteOrderCache { ...@@ -1052,6 +1060,7 @@ public class LiteOrderCache {
if (barcode.isBox()) { if (barcode.isBox()) {
task.updateAppendData("isBox", true); task.updateAppendData("isBox", true);
} }
task.updateAppendData("hasReel",hasReel);
//先更新出料口,再更新任务 //先更新出料口,再更新任务
if (!barcode.isBox()) { if (!barcode.isBox()) {
log.info(barcode.getBarcode()+"为非料盒信息,需要更改出料口信息"); log.info(barcode.getBarcode()+"为非料盒信息,需要更改出料口信息");
......
...@@ -411,6 +411,11 @@ public class JkemController { ...@@ -411,6 +411,11 @@ public class JkemController {
//如果sourceName和subSourceId都不为空时,则返回目标位置 //如果sourceName和subSourceId都不为空时,则返回目标位置
String sourceName = dataLog.getSourceName(); String sourceName = dataLog.getSourceName();
String sourceId = dataLog.getSourceId(); String sourceId = dataLog.getSourceId();
//判断是否去ng口的
Boolean hasReel = dataLog.getAppendData("hasReel");
if (hasReel == null){
hasReel = true;
}
if (StringUtils.isNotBlank(sourceId) && StringUtils.isNotBlank(sourceName)) { if (StringUtils.isNotBlank(sourceId) && StringUtils.isNotBlank(sourceName)) {
String exportStr = dataLog.getExport(); String exportStr = dataLog.getExport();
if (StringUtils.isNotBlank(exportStr)) { if (StringUtils.isNotBlank(exportStr)) {
...@@ -418,7 +423,11 @@ public class JkemController { ...@@ -418,7 +423,11 @@ public class JkemController {
Boolean isBox = dataLog.getAppendData("isBox"); Boolean isBox = dataLog.getAppendData("isBox");
if (isBox == null){ if (isBox == null){
resultMap.put("export", exportStr); if (hasReel) {
resultMap.put("export", exportStr);
} else {
resultMap.put("export", "ng");
}
} else { } else {
resultMap.put("export", "ng"); resultMap.put("export", "ng");
} }
...@@ -437,6 +446,9 @@ public class JkemController { ...@@ -437,6 +446,9 @@ public class JkemController {
} else { } else {
resultMap.put("type",0); resultMap.put("type",0);
} }
if (!hasReel){
resultMap.put("type",2);
}
} }
} }
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!