| | |
| | | }); |
| | | List<LackDetailsDTO> detailsDTOS = baseMapper.queryLackByFlowCardByERP(processCardReports); |
| | | List<Damage> damages = damageService.queryUnTempByFlowCardId(flowCardId); |
| | | damages = damages.stream() |
| | | .filter(damage -> damage.getType() != 8) // 核心:排除type=8的元素 |
| | | .collect(Collectors.toList()); |
| | | // 1. 按(orderNumber+layer)分组,同时缓存DTO的其他字段作为模板 |
| | | Map<String, List<Damage>> damageMap = new HashMap<>(); |
| | | Map<String, LackDetailsDTO> dtoTemplateMap = new HashMap<>(); // 存储分组对应的DTO模板 |
| | |
| | | |
| | | |
| | | private void sortFlowCardIdList(List<HollowAllFlowCardVO> list) { |
| | | Pattern pattern = Pattern.compile("^NG(\\d+)([A-Za-z]+)(\\d+)$"); |
| | | Pattern pattern = Pattern.compile("^(NG|R)(\\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("获取到的流程卡不符合校验规则"); |
| | | log.info("获取到的流程卡不符合校验规则:流程卡A:{},流程卡B:{}", v1.getFlowCardId(), v2.getFlowCardId()); |
| | | return -1; |
| | | } |
| | | |
| | | // 提取部分 |
| | | 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)); |
| | | BigInteger order1 = new BigInteger(m1.group(2)); |
| | | BigInteger order2 = new BigInteger(m2.group(2)); |
| | | String layer1 = m1.group(3); |
| | | String layer2 = m2.group(3); |
| | | BigInteger seq1 = new BigInteger(m1.group(4)); |
| | | BigInteger seq2 = new BigInteger(m2.group(4)); |
| | | |
| | | // 优先级排序 |
| | | int cmp = order1.compareTo(order2); |