From 4e3b8155722b66e25df3c6fd42cc586b68dea391 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期五, 06 六月 2025 13:55:39 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java | 64 +++++++++++++++++++++++++++----
1 files changed, 55 insertions(+), 9 deletions(-)
diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
index 5b12e1a..a26d6b8 100644
--- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
@@ -13,10 +13,7 @@
import com.mes.hollow.entity.HollowBigStorageCageDetails;
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.entity.HollowGlassRelationInfo;
-import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
-import com.mes.hollow.entity.dto.HollowBigStorageDTO;
-import com.mes.hollow.entity.dto.HollowGlassDetailsDTO;
-import com.mes.hollow.entity.dto.LackDetailsDTO;
+import com.mes.hollow.entity.dto.*;
import com.mes.hollow.entity.vo.HollowAllFlowCardVO;
import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
import com.mes.hollow.mapper.HollowGlassRelationInfoMapper;
@@ -30,10 +27,13 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
+import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@@ -250,7 +250,8 @@
//鏂瑰紡浜岋細灏嗙幓鐠冩寜娴佺▼鍗°�佸昂瀵搞�佺増鍥俱�佺増搴� 锛屼紭鍏堝皢鏍煎瓙鍏ㄩ儴琛ュ叏鍚� 渚濇璁$畻鍚庨潰鐨勬牸瀛愬彿
Integer slotWidth = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_WIDTH);
- Integer glassGap = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_GLASS_GAP);
+// Integer glassGap = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_GLASS_GAP);
+ Integer glassGap = getGlassGapByThickness(tempGlassList.get(0).getThickness());
Integer outCarMaxSize = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_OUT_CAR_SIZE);
List<HollowGlassRelationInfo> relationInfoList = new ArrayList();
List<List<HollowGlassRelationInfo>> tempHollowList = new ArrayList<>();
@@ -315,21 +316,23 @@
listMap.forEach((e, v) -> {
HollowAllFlowCardVO hollowAllFlowCardVO = new HollowAllFlowCardVO();
HollowBigStorageCageDetails cageDetails = v.get(0);
+ //鎸夌収娴佺▼鍗¤幏鍙栧搴旂殑浜у搧鍚嶇О
+ OrderDetailsDTO orderDetails = baseMapper.queryProductNameByFlowCardId(cageDetails.getFlowCardId());
+ if (null != orderDetails) {
+ BeanUtils.copyProperties(orderDetails, hollowAllFlowCardVO);
+ }
hollowAllFlowCardVO.setFlowCardId(e);
if (cageDetails.getHollowSequence() == 0) {
hollowAllFlowCardVO.setIsThroughSlot(Boolean.TRUE);
} else {
hollowAllFlowCardVO.setIsThroughSlot(Boolean.FALSE);
}
- //鎸夌収娴佺▼鍗¤幏鍙栧搴旂殑浜у搧鍚嶇О
- String productName = baseMapper.queryProductNameByFlowCardId(cageDetails.getFlowCardId());
- hollowAllFlowCardVO.setProductName(productName);
List<FlowCardGlassInfoDTO> flowCardInfoList = hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE);
hollowAllFlowCardVO.setFlowCardGlassInfoDTOList(flowCardInfoList);
resultList.add(hollowAllFlowCardVO);
});
+ sortFlowCardIdList(resultList);
return resultList;
-// return dtos.stream().collect(Collectors.groupingBy(e -> e.getFlowCardId() + ":" + e.getProductName()));
}
@Override
@@ -390,11 +393,54 @@
public int queryLayerByFlowCardId(String flowCardId) {
return baseMapper.queryLayerByFlowCardId(flowCardId);
}
+
+ @Override
+ public Integer getGlassGapByThickness(Double thickness) {
+ int sysKey = 0;
+ if (thickness >= 12) {
+ sysKey = ConstSysConfig.HOLLOW_GLASS_GAP_12;
+ } else if (thickness == 8) {
+ sysKey = ConstSysConfig.HOLLOW_GLASS_GAP_8;
+ } else if (thickness == 10) {
+ sysKey = ConstSysConfig.HOLLOW_GLASS_GAP_10;
+ } else {
+ sysKey = ConstSysConfig.HOLLOW_GLASS_GAP;
+ }
+ return sysConfigService.queryConfigValue(sysKey);
+ }
// @Override
// public List<LackDetailsDTO> queryLackByFlowCard(String flowCardId) {
// List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryLackByFlowCard(flowCardId);
// return lackDetailsList;
// }
+ private void sortFlowCardIdList(List<HollowAllFlowCardVO> list) {
+ Pattern pattern = Pattern.compile("^NG(\\d+)([A-Za-z]+)(\\d+)$");
+
+ list.sort((v1, v2) -> {
+ Matcher m1 = pattern.matcher(v1.getFlowCardId());
+ Matcher m2 = pattern.matcher(v2.getFlowCardId());
+
+ if (!m1.find() || !m2.find()) {
+ throw new IllegalArgumentException("鑾峰彇鍒扮殑娴佺▼鍗′笉绗﹀悎鏍¢獙瑙勫垯");
+ }
+
+ // 鎻愬彇閮ㄥ垎
+ BigInteger order1 = new BigInteger(m1.group(1));
+ BigInteger order2 = new BigInteger(m2.group(1));
+ String layer1 = m1.group(2);
+ String layer2 = m2.group(2);
+ BigInteger seq1 = new BigInteger(m1.group(3));
+ BigInteger seq2 = new BigInteger(m2.group(3));
+
+ // 浼樺厛绾ф帓搴�
+ int cmp = order1.compareTo(order2);
+ if (cmp != 0) return cmp;
+ cmp = layer1.compareTo(layer2);
+ if (cmp != 0) return cmp;
+ return seq1.compareTo(seq2);
+ });
+ }
+
}
--
Gitblit v1.8.0