guoyujie
2025-06-09 2c98be64470f8298d3083ce337b0ffb948bee5f7
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -304,8 +304,11 @@
        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<>();
            for (FlowCard flowCard : flowCardList) {
                String processId = flowCard.getProcessId();
                Integer orderNumber = flowCard.getOrderNumber();
                String uniqueKey = processId + "|" + orderNumber;  // 用特殊字符连接防止冲突
                Map<String, Object> itemmap = new HashMap<>();
                //流程卡表头表尾数据
                //是否传入合并层数
@@ -323,11 +326,11 @@
                    } else {
                        if (merge.equals("1") && flowCard.getMerge().equals(1)) {
                            // 检查是否已经处理过该 processId,如果处理过则跳过
                            if (processedProcessIds.contains(flowCard.getProcessId())) {
                            if (processedKeys.contains(uniqueKey)) {
                                continue;
                            }
                            // 将该 processId 加入已处理集合
                            processedProcessIds.add(flowCard.getProcessId());
                            processedKeys.add(uniqueKey);
                            itemmap.put("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()), flowCard.getGlassChild(), flowCard.getProcess(), flowCard.getOrderId()));
                            List<Map<String, Object>> detailList = flowCardMapper.getDetailListMerge(flowCard.getProcessId(), flowCard.getProcess());
@@ -400,11 +403,14 @@
        }
        List<FlowCard> flowCardList = flowCardMapper.getFlowCardListPrintProject(printProject);
        if (!flowCardList.isEmpty()) {
            Set<String> processedProcessIds = new HashSet<>();  // 用来存放已处理过的 processId
            Set<String> processedKeys = new HashSet<>();
            for (FlowCard flowCard : flowCardList) {
                Map<String, Object> itemmap = new HashMap<>();
                String processId = flowCard.getProcessId();
                Integer orderNumber = flowCard.getOrderNumber();
                String uniqueKey = processId + "|" + orderNumber;  // 用特殊字符连接防止冲突
                //是否包含切割
                //boolean containsCutting = flowCard.getProcess().contains("切割");
                String processSub = flowCard.getProcess().substring(0, 2);
@@ -425,11 +431,11 @@
                    if (flowCard.getPatchState().equals(0)) {
                        if (merge.equals("1") && flowCard.getMerge().equals(1)) {
                            // 检查是否已经处理过该 processId,如果处理过则跳过
                            if (processedProcessIds.contains(flowCard.getProcessId())) {
                            if (processedKeys.contains(uniqueKey)) {
                                continue;
                            }
                            // 将该 processId 加入已处理集合
                            processedProcessIds.add(flowCard.getProcessId());
                            processedKeys.add(uniqueKey);
                            itemmap.put("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()), flowCard.getGlassChild(), flowCard.getProcess(), flowCard.getOrderId()));
                            List<Map<String, Object>> detailList = flowCardMapper.getDetailListMerge(flowCard.getProcessId(), flowCard.getProcess());
@@ -589,14 +595,15 @@
        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 processId = flowCard.getProcessId();
                    Integer orderNumber = flowCard.getOrderNumber();
                    String uniqueKey = processId + "|" + orderNumber;  // 用特殊字符连接防止冲突
                    // 检查是否已经处理过该 processId,如果处理过则跳过
                    if (processedProcessIds.contains(processId)) {
                    if (processedKeys.contains(uniqueKey)) {
                        continue;
                    }
                    Map<String, Object> itemmap = new HashMap<>();
@@ -604,7 +611,7 @@
                    list.add(itemmap);
                    // 将该 processId 加入已处理集合
                    processedProcessIds.add(processId);
                    processedKeys.add(uniqueKey);
                }
            } else {//小片标签
                for (FlowCard flowCard : flowCardList) {
@@ -624,14 +631,15 @@
        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 processId = flowCard.getProcessId();
                    Integer orderNumber = flowCard.getOrderNumber();
                    String uniqueKey = processId + "|" + orderNumber;  // 用特殊字符连接防止冲突
                    // 检查是否已经处理过该 processId,如果处理过则跳过
                    if (processedProcessIds.contains(processId)) {
                    if (processedKeys.contains(uniqueKey)) {
                        continue;
                    }
                    Map<String, Object> itemmap = new HashMap<>();
@@ -639,7 +647,7 @@
                    list.add(itemmap);
                    // 将该 processId 加入已处理集合
                    processedProcessIds.add(processId);
                    processedKeys.add(uniqueKey);
                }
            } else {//小片标签
                for (FlowCard flowCard : flowCardList) {
@@ -1008,7 +1016,6 @@
        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
            for (FlowCard flowCard : flowCardList) {
                Map<String, Object> itemmap = new HashMap<>();
                //是否是工程明细打印