Commit 37544f10 LN

1.取消任务时不禁用库位。2.麦康尼料仓入库增加容量验证

1 个父辈 2029703b
......@@ -428,8 +428,11 @@ public class RobotBoxHandler extends BaseDeviceHandler {
storages.add(storage);
}
}else if(inStorageType==2){
if(storage.isTHIRDBox()){
storages.add(storage);
if(storage.isTHIRDBox()) {
//麦康尼料仓需要判断 当前剩余空库位是否可以放下料盘
if (dataCache.thirdBoxCanPutIn(storage, barcode.getPlateSize(), barcode.getHeight())) {
storages.add(storage);
}
}
}else {
storages.add(storage);
......
package com.neotel.smfcore.core.device.util;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
......@@ -10,6 +11,7 @@ import com.neotel.smfcore.core.barcode.service.manager.IComponentManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.service.po.Component;
import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.core.device.bean.BoxStatusBean;
import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.inList.util.InListCache;
import com.neotel.smfcore.core.inout.service.manager.IInOutDataManager;
......@@ -776,6 +778,47 @@ public class DataCache {
}
return availableStorageIds;
}
public boolean thirdBoxCanPutIn(Storage storage,int plateW,int plateH) {
try {
StatusBean bean = DevicesStatusUtil.getStatusBean(storage.getCid());
if (bean == null || bean.timeOut() || !bean.isAvailable()) {
return false;
}
Map<String, Integer> posCapMap = null;
for (BoxStatusBean boxStatus : bean.getBoxStatus().values()
) {
posCapMap = boxStatus.getCapacity();
if (posCapMap != null && posCapMap.size() > 0) {
break;
}
}
if (posCapMap != null && posCapMap.size() > 0) {
for (String key : posCapMap.keySet()
) {
int count = posCapMap.get(key);
if (count > 0) {
String[] array = key.split("x");
if (array.length == 2) {
int w = Convert.toInt(array[0]);
int h = Convert.toInt(array[1]);
if (storage.canPutInPos(plateW, plateH, w, h)) {
return true;
}
}
}
}
}else{
//未找到容量也返回true
return true;
}
} catch (Exception ex) {
log.error("thirdBoxCanPutIn [" + storage.getCid() + "] [" + plateW + "] [" + plateH + "]出错:" + ex.getMessage());
}
return false;
}
public Storage AutoCreateStorage(String cid, String deviceType) {
//判断cid存在
Storage storage = null;
......
......@@ -234,7 +234,8 @@ public class TaskController {
if(task.isCancel()||task.isFinished()||task.isEnd()){
throw new ValidateException("smfcore.taskHasEnd","任务{0}已取消或已结束",new String[]{task.getPosName()} );
}
taskService.cancelTaskAndDisPos(taskId);
//取消任务不需要屏蔽库位
taskService.cancelTask(taskId);
}
return new ResponseEntity<>(HttpStatus.OK);
}
......
......@@ -223,10 +223,15 @@ public class MicronStatusController {
}
Map<String,String> msgMap=s.getMsgMap();
if(msgMap!=null&&msgMap.size()>0) {
String name=cid;
Storage storage=dataCache.getStorage(cid);
if(storage!=null){
name=storage.getName();
}
for (String msg :
msgMap.keySet()) {
String type= msgMap.getOrDefault(msg, "");
dto.getMsgList().add(new EquipMsg(cid, s.getStatus(), msg, new Date(s.getTime()), type.toUpperCase(), "", "", new String[]{}));
dto.getMsgList().add(new EquipMsg(name, s.getStatus(), msg, new Date(s.getTime()), type.toUpperCase(), "", "", new String[]{}));
}
}
// String msg=s.getErrorMsg(locale);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!