Commit b23370b2 LN

msg显示修改

1 个父辈 e641fc58
......@@ -25,6 +25,7 @@ import com.neotel.smfcore.core.device.bean.PosInfo;
import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.inList.enums.INITEM.INITEM_STATUS;
import com.neotel.smfcore.core.inList.service.po.InList;
import com.neotel.smfcore.core.language.util.MessageUtils;
import com.neotel.smfcore.core.message.util.DeviceMessageUtil;
import com.neotel.smfcore.core.order.service.po.LiteOrder;
import com.neotel.smfcore.core.storage.service.manager.IStorageManager;
......@@ -170,6 +171,7 @@ public class DeviceController {
return barcodeSave;
}
/**
* 流水线入库查找空的料格
*/
......@@ -186,11 +188,11 @@ public class DeviceController {
lineMsg = "";
log.info("流水线[" + cids + "]获取[" + rfid + "][" + code + "]的入库库位");
EnLog.info("Pipeline [" + cids + "] gets inbound position for [" + rfid + "][" + code + "]");
Map<String, Object> resultMap = Maps.newHashMap();
if (dataCache.getCache(Constants.CACHE_StopOut)) {
lineMsg = "系统更新中,暂停出入库";
Boolean stopOut = dataCache.getCache(Constants.CACHE_StopOut);
if (stopOut) {
lineMsg = MessageUtils.getText("smfcore.linemsg.update", MessageUtils.getDefaultLocal(), "系统更新中,暂停出入库");
DeviceMessageUtil.updateLineMsg(lineMsg,code,cids,"" ,"smfcore.linemsg.update",null);
resultMap.put("result", "100");
resultMap.put("msg", lineMsg);
......@@ -201,7 +203,8 @@ public class DeviceController {
String errorMsg = "";
if (Strings.isNullOrEmpty(cids)) {
resultMap.put("result", "101");
resultMap.put("msg", "未指定料仓 cids ");
String msg = MessageUtils.getText("smfcore.storage.noCids", MessageUtils.getDefaultLocal(), "未指定料仓CID");
resultMap.put("msg", msg);
} else {
List<Storage> storageList = Lists.newArrayList();
List<String> cidList = Lists.newArrayList();
......@@ -210,7 +213,6 @@ public class DeviceController {
if (notIntoCids != null) {
if (notIntoCids.contains(cid)) {
log.info("料仓[" + cid + "]已被屏蔽入库");
EnLog.info("Storage [" + cid + "] is blocked for inbound");
continue;
}
}
......@@ -222,7 +224,7 @@ public class DeviceController {
}
if (storageList.isEmpty()) {
resultMap.put("result", "99");
errorMsg = "无可用的料仓";
errorMsg = MessageUtils.getText("smfcore.storage.noCanUseStorage",MessageUtils.getDefaultLocal(),"无可用的料仓");
resultMap.put("msg", errorMsg);
} else {
try {
......@@ -245,8 +247,7 @@ public class DeviceController {
resultMap.put("cid", dataLog.getCid());
return resultMap;
} else {
//已有出库任务
errorMsg = "物料[" + dataLog.getBarcode() + "]已有出库任务,需继续执行出库动作";
errorMsg= MessageUtils.getText("smfcore.barcode.hasOutTask",new String[]{dataLog.getBarcode()},MessageUtils.getDefaultLocal(),"物料[{0}]已有出库任务,需继续执行出库动作");
resultMap.put("result", "98");
resultMap.put("msg", errorMsg);
......@@ -306,20 +307,18 @@ public class DeviceController {
if (oldLockInfo != null) {
if (!oldLockInfo.getBarcode().equals(barcode.getBarcode())) {
String result = "-1";
okMsg = rfid + "[" + rfidLoc + "][" + barcode.getBarcode() + "]锁定库位[" + pos.getPosName() + "],清理旧有锁定信息";
okMsg = MessageUtils.getText("smfcore.barcode.clearOldLock",new String[]{rfid,rfidLoc,barcode.getBarcode(),pos.getPosName()},MessageUtils.getDefaultLocal(),"{0}[{1}][{2}]锁定库位[{3}],清理旧有锁定信息");
resultMap.put("result", result);
resultMap.put("msg", okMsg);
//已经锁定过库位,但不是同一个条码,需要把对应位置的锁定信息清理掉
ReelLockPosUtil.removeReelLockPosInfo(oldLockInfo.getBarcode());
log.info("清理锁定库位:库位号[" + oldLockInfo.getLockPosName() + "]上物料[" + oldLockInfo.getBarcode() + "]锁定的库位");
EnLog.info("Clean lock position: Position [" + oldLockInfo.getLockPosName() + "] Material [" + oldLockInfo.getBarcode() + "] locked position");
}
}
log.info(okMsg + oldLockInfo);
EnLog.info("Lock position success info: " + oldLockInfo);
ReelLockPosInfo reelLocInfo = new ReelLockPosInfo();
reelLocInfo.setBarcode(barcode.getBarcode());
......@@ -329,7 +328,7 @@ public class DeviceController {
reelLocInfo = ReelLockPosUtil.addReelLockPosInfo(reelLocInfo, cidList);
if (reelLocInfo == null) {
errorMsg = "[" + barcode.getBarcode() + "]库位["+reelLocInfo.getLockPosName()+"]已被锁定,暂停入库";
errorMsg = MessageUtils.getText("smfcore.linemsg.posLock",new String[]{barcode.getBarcode(),reelLocInfo.getLockPosName()},MessageUtils.getDefaultLocal(),"[{0}]库位[{1}]已被锁定,暂停入库");
lineMsg = errorMsg;
DeviceMessageUtil.updateLineMsg(lineMsg,code,cids, reelLocInfo.getLockPosName(),"smfcore.linemsg.posLock",new String[]{barcode.getBarcode(),reelLocInfo.getLockPosName()});
......@@ -344,16 +343,17 @@ public class DeviceController {
} else {
resultMap.put("result", "104");
errorMsg = "[" + barcode.getBarcode() + "]未找到可用的[" + barcode.getPlateSize() + "x" + barcode.getHeight() + "]仓位";
errorMsg = MessageUtils.getText("smfcore.barcode.noPutInPos",new String[]{barcode.getBarcode(),barcode.getPlateSize()+"",barcode.getHeight()+""},MessageUtils.getDefaultLocal(),"[{0}]未找到[{1}x{2}]仓位");
resultMap.put("msg", errorMsg);
}
} catch (ValidateException ve) {
errorMsg = ve.getMessage();
errorMsg= MessageUtils.getText(ve.getMsgKey(),ve.getMsgParam(),MessageUtils.getDefaultLocal(),ve.getDefaultMsg());
log.info("查找空库位失败:" + errorMsg);
EnLog.info("Find empty position failed: " + errorMsg);
resultMap.put("result", "105");
resultMap.put("msg", errorMsg);
resultMap.put("msg",errorMsg);
} catch (Exception e) {
errorMsg = e.getMessage();
log.info("查找空库位失败,", e);
......
package com.neotel.smfcore.core.equipment.bean;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.base.Strings;
import com.neotel.smfcore.core.equipment.enums.EquipmentType;
import com.neotel.smfcore.core.message.enums.MessageType;
......@@ -134,17 +135,47 @@ public class EquipStatusBean implements Serializable {
return null;
}
public String getShowMsg(Locale locale){
MessageType[] types=new MessageType[]{MessageType.ERROR,MessageType.WARNING,MessageType.INFO,MessageType.SHOW };
for (MessageType type :
types) {
EquipMsg showMsg= getMsgByType(type.name());
if(showMsg!=null){
public String getShowMsg(Locale locale) {
if (ObjectUtil.isEmpty(this.msgList)) {
return "";
}
String returnMsg = "";
for (EquipMsg msg :
msgList) {
String mMsg = msg.getMsg();
if (ObjectUtil.isEmpty(returnMsg)) {
returnMsg = mMsg;
} else {
returnMsg += ";" + mMsg;
}
}
return returnMsg;
}
public String getErrorMsg(Locale locale) {
if (ObjectUtil.isEmpty(this.msgList)) {
return "";
}
for (EquipMsg msg :
msgList) {
return showMsg.getShowMsg(locale);
if (msg.getType().toUpperCase().equals(MessageType.ERROR.name())) {
return msg.getMsg();
}
}
return "";
}
// public String getShowMsg(Locale locale){
// MessageType[] types=new MessageType[]{MessageType.ERROR,MessageType.WARNING,MessageType.INFO,MessageType.SHOW };
// for (MessageType type :
// types) {
// EquipMsg showMsg= getMsgByType(type.name());
// if(showMsg!=null){
//
// return showMsg.getShowMsg(locale);
// }
// }
// return "";
// }
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!