From 8891898a6ae6229ede66c8005f2912c75ddc6d90 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期三, 05 三月 2025 22:32:26 +0800
Subject: [PATCH] 1、fixbug:中空任务领取部分对数玻璃后继续领任务,任务显示异常bug解决 2、大理片笼/中空理片笼显示异常bug:进片任务计算目标格子后,预先将笼子插入一条记录,界面相同判断时显示存在歧义,修改数据返回逻辑:在没有目标格子前提下,如果笼内存在玻璃显示相同,有目标格子后笼内有数据不显示 3、中空理片笼进片任务优化:中空可能存在脏数据,原因人为操作或订单多补片造成中空关系订单数量与实际数据不匹配,实际数量大于订单数量,系统会重新生成一份关系造成关系进笼玻璃数据顺序存在重复而无法进笼。
---
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java | 74 ++++++++++++++++++++++++++++++-------
1 files changed, 60 insertions(+), 14 deletions(-)
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
index 5099eb5..d66abaf 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -28,6 +28,7 @@
import freemarker.template.Version;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -59,6 +60,12 @@
@Resource
RedisUtil redisUtil;
+
+ @Value("${mes.glassGap}")
+ private Integer glassGap;
+
+ @Value("${mes.carWidth}")
+ private Integer carWidth;
private static final int ID_RATIO = 10;
@@ -119,6 +126,7 @@
return this.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
.set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
.eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId)
+ .ne(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_SUCCESS)
.eq(HollowGlassOutRelationInfo::getCell, cell));
}
@@ -128,6 +136,7 @@
return this.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
.set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_PAUSE)
.eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId)
+ .ne(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_SUCCESS)
.eq(HollowGlassOutRelationInfo::getCell, cell));
}
@@ -328,20 +337,46 @@
.queryOutGlassList(request.getFlowCardId(), request.getCell());
int isPairCount = glassInfo.getTotalLayer() * request.getTotalPairQuantity();
List<HollowGlassQueueInfo> hollowQueues = new ArrayList<>();
- loop:
- for (HollowBigStorageCageDetails queue : hollowBigStorageCageDetailsList) {
- HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo();
- BeanUtils.copyProperties(queue, queueInfo);
- queueInfo.setRelationId(info.getId());
- queueInfo.setState(Const.TEMPERING_NEW);
- queueInfo.setCell(request.getCell());
- queueInfo.setCreateTime(new Date());
- queueInfo.setUpdateTime(new Date());
- hollowQueues.add(queueInfo);
- if (queue.getIsPair() == 1) {
- isPairCount -= 1;
- if (isPairCount == 0) {
- break loop;
+
+ if (930 == request.getCell()) {
+ Map<Integer, List<HollowBigStorageCageDetails>> listMap = hollowBigStorageCageDetailsList.stream()
+ .collect(Collectors.groupingBy(HollowBigStorageCageDetails::getHollowSequence));
+ for (Map.Entry<Integer, List<HollowBigStorageCageDetails>> entry : listMap.entrySet()) {
+ //鍒涘缓闃熷垪鎺ユ敹涓嶆弧瓒虫垚瀵规儏鍐典笅锛氫竴瀵圭幓鐠冨垎鍑犳涓婅溅鐨勬搴忛棶棰�
+ List<HollowGlassQueueInfo> tempList = new ArrayList<>();
+ //鍏堝皢鐜荤拑鎸夌収姝e父椤哄簭鎺掑垪锛岃绠椾竴杞︽渶澶氭斁鍑犲潡锛岀畻濂藉潡鏁颁箣鍚庡皢涓�杞︾殑鐜荤拑鎸夌収鍊掑簭瀛樺偍
+ List<HollowBigStorageCageDetails> reverse = CollectionUtil.reverse(entry.getValue());
+ int remainWidth = carWidth;
+ for (HollowBigStorageCageDetails item : reverse) {
+ remainWidth = remainWidth - (int) Math.max(item.getWidth(), item.getHeight());
+ if (remainWidth < 0) {
+ hollowQueues.addAll(CollectionUtil.reverse(tempList));
+ tempList = new ArrayList<>();
+ remainWidth = carWidth - (int) Math.max(item.getWidth(), item.getHeight());
+ }
+ HollowGlassQueueInfo queueInfo = HollowBDetailToQueue(item, info.getId(), request.getCell());
+ tempList.add(queueInfo);
+ remainWidth = remainWidth - glassGap;
+ }
+ hollowQueues.addAll(CollectionUtil.reverse(tempList));
+ HollowBigStorageCageDetails cageDetails = entry.getValue().get(0);
+ if (cageDetails.getIsPair() == 1) {
+ isPairCount = isPairCount - cageDetails.getTotalLayer();
+ if (isPairCount == 0) {
+ break;
+ }
+ }
+ }
+ } else {
+ loop:
+ for (HollowBigStorageCageDetails item : hollowBigStorageCageDetailsList) {
+ HollowGlassQueueInfo queueInfo = HollowBDetailToQueue(item, info.getId(), request.getCell());
+ hollowQueues.add(queueInfo);
+ if (item.getIsPair() == 1) {
+ isPairCount = isPairCount - 1;
+ if (isPairCount == 0) {
+ break loop;
+ }
}
}
}
@@ -355,5 +390,16 @@
}
return info;
}
+
+ private HollowGlassQueueInfo HollowBDetailToQueue(HollowBigStorageCageDetails details, Long taskId, int targetCell) {
+ HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo();
+ BeanUtils.copyProperties(details, queueInfo);
+ queueInfo.setRelationId(taskId);
+ queueInfo.setState(Const.TEMPERING_NEW);
+ queueInfo.setCell(targetCell);
+ queueInfo.setCreateTime(new Date());
+ queueInfo.setUpdateTime(new Date());
+ return queueInfo;
+ }
}
--
Gitblit v1.8.0