huang
2025-10-09 d4a06fc08b6e6e215bbf1771d204c3b7d773bc29
hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
@@ -26,14 +26,12 @@
import com.mes.sysconfig.service.SysConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.cache.annotation.Cacheable;
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.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -107,7 +105,9 @@
                    .last("limit 1")
            );
        }
        Assert.isTrue(null != relationInfoOne, "相关流程卡未找到对应的组号信息,玻璃流程卡:{},序号:{},总层数:{},层数:{}", flowCardId, glassType, totalLayer, layer);
        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>()
@@ -305,6 +305,8 @@
    @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())
@@ -316,6 +318,8 @@
            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));
        List<HollowAllFlowCardVO> resultList = new ArrayList<>();
        AtomicInteger pairTotalCount = new AtomicInteger();
@@ -323,7 +327,7 @@
            HollowAllFlowCardVO hollowAllFlowCardVO = new HollowAllFlowCardVO();
            HollowBigStorageCageDetails 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);
@@ -341,6 +345,8 @@
                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<>();
        }
@@ -397,10 +403,9 @@
    }
    @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
@@ -436,6 +441,16 @@
        return Boolean.TRUE;
    }
    @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+)$");