From b21caa5499c50384f3a3a5dd795a7a0ad197d36f Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期四, 06 十一月 2025 21:26:11 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java | 95 +++++++++++++++++++++++++++++++++--------------
1 files changed, 67 insertions(+), 28 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 bc1dae1..3d508b1 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
@@ -15,7 +15,9 @@
import com.mes.hollow.entity.HollowBigStorageCageDetails;
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.entity.HollowGlassRelationInfo;
-import com.mes.hollow.entity.dto.*;
+import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO;
+import com.mes.hollow.entity.dto.HollowBigStorageDTO;
+import com.mes.hollow.entity.dto.LackDetailsDTO;
import com.mes.hollow.entity.vo.HollowAllFlowCardVO;
import com.mes.hollow.entity.vo.HollowBigStorageDetailsQueryVO;
import com.mes.hollow.mapper.HollowGlassRelationInfoMapper;
@@ -23,6 +25,9 @@
import com.mes.hollow.service.HollowBigStorageCageService;
import com.mes.hollow.service.HollowGlassOutRelationInfoService;
import com.mes.hollow.service.HollowGlassRelationInfoService;
+import com.mes.order.entity.HollowGlassDetailsDTO;
+import com.mes.order.entity.OrderDetailsDTO;
+import com.mes.order.service.OrdersService;
import com.mes.sysconfig.service.SysConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
@@ -60,6 +65,8 @@
SysConfigService sysConfigService;
@Resource
DamageService damageService;
+ @Resource
+ OrdersService ordersService;
// @Value("${mes.slotWidth}")
// private Integer slotWidth;
// @Value("${mes.glassGap}")
@@ -104,12 +111,27 @@
.last("limit 1")
);
}
- Assert.isTrue(null != relationInfoOne, "鐩稿叧娴佺▼鍗℃湭鎵惧埌瀵瑰簲鐨勭粍鍙蜂俊鎭紝鐜荤拑娴佺▼鍗★細{}锛屽簭鍙凤細{}锛屾�诲眰鏁帮細{}锛屽眰鏁帮細{}", flowCardId, glassType, totalLayer, layer);
+ if (null == relationInfoOne) {
+ throw new RuntimeException("鐩稿叧娴佺▼鍗℃湭鎵惧埌瀵瑰簲鐨勭粍鍙蜂俊鎭紝鐜荤拑娴佺▼鍗★細" + flowCardId + "锛屽簭鍙凤細" + glassType + "锛屾�诲眰鏁帮細" + totalLayer + "锛屽眰鏁帮細" + layer);
+ }
+ Integer slotMaxHeight = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_MAX_HEIGHT);
Integer slotWidth = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_WIDTH);
+ HollowBigStorageCage storageCage = null;
+ if (Math.min(width, height) > slotMaxHeight) {
+ storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
+ .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth)
+ .eq(HollowBigStorageCage::getDeviceId, 6)
+ .orderByAsc(HollowBigStorageCage::getMaxThickness).last("limit 1"));
+ HollowBigStorageDTO storageDTO = new HollowBigStorageDTO();
+ BeanUtils.copyProperties(storageCage, storageDTO);
+ BeanUtils.copyProperties(relationInfoOne, storageDTO);
+ return storageDTO;
+ }
+
//璇︽儏琛ㄥ唴鑾峰彇鏈粍鏄惁宸茬粡鏈夌幓鐠冨湪绗煎瓙鍐咃紙0琛ㄧず鎻愬墠鍗犵敤锛�
int taskCount = hollowGlassOutRelationInfoService.count(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
.eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId));
- HollowBigStorageCage storageCage = null;
+
//濡傛灉涓嶅瓨鍦ㄥ垯閫夋嫨绗煎唴鏈敤鐨勬柊鏍煎瓙
if (taskCount > 0) {
storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
@@ -205,13 +227,13 @@
return;
}
//鎸夌収娴佺▼鍗¤幏鍙栨湰娴佺▼鍗℃渶鍚庝竴灞傛垨绗竴娆$殑鐜荤拑鏁版嵁
- List<HollowGlassDetailsDTO> glassDetailsDTOS = this.baseMapper.queryFlowCardIdMaxLayerGlassInfo(flowCardId, totalLayer);
+ List<HollowGlassDetailsDTO> glassDetailsDTOS = ordersService.queryFlowCardIdMaxLayerGlassInfo(flowCardId, totalLayer);
if (CollectionUtil.isEmpty(glassDetailsDTOS)) {
log.info("褰撳墠娴佺▼鍗℃渶澶栧眰鏁版嵁鏈壘鍒帮紝璇峰湪erp纭鏁版嵁鏃犺锛屾祦绋嬪崱锛歿}锛屾�诲眰鏁皗}", flowCardId, totalLayer);
return;
}
if (totalLayer != layer) {
- glassDetailsDTOS = this.baseMapper.queryFlowCardIdLayerGlassInfo(flowCardId, totalLayer, layer);
+ glassDetailsDTOS = ordersService.queryFlowCardIdLayerGlassInfo(flowCardId, totalLayer, layer);
}
if (CollectionUtil.isEmpty(glassDetailsDTOS)) {
log.info("褰撳墠娴佺▼鍗℃渶澶栧眰鏁版嵁鏈壘鍒帮紝璇峰湪erp纭鏁版嵁鏃犺锛屾祦绋嬪崱锛歿}锛屾�诲眰鏁皗},灞傛暟{}", flowCardId, totalLayer, layer);
@@ -296,35 +318,34 @@
for (List<HollowGlassRelationInfo> item : tempHollowList) {
relationInfoList.addAll(item);
}
- log.info("鍒嗛厤瀹屾瘯");
- this.saveBatch(relationInfoList);
+ log.info("鍒嗛厤瀹屾瘯:{}", relationInfoList);
+ try {
+ this.saveBatch(relationInfoList);
+ } catch (Exception e) {
+ log.error("淇濆瓨澶辫触:{}", e);
+ }
}
@Override
public List<HollowAllFlowCardVO> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query) {
Date startDate = new Date();
log.info("寮�濮嬫煡璇腑绌烘祦绋嬪崱浠诲姟淇℃伅锛屽紑濮嬫椂闂磠}", startDate);
- List<HollowBigStorageCageDetails> detailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
- .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN)
- .like(StringUtils.isNotBlank(query.getFilmsId()), HollowBigStorageCageDetails::getFilmsId, query.getFilmsId())
- .like(StringUtils.isNotBlank(query.getFlowCardId()), HollowBigStorageCageDetails::getFlowCardId, query.getFlowCardId())
- .eq(query.getThickness() != 0, HollowBigStorageCageDetails::getThickness, query.getThickness())
- .orderByAsc(HollowBigStorageCageDetails::getFlowCardId)
- );
+ List<FlowCardGlassInfoDTO> detailsList = hollowBigStorageCageDetailsService.queryHollowAllFlowCard(query);
+
if (CollectionUtil.isEmpty(detailsList)) {
log.info("绗煎唴鏃犵幓鐠�");
return new ArrayList<>();
}
Date middleDate = new Date();
log.info("涓┖鐞嗙墖绗艰鎯呮暟鎹凡鏌ヨ瀹屾瘯锛岃�楁椂:{}ms", middleDate.getTime() - startDate.getTime());
- Map<String, List<HollowBigStorageCageDetails>> listMap = detailsList.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getFlowCardId));
+ Map<String, List<FlowCardGlassInfoDTO>> listMap = detailsList.stream().collect(Collectors.groupingBy(FlowCardGlassInfoDTO::getFlowCardId));
List<HollowAllFlowCardVO> resultList = new ArrayList<>();
AtomicInteger pairTotalCount = new AtomicInteger();
listMap.forEach((e, v) -> {
HollowAllFlowCardVO hollowAllFlowCardVO = new HollowAllFlowCardVO();
- HollowBigStorageCageDetails cageDetails = v.get(0);
+ FlowCardGlassInfoDTO cageDetails = v.get(0);
//鎸夌収娴佺▼鍗¤幏鍙栧搴旂殑浜у搧鍚嶇О
- OrderDetailsDTO orderDetails = baseMapper.queryProductNameByFlowCardId(cageDetails.getFlowCardId(), query.getProductName(), query.getCustomerName());
+ OrderDetailsDTO orderDetails = this.queryProductNameByFlowCardId(cageDetails.getFlowCardId(), query.getProductName(), query.getCustomerName());
if (null != orderDetails) {
BeanUtils.copyProperties(orderDetails, hollowAllFlowCardVO);
hollowAllFlowCardVO.setFlowCardId(e);
@@ -333,12 +354,8 @@
} else {
hollowAllFlowCardVO.setIsThroughSlot(Boolean.FALSE);
}
- List<FlowCardGlassInfoDTO> flowCardInfoList = hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE);
- log.info("鑾峰彇鍒扮殑娴佺▼鍗′俊鎭负:{}", flowCardInfoList);
- if (CollectionUtil.isNotEmpty(flowCardInfoList)) {
- hollowAllFlowCardVO.setFlowCardGlassInfoDTOList(flowCardInfoList);
- pairTotalCount.addAndGet(flowCardInfoList.get(0).getPairCount());
- }
+ hollowAllFlowCardVO.setFlowCardGlassInfoDTOList(v);
+ pairTotalCount.addAndGet(cageDetails.getPairCount());
resultList.add(hollowAllFlowCardVO);
}
});
@@ -400,15 +417,20 @@
}
@Override
- public Map<Integer, List<LackDetailsDTO>> queryLackByFlowCard(String flowCardId) {
- List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryLackByFlowCard(flowCardId);
- Map<Integer, List<LackDetailsDTO>> listMap = lackDetailsList.stream().collect(Collectors.groupingBy(LackDetailsDTO::getLayer));
- return listMap;
+ public List<LackDetailsDTO> queryAllLackByFlowCard() {
+ List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryAllLackByFlowCard();
+ return lackDetailsList;
}
@Override
public int queryLayerByFlowCardId(String flowCardId) {
return baseMapper.queryLayerByFlowCardId(flowCardId);
+ }
+
+ @Override
+ public Map<Integer, List<LackDetailsDTO>> queryLackByFlowCard(String flowCardId) {
+ List<LackDetailsDTO> detailsDTOS = baseMapper.queryLackByFlowCard(flowCardId);
+ return detailsDTOS.stream().collect(Collectors.groupingBy(item -> item.getLayer()));
}
@Override
@@ -431,7 +453,9 @@
List<GlassInfo> glassInfos = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>()
.eq(GlassInfo::getFlowCardId, request.getFlowCardId())
.eq(GlassInfo::getLayer, request.getLayer())
- .eq(GlassInfo::getGlassType, request.getGlassType()));
+ .eq(GlassInfo::getGlassType, request.getGlassType())
+ .eq(request.getGlassId() != null, GlassInfo::getGlassId, request.getGlassId())
+ );
for (GlassInfo glassInfo : glassInfos) {
//鎺扮墖鎶ョ牬鎹�
damageService.autoSubmitReport(glassInfo.getGlassId(), request.getLine(), request.getWorkingProcedure(), request.getRemark(), request.getState());
@@ -439,6 +463,21 @@
return Boolean.TRUE;
}
+ @Override
+ public List<LackDetailsDTO> queryLackGlassByFlowCard(HollowBigStorageDetailsQueryVO query) {
+ return baseMapper.queryLackGlassByFlowCard(query.getFlowCardId(), query.getOrderSort(), query.getLayer());
+ }
+
+ @Override
+ public OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId, String productName, String customerName) {
+ OrderDetailsDTO dto = ordersService.queryProductNameByFlowCardId(flowCardId);
+ if ((StringUtils.isBlank(productName) || dto.getProductName().contains(productName)) && (StringUtils.isBlank(customerName) || dto.getCustomerName().contains(customerName))) {
+ return dto;
+ }
+ return null;
+ }
+
+
private void sortFlowCardIdList(List<HollowAllFlowCardVO> list) {
Pattern pattern = Pattern.compile("^NG(\\d+)([A-Za-z]+)(\\d+)$");
--
Gitblit v1.8.0