no message

main
HUOJIN\92525 2026-01-15 18:00:18 +08:00
parent fdf940aaf6
commit 3ccab344bd
5 changed files with 99 additions and 7 deletions

View File

@ -67,6 +67,7 @@ public class AreaController extends JeecgController<Area, IAreaService> {
List<String> areaCodes= Arrays.asList(areaCode.split(","));
queryWrapper.in("area_code", areaCodes);
}
queryWrapper.orderByAsc("create_time");
Page<Area> page = new Page<Area>(pageNo, pageSize);
IPage<Area> pageList = areaService.page(page, queryWrapper);
return Result.OK(pageList);

View File

@ -15,9 +15,15 @@ public enum AreaTypeEnum {
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", "出库工作站"),
;
/**
*

View File

@ -18,6 +18,10 @@ public enum CommonStatusEnum {
TWO(2, "二层"),
THREE(3, "三层"),
FOUR(4, "四层"),
;
/**
*

View File

@ -199,6 +199,23 @@ public class ScanTrayProcessor {
* @return
*/
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. 获取可用库位
List<Point> availablePoints = getAvailablePoints(itemKeys, areaCode, type);
if (CollectionUtils.isEmpty(availablePoints)) {
@ -231,10 +248,74 @@ public class ScanTrayProcessor {
}
//合并获取最优库位
List<PointScore> scoredPoints = Stream.concat(
firstScoredPoints.stream(),
secondScoredPoints.stream()
)
List<PointScore> scoredPoints = Stream.of(firstScoredPoints, secondScoredPoints)
.flatMap(List::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())
.toList();

View File

@ -64,7 +64,7 @@ spring:
clusterCheckinInterval: 15000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadCount: 32
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
#json 时间戳统一转换