Commit 4c1df6bf 孙克

分配料串逻辑

1 个父辈 7cac54e1
......@@ -5,6 +5,7 @@ import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.third.bean.RawInLineMaterialLoc;
import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -41,7 +42,9 @@ public class RawInLineUtil {
materialLoc = new RawInLineMaterialLoc();
}
materialLoc.setMaterial(material);
if(StringUtils.isNotEmpty(loc)){
materialLoc.setCurrentLoc(loc);
}
if (StringUtils.isNotEmpty(destination)){
materialLoc.setDestination(destination);
}
......@@ -69,13 +72,33 @@ public class RawInLineUtil {
}
private static String getNextLoc(String material, String loc) {
log.info("获取满料串:"+material+",当前位置为:"+loc);
String nextLoc = "forkLoc";
if (forkLoc.equals(loc)) {
nextLoc = rawInLine01;
} else if (rawInLine01.equals(loc)) {
Map<String, RawInLineMaterialLoc> destinationMap = dataCache.getCache(CacheNameUtil.CHCHE_RAWIN_LINE_MATERIAL_DESTINATION);
if(loc.equals(forkLoc)){
int count = 0;
String nextLoc = "";
for (RawInLineMaterialLoc materialLoc : destinationMap.values()) {
if (rawInLine01.equals(materialLoc.getDestination())) {
count++;
}
}
if(count >= 3){
//1号已经3个, 分2号
nextLoc = rawInLine02;
} else if (rawInLine02.equals(loc)) {
}else{
nextLoc = rawInLine01;
}
updateDestinationMap(material,loc,nextLoc);
return nextLoc;
}else{
int count = 0;
for (RawInLineMaterialLoc materialLoc : destinationMap.values()) {
if (loc.equals(materialLoc.getDestination())) {
count++;
}
}
if(count >=3){
String nextLoc = loc;
if (rawInLine02.equals(loc)) {
nextLoc = rawInLine03;
} else if (rawInLine03.equals(loc)) {
nextLoc = rawInLine04;
......@@ -84,26 +107,13 @@ public class RawInLineUtil {
} else if (rawInLine05.equals(loc)) {
nextLoc = rawInLine06;
}
Map<String, RawInLineMaterialLoc> destinationMap = dataCache.getCache(CacheNameUtil.CHCHE_RAWIN_LINE_MATERIAL_DESTINATION);
int count = 0;
for (RawInLineMaterialLoc materialLoc : destinationMap.values()) {
if (nextLoc.equals(materialLoc.getDestination())) {
count++;
}
}
log.info("获取满料串:"+material+",下一个位置为:"+nextLoc+",当前数量为:"+count);
if (count >= 5) {
updateDestinationMap(material,loc,loc);
return loc;
}
log.info("获取满料串:"+material+",当前位置["+loc+"]数量为:"+count+"超过3个,分配到下一位置" + nextLoc);
updateDestinationMap(material,loc,nextLoc);
return nextLoc;
}else{
return loc;
}
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!