From 7ee68df04b7a169d51ab95ad9955276c9aff6ee1 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期一, 22 九月 2025 09:44:34 +0800
Subject: [PATCH] 流程卡查询界面修改表格下方汇总方式

---
 north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java |  498 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 424 insertions(+), 74 deletions(-)

diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
index 724fdb3..c579340 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
@@ -23,6 +23,7 @@
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.sql.Date;
+import java.sql.SQLOutput;
 import java.time.LocalDate;
 import java.util.*;
 import java.util.function.Function;
@@ -137,7 +138,7 @@
     }
 
     //娴佺▼鍗¤繘搴︽柟娉�
-    public Map<String, Object> processCardProgressSv(String orderId, List<Integer> columns) {
+    public Map<String, Object> processCardProgressSv(String orderId, List<String> columns) {
         Map<String, Object> map = new HashMap<>();
         //鑾峰彇琛ㄦ牸鍐呭鏁版嵁
         List<Map<String, String>> dataList = reportMapper.processCardProgressMp(orderId);
@@ -148,6 +149,7 @@
 
         map.put("title", uniqueList);
         Map<String,Integer> clos = new HashMap<>();
+        HashMap<String,HashMap<String,Map<String, Integer>>> rowCount = new HashMap<String,HashMap<String,Map<String, Integer>>>();
         for (int i=0;i<uniqueList.size();i++){
             //鏍规嵁娴佺▼鏌ヨ鍩虹鏁版嵁
             BasicData basicData =  basicDataMapper.selectOne(
@@ -156,81 +158,101 @@
                             .eq("basic_name",uniqueList.get(i).get("process"))
                             .last("limit 1")
             );
-            //鍒ゆ柇纾ㄨ竟鍜岀(杈瑰悗宸ュ簭
+
+            //鍒ゆ柇澶硅兌鍜屽す鑳跺悗宸ュ簭
             //Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")
             if(Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")){
-                clos.put(uniqueList.get(i).get("process"), 15+i);
+                clos.put(uniqueList.get(i).get("process"), 14+i);
             }
             //鍒ゆ柇涓┖鍜屼腑绌哄悗宸ュ簭
             //Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")
             if(Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")){
-                columns.add(15+i);
+                columns.add("reportWorkQuantity."+uniqueList.get(i).get("process"));
             }
         }
 
 
         List<Map<String, Object>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId);
-        List<Map<String, Integer>> rowCount = new ArrayList<>();
-        columns.forEach(col -> {
-            getRowCount.forEach(row -> {
-                Map<String, Integer> getRow = new HashMap<>();
-                // { row: 0, col: 1, rowspan: 3, colspan: 0},
-                getRow.put("row", ((Number) row.get("RowNum")).intValue());
-                getRow.put("col", col);
-                getRow.put("rowspan", ((Number) row.get("rowCount")).intValue());
-                getRow.put("colspan", 0);
-                rowCount.add(getRow);
-            });
+        HashMap<Integer,Map<String, Object>> getRowCountMap = new HashMap<>();
+        getRowCount.forEach(col -> {
+            Integer getRowCountOrderNumber = ((Number) col.get("order_number")).intValue();
+            getRowCountMap.put(getRowCountOrderNumber, col);
         });
-        if(!clos.isEmpty()){
-            //寰幆缁撴灉
-            for (int i=0;i<dataList.size();i++ ) {
-                Map<String, String> data = JSON.parseObject(dataList.get(i).get("reportWorkQuantity"),
-                        new TypeReference<Map<String, String>>() {
-                        });
-                Map<String, String> dataShow = JSON.parseObject(dataList.get(i).get("reportWorkQuantityShow"),
-                        new TypeReference<Map<String, String>>() {
-                        });
-               //鍒ゆ柇鍚庡伐搴忔娴佺▼鍗″彿鏄惁鏈夋鐮�
-                List<DamageDetails> hasBreak = damageDetailsMapper
-                        .selectList(new LambdaQueryWrapper<DamageDetails>()
-                                .eq(DamageDetails::getProcessId, dataList.get(i).get("processId"))
-                                .eq(DamageDetails::getOrderNumber, dataList.get(i).get("order_number"))
-                                .eq(DamageDetails::getTechnologyNumber, dataList.get(i).get("technology_number"))
-                                .eq(DamageDetails::getPatchStatus, 0)
-                                .gt(DamageDetails::getBreakageQuantity,0)
 
-                        );
-                if(!hasBreak.isEmpty()){
-                    int finalI = i;
-                    data.forEach((thisProcess, index)->{
-                        String behindProcess = orderProcessDetailMapper.getBehindProcess(
-                                dataList.get(finalI).get("processId"),
-                                String.valueOf(dataList.get(finalI).get("order_number")),
-                                String.valueOf(dataList.get(finalI).get("technology_number")),
-                                thisProcess,
-                                orderId
-                        );
-                        System.out.println(behindProcess);
-                        System.out.println("--------");
-                        if(behindProcess!=null &&!behindProcess.isEmpty()){
-                            Integer behindDamageSum = damageDetailsMapper.getBehindDamageSum(
-                                    dataList.get(finalI).get("processId"),
-                                    String.valueOf(dataList.get(finalI).get("order_number")),
-                                    String.valueOf(dataList.get(finalI).get("technology_number")),
-                                    behindProcess
-                            );
-                            if(behindDamageSum>0){
-                                data.put(thisProcess, String.valueOf(Integer.parseInt(data.get(thisProcess) )- behindDamageSum));
-                                dataShow.put(thisProcess, String.valueOf(Integer.parseInt(dataShow.get(thisProcess) )- behindDamageSum));
-                            }
+        //寰幆缁撴灉
+        for (int i=0;i<dataList.size();i++ ) {
+            Integer orderNumber = Integer.parseInt(String.valueOf(dataList.get(i).get("order_number")));
+            Integer technologyNumber = Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number")));
+            int finalI1 = i;
+            columns.forEach(col -> {
+                if(rowCount.get(col) == null){
+                    rowCount.put(col, new HashMap<String,Map<String,Integer>>());
+                }
 
-                        }
-                    });
-
+                if(getRowCountMap.get(orderNumber) != null){
+                    Map<String,Object> row = getRowCountMap.get(orderNumber);
+                    Map<String, Integer> getRow = new HashMap<>();
+                    //鍒ゆ柇褰撳墠姝ゆ 鏄惁涓虹涓�琛� 骞朵笖鐩稿悓搴忓彿
+                    if(technologyNumber==1){
+                        getRow.put("rowspan", ((Number) row.get("rowCount")).intValue());
+                        getRow.put("colspan", 1);
+                    }else{
+                        getRow.put("rowspan", 0);
+                        getRow.put("colspan", 0);
+                    }
+                    rowCount.get(col).put(finalI1+"_"+col, getRow);
                 }
 
 
+            });
+
+
+            Map<String, String> data = JSON.parseObject(dataList.get(i).get("reportWorkQuantity"),
+                    new TypeReference<Map<String, String>>() {
+                    });
+            Map<String, String> dataShow = JSON.parseObject(dataList.get(i).get("reportWorkQuantityShow"),
+                    new TypeReference<Map<String, String>>() {
+                    });
+           //鍒ゆ柇鍚庡伐搴忔娴佺▼鍗″彿鏄惁鏈夋鐮�
+            List<DamageDetails> hasBreak = damageDetailsMapper
+                    .getNotReview(dataList.get(i).get("processId"),
+                            String.valueOf(dataList.get(i).get("order_number")),
+                            String.valueOf(dataList.get(i).get("technology_number"))
+                    );
+
+
+
+
+
+            if(!hasBreak.isEmpty()){
+                int finalI = i;
+                data.forEach((thisProcess, index)->{
+                    String behindProcess = orderProcessDetailMapper.getBehindProcess(
+                            dataList.get(finalI).get("processId"),
+                            String.valueOf(dataList.get(finalI).get("order_number")),
+                            String.valueOf(dataList.get(finalI).get("technology_number")),
+                            thisProcess,
+                            orderId
+                    );
+
+                    if(behindProcess!=null &&!behindProcess.isEmpty()){
+                        Integer behindDamageSum = damageDetailsMapper.getBehindDamageSum(
+                                dataList.get(finalI).get("processId"),
+                                String.valueOf(dataList.get(finalI).get("order_number")),
+                                String.valueOf(dataList.get(finalI).get("technology_number")),
+                                behindProcess,1
+                        );
+                        if(behindDamageSum>0){
+                            data.put(thisProcess, String.valueOf(Integer.parseInt(data.get(thisProcess) )- behindDamageSum));
+                            dataShow.put(thisProcess, String.valueOf(Integer.parseInt(dataShow.get(thisProcess) )- behindDamageSum));
+                        }
+
+                    }
+                });
+
+            }
+            //澶硅兌宸ュ簭鍒ゆ柇鍚堝苟琛屾暟
+            if(!clos.isEmpty()){
 
                 Integer max = orderGlassDetailMapper
                         .getMaxTechnologyNumberByGroup(dataList.get(i).get("order_id"),
@@ -242,28 +264,34 @@
                                 String.valueOf(dataList.get(i).get("order_number")),
                                 String.valueOf(dataList.get(i).get("group"))
                         );
+
                 for (String key : clos.keySet()) {
                     if(data.get(key) != null){
-
+                        if (rowCount.get("reportWorkQuantity."+key)==null){
+                            rowCount.put("reportWorkQuantity."+key, new HashMap<String,Map<String,Integer>>());
+                        }
+                        Map<String, Integer> getRow = new HashMap<>();
                        if(min == Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number")))  ){
-                            Map<String, Integer> getRow = new HashMap<>();
-                            // { row: 0, col: 1, rowspan: 3, colspan: 0},
-                            getRow.put("row", i );
-                            getRow.put("col", clos.get(key));
-                            getRow.put("rowspan", max-min+1);
-                            getRow.put("colspan", 0);
-                            rowCount.add(getRow);
+
+                           // { row: 0, col: 1, rowspan: 3, colspan: 0},
+                           //getRow.put("row", i );
+                           getRow.put("rowspan", max-min+1);
+                           getRow.put("colspan", 1);
+
                         }else{
+                           getRow.put("rowspan", 0);
+                           getRow.put("colspan", 0);
                            data.put(key,"0");
                        }
-
+                        rowCount.get("reportWorkQuantity."+key).put(i+"_reportWorkQuantity."+key, getRow);
                     }
                 }
-                dataList.get(i).put("reportWorkQuantity",JSON.toJSONString(data));
-                dataList.get(i).put("reportWorkQuantityShow",JSON.toJSONString(dataShow));
-
             }
+            dataList.get(i).put("reportWorkQuantity",JSON.toJSONString(data));
+            dataList.get(i).put("reportWorkQuantityShow",JSON.toJSONString(dataShow));
+
         }
+
 
 
 
@@ -382,7 +410,7 @@
         return map;
     }
 
-    public Map<String, Object> yieldSv(Date selectTime1, Date selectTime2, String selectProcesses, Report report) {
+    public Map<String, Object> yieldSv(String selectTime1, String selectTime2, String selectProcesses, Report report) {
         Map<String, Object> map = new HashMap<>();
         map.put("data", reportMapper.yieldMp(selectTime1, selectTime2, selectProcesses, report));
         map.put("process", productionSchedulingMapper.selectProcess());
@@ -820,14 +848,336 @@
         return resultList;
     }
 
-    public Object processCardProgressCollectSv(String orderId, List<Integer> columns) {
+    public Object processCardProgressCollectSv(String orderId, List<String> columns) {
         Map<String, Object> map = new HashMap<>();
         //鑾峰彇琛ㄦ牸鍐呭鏁版嵁
         List<Map<String, String>> dataList = reportMapper.processCardProgressCollectMp(orderId);
         //鑾峰彇琛ㄥご宸ュ簭绛涢�夋暟鎹�
         List<Map<String, String>> uniqueList = orderProcessDetailMapper.filterOrderProcess(orderId);
+        map.put("title", uniqueList);
+        Map<String,Map<String,Object>> clos = new HashMap<>();
+        for (int i=0;i<uniqueList.size();i++){
+            //鏍规嵁娴佺▼鏌ヨ鍩虹鏁版嵁
+            BasicData basicData =  basicDataMapper.selectOne(
+                    new QueryWrapper<BasicData>()
+                            .eq("basic_category","process")
+                            .eq("basic_name",uniqueList.get(i).get("process"))
+                            .last("limit 1")
+            );
+            Map<String,Object> getCol = new HashMap<>();
+            //鍒ゆ柇澶硅兌鍜屽す鑳跺悗宸ュ簭
+            //Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")
+            if(Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")){
+                getCol.put("col", 11+i);
+                getCol.put("step","stepA");
+                clos.put(uniqueList.get(i).get("process"), getCol);
+            }
+            //鍒ゆ柇涓┖鍜屼腑绌哄悗宸ュ簭
+            //Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")
+            if(Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")){
+                columns.add("reportWorkQuantity."+uniqueList.get(i).get("process"));
+                getCol.put("col", 11+i);
+                getCol.put("step","stepB");
+                clos.put(uniqueList.get(i).get("process"), getCol);
+            }
+        }
+        List<Map<String, Object>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId);
+        HashMap<String,Map<String, Object>> getRowCountMap = new HashMap<>();
+        getRowCount.forEach(col -> {
+            String getRowCountProcessId = String.valueOf(col.get("process_id"));
+            getRowCountMap.put(getRowCountProcessId, col);
+        });
+        HashMap<String,HashMap<String,Map<String, Integer>>> rowCount = new HashMap<String,HashMap<String,Map<String, Integer>>>();
+        //寰幆缁撴灉
+        for (int i=0;i<dataList.size();i++ ) {
+            String processId = String.valueOf(dataList.get(i).get("process_id"));
+            Integer technologyNumber = Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number")));
+            int finalI1 = i;
+            columns.forEach(col -> {
+                if(rowCount.get(col) == null){
+                    rowCount.put(col, new HashMap<String,Map<String,Integer>>());
+                }
+
+                if(getRowCountMap.get(processId) != null){
+                    Map<String,Object> row = getRowCountMap.get(processId);
+                    Map<String, Integer> getRow = new HashMap<>();
+                    //鍒ゆ柇褰撳墠姝ゆ 鏄惁涓虹涓�琛� 骞朵笖鐩稿悓搴忓彿
+                    if(technologyNumber==1){
+                        getRow.put("rowspan", ((Number) row.get("rowCount")).intValue());
+                        getRow.put("colspan", 1);
+                    }else{
+                        getRow.put("rowspan", 0);
+                        getRow.put("colspan", 0);
+                    }
+                    rowCount.get(col).put(finalI1+"_"+col, getRow);
+                }
+
+
+            });
+
+
+            dataList.get(i).put("reportWorkQuantityShow",dataList.get(i).get("reportWorkQuantity"));
+            Map<String, String> data = JSON.parseObject(dataList.get(i).get("reportWorkQuantity"),
+                    new TypeReference<Map<String, String>>() {
+                    });
+            Map<String, String> dataShow = JSON.parseObject(dataList.get(i).get("reportWorkQuantityShow"),
+                    new TypeReference<Map<String, String>>() {
+                    });
+            //鍒ゆ柇鍚庡伐搴忔娴佺▼鍗″彿鏄惁鏈夋鐮�
+            List<DamageDetails> hasBreak = damageDetailsMapper
+                    .getNotReview(dataList.get(i).get("process_id"),
+                            null,
+                            String.valueOf(dataList.get(i).get("technology_number"))
+                    );
+
+            if(!hasBreak.isEmpty()){
+                int finalI = i;
+                data.forEach((thisProcess, index)->{
+                    String behindProcess = orderProcessDetailMapper.getBehindProcess(
+                            dataList.get(finalI).get("process_id"),
+                            String.valueOf(dataList.get(finalI).get("order_number")),
+                            String.valueOf(dataList.get(finalI).get("technology_number")),
+                            thisProcess,
+                            orderId
+                    );
+
+                    if(behindProcess!=null &&!behindProcess.isEmpty()){
+                        Integer behindDamageSum = damageDetailsMapper.getBehindDamageSum(
+                                dataList.get(finalI).get("process_id"),
+                                String.valueOf(dataList.get(finalI).get("order_number")),
+                                String.valueOf(dataList.get(finalI).get("technology_number")),
+                                behindProcess,
+                                null
+                        );
+                        if(behindDamageSum>0){
+                            data.put(thisProcess, String.valueOf(Integer.parseInt(data.get(thisProcess) )- behindDamageSum));
+                            dataShow.put(thisProcess, String.valueOf(Integer.parseInt(dataShow.get(thisProcess) )- behindDamageSum));
+                        }
+
+                    }
+                });
+
+            }
+
+            if(!clos.isEmpty()){
+                Integer max = orderGlassDetailMapper
+                        .getMaxTechnologyNumberByGroup(dataList.get(i).get("order_id"),
+                                String.valueOf(dataList.get(i).get("order_number")),
+                                String.valueOf(dataList.get(i).get("group"))
+                        );
+                Integer min = orderGlassDetailMapper
+                        .getMinTechnologyNumberByGroup(dataList.get(i).get("order_id"),
+                                String.valueOf(dataList.get(i).get("order_number")),
+                                String.valueOf(dataList.get(i).get("group"))
+                        );
+
+                for (String key : clos.keySet()) {
+                    if(data.get(key) != null){
+                        //鍒ゆ柇鏄す鑳跺伐搴�
+                        if( clos.get(key).get("step")=="stepA"){
+                            if (rowCount.get("reportWorkQuantity."+key)==null){
+                                rowCount.put("reportWorkQuantity."+key, new HashMap<String,Map<String,Integer>>());
+                            }
+                            Map<String, Integer> getRow = new HashMap<>();
+                            if(min == Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number")))  ){
+                                getRow.put("rowspan", max-min+1);
+                                getRow.put("colspan", 1);
+                            }else{
+                                getRow.put("rowspan", 0);
+                                getRow.put("colspan", 0);
+                                data.put(key,"0");
+                            }
+                            rowCount.get("reportWorkQuantity."+key).put(i+"_reportWorkQuantity."+key, getRow);
+                        }else{//涓┖锛屼腑绌哄悗宸ュ簭
+                            //灏忕墖搴忓彿涓嶆槸1 鐨勬椂鍊欒祴鍊�0
+                            if(Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number")))  !=1){
+                                data.put(key,"0");
+                            }
+                        }
+
+                    }
+
+                }
+            }
+            dataList.get(i).put("reportWorkQuantity",JSON.toJSONString(data));
+            dataList.get(i).put("reportWorkQuantityShow",JSON.toJSONString(dataShow));
+
+        }
+
+        map.put("mergeCells", rowCount);
+
+        map.put("data",dataList);
+
+
+        return  map;
+    }
+
+    public Map<String, Object> processCardProgressReportSv(String orderId, List<String> columns) {
+        Map<String, Object> map = new HashMap<>();
+        //鑾峰彇琛ㄦ牸鍐呭鏁版嵁
+        List<Map<String, String>> dataList = reportMapper.processCardProgressReportMp(orderId);
+
+        //鑾峰彇琛ㄥご宸ュ簭绛涢�夋暟鎹�
+        List<Map<String, String>> uniqueList = orderProcessDetailMapper.filterOrderProcess(orderId);
 
         map.put("title", uniqueList);
-        return  null;
+        Map<String,Integer> clos = new HashMap<>();
+        HashMap<String,HashMap<String,Map<String, Integer>>> rowCount = new HashMap<String,HashMap<String,Map<String, Integer>>>();
+        for (int i=0;i<uniqueList.size();i++){
+            //鏍规嵁娴佺▼鏌ヨ鍩虹鏁版嵁
+            BasicData basicData =  basicDataMapper.selectOne(
+                    new QueryWrapper<BasicData>()
+                            .eq("basic_category","process")
+                            .eq("basic_name",uniqueList.get(i).get("process"))
+                            .last("limit 1")
+            );
+
+            //鍒ゆ柇澶硅兌鍜屽す鑳跺悗宸ュ簭
+            //Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")
+            if(Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")){
+                clos.put(uniqueList.get(i).get("process"), 14+i);
+            }
+            //鍒ゆ柇涓┖鍜屼腑绌哄悗宸ュ簭
+            //Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")
+            if(Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")){
+                columns.add("reportWorkQuantity."+uniqueList.get(i).get("process"));
+            }
+        }
+
+
+        List<Map<String, Object>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId);
+        HashMap<Integer,Map<String, Object>> getRowCountMap = new HashMap<>();
+        getRowCount.forEach(col -> {
+            Integer getRowCountOrderNumber = ((Number) col.get("order_number")).intValue();
+            getRowCountMap.put(getRowCountOrderNumber, col);
+        });
+
+        //寰幆缁撴灉
+        for (int i=0;i<dataList.size();i++ ) {
+            Integer orderNumber = Integer.parseInt(String.valueOf(dataList.get(i).get("order_number")));
+            Integer technologyNumber = Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number")));
+            int finalI1 = i;
+            columns.forEach(col -> {
+                if(rowCount.get(col) == null){
+                    rowCount.put(col, new HashMap<String,Map<String,Integer>>());
+                }
+
+                if(getRowCountMap.get(orderNumber) != null){
+                    Map<String,Object> row = getRowCountMap.get(orderNumber);
+                    Map<String, Integer> getRow = new HashMap<>();
+                    //鍒ゆ柇褰撳墠姝ゆ 鏄惁涓虹涓�琛� 骞朵笖鐩稿悓搴忓彿
+                    if(technologyNumber==1){
+                        getRow.put("rowspan", ((Number) row.get("rowCount")).intValue());
+                        getRow.put("colspan", 1);
+                    }else{
+                        getRow.put("rowspan", 0);
+                        getRow.put("colspan", 0);
+                    }
+                    rowCount.get(col).put(finalI1+"_"+col, getRow);
+                }
+
+
+            });
+
+
+            Map<String, String> data = JSON.parseObject(dataList.get(i).get("reportWorkQuantity"),
+                    new TypeReference<Map<String, String>>() {
+                    });
+            Map<String, String> dataShow = JSON.parseObject(dataList.get(i).get("reportWorkQuantityShow"),
+                    new TypeReference<Map<String, String>>() {
+                    });
+            //鍒ゆ柇鍚庡伐搴忔娴佺▼鍗″彿鏄惁鏈夋鐮�
+            List<DamageDetails> hasBreak = damageDetailsMapper
+                    .getNotReview(dataList.get(i).get("processId"),
+                            String.valueOf(dataList.get(i).get("order_number")),
+                            String.valueOf(dataList.get(i).get("technology_number"))
+                    );
+
+
+
+
+
+            if(!hasBreak.isEmpty()){
+                int finalI = i;
+                data.forEach((thisProcess, index)->{
+                    String behindProcess = orderProcessDetailMapper.getBehindProcess(
+                            dataList.get(finalI).get("processId"),
+                            String.valueOf(dataList.get(finalI).get("order_number")),
+                            String.valueOf(dataList.get(finalI).get("technology_number")),
+                            thisProcess,
+                            orderId
+                    );
+
+                    if(behindProcess!=null &&!behindProcess.isEmpty()){
+                        Integer behindDamageSum = damageDetailsMapper.getBehindDamageSum(
+                                dataList.get(finalI).get("processId"),
+                                String.valueOf(dataList.get(finalI).get("order_number")),
+                                String.valueOf(dataList.get(finalI).get("technology_number")),
+                                behindProcess,1
+                        );
+                        if(behindDamageSum>0){
+                            data.put(thisProcess, String.valueOf(Integer.parseInt(data.get(thisProcess) )- behindDamageSum));
+                            dataShow.put(thisProcess, String.valueOf(Integer.parseInt(dataShow.get(thisProcess) )- behindDamageSum));
+                        }
+
+                    }
+                });
+
+            }
+            //澶硅兌宸ュ簭鍒ゆ柇鍚堝苟琛屾暟
+            if(!clos.isEmpty()){
+
+                Integer max = orderGlassDetailMapper
+                        .getMaxTechnologyNumberByGroup(dataList.get(i).get("order_id"),
+                                String.valueOf(dataList.get(i).get("order_number")),
+                                String.valueOf(dataList.get(i).get("group"))
+                        );
+                Integer min = orderGlassDetailMapper
+                        .getMinTechnologyNumberByGroup(dataList.get(i).get("order_id"),
+                                String.valueOf(dataList.get(i).get("order_number")),
+                                String.valueOf(dataList.get(i).get("group"))
+                        );
+
+                for (String key : clos.keySet()) {
+                    if(data.get(key) != null){
+                        if (rowCount.get("reportWorkQuantity."+key)==null){
+                            rowCount.put("reportWorkQuantity."+key, new HashMap<String,Map<String,Integer>>());
+                        }
+                        Map<String, Integer> getRow = new HashMap<>();
+                        if(min == Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number")))  ){
+
+                            // { row: 0, col: 1, rowspan: 3, colspan: 0},
+                            //getRow.put("row", i );
+                            getRow.put("rowspan", max-min+1);
+                            getRow.put("colspan", 1);
+
+                        }else{
+                            getRow.put("rowspan", 0);
+                            getRow.put("colspan", 0);
+                            data.put(key,"0");
+                        }
+                        rowCount.get("reportWorkQuantity."+key).put(i+"_reportWorkQuantity."+key, getRow);
+                    }
+                }
+            }
+            dataList.get(i).put("reportWorkQuantity",JSON.toJSONString(data));
+            dataList.get(i).put("reportWorkQuantityShow",JSON.toJSONString(dataShow));
+
+        }
+
+
+
+
+        map.put("data",dataList );
+        map.put("mergeCells", rowCount);
+
+        return map;
+    }
+
+    public Map<String, Object> yieldProcessSv(String selectTime1, String selectTime2, Report report) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("data", reportMapper.yieldProcessMp(selectTime1, selectTime2, report));
+        map.put("process", productionSchedulingMapper.selectProcess());
+        return map;
     }
 }

--
Gitblit v1.8.0