Commit 16f0fc42 LN

1053bug修改:1.看板提示有A=。2.NG物料保存到错误日志。3.过期时间出库问题。4.离线料仓不能出库。

1 个父辈 eab52fd3
......@@ -547,7 +547,8 @@ public class StatusBean {
if (!code.startsWith(MessageUtils.smfcore)) {
code = MessageUtils.smfcore + "." + this.msgCode;
}
String newMsg = MessageUtils.getText(code, getMsgParam(), locale, getMsg());
String newMsg=this.msg.replace("A=","").replace("I=","").replace("W=","");
newMsg = MessageUtils.getText(code, getMsgParam(), locale, newMsg);
return newMsg;
}
}
......
......@@ -290,6 +290,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
String okMsg = "";
String errorMsg = "";
List<Storage> storageList = Lists.newArrayList();
//急停,报警,调试状态的料仓不可用
List<String> cidList = dataCache.getAvailableStorageIds(this.getDeviceType());
List<String> thirdList=dataCache.getAvailableStorageIds(DeviceType.SMDBOX_THIRD);
cidList.addAll(thirdList);
......
......@@ -108,9 +108,9 @@ public class DataCache {
@PostConstruct
public void initialize() {
settings = getSettings();;
settings = getSettings();
initCacheItem();
Integer expireDay=getCache(Constants.CACHE_ExpiresDay);
Integer expireDay = getCache(Constants.CACHE_ExpiresDay);
codeResolve.updateExpiresDay(expireDay);
}
......@@ -170,8 +170,8 @@ public class DataCache {
List<String> ruleList = (List<String>) value;
codeResolve.updateBarcodeRuleList(ruleList);
}
if(cacheKey.equals(Constants.CACHE_ExpiresDay)){
codeResolve.updateExpiresDay((Integer)value);
if (cacheKey.equals(Constants.CACHE_ExpiresDay)) {
codeResolve.updateExpiresDay((Integer) value);
}
log.info("updateCache [" + cacheKey + "]=[" + value + "]");
......@@ -292,7 +292,7 @@ public class DataCache {
* 所有的料仓 key 为 cid, value 为 Storage
*/
private static Map<String, Storage> allStorage = new ConcurrentHashMap<>();
//
//
// /**
// * 某个区域需要进行清理呆滞物料的所有料仓(虚拟仓应该不需要清理的)
......@@ -843,12 +843,12 @@ public class DataCache {
return map.get(type);
}
/**
* key为cid,value为出入库数量
*/
private static Map<String, InOutData> inOutDataMap = new ConcurrentHashMap<>();
private void updateInOutData(Storage storage, int count) {
public boolean StorageIsAvailable(Storage storage) {
StatusBean bean = DevicesStatusUtil.getStatusBean(storage.getCid());
if (bean == null || bean.timeOut() || !bean.isAvailable()) {
return false;
}
return true;
}
}
......@@ -7,6 +7,7 @@ import com.neotel.smfcore.core.device.util.EquipmentCache;
import com.neotel.smfcore.core.equipment.service.po.Equipment;
import com.neotel.smfcore.core.language.util.MessageUtils;
import com.neotel.smfcore.core.message.enums.MessageType;
import com.neotel.smfcore.core.message.service.bean.DataContent;
import com.neotel.smfcore.core.message.service.manager.IMessageManager;
import com.neotel.smfcore.core.message.service.po.Message;
import com.neotel.smfcore.core.message.util.bean.DeviceInfo;
......@@ -23,6 +24,7 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.List;
import java.util.Map;
@Slf4j
......@@ -132,9 +134,10 @@ public class DeviceMessageUtil {
messageManager.save(message);
}
}
public static void addMessage( String msgType, String name,String moudle, String msgCode, String msg, String[] msgParam) {
public static void addMessage(String msgType, String name, String moudle, String msgCode, String msg, String[] msgParam ) {
addMessage(msgType,name,moudle,msgCode,msg,msgParam,null);
}
public static void addMessage(String msgType, String name, String moudle, String msgCode, String msg, String[] msgParam, List<DataContent> dataList) {
if(ObjectUtil.isEmpty(msgType)||ObjectUtil.isEmpty(msg)){
return;
}try {
......@@ -145,6 +148,9 @@ public class DeviceMessageUtil {
}
}
Message message = Message.newMsg(msgType, name, "", moudle, code, msg, msgParam);
if(dataList!=null){
message.setDataList(dataList);
}
messageManager.save(message);
}catch (Exception ex){
log.error("addMessage ["+msgType+"]["+name+"]["+msg+"]出错:"+ex.toString());
......
......@@ -442,6 +442,11 @@ public class StoragePosController {
// throw new ValidateException("料仓[" + pos.getStorageId() + "]不存在");
}
//如果料仓不可用,不能出库
if(!dataCache.StorageIsAvailable(storage)){
throw new ValidateException("smfcore.storage.notAvailable", "料仓{0}离线或不可用,无法出库", new String[]{storage.getName()});
}
// //西门子接口验证
// boolean result=SiemensApi.getMaterialLot(2, storage.getId(),storage.getName(),pos.getBarcode().getBarcode());
// if(!result) {
......
......@@ -720,12 +720,19 @@ public class StoragePosManagerImpl implements IStoragePosManager {
//把value转换为时间
try {
Date date = DateUtil.toDate(value);
String[] patternArray=new String[]{"yyyy-MM-dd","MM-dd-yyyy","yyyyMMdd"};
date= DateUtil.toDate(value,patternArray);
if (date == null) {
String[] patternArray = new String[]{"MM-dd-yyyy", "yyyy-MM-dd", "yyyyMMdd"};
if (key.equals("barcode.produceDate")) {
patternArray = new String[]{"yyyyMMdd", "yyyy-MM-dd", "MM-dd-yyyy"};
}
date = DateUtil.toDate(value, patternArray);
}
if(date!=null) {
if (date != null) {
//时间判断为当天
Date endDate=new Date(date.getTime()+24*60*60*1000);
Date endDate = new Date(date.getTime() + 24 * 60 * 60 * 1000);
// String str = DateUtil.toDateTimeString(date);
// String endStr = DateUtil.toDateTimeString(endDate);
c.and(key).gte(date).lt(endDate);
}
} catch (ParseException e) {
......
package com.neotel.smfcore.custom.micron1053.util;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.core.message.enums.MessageType;
import com.neotel.smfcore.core.message.service.bean.DataContent;
import com.neotel.smfcore.core.message.util.DeviceMessageUtil;
import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.custom.micron1053.bean.EquipMsg;
......@@ -182,6 +184,13 @@ public class MicronDataCache {
List<ML5NgReelInfo> list=ml5NgMap.getOrDefault(info.getNgPos(),new ArrayList<>());
list.add(info);
ml5NgMap.put(info.getNgPos(),list);
//NG物料保存到错误日志
List<DataContent> dataList=new ArrayList<>();
dataList.add(new DataContent("barcode",info.getBarcode()));
dataList.add(new DataContent("inoutType",info.getType()));
dataList.add(new DataContent("MType",info.getMType()));
DeviceMessageUtil.addMessage(MessageType.ERROR.name(),"ML5",info.getPosName(),"",info.getNgMsg(),null,dataList);
}
public static void clearNgPos(Integer ngPos) {
......
......@@ -329,6 +329,7 @@ smfcore.reports=Report
smfcore.queryPos.cannotFind=cannot find posName [{0}]
smfcore.queryPos.posIsEmpty=[{0}] is empty
smfcore.queryPos.cannotFindBarcode=cannot find barcode [{0}] In storage
smfcore.storage.notAvailable=\u6599\u4ED3{0}\u4E0D\u53EF\u7528\uFF0C\u65E0\u6CD5\u51FA\u5E93
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
#smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
......
......@@ -328,3 +328,4 @@ smfcore.reports=Report
smfcore.queryPos.cannotFind=cannot find posName [{0}]
smfcore.queryPos.posIsEmpty=[{0}] is empty
smfcore.queryPos.cannotFindBarcode=cannot find barcode [{0}] In storage
smfcore.storage.notAvailable=SMD BOX{0} Offline or Not Avaliable, Can Not Retrieve.
\ No newline at end of file
......@@ -325,3 +325,4 @@ smfcore.reports=Report
smfcore.queryPos.cannotFind=cannot find posName [{0}]
smfcore.queryPos.posIsEmpty=[{0}] is empty
smfcore.queryPos.cannotFindBarcode=cannot find barcode [{0}] In storage
smfcore.storage.notAvailable=\u6599\u4ED3{0}\u4E0D\u53EF\u7528\uFF0C\u65E0\u6CD5\u51FA\u5E93
......@@ -325,3 +325,4 @@ smfcore.reports=Report
smfcore.queryPos.cannotFind=cannot find posName [{0}]
smfcore.queryPos.posIsEmpty=[{0}] is empty
smfcore.queryPos.cannotFindBarcode=cannot find barcode [{0}] In storage
smfcore.storage.notAvailable=\u6599\u4ED3{0}\u4E0D\u53EF\u7528\uFF0C\u65E0\u6CD5\u51FA\u5E93
\ No newline at end of file
......@@ -326,3 +326,4 @@ smfcore.reports=Report
smfcore.queryPos.cannotFind=cannot find posName [{0}]
smfcore.queryPos.posIsEmpty=[{0}] is empty
smfcore.queryPos.cannotFindBarcode=cannot find barcode [{0}] In storage
smfcore.storage.notAvailable=\u6599\u5009{0}\u96E2\u7DDA\u6216\u4E0D\u53EF\u7528\uFF0C\u7121\u6CD5\u51FA\u5EAB
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!