Commit 408d82c7 LN

已完成放料的料架不再锁定新位置

1 个父辈 9f680fa2
...@@ -333,10 +333,11 @@ public class LiteOrderCache { ...@@ -333,10 +333,11 @@ public class LiteOrderCache {
liteOrderMap.put(orderNo, order); liteOrderMap.put(orderNo, order);
} else { } else {
//取消任务料架位置锁定
TaskShelfUtil.cancelReelTask(task);
if(!orderNo.equalsIgnoreCase("PN")){ if(!orderNo.equalsIgnoreCase("PN")){
log.error("完成任务时,未找到工单[" + orderNo + "]信息"); log.error("["+task.getBarcode()+"]完成任务时,未找到工单[" + orderNo + "]信息");
}else{
//取消任务料架位置锁定
TaskShelfUtil.cancelReelTask(task);
} }
} }
} }
...@@ -414,7 +415,9 @@ public class LiteOrderCache { ...@@ -414,7 +415,9 @@ public class LiteOrderCache {
//设置颜色 //设置颜色
Set<String> currentColors = new HashSet<>(); Set<String> currentColors = new HashSet<>();
for (DataLog dataLog :taskService. getQueueTasks()) { for (DataLog dataLog :taskService. getQueueTasks()) {
currentColors.add(dataLog.getLightColor()); if(ObjectUtil.isNotEmpty(dataLog.getLightColor())) {
currentColors.add(dataLog.getLightColor());
}
} }
ORDER_COLOR nextColor = ORDER_COLOR.nextColor(currentColors); ORDER_COLOR nextColor = ORDER_COLOR.nextColor(currentColors);
return nextColor; return nextColor;
......
...@@ -62,6 +62,10 @@ public class ShelfInfo { ...@@ -62,6 +62,10 @@ public class ShelfInfo {
*/ */
private int maxLocCount = 0; private int maxLocCount = 0;
/**
* 如果已绑定任务都放完成,可以离开
*/
private boolean needLeave=false;
/** /**
* 是否所有位置都已扫码亮灯 * 是否所有位置都已扫码亮灯
...@@ -233,6 +237,21 @@ public class ShelfInfo { ...@@ -233,6 +237,21 @@ public class ShelfInfo {
boolean putInResult = shelfLoc.putIn(barcode); boolean putInResult = shelfLoc.putIn(barcode);
locMap.put(loc, shelfLoc); locMap.put(loc, shelfLoc);
//判断是否放完
// if (!orderNo.equals(TaskShelfUtil.DEFAULT_ORDERNO)) {
int lCount = 0;
for (ShelfLoc nLoc : locMap.values()) {
if (nLoc.isEmpty()) {
lCount++;
}
}
if (lCount == 0) {
needLeave = true;
}
// }
log.info("料盘[" + barcode + "]放入位置" + rfid + "[" + loc + "]成功,料架是否需要离开="+needLeave);
return putInResult; return putInResult;
} else { } else {
log.error("料盘[" + barcode + "]放入位置" + rfid + "[" + loc + "]失败,此位置料盘已放入"); log.error("料盘[" + barcode + "]放入位置" + rfid + "[" + loc + "]失败,此位置料盘已放入");
......
...@@ -246,30 +246,30 @@ public class TaskShelfController { ...@@ -246,30 +246,30 @@ public class TaskShelfController {
int bigEmpty = 0; int bigEmpty = 0;
if (shelfInfo != null) { if (shelfInfo != null) {
if (shelfInfo.getOrderNo().equals(TaskShelfUtil.DEFAULT_ORDERNO)) { // if (shelfInfo.getOrderNo().equals(TaskShelfUtil.DEFAULT_ORDERNO)) {
//
List<DataLog> allTask=taskService.getAllTasks(); // List<DataLog> allTask=taskService.getAllTasks();
for (DataLog log : // for (DataLog log :
allTask) { // allTask) {
if(log.isFinished()|| log.isEnd()||log.isCancel()){ // if(log.isFinished()|| log.isEnd()||log.isCancel()){
continue; // continue;
} // }
if(shelfInfo.isSmallReel(log)){ // if(shelfInfo.isSmallReel(log)){
smallEmpty++; // smallEmpty++;
}else{ // }else{
bigEmpty++; // bigEmpty++;
} // }
}
// List<Integer> shelfEmpty=shelfInfo.getEmptySlot();
// if(smallEmpty>shelfEmpty.get(0)){
// smallEmpty=shelfEmpty.get(0);
// }
// if(bigEmpty>shelfEmpty.get(1)){
// bigEmpty=shelfEmpty.get(0);
// } // }
//
} else { //// List<Integer> shelfEmpty=shelfInfo.getEmptySlot();
//// if(smallEmpty>shelfEmpty.get(0)){
//// smallEmpty=shelfEmpty.get(0);
//// }
//// if(bigEmpty>shelfEmpty.get(1)){
//// bigEmpty=shelfEmpty.get(0);
//// }
//
// } else {
Map<Integer, ShelfLoc> locMap = shelfInfo.getLocMap(); Map<Integer, ShelfLoc> locMap = shelfInfo.getLocMap();
for (ShelfLoc shelfLoc : locMap.values()) { for (ShelfLoc shelfLoc : locMap.values()) {
if (shelfLoc.isEmpty()) { if (shelfLoc.isEmpty()) {
...@@ -280,7 +280,7 @@ public class TaskShelfController { ...@@ -280,7 +280,7 @@ public class TaskShelfController {
} }
} }
} }
} // }
} }
List<Integer> result = new ArrayList<>(); List<Integer> result = new ArrayList<>();
...@@ -405,7 +405,7 @@ public class TaskShelfController { ...@@ -405,7 +405,7 @@ public class TaskShelfController {
for (String tempRfid : for (String tempRfid :
map2.keySet()) { map2.keySet()) {
ShelfInfo shelfInfo=map2.get(tempRfid); ShelfInfo shelfInfo=map2.get(tempRfid);
msg+="hSerial="+hSerial+",tempRfid="+tempRfid+",realRfid="+shelfInfo.getRealRfid()+"\r\n"; msg+="hSerial="+hSerial+",tempRfid="+tempRfid+",realRfid="+shelfInfo.getRealRfid()+",needLeave="+shelfInfo.isNeedLeave()+"\r\n";
} }
} }
} }
......
...@@ -40,6 +40,7 @@ public class TaskShelfUtil { ...@@ -40,6 +40,7 @@ public class TaskShelfUtil {
private static String LINE_SHELF_MAP_KEY = "LINE_SHELF_MAP_KEY"; private static String LINE_SHELF_MAP_KEY = "LINE_SHELF_MAP_KEY";
public static String DEFAULT_ORDERNO = "1"; public static String DEFAULT_ORDERNO = "1";
public static String DEFAULT_PN = "PN";
public static String ShelfSpilt=","; public static String ShelfSpilt=",";
...@@ -171,6 +172,9 @@ public class TaskShelfUtil { ...@@ -171,6 +172,9 @@ public class TaskShelfUtil {
int maxIndex = 0; int maxIndex = 0;
if (shelfMap != null) { if (shelfMap != null) {
for (ShelfInfo shelfInfo : shelfMap.values()) { for (ShelfInfo shelfInfo : shelfMap.values()) {
if(shelfInfo.isNeedLeave()){
continue;
}
if (shelfInfo.getRfidIndex() > maxIndex) { if (shelfInfo.getRfidIndex() > maxIndex) {
maxIndex = shelfInfo.getRfidIndex(); maxIndex = shelfInfo.getRfidIndex();
} }
...@@ -324,7 +328,7 @@ public class TaskShelfUtil { ...@@ -324,7 +328,7 @@ public class TaskShelfUtil {
}); });
ShelfInfo minIndexShelf = null; ShelfInfo minIndexShelf = null;
for (ShelfInfo shelf : shelfList) { for (ShelfInfo shelf : shelfList) {
if (shelf.isFull()) { if (shelf.isFull()||shelf.isNeedLeave()) {
//已经放满,查找下一个 //已经放满,查找下一个
continue; continue;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!