| | |
| | | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | Set<String> processedProcessIds = new HashSet<>(); // 用来存放已处理过的 processId |
| | | Set<String> processedKeys = new HashSet<>(); |
| | | |
| | | if (lableType != 2) {//成品标签 |
| | | for (FlowCard flowCard : flowCardList) { |
| | | String orderId = flowCard.getOrderId(); |
| | | String processId = flowCard.getProcessId(); |
| | | String orderNumber = flowCard.getOrderNumber().toString(); |
| | | String uniqueKey = processId + "|" + orderNumber; // 用特殊字符连接防止冲突 |
| | | if (processId!=null){ |
| | | // 检查是否已经处理过该 processId,如果处理过则跳过 |
| | | if (processedProcessIds.contains(processId) && processedProcessIds.contains(orderNumber)) { |
| | | if (processedKeys.contains(uniqueKey)) { |
| | | continue; |
| | | } |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | |
| | | list.add(itemmap); |
| | | |
| | | // 将该 processId 加入已处理集合 |
| | | processedProcessIds.add(processId); |
| | | processedProcessIds.add(orderNumber); |
| | | processedKeys.add(uniqueKey); |
| | | } else{ |
| | | |
| | | Map<String, Object> itemmap = new HashMap<>(); |