From b03389088870daf55208b44f627a538df077e91b Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期六, 11 十月 2025 08:39:22 +0800
Subject: [PATCH] 1、中空部分直接查询ERP数据库修改为使用OrderServices
---
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java | 268 ++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 230 insertions(+), 38 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 b0a212b..1ab8446 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
@@ -6,30 +6,37 @@
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.common.config.Const;
+import com.mes.common.config.ConstSysConfig;
+import com.mes.damage.entity.request.DamageRequest;
+import com.mes.damage.service.DamageService;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.service.GlassInfoService;
import com.mes.hollow.entity.HollowBigStorageCage;
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;
import com.mes.hollow.service.HollowBigStorageCageDetailsService;
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;
-import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.math.BigInteger;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@@ -49,22 +56,30 @@
@Resource
HollowGlassRelationInfoService hollowGlassRelationInfoService;
@Resource
+ HollowGlassOutRelationInfoService hollowGlassOutRelationInfoService;
+ @Resource
HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService;
- @Value("${mes.slotWidth}")
- private Integer slotWidth;
- @Value("${mes.glassGap}")
- private Integer glassGap;
-
- @Value("${mes.outCarMaxSize}")
- private Integer outCarMaxSize;
+ @Resource
+ SysConfigService sysConfigService;
+ @Resource
+ DamageService damageService;
+ @Resource
+ OrdersService ordersService;
+// @Value("${mes.slotWidth}")
+// private Integer slotWidth;
+// @Value("${mes.glassGap}")
+// private Integer glassGap;
+//
+// @Value("${mes.outCarMaxSize}")
+// private Integer outCarMaxSize;
@Override
- public HollowBigStorageDTO queryHollowTargetSlot(String flowCardId, double width, double height, int totalLayer, int layer) {
+ public HollowBigStorageDTO queryHollowTargetSlot(String flowCardId, Integer glassType, double width, double height, int totalLayer, int layer) {
+ log.info("鐜荤拑娴佺▼鍗★細{}锛屽簭鍙凤細{}锛屾�诲眰鏁帮細{}锛屽眰鏁帮細{}", flowCardId, glassType, totalLayer, layer);
//鎸夌収鐜荤拑淇℃伅鑾峰彇鍏崇郴琛ㄤ腑瀵瑰簲鐨勫ぇ鐞嗙墖绗兼牸瀛愬彿
HollowGlassRelationInfo relationInfoOne = hollowGlassRelationInfoService.getOne(new LambdaQueryWrapper<HollowGlassRelationInfo>()
.eq(HollowGlassRelationInfo::getFlowCardId, flowCardId)
- .eq(HollowGlassRelationInfo::getWidth, width)
- .eq(HollowGlassRelationInfo::getHeight, height)
+ .eq(HollowGlassRelationInfo::getOrderSort, glassType)
.eq(HollowGlassRelationInfo::getTotalLayer, totalLayer)
.eq(HollowGlassRelationInfo::getLayer, layer)
.eq(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_NEW)
@@ -72,13 +87,21 @@
.last("limit 1")
);
if (relationInfoOne == null) {
+ //鏌ョ湅mes鏄惁鏈夊搴旂殑娴佺▼鍗′俊鎭�
+ int count = hollowGlassRelationInfoService.count(new LambdaQueryWrapper<HollowGlassRelationInfo>()
+ .eq(HollowGlassRelationInfo::getFlowCardId, flowCardId)
+ .eq(HollowGlassRelationInfo::getLayer, layer));
+ if (count == 0) {
+ generateHollowGlassInfo(flowCardId, totalLayer, layer);
+ } else {
+ //姣旇緝鍏崇郴琛ㄥ強涓┖鐞嗙墖绗艰鎯呰〃鐨勬祦绋嬪崱鏁版嵁锛屽鐞嗚剰鏁版嵁锛氬皢涓嶅湪绗煎唴鐨勬祦绋嬪崱鍖归厤鏁版嵁鑱屼綅绌�
+ this.baseMapper.clearDirtyFlowCardData(flowCardId, layer);
+ }
//鐞嗙墖绗煎叧绯昏〃涓病鏈夊搴旂殑鏁版嵁锛屾煡鐪嬬悊鐗囩铏氭嫙浣嶇疆琛ㄦ槸鍚︽湁鏈伐绋嬩笅鐨勬墍鏈夌幓鐠冭櫄鎷熶俊鎭�
//铏氭嫙浣嶇疆琛ㄦ病鏈夋湰宸ョ▼涓嬬殑鎵�鏈夌幓鐠冭櫄鎷熶俊鎭紝鎸夌収鐜荤拑id鐢熸垚鏈伐绋嬩笅鎵�鏈夌幓鐠冪殑铏氭嫙淇℃伅
- generateHollowGlassInfo(flowCardId, totalLayer, layer);
relationInfoOne = this.getOne(new LambdaQueryWrapper<HollowGlassRelationInfo>()
.eq(HollowGlassRelationInfo::getFlowCardId, flowCardId)
- .eq(HollowGlassRelationInfo::getWidth, width)
- .eq(HollowGlassRelationInfo::getHeight, height)
+ .eq(HollowGlassRelationInfo::getOrderSort, glassType)
.eq(HollowGlassRelationInfo::getTotalLayer, totalLayer)
.eq(HollowGlassRelationInfo::getLayer, layer)
.eq(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_NEW)
@@ -86,14 +109,32 @@
.last("limit 1")
);
}
+ if (null == relationInfoOne) {
+ throw new RuntimeException("鐩稿叧娴佺▼鍗℃湭鎵惧埌瀵瑰簲鐨勭粍鍙蜂俊鎭紝鐜荤拑娴佺▼鍗★細" + flowCardId + "锛屽簭鍙凤細" + glassType + "锛屾�诲眰鏁帮細" + totalLayer + "锛屽眰鏁帮細" + layer);
+ }
+ Integer slotWidth = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_WIDTH);
//璇︽儏琛ㄥ唴鑾峰彇鏈粍鏄惁宸茬粡鏈夌幓鐠冨湪绗煎瓙鍐咃紙0琛ㄧず鎻愬墠鍗犵敤锛�
+ int taskCount = hollowGlassOutRelationInfoService.count(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
+ .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId));
+ HollowBigStorageCage storageCage = null;
+ //濡傛灉涓嶅瓨鍦ㄥ垯閫夋嫨绗煎唴鏈敤鐨勬柊鏍煎瓙
+ if (taskCount > 0) {
+ storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
+ .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth)
+ .le(HollowBigStorageCage::getMinThickness, relationInfoOne.getThickness())
+ .ge(HollowBigStorageCage::getMaxThickness, relationInfoOne.getThickness())
+ .orderByAsc(HollowBigStorageCage::getMaxThickness).last("limit 1"));
+ HollowBigStorageDTO storageDTO = new HollowBigStorageDTO();
+ BeanUtils.copyProperties(storageCage, storageDTO);
+ BeanUtils.copyProperties(relationInfoOne, storageDTO);
+ return storageDTO;
+ } //璇︽儏琛ㄥ唴鑾峰彇鏈粍鏄惁宸茬粡鏈夌幓鐠冨湪绗煎瓙鍐咃紙0琛ㄧず鎻愬墠鍗犵敤锛�
List<HollowBigStorageCageDetails> hollowDetailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>()
.eq(HollowBigStorageCageDetails::getFlowCardId, relationInfoOne.getFlowCardId())
.eq(HollowBigStorageCageDetails::getTotalLayer, totalLayer)
.eq(HollowBigStorageCageDetails::getLayer, layer)
.eq(HollowBigStorageCageDetails::getVirtualSlot, relationInfoOne.getVirtualSlot())
.in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO));
- HollowBigStorageCage storageCage = null;
//濡傛灉涓嶅瓨鍦ㄥ垯閫夋嫨绗煎唴鏈敤鐨勬柊鏍煎瓙
if (CollectionUtil.isEmpty(hollowDetailsList)) {
storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>()
@@ -165,19 +206,19 @@
public void generateHollowGlassInfo(String flowCardId, int totalLayer, int layer) {
GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getFlowCardId, flowCardId)
- .eq(GlassInfo::getLayer, layer).last("limit 1"));
+ .eq(GlassInfo::getLayer, layer).orderByDesc(GlassInfo::getId).last("limit 1"));
if (null == glassInfo) {
log.info("褰撳墠娴佺▼鍗′俊鎭负瀵煎叆mes绯荤粺娴佺▼鍗★細{}锛屽眰鏁皗}", flowCardId, layer);
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);
@@ -216,6 +257,11 @@
// List<HollowBigStorageCage> hollowSlotList = HollowBigStorageCageService.list(new LambdaQueryWrapper<HollowBigStorageCage>()
// .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth));
//鏂瑰紡浜岋細灏嗙幓鐠冩寜娴佺▼鍗°�佸昂瀵搞�佺増鍥俱�佺増搴� 锛屼紭鍏堝皢鏍煎瓙鍏ㄩ儴琛ュ叏鍚� 渚濇璁$畻鍚庨潰鐨勬牸瀛愬彿
+
+ Integer slotWidth = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_WIDTH);
+// Integer glassGap = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_GLASS_GAP);
+ Integer glassGap = getGlassGapByThickness(glassInfo.getThickness());
+ Integer outCarMaxSize = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_OUT_CAR_SIZE);
List<HollowGlassRelationInfo> relationInfoList = new ArrayList();
List<List<HollowGlassRelationInfo>> tempHollowList = new ArrayList<>();
int slotNumber = 1;
@@ -262,15 +308,69 @@
}
@Override
- public Map<String, List<FlowCardGlassInfoDTO>> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query) {
+ 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)
);
if (CollectionUtil.isEmpty(detailsList)) {
log.info("绗煎唴鏃犵幓鐠�");
- return new HashMap<>();
+ 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));
+ List<HollowAllFlowCardVO> resultList = new ArrayList<>();
+ AtomicInteger pairTotalCount = new AtomicInteger();
+ listMap.forEach((e, v) -> {
+ HollowAllFlowCardVO hollowAllFlowCardVO = new HollowAllFlowCardVO();
+ HollowBigStorageCageDetails cageDetails = v.get(0);
+ //鎸夌収娴佺▼鍗¤幏鍙栧搴旂殑浜у搧鍚嶇О
+ OrderDetailsDTO orderDetails = this.queryProductNameByFlowCardId(cageDetails.getFlowCardId(), query.getProductName(), query.getCustomerName());
+ if (null != orderDetails) {
+ BeanUtils.copyProperties(orderDetails, hollowAllFlowCardVO);
+ hollowAllFlowCardVO.setFlowCardId(e);
+ if (cageDetails.getHollowSequence() == 0) {
+ hollowAllFlowCardVO.setIsThroughSlot(Boolean.TRUE);
+ } 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());
+ }
+ resultList.add(hollowAllFlowCardVO);
+ }
+ });
+ Date endDate = new Date();
+ log.info("瀹㈡埛淇℃伅鏁版嵁宸叉煡璇㈠畬姣曪紝鑰楁椂:{}ms锛屾�昏鑰楁椂锛歿}ms", endDate.getTime() - middleDate.getTime(), endDate.getTime() - startDate.getTime());
+ if (CollectionUtil.isEmpty(resultList)) {
+ return new ArrayList<>();
+ }
+ sortFlowCardIdList(resultList);
+ resultList.get(0).setPairTotalCount(pairTotalCount.get());
+ return resultList;
+ }
+
+ @Override
+ public List<FlowCardGlassInfoDTO> queryHollowAllFlowCardSummary(HollowBigStorageDetailsQueryVO query) {
+ 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)
+ );
+ if (CollectionUtil.isEmpty(detailsList)) {
+ log.info("绗煎唴鏃犵幓鐠�");
+ return null;
}
Map<String, List<HollowBigStorageCageDetails>> listMap = detailsList.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getFlowCardId));
List<FlowCardGlassInfoDTO> dtos = new ArrayList<>();
@@ -278,25 +378,117 @@
HollowBigStorageCageDetails cageDetails = v.get(0);
dtos.addAll(hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE));
});
- return dtos.stream().collect(Collectors.groupingBy(FlowCardGlassInfoDTO::getFlowCardId));
+ Map<String, FlowCardGlassInfoDTO> result = dtos.stream()
+ .collect(Collectors.toMap(
+ FlowCardGlassInfoDTO::getFlowCardId,
+ dto -> {
+ FlowCardGlassInfoDTO newDto = new FlowCardGlassInfoDTO();
+ newDto.setFlowCardId(dto.getFlowCardId());
+ newDto.setSumCount(dto.getSumCount());
+ newDto.setPairCount(dto.getPairCount());
+ newDto.setRealCount(dto.getRealCount());
+ newDto.setLayer(dto.getLayer());
+ newDto.setSlotCount(dto.getSlotCount());
+ return newDto;
+ },
+ (dto1, dto2) -> {
+ dto1.setRealCount(dto1.getRealCount() + dto2.getRealCount()); // 绱姞 realCount
+ dto1.setLayer(Math.max(dto1.getLayer(), dto2.getLayer())); // 绱姞 鏈�澶у眰鏁�
+ dto1.setSlotCount(dto1.getSlotCount() + dto2.getSlotCount());
+ return dto1; // 杩斿洖鍚堝苟鍚庣殑瀵硅薄
+ }
+ ));
+ List<FlowCardGlassInfoDTO> resultList = new ArrayList<>(result.values());
+ List<FlowCardGlassInfoDTO> sortedList = resultList.stream()
+ .sorted(Comparator.comparing(FlowCardGlassInfoDTO::getRealCount).reversed() // 绗竴涓瓧娈靛�掑簭
+ .thenComparing(FlowCardGlassInfoDTO::getSumCount, Comparator.reverseOrder())) // 绗簩涓瓧娈靛�掑簭
+ .collect(Collectors.toList());
+ return sortedList;
}
@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> queryLackByFlowCard() {
+ List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryLackByFlowCard();
+ return lackDetailsList;
}
@Override
public int queryLayerByFlowCardId(String flowCardId) {
return baseMapper.queryLayerByFlowCardId(flowCardId);
}
- // @Override
-// public List<LackDetailsDTO> queryLackByFlowCard(String flowCardId) {
-// List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryLackByFlowCard(flowCardId);
-// return lackDetailsList;
-// }
+
+ @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 Boolean hollowBigStorageGlassDamage(DamageRequest request) {
+ List<GlassInfo> glassInfos = glassInfoService.list(new LambdaQueryWrapper<GlassInfo>()
+ .eq(GlassInfo::getFlowCardId, request.getFlowCardId())
+ .eq(GlassInfo::getLayer, request.getLayer())
+ .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());
+ }
+ return Boolean.TRUE;
+ }
+
+ @Override
+ public List<GlassInfo> queryLackGlassByFlowCard(HollowBigStorageDetailsQueryVO query) {
+ return baseMapper.queryLackGlassByFlowCard(query.getFlowCardId(), query.getOrderSort(), query.getLayer());
+ }
+
+ @Override
+ public OrderDetailsDTO queryProductNameByFlowCardId(String flowCardId, String productName, String customerName) {
+ OrderDetailsDTO dto = hollowGlassOutRelationInfoService.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+)$");
+
+ 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