no message
parent
fdf940aaf6
commit
3ccab344bd
|
|
@ -67,6 +67,7 @@ public class AreaController extends JeecgController<Area, IAreaService> {
|
||||||
List<String> areaCodes= Arrays.asList(areaCode.split(","));
|
List<String> areaCodes= Arrays.asList(areaCode.split(","));
|
||||||
queryWrapper.in("area_code", areaCodes);
|
queryWrapper.in("area_code", areaCodes);
|
||||||
}
|
}
|
||||||
|
queryWrapper.orderByAsc("create_time");
|
||||||
Page<Area> page = new Page<Area>(pageNo, pageSize);
|
Page<Area> page = new Page<Area>(pageNo, pageSize);
|
||||||
IPage<Area> pageList = areaService.page(page, queryWrapper);
|
IPage<Area> pageList = areaService.page(page, queryWrapper);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,15 @@ public enum AreaTypeEnum {
|
||||||
|
|
||||||
MJCCQ("MJCCQ", "模具存储区"),
|
MJCCQ("MJCCQ", "模具存储区"),
|
||||||
|
|
||||||
RK_DOCK("RK_DOCK", "入库工作站"),
|
RK_DOCK("RK_DOCK", "成品入库工作站"),
|
||||||
|
|
||||||
|
CK_DOCK("CK_DOCK", "成品出库工作站"),
|
||||||
|
|
||||||
|
MJRK_DOCK("MJRK_DOCK", "模具入库工作站"),
|
||||||
|
|
||||||
|
MJCK_DOCK("MJCK_DOCK", "模具出库工作站"),
|
||||||
|
|
||||||
|
|
||||||
CK_DOCK("CK_DOCK", "出库工作站"),
|
|
||||||
;
|
;
|
||||||
/**
|
/**
|
||||||
* 值
|
* 值
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,10 @@ public enum CommonStatusEnum {
|
||||||
|
|
||||||
TWO(2, "二层"),
|
TWO(2, "二层"),
|
||||||
|
|
||||||
|
THREE(3, "三层"),
|
||||||
|
|
||||||
|
FOUR(4, "四层"),
|
||||||
|
|
||||||
;
|
;
|
||||||
/**
|
/**
|
||||||
* 值
|
* 值
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,23 @@ public class ScanTrayProcessor {
|
||||||
* @return 目标库位
|
* @return 目标库位
|
||||||
*/
|
*/
|
||||||
public Point allocatePoint(List<ItemKey> itemKeys, Point station, String areaCode, String type) {
|
public Point allocatePoint(List<ItemKey> itemKeys, Point station, String areaCode, String type) {
|
||||||
|
if(AreaTypeEnum.CPCCQ.getValue().equals(areaCode)){
|
||||||
|
return allocateCpPoint(itemKeys, station, areaCode, type);
|
||||||
|
}else{
|
||||||
|
return allocateMjPoint(itemKeys, station, areaCode, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 智能库位分配成品库位
|
||||||
|
*
|
||||||
|
* @param itemKeys 物料属性
|
||||||
|
* @param station 工作站
|
||||||
|
* @param areaCode 库区
|
||||||
|
* @param type 业务类型
|
||||||
|
* @return 目标库位
|
||||||
|
*/
|
||||||
|
private Point allocateCpPoint(List<ItemKey> itemKeys, Point station, String areaCode,String type){
|
||||||
// 1. 获取可用库位
|
// 1. 获取可用库位
|
||||||
List<Point> availablePoints = getAvailablePoints(itemKeys, areaCode, type);
|
List<Point> availablePoints = getAvailablePoints(itemKeys, areaCode, type);
|
||||||
if (CollectionUtils.isEmpty(availablePoints)) {
|
if (CollectionUtils.isEmpty(availablePoints)) {
|
||||||
|
|
@ -231,10 +248,74 @@ public class ScanTrayProcessor {
|
||||||
}
|
}
|
||||||
|
|
||||||
//合并获取最优库位
|
//合并获取最优库位
|
||||||
List<PointScore> scoredPoints = Stream.concat(
|
List<PointScore> scoredPoints = Stream.of(firstScoredPoints, secondScoredPoints)
|
||||||
firstScoredPoints.stream(),
|
.flatMap(List::stream)
|
||||||
secondScoredPoints.stream()
|
.sorted(Comparator.comparing(PointScore::getScore).reversed())
|
||||||
)
|
.toList();
|
||||||
|
|
||||||
|
if (CollectionUtils.isNotEmpty(scoredPoints)) {
|
||||||
|
log.info("最优【{}】库位评分结果:{}", scoredPoints.get(0).getPoint().getPointCode(), scoredPoints.get(0).getScore());
|
||||||
|
return scoredPoints.get(0).getPoint();
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new RuntimeException("系统无可用库位");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 智能库位分配模具库位
|
||||||
|
*
|
||||||
|
* @param itemKeys 物料属性
|
||||||
|
* @param station 工作站
|
||||||
|
* @param areaCode 库区
|
||||||
|
* @param type 业务类型
|
||||||
|
* @return 目标库位
|
||||||
|
*/
|
||||||
|
private Point allocateMjPoint(List<ItemKey> itemKeys, Point station, String areaCode,String type){
|
||||||
|
// 1. 获取可用库位
|
||||||
|
List<Point> availablePoints = getAvailablePoints(itemKeys, areaCode, type);
|
||||||
|
if (CollectionUtils.isEmpty(availablePoints)) {
|
||||||
|
throw new RuntimeException("系统无可用库位");
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据巷道分组,得到每个巷道有多个库位,<巷道编号,库位个数>
|
||||||
|
Map<String, Long> colMap = getColMap(areaCode);
|
||||||
|
|
||||||
|
//获取每个巷道已占用的库位
|
||||||
|
Map<String, Long> colUsedMap = getColUsedMap(areaCode);
|
||||||
|
|
||||||
|
//根据layerNum层来分组
|
||||||
|
Map<String, List<Point>> layerMap = availablePoints.stream().collect(Collectors.groupingBy(Point::getLayerNum));
|
||||||
|
|
||||||
|
List<PointScore> firstScoredPoints;
|
||||||
|
List<PointScore> secondScoredPoints = new ArrayList<>();
|
||||||
|
List<PointScore> thirdScoredPoints = new ArrayList<>();
|
||||||
|
List<PointScore> fourthScoredPoints = new ArrayList<>();
|
||||||
|
|
||||||
|
//移位选择最优库位
|
||||||
|
if (type.equals(BusinessTypeEnum.MOVE.getValue())) {
|
||||||
|
firstScoredPoints = selectBestPointForMove(station, itemKeys, colMap, layerMap, colUsedMap);
|
||||||
|
} else {
|
||||||
|
//计算第一层的库位分数
|
||||||
|
Station firstStation = new Station(4878, 36395);
|
||||||
|
firstScoredPoints = selectBestPointForStorage(firstStation, itemKeys, CommonStatusEnum.ONE.getValue(), colMap, layerMap, colUsedMap);
|
||||||
|
|
||||||
|
//计算第二层的库位分数
|
||||||
|
Station secondStation = new Station(4878, 38395);
|
||||||
|
secondScoredPoints = selectBestPointForStorage(secondStation, itemKeys, CommonStatusEnum.TWO.getValue(), colMap, layerMap, colUsedMap);
|
||||||
|
|
||||||
|
//计算第三层的库位分数
|
||||||
|
Station thirdStation = new Station(4878, 40395);
|
||||||
|
thirdScoredPoints = selectBestPointForStorage(thirdStation, itemKeys, CommonStatusEnum.THREE.getValue(), colMap, layerMap, colUsedMap);
|
||||||
|
|
||||||
|
//计算第四层的库位分数
|
||||||
|
Station fourthStation = new Station(4878, 42395);
|
||||||
|
fourthScoredPoints = selectBestPointForStorage(fourthStation, itemKeys, CommonStatusEnum.FOUR.getValue(), colMap, layerMap, colUsedMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
//合并获取最优库位
|
||||||
|
List<PointScore> scoredPoints = Stream.of(firstScoredPoints, secondScoredPoints, thirdScoredPoints, fourthScoredPoints)
|
||||||
|
.flatMap(List::stream)
|
||||||
.sorted(Comparator.comparing(PointScore::getScore).reversed())
|
.sorted(Comparator.comparing(PointScore::getScore).reversed())
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ spring:
|
||||||
clusterCheckinInterval: 15000
|
clusterCheckinInterval: 15000
|
||||||
threadPool:
|
threadPool:
|
||||||
class: org.quartz.simpl.SimpleThreadPool
|
class: org.quartz.simpl.SimpleThreadPool
|
||||||
threadCount: 10
|
threadCount: 32
|
||||||
threadPriority: 5
|
threadPriority: 5
|
||||||
threadsInheritContextClassLoaderOfInitializingThread: true
|
threadsInheritContextClassLoaderOfInitializingThread: true
|
||||||
#json 时间戳统一转换
|
#json 时间戳统一转换
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue