Commit 9f680fa2 LN

修改:1.同一个库位入两盘问题。2.元器件同料号不同供应商可以保存。

1 个父辈 3ed7fbf9
package com.neotel.smfcore.common.utils;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.common.bean.ReelLockPosInfo;
import org.apache.logging.log4j.LogManager;
......@@ -25,15 +26,15 @@ public class ReelLockPosUtil {
/**
* 料盘锁定库位信息,用于包装料分配到其他料仓
*/
private static Map<String, ReelLockPosInfo> reelLocKPosMap;
private static Map<String, ReelLockPosInfo> reelLocKPosMap = Maps.newConcurrentMap();
@PostConstruct
public void init() {
dataCache = autodataCache;
reelLocKPosMap=dataCache.getCache(REEL_LOCK_POS_MAP_KEY);
if(reelLocKPosMap==null){
reelLocKPosMap=new HashMap<String,ReelLockPosInfo>(){};
Map<String, ReelLockPosInfo> cacheReelLocKPosMap = dataCache.getCache(REEL_LOCK_POS_MAP_KEY);
if (cacheReelLocKPosMap != null) {
reelLocKPosMap.putAll(cacheReelLocKPosMap);
}
}
......
......@@ -843,6 +843,8 @@ public class BarcodeRule {
rule="SP*PN*BATCH*QTY*xxx[RI]";
codeStr="998168*340093000002*3506*3000*200188890";
rule="SP*PN*BATCH*QTY*xxx[RI]";
codeStr="100301*340093060042*20231228*2853*0002";
// codeStr="woerweoruweorwer*wrwerwerwe";
BarcodeRule br = BarcodeRule.newRule(rule);
......
......@@ -164,6 +164,7 @@ public class ComponentManagerImpl implements IComponentManager {
if (resources.getId() != null) {
logName = "修改元器件";
c.and("id").ne(resources.getId());
c.and("provider").is(resources.getProvider());
}
Component com = componentDao.findOne(new Query(c));
if (com != null) {
......
......@@ -267,15 +267,47 @@ public class DeviceController {
resultMap.put("result", "0");
resultMap.put("msg", "ok");
DataLog newTask = taskService.addPutInTaskToExecute(storage, barcode, pos);
okMsg = "[" + barcode.getBarcode() + "]锁定库位[" + pos.getPosName() + "]优先级[" + pos.getPriority() + "] 上个库位号[" + lastPosId + "]";
ReelLockPosInfo oldLockInfo = ReelLockPosUtil.getLockPosInfoByCode(barcode.getBarcode());
if (oldLockInfo != null) {
if (!oldLockInfo.getBarcode().equals(barcode.getBarcode())) {
String result = "-1";
okMsg = rfid + "[" + rfidLoc + "][" + barcode.getBarcode() + "]锁定库位[" + pos.getPosName() + "],清理旧有锁定信息";
resultMap.put("result", result);
resultMap.put("msg", okMsg);
//已经锁定过库位,但不是同一个条码,需要把对应位置的锁定信息清理掉
ReelLockPosUtil.removeReelLockPosInfo(oldLockInfo.getBarcode());
log.info("清理锁定库位:库位号[" + oldLockInfo.getLockPosName() + "]上物料[" + oldLockInfo.getBarcode() + "]锁定的库位");
}
}
log.info(okMsg + oldLockInfo);
ReelLockPosInfo reelLocInfo = new ReelLockPosInfo();
reelLocInfo.setBarcode(barcode.getBarcode());
reelLocInfo.setCid(storage.getCid());
reelLocInfo.setLockPosName(pos.getPosName());
reelLocInfo.setLockPosId(pos.getId());
ReelLockPosInfo nLocInfo = ReelLockPosUtil.addReelLockPosInfo(reelLocInfo, cidList);
if (nLocInfo == null) {
errorMsg = "[" + barcode.getBarcode() + "]库位["+reelLocInfo.getLockPosName()+"]已被锁定,暂停入库";
lineMsg = errorMsg;
DeviceMessageUtil.updateLineMsg(lineMsg,code,cids, reelLocInfo.getLockPosName(),"smfcore.linemsg.posLock",new String[]{barcode.getBarcode(),reelLocInfo.getLockPosName()});
resultMap.put("result", "99");
resultMap.put("msg", errorMsg);
} else {
DataLog newTask = taskService.addPutInTaskToExecute(storage, barcode, pos);
resultMap.put("pos", pos.getPosName());
resultMap.put("barcode", barcode.getBarcode());
resultMap.put("cid", storage.getCid());
resultMap.put("taskId", newTask.getId());
}
log.info(okMsg);
resultMap.put("pos", pos.getPosName());
resultMap.put("barcode", barcode.getBarcode());
resultMap.put("cid", storage.getCid());
resultMap.put("taskId", newTask.getId());
} else {
resultMap.put("result", "104");
errorMsg = "[" + barcode.getBarcode() + "]未找到可用的[" + barcode.getPlateSize() + "x" + barcode.getHeight() + "]仓位";
......@@ -313,6 +345,7 @@ public class DeviceController {
lineMsg = errorMsg;
DeviceMessageUtil.updateLineMsg(lineMsg,code,cids,"","",null );
log.error(errorMsg);
} else {
lineMsg = okMsg;
DeviceMessageUtil.lastLineMsg = null;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!