Commit 16f0fc42 LN

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

1 个父辈 eab52fd3
...@@ -547,7 +547,8 @@ public class StatusBean { ...@@ -547,7 +547,8 @@ public class StatusBean {
if (!code.startsWith(MessageUtils.smfcore)) { if (!code.startsWith(MessageUtils.smfcore)) {
code = MessageUtils.smfcore + "." + this.msgCode; 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; return newMsg;
} }
} }
......
...@@ -290,6 +290,7 @@ public class RobotBoxHandler extends BaseDeviceHandler { ...@@ -290,6 +290,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
String okMsg = ""; String okMsg = "";
String errorMsg = ""; String errorMsg = "";
List<Storage> storageList = Lists.newArrayList(); List<Storage> storageList = Lists.newArrayList();
//急停,报警,调试状态的料仓不可用
List<String> cidList = dataCache.getAvailableStorageIds(this.getDeviceType()); List<String> cidList = dataCache.getAvailableStorageIds(this.getDeviceType());
List<String> thirdList=dataCache.getAvailableStorageIds(DeviceType.SMDBOX_THIRD); List<String> thirdList=dataCache.getAvailableStorageIds(DeviceType.SMDBOX_THIRD);
cidList.addAll(thirdList); cidList.addAll(thirdList);
......
...@@ -108,9 +108,9 @@ public class DataCache { ...@@ -108,9 +108,9 @@ public class DataCache {
@PostConstruct @PostConstruct
public void initialize() { public void initialize() {
settings = getSettings();; settings = getSettings();
initCacheItem(); initCacheItem();
Integer expireDay=getCache(Constants.CACHE_ExpiresDay); Integer expireDay = getCache(Constants.CACHE_ExpiresDay);
codeResolve.updateExpiresDay(expireDay); codeResolve.updateExpiresDay(expireDay);
} }
...@@ -170,8 +170,8 @@ public class DataCache { ...@@ -170,8 +170,8 @@ public class DataCache {
List<String> ruleList = (List<String>) value; List<String> ruleList = (List<String>) value;
codeResolve.updateBarcodeRuleList(ruleList); codeResolve.updateBarcodeRuleList(ruleList);
} }
if(cacheKey.equals(Constants.CACHE_ExpiresDay)){ if (cacheKey.equals(Constants.CACHE_ExpiresDay)) {
codeResolve.updateExpiresDay((Integer)value); codeResolve.updateExpiresDay((Integer) value);
} }
log.info("updateCache [" + cacheKey + "]=[" + value + "]"); log.info("updateCache [" + cacheKey + "]=[" + value + "]");
...@@ -292,7 +292,7 @@ public class DataCache { ...@@ -292,7 +292,7 @@ public class DataCache {
* 所有的料仓 key 为 cid, value 为 Storage * 所有的料仓 key 为 cid, value 为 Storage
*/ */
private static Map<String, Storage> allStorage = new ConcurrentHashMap<>(); private static Map<String, Storage> allStorage = new ConcurrentHashMap<>();
//
// //
// /** // /**
// * 某个区域需要进行清理呆滞物料的所有料仓(虚拟仓应该不需要清理的) // * 某个区域需要进行清理呆滞物料的所有料仓(虚拟仓应该不需要清理的)
...@@ -773,7 +773,7 @@ public class DataCache { ...@@ -773,7 +773,7 @@ public class DataCache {
if (component != null && component.getSluggishDay() > 0) { if (component != null && component.getSluggishDay() > 0) {
return component.getSluggishDay(); return component.getSluggishDay();
} }
Integer sluggishDay = getCache(Constants.CACHE_SluggishDay); Integer sluggishDay = getCache(Constants.CACHE_SluggishDay);
if(sluggishDay == null){ if(sluggishDay == null){
sluggishDay = 0; sluggishDay = 0;
} }
...@@ -843,12 +843,12 @@ public class DataCache { ...@@ -843,12 +843,12 @@ public class DataCache {
return map.get(type); 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; ...@@ -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.equipment.service.po.Equipment;
import com.neotel.smfcore.core.language.util.MessageUtils; import com.neotel.smfcore.core.language.util.MessageUtils;
import com.neotel.smfcore.core.message.enums.MessageType; 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.manager.IMessageManager;
import com.neotel.smfcore.core.message.service.po.Message; import com.neotel.smfcore.core.message.service.po.Message;
import com.neotel.smfcore.core.message.util.bean.DeviceInfo; import com.neotel.smfcore.core.message.util.bean.DeviceInfo;
...@@ -23,6 +24,7 @@ import org.springframework.data.mongodb.core.query.Query; ...@@ -23,6 +24,7 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import java.util.List;
import java.util.Map; import java.util.Map;
@Slf4j @Slf4j
...@@ -132,9 +134,10 @@ public class DeviceMessageUtil { ...@@ -132,9 +134,10 @@ public class DeviceMessageUtil {
messageManager.save(message); messageManager.save(message);
} }
} }
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) { }
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)){ if(ObjectUtil.isEmpty(msgType)||ObjectUtil.isEmpty(msg)){
return; return;
}try { }try {
...@@ -145,6 +148,9 @@ public class DeviceMessageUtil { ...@@ -145,6 +148,9 @@ public class DeviceMessageUtil {
} }
} }
Message message = Message.newMsg(msgType, name, "", moudle, code, msg, msgParam); Message message = Message.newMsg(msgType, name, "", moudle, code, msg, msgParam);
if(dataList!=null){
message.setDataList(dataList);
}
messageManager.save(message); messageManager.save(message);
}catch (Exception ex){ }catch (Exception ex){
log.error("addMessage ["+msgType+"]["+name+"]["+msg+"]出错:"+ex.toString()); log.error("addMessage ["+msgType+"]["+name+"]["+msg+"]出错:"+ex.toString());
......
...@@ -442,6 +442,11 @@ public class StoragePosController { ...@@ -442,6 +442,11 @@ public class StoragePosController {
// throw new ValidateException("料仓[" + pos.getStorageId() + "]不存在"); // 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()); // boolean result=SiemensApi.getMaterialLot(2, storage.getId(),storage.getName(),pos.getBarcode().getBarcode());
// if(!result) { // if(!result) {
......
...@@ -720,12 +720,19 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -720,12 +720,19 @@ public class StoragePosManagerImpl implements IStoragePosManager {
//把value转换为时间 //把value转换为时间
try { try {
Date date = DateUtil.toDate(value); Date date = DateUtil.toDate(value);
String[] patternArray=new String[]{"yyyy-MM-dd","MM-dd-yyyy","yyyyMMdd"}; if (date == null) {
date= DateUtil.toDate(value,patternArray); 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); c.and(key).gte(date).lt(endDate);
} }
} catch (ParseException e) { } catch (ParseException e) {
......
package com.neotel.smfcore.custom.micron1053.util; package com.neotel.smfcore.custom.micron1053.util;
import cn.hutool.core.util.ObjectUtil; 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.message.util.DeviceMessageUtil;
import com.neotel.smfcore.core.system.service.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.custom.micron1053.bean.EquipMsg; import com.neotel.smfcore.custom.micron1053.bean.EquipMsg;
...@@ -182,6 +184,13 @@ public class MicronDataCache { ...@@ -182,6 +184,13 @@ public class MicronDataCache {
List<ML5NgReelInfo> list=ml5NgMap.getOrDefault(info.getNgPos(),new ArrayList<>()); List<ML5NgReelInfo> list=ml5NgMap.getOrDefault(info.getNgPos(),new ArrayList<>());
list.add(info); list.add(info);
ml5NgMap.put(info.getNgPos(),list); 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) { public static void clearNgPos(Integer ngPos) {
......
...@@ -328,7 +328,8 @@ smfcore.eventLog=EventLog ...@@ -328,7 +328,8 @@ smfcore.eventLog=EventLog
smfcore.reports=Report smfcore.reports=Report
smfcore.queryPos.cannotFind=cannot find posName [{0}] smfcore.queryPos.cannotFind=cannot find posName [{0}]
smfcore.queryPos.posIsEmpty=[{0}] is empty smfcore.queryPos.posIsEmpty=[{0}] is empty
smfcore.queryPos.cannotFindBarcode=cannot find barcode [{0}] In storage 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.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1} #smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
#smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F #smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
......
...@@ -327,4 +327,5 @@ smfcore.eventLog=EventLog ...@@ -327,4 +327,5 @@ smfcore.eventLog=EventLog
smfcore.reports=Report smfcore.reports=Report
smfcore.queryPos.cannotFind=cannot find posName [{0}] smfcore.queryPos.cannotFind=cannot find posName [{0}]
smfcore.queryPos.posIsEmpty=[{0}] is empty smfcore.queryPos.posIsEmpty=[{0}] is empty
smfcore.queryPos.cannotFindBarcode=cannot find barcode [{0}] In storage
\ No newline at end of file \ No newline at end of file
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 \ No newline at end of file
...@@ -325,3 +325,4 @@ smfcore.reports=Report ...@@ -325,3 +325,4 @@ smfcore.reports=Report
smfcore.queryPos.cannotFind=cannot find posName [{0}] smfcore.queryPos.cannotFind=cannot find posName [{0}]
smfcore.queryPos.posIsEmpty=[{0}] is empty smfcore.queryPos.posIsEmpty=[{0}] is empty
smfcore.queryPos.cannotFindBarcode=cannot find barcode [{0}] In storage smfcore.queryPos.cannotFindBarcode=cannot find barcode [{0}] In storage
smfcore.storage.notAvailable=\u6599\u4ED3{0}\u4E0D\u53EF\u7528\uFF0C\u65E0\u6CD5\u51FA\u5E93
...@@ -324,4 +324,5 @@ smfcore.eventLog=EventLog ...@@ -324,4 +324,5 @@ smfcore.eventLog=EventLog
smfcore.reports=Report smfcore.reports=Report
smfcore.queryPos.cannotFind=cannot find posName [{0}] smfcore.queryPos.cannotFind=cannot find posName [{0}]
smfcore.queryPos.posIsEmpty=[{0}] is empty smfcore.queryPos.posIsEmpty=[{0}] is empty
smfcore.queryPos.cannotFindBarcode=cannot find barcode [{0}] In storage
\ No newline at end of file \ No newline at end of file
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 \ No newline at end of file
...@@ -325,4 +325,5 @@ smfcore.eventLog=EventLog ...@@ -325,4 +325,5 @@ smfcore.eventLog=EventLog
smfcore.reports=Report smfcore.reports=Report
smfcore.queryPos.cannotFind=cannot find posName [{0}] smfcore.queryPos.cannotFind=cannot find posName [{0}]
smfcore.queryPos.posIsEmpty=[{0}] is empty smfcore.queryPos.posIsEmpty=[{0}] is empty
smfcore.queryPos.cannotFindBarcode=cannot find barcode [{0}] In storage
\ No newline at end of file \ No newline at end of file
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 \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!