满架下料多列可放时优先放数量最多的
This commit is contained in:
@@ -32,11 +32,7 @@ import org.springframework.context.annotation.Lazy;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: psh
|
* @Author: psh
|
||||||
@@ -134,6 +130,7 @@ public class MJXLTask extends AbstractTask {
|
|||||||
regionCode = "GHS2";
|
regionCode = "GHS2";
|
||||||
}
|
}
|
||||||
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "2");
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "2");
|
||||||
|
Map<SchBasePoint,Integer> pointMap=new HashMap<>();
|
||||||
for (SchBasePoint schBasePoint : schBasePointList) {
|
for (SchBasePoint schBasePoint : schBasePointList) {
|
||||||
if (!schBasePoint.getPoint_code().endsWith("01") &&
|
if (!schBasePoint.getPoint_code().endsWith("01") &&
|
||||||
!schBasePoint.getPoint_code().endsWith("06")) {
|
!schBasePoint.getPoint_code().endsWith("06")) {
|
||||||
@@ -146,7 +143,8 @@ public class MJXLTask extends AbstractTask {
|
|||||||
//新增逻辑,同一列只能放相同物料
|
//新增逻辑,同一列只能放相同物料
|
||||||
boolean flag=true;
|
boolean flag=true;
|
||||||
List<String> list=new ArrayList<>();
|
List<String> list=new ArrayList<>();
|
||||||
for(int i=1;i<=4;i++){
|
Integer qty=0;
|
||||||
|
for(int i=0;i<=4;i++){
|
||||||
int end=Integer.parseInt(schBasePoint.getPoint_code().substring(schBasePoint.getPoint_code().length()-1))+i;
|
int end=Integer.parseInt(schBasePoint.getPoint_code().substring(schBasePoint.getPoint_code().length()-1))+i;
|
||||||
String pointCode=schBasePoint.getPoint_code().substring(0,schBasePoint.getPoint_code().length()-1);
|
String pointCode=schBasePoint.getPoint_code().substring(0,schBasePoint.getPoint_code().length()-1);
|
||||||
list.add(pointCode+end);
|
list.add(pointCode+end);
|
||||||
@@ -156,16 +154,27 @@ public class MJXLTask extends AbstractTask {
|
|||||||
if (ObjectUtil.isNotEmpty(schBasePoint2.getVehicle_type()) && !materialType.equals(schBasePoint2.getVehicle_type())) {
|
if (ObjectUtil.isNotEmpty(schBasePoint2.getVehicle_type()) && !materialType.equals(schBasePoint2.getVehicle_type())) {
|
||||||
flag = false;
|
flag = false;
|
||||||
}
|
}
|
||||||
|
qty+=schBasePoint2.getVehicle_qty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!flag){
|
if(!flag){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
log.info("满架下料找到当前符合条件的点位{}", schBasePoint.getPoint_code());
|
log.info("满架下料找到当前符合条件的点位{},当前列总数{}", schBasePoint.getPoint_code(),qty);
|
||||||
return schBasePoint;
|
pointMap.put(schBasePoint,qty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
SchBasePoint schBasePoint=null;
|
||||||
|
int qty=0;
|
||||||
|
Iterator<Map.Entry<SchBasePoint,Integer>> iterator = pointMap.entrySet().iterator();
|
||||||
|
while (iterator.hasNext()){
|
||||||
|
Map.Entry<SchBasePoint,Integer> next = iterator.next();
|
||||||
|
if (next.getValue()>qty){
|
||||||
|
qty=next.getValue();
|
||||||
|
schBasePoint=next.getKey();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return schBasePoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user