Commit 408d82c7 LN

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

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