| | |
| | | |
| | | |
| | | 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); |