| 
					
				 | 
			
			
				@@ -880,14 +880,11 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return result; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             String load="D:\\单证模板\\预装箱单新.xlsx"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            File file=new File(load); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            TemplateExportParams templateExcelConstants=new TemplateExportParams(file.getAbsolutePath(),true,"预装箱单汇总"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Map<Integer, Map<String, Object>> maps = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            templateExcelConstants.setColForEach(true);//横向循环 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Workbook workbook = ExcelExportUtil.exportExcel(maps,templateExcelConstants); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            TemplateExportParams params = new TemplateExportParams(load); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Workbook workbook = ExcelExportUtil.exportExcel(params, new HashMap<>()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            refreshSheet(workbook,pageLists);//配置某列数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             ServletOutputStream outputStream = response.getOutputStream(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             workbook.write(outputStream); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            refreshSheet(workbook,pageLists);//配置某列数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             result.setCode(200); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             result.setResult(pageLists.get(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             result.setMessage("导出成功!"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -904,12 +901,36 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     protected static void refreshSheet(Workbook workbook,List<SyPreAssembledPackingListVo> mains ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        CellStyle cellStyle = workbook.createCellStyle();//设置单元格样式 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle.setAlignment(HorizontalAlignment.CENTER);//左右居中 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//上下居中 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle.setFillForegroundColor(IndexedColors.YELLOW.getIndex());//设置前景色 现在是浅绿色 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle.setFillBackgroundColor(HSSFColor.HSSFColorPredefined.YELLOW.getIndex());//设置背景色 现在是浅绿色 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle.setBorderBottom(BorderStyle.THIN);//边框 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle.setBorderTop(BorderStyle.THIN);//边框 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle.setBorderLeft(BorderStyle.THIN);//边框 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle.setBorderRight(BorderStyle.THIN);//边框 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);//必须设置 否则无效 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        CellStyle cellStyle2 = workbook.createCellStyle();//设置单元格样式 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle2.setAlignment(HorizontalAlignment.CENTER);//左右居中 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle2.setWrapText(true);//自动换行 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle2.setBorderBottom(BorderStyle.THIN);//边框 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle2.setBorderTop(BorderStyle.THIN);//边框 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle2.setBorderLeft(BorderStyle.THIN);//边框 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle2.setBorderRight(BorderStyle.THIN);//边框 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle2.setVerticalAlignment(VerticalAlignment.CENTER);//上下居中 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        cellStyle2.setFillPattern(FillPatternType.SOLID_FOREGROUND);//必须设置 否则无效 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Iterator sheets=workbook.sheetIterator(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        workbook.setSheetName(0,"测试数据"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (sheets.hasNext()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Sheet sheet=(Sheet) sheets.next(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            System.out.println("sheets.size\t"+sheet); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Map<String,Object> maps=new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            SyPreAssembledPackingListVo sysCount=new SyPreAssembledPackingListVo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            SyPreAssembledPackingListVo sysCount=new SyPreAssembledPackingListVo();//所有数据的汇总 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             sysCount.setTotal(new BigDecimal("0")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             sysCount.setTotalBoxes(new BigDecimal("0")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             sysCount.setTotalGrossWeight(new BigDecimal("0")); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -936,17 +957,70 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             int num=0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for (String key : maps.keySet()) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<SyPreAssembledPackingListVo> sys = (List<SyPreAssembledPackingListVo>) maps.get(key); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                SyPreAssembledPackingListVo sysGroupCount=new SyPreAssembledPackingListVo();//单个分组的汇总 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sysGroupCount.setTotal(new BigDecimal("0")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sysGroupCount.setTotalBoxes(new BigDecimal("0")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sysGroupCount.setTotalGrossWeight(new BigDecimal("0")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sysGroupCount.setTotalNetWeight(new BigDecimal("0")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sysGroupCount.setTotalVolume(new BigDecimal("0")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 for (SyPreAssembledPackingListVo sy : sys){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    Row row = sheet.createRow( num);//列 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Row row = sheet.createRow(num+1);//列 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sysGroupCount.setTotal(sysGroupCount.getTotal().add(sy.getTotal())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sysGroupCount.setTotalBoxes(sysGroupCount.getTotalBoxes().add(sy.getTotalBoxes())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sysGroupCount.setTotalGrossWeight(sysGroupCount.getTotalGrossWeight().add(sy.getTotalGrossWeight())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sysGroupCount.setTotalNetWeight(sysGroupCount.getTotalNetWeight().add(sy.getTotalNetWeight())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    sysGroupCount.setTotalVolume(sysGroupCount.getTotalVolume().add(sy.getTotalVolume())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     String [] strs=sy.str().split(","); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     for (int i=0; i<strs.length;i++){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        Cell cell = row.createCell(i+1);//横向 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        cell.setCellValue("1134134"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        System.out.println("strs"+i+""+strs[i]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        Cell cell = row.createCell(i);//横向 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        cell.setCellStyle(cellStyle2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        cell.setCellValue(strs[i]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        //System.out.println("strs"+i+""+strs[i]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     num++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Row row = sheet.createRow(num+1);//数量 	箱数	总净重	总毛重	总体积 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Cell cell = row.createCell(9); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell.setCellValue("分组合计"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Cell cell1 = row.createCell(10); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell1.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell1.setCellValue(sysGroupCount.getTotal().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Cell cell2 = row.createCell(11); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell2.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell2.setCellValue(sysGroupCount.getTotalBoxes().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Cell cell3 = row.createCell(12); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell3.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell3.setCellValue(sysGroupCount.getTotalNetWeight().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Cell cell4 = row.createCell(13); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell4.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell4.setCellValue(sysGroupCount.getTotalGrossWeight().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Cell cell5 = row.createCell(14); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell5.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                cell5.setCellValue(sysGroupCount.getTotalVolume().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                num++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Row row = sheet.createRow(num+1);//数量 	箱数	总净重	总毛重	总体积 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Cell cell = row.createCell(9); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell.setCellValue("所有数据合计"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Cell cell1 = row.createCell(10); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell1.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell1.setCellValue(sysCount.getTotal().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Cell cell2 = row.createCell(11); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell2.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell2.setCellValue(sysCount.getTotalBoxes().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Cell cell3 = row.createCell(12); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell3.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell3.setCellValue(sysCount.getTotalNetWeight().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Cell cell4 = row.createCell(13); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell4.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell4.setCellValue(sysCount.getTotalGrossWeight().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Cell cell5 = row.createCell(14); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell5.setCellStyle(cellStyle); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            cell5.setCellValue(sysCount.getTotalVolume().toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            num++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |