| | |
| | | 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 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; |
| | | |
| | | /** |
| | |
| | | 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 |
| | |
| | | // 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); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |