Commit 3694c3d7 LN

麦康尼料仓入库验证。

1 个父辈 a3218d7b
......@@ -9,6 +9,7 @@ import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.system.service.po.AlarmInfo;
import lombok.Data;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import java.util.*;
......@@ -22,6 +23,7 @@ import java.util.*;
*/
@ToString
@Data
@Slf4j
public class StatusBean {
/// <summary>
......@@ -522,36 +524,43 @@ public class StatusBean {
public void MsgDataProcess() {
//消息格式处理
if( getMsgList()==null&& ObjectUtil.isNotEmpty(msg)){
msgList=new ArrayList<>();
//判断是否有换行
String[] msgArray=this.msg.split("\r\n");
if(msgArray.length>0) {
for (String msg :
msgArray) {
if (ObjectUtil.isEmpty(msg)) {
continue;
}
String msgType = MessageType.ERROR.name();
if (msg.startsWith("A=")) {
msgType = MessageType.ERROR.name();
msg = msg.substring(2);
} else if (msg.startsWith("I=")) {
msgType = MessageType.INFO.name();
msg = msg.substring(2);
} else if (msg.startsWith("W=")) {
msgType = MessageType.WARNING.name();
msg = msg.substring(2);
}
if (msgArray.length == 1) {
msgList.add(new MsgInfo(msg, msgType,msgEn,msgJp,msgCode,msgParam,"",""));
} else {
msgList.add(new MsgInfo(msg, msgType));
try {
//消息格式处理
if (getMsgList() == null && ObjectUtil.isNotEmpty(msg)) {
msgList = new ArrayList<>();
//判断是否有换行
String[] msgArray = this.msg.split("\r\n");
if (msgArray.length > 0) {
for (String msg :
msgArray) {
if (ObjectUtil.isEmpty(msg)) {
continue;
}
String msgType = MessageType.ERROR.name();
if (msg.startsWith("A=")) {
msgType = MessageType.ERROR.name();
msg = msg.substring(2);
} else if (msg.startsWith("I=")) {
msgType = MessageType.INFO.name();
msg = msg.substring(2);
} else if (msg.startsWith("W=")) {
msgType = MessageType.WARNING.name();
msg = msg.substring(2);
}
if (msgArray.length == 1) {
msgList.add(new MsgInfo(msg, msgType, msgEn, msgJp, msgCode, msgParam, "", ""));
} else {
msgList.add(new MsgInfo(msg, msgType));
}
}
}
} else if (getMsgList() == null) {
msgList = new ArrayList<>();
}
} catch (Exception e) {
log.error("" + getCid() + "MsgDataProcess 出錯:" + e.toString(), e);
}
}
......
......@@ -908,7 +908,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
// DevicesStatusUtil.updateClientMsg(statusBean.getCid(), msgCode, msg, msgEn, msgJp,statusBean.getMsgParam());
// }
} catch (Exception e) {
log.error("客户端故障消息处理出错", e);
log.error("客户端"+statusBean.getCid()+"故障消息处理出错:"+e.toString(), e);
}
}
......
......@@ -578,7 +578,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
}else if(inStorageType==2){
if(storage.isTHIRDBox()) {
//麦康尼料仓需要判断 当前剩余空库位是否可以放下料盘
if (dataCache.thirdBoxCanPutIn(storage, barcode.getPlateSize(), barcode.getHeight())) {
if (dataCache.thirdBoxCanPutIn(storage, barcode.getPlateSize(), barcode.getHeight(),taskService.getQueueTasks(storage.getCid()))) {
storages.add(storage);
}
}
......
......@@ -30,6 +30,7 @@ import com.neotel.smfcore.core.barcode.bean.PlateSizeBean;
import com.neotel.smfcore.core.storage.service.manager.IStorageManager;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import com.neotel.smfcore.core.system.service.po.CacheItem;
import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.service.po.Settings;
import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
......@@ -828,7 +829,7 @@ public class DataCache {
return availableStorageIds;
}
public boolean thirdBoxCanPutIn(Storage storage,int plateW,int plateH) {
public boolean thirdBoxCanPutIn(Storage storage, int plateW, int plateH, Collection<DataLog> dataLogs ) {
try {
StatusBean bean = DevicesStatusUtil.getStatusBean(storage.getCid());
if (bean == null || bean.timeOut() || !bean.isAvailable()) {
......@@ -843,11 +844,23 @@ public class DataCache {
break;
}
}
Map<String, Integer> taskMap = new HashMap<>();
for (DataLog dataLog: dataLogs ) {
if(dataLog.isPutInTask()){
String key=dataLog.getW()+"x"+dataLog.getH();
int currvalue=taskMap.getOrDefault(key,0);
taskMap.put(key.toLowerCase(),currvalue+1);
}
}
if (posCapMap != null && posCapMap.size() > 0) {
for (String key : posCapMap.keySet()
) {
int count = posCapMap.get(key);
if (count > 0) {
int currCount=taskMap.getOrDefault(key,0);
if (count-currCount > 0) {
String[] array = key.split("x");
if (array.length == 2) {
int w = Convert.toInt(array[0]);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!