huangfuli 3 年 前
コミット
4936e9628a

+ 19 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/ExportVView.java

@@ -67,6 +67,22 @@ public class ExportVView {
      * 杂质
      */
     private String impurity;
+    /**
+     * 霉变粒
+     */
+    private String mildewGrain;
+    /**
+     * 不完善粒
+     */
+    private String imperfectGrain;
+    /**
+     * 容重
+     */
+    private String bulkDensity;
+    /**
+     * 热损伤
+     */
+    private String jiaorenli;
     /**
      * 车牌号
      */
@@ -204,15 +220,15 @@ public class ExportVView {
     /**
      * 应收金额(元/吨)
      */
-    private Float amountIngReceivable;
+    private Double amountIngReceivable;
     /**
      * 已收金额(元/吨)
      */
-    private Float amountEdReceivable;
+    private Double amountEdReceivable;
     /**
      * 未收金额(元/吨)
      */
-    private Float amountNotReceivable;
+    private Double amountNotReceivable;
     /**
      * 收款日期
      */

+ 138 - 32
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PaymentManagementServiceImpl.java

@@ -858,6 +858,24 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         // 下styleDetailTitle
         styleDetail.setBorderBottom(HSSFCellStyle.BORDER_THIN);
 
+        HSSFCellStyle contextstyle = wb.createCellStyle();
+        // 指定单元格居中对齐
+        contextstyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        // 指定单元格垂直居中对齐
+        contextstyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        contextstyle.setWrapText(true);
+        // 设置单元格字体
+        contextstyle.setFont(fontDetail);
+        // 右边框
+        contextstyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        // 左边框
+        contextstyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+        // 上边框
+        contextstyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
+        // 下styleDetailTitle
+        contextstyle.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+
         HSSFCellStyle styleDetailYellow = wb.createCellStyle();
         // 指定单元格居中对齐
         styleDetailYellow.setAlignment(HSSFCellStyle.ALIGN_CENTER);
@@ -926,7 +944,11 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         sheet.setColumnWidth(24, 12 * 256 + 184);
         sheet.setColumnWidth(25, 12 * 256 + 184);
         sheet.setColumnWidth(26, 12 * 256 + 184);
-        sheet.setColumnWidth(27, 1 * 256 + 184);
+        sheet.setColumnWidth(27, 12 * 256 + 184);
+        sheet.setColumnWidth(28, 12 * 256 + 184);
+        sheet.setColumnWidth(29, 12 * 256 + 184);
+        sheet.setColumnWidth(30, 12 * 256 + 184);
+        sheet.setColumnWidth(31, 1 * 256 + 184);
 
         // 创建单元格对象
         HSSFCell cell = null;
@@ -1000,6 +1022,15 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         cell.setCellStyle(styleTitle);
         cell = row0.createCell(26);
         cell.setCellStyle(styleTitle);
+        cell = row0.createCell(27);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(28);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(29);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(30);
+        cell.setCellStyle(styleTitle);
+
         rownum++;
 
         HSSFRow row1 = sheet.createRow((int) rownum);
@@ -1041,45 +1072,57 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
         cell.setCellValue("杂质");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(13);
-        cell.setCellValue("车牌号");
+        cell.setCellValue("霉变粒");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(14);
-        cell.setCellValue("净重单价");
+        cell.setCellValue("不完善粒");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(15);
-        cell.setCellValue("重");
+        cell.setCellValue("重");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(16);
-        cell.setCellValue("皮重");
+        cell.setCellValue("热损伤");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(17);
-        cell.setCellValue("扣重");
+        cell.setCellValue("车牌号");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(18);
-        cell.setCellValue("净重");
+        cell.setCellValue("净重单价");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(19);
-        cell.setCellValue("扣单价");
+        cell.setCellValue("毛重");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(20);
-        cell.setCellValue("纯重单价");
+        cell.setCellValue("皮重");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(21);
-        cell.setCellValue("重");
+        cell.setCellValue("重");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(22);
-        cell.setCellValue("合计应付");
+        cell.setCellValue("净重");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(23);
-        cell.setCellValue("实付金额");
+        cell.setCellValue("扣单价");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(24);
-        cell.setCellValue("姓名");
+        cell.setCellValue("纯重单价");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(25);
-        cell.setCellValue("卡号");
+        cell.setCellValue("纯重");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(26);
+        cell.setCellValue("合计应付");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(27);
+        cell.setCellValue("实付金额");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(28);
+        cell.setCellValue("姓名");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(29);
+        cell.setCellValue("卡号");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(30);
         cell.setCellValue("开户支行");
         cell.setCellStyle(styleDetail);
 
@@ -1090,6 +1133,15 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
 
         // 详情信息
         if (org.apache.commons.collections.CollectionUtils.isNotEmpty(paymentManagement.getPaymentManagementList())) {
+            Double waterContentTotal = 0d;//水分合计
+            Double impurityTotal = 0d;//杂质合计
+            Double mildewGrainTotal = 0d;//霉变粒合计
+            Double imperfectGrainTotal = 0d;//不完善粒合计
+            Double bulkDensityTotal = 0d;//容重合计
+            Double jiaorenliTotal = 0d;//热损伤合计
+            Double netWeightPriceTotal = 0d;//单价合计
+            Double netWeightTotal = 0d;//净重合计
+            Double amountIngPayableTotal = 0d;//应收合计
             for (int i = 0; i < paymentManagement.getPaymentManagementList().size(); i++) {
                 PaymentManagement paymentManagement1 = paymentManagement.getPaymentManagementList().get(i);
                 paymentManagement1.setIdentityAuthenticationInfo(iIdentityAuthenticationInfoService.selectById(paymentManagement1.getIdentityId()));
@@ -1131,16 +1183,30 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
                 cell = rowx.createCell(10);
                 cell.setCellValue(editString(paymentManagement1.getQualityInspectionManagement().getGrade()));
                 cell.setCellStyle(styleDetail);
+                HSSFDataFormat df = wb.createDataFormat(); // 此处设置数据格式
+                contextstyle.setDataFormat(df.getBuiltinFormat("#,##0.00"));//保留两位小数点
                 cell = rowx.createCell(11);
-                cell.setCellValue(editString(paymentManagement1.getQualityInspectionManagement().getWaterContent()));
-                cell.setCellStyle(styleDetail);
+                cell.setCellValue(Double.parseDouble(paymentManagement1.getQualityInspectionManagement().getWaterContent()!=null?paymentManagement1.getQualityInspectionManagement().getWaterContent():"0"));
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(12);
-                cell.setCellValue(editString(paymentManagement1.getQualityInspectionManagement().getImpurity()));
-                cell.setCellStyle(styleDetail);
+                cell.setCellValue(Double.parseDouble(paymentManagement1.getQualityInspectionManagement().getImpurity()!=null?paymentManagement1.getQualityInspectionManagement().getImpurity():"0"));
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(13);
+                cell.setCellValue(Double.parseDouble(paymentManagement1.getQualityInspectionManagement().getMildewGrain()!=null?paymentManagement1.getQualityInspectionManagement().getMildewGrain():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(14);
+                cell.setCellValue(Double.parseDouble(paymentManagement1.getQualityInspectionManagement().getImperfectGrain()!=null?paymentManagement1.getQualityInspectionManagement().getImperfectGrain():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(15);
+                cell.setCellValue(Double.parseDouble(paymentManagement1.getQualityInspectionManagement().getBulkDensity()!=null?paymentManagement1.getQualityInspectionManagement().getBulkDensity():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(16);
+                cell.setCellValue(Double.parseDouble(paymentManagement1.getQualityInspectionManagement().getJiaorenli()!=null?paymentManagement1.getQualityInspectionManagement().getJiaorenli():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(17);
                 cell.setCellValue(editString(paymentManagement1.getCarNo()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(14);
+                cell = rowx.createCell(18);
 //                if("潮粮".equals(paymentManagement1.getType())){
 //                    cell.setCellValue(new Formatter().format("%.3f", editFloat(paymentManagement1.getTidalGrainPrice())).toString());
 //
@@ -1151,46 +1217,86 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
 //                }
                 cell.setCellValue(new Formatter().format("%.3f", editFloat(paymentManagement1.getTidalGrainPrice())).toString());
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(15);
+                cell = rowx.createCell(19);
                 cell.setCellValue(editFloat(paymentManagement1.getGrossWeight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(16);
+                cell = rowx.createCell(20);
                 cell.setCellValue(editFloat(paymentManagement1.getTare()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(17);
+                cell = rowx.createCell(21);
                 cell.setCellValue(new Formatter().format("%.2f", editFloat(paymentManagement1.getWeightDeduction())).toString());
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(18);
+                cell = rowx.createCell(22);
                 cell.setCellValue(editFloat(paymentManagement1.getNetWeight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(19);
+                cell = rowx.createCell(23);
                 cell.setCellValue(editDouble(paymentManagement1.getUnitDeduction()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(20);
+                cell = rowx.createCell(24);
                 cell.setCellValue(new Formatter().format("%.2f", editFloat(paymentManagement1.getSolidGrainPrice())).toString());
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(21);
+                cell = rowx.createCell(25);
                 cell.setCellValue(editFloat(paymentManagement1.getPureWeight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(22);
+                cell = rowx.createCell(26);
                 cell.setCellValue(editDouble(paymentManagement1.getAmountIngPayable()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(23);
+                cell = rowx.createCell(27);
                 cell.setCellValue(editDouble(paymentManagement1.getAmountEdPayable()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(24);
+                cell = rowx.createCell(28);
                 cell.setCellValue(editString(paymentManagement1.getCustomerName()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(25);
+                cell = rowx.createCell(29);
                 cell.setCellValue(editString(paymentManagement1.getIdentityAuthenticationInfo().getBankCard()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(26);
+                cell = rowx.createCell(30);
                 cell.setCellValue(editString(paymentManagement1.getIdentityAuthenticationInfo().getBankDeposit() + "-" +paymentManagement1.getIdentityAuthenticationInfo().getBankDepositBranch()));
                 cell.setCellStyle(styleDetail);
 
+                //水分累计和
+                waterContentTotal = waterContentTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getWaterContent()!=null?paymentManagement1.getQualityInspectionManagement().getWaterContent():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
+                impurityTotal = impurityTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getImpurity()!=null?paymentManagement1.getQualityInspectionManagement().getImpurity():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
+                mildewGrainTotal = mildewGrainTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getMildewGrain()!=null?paymentManagement1.getQualityInspectionManagement().getMildewGrain():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
+                imperfectGrainTotal = imperfectGrainTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getImperfectGrain()!=null?paymentManagement1.getQualityInspectionManagement().getImperfectGrain():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
+                bulkDensityTotal = bulkDensityTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getBulkDensity()!=null?paymentManagement1.getQualityInspectionManagement().getBulkDensity():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
+                jiaorenliTotal = jiaorenliTotal + ((Double.valueOf(String.valueOf(paymentManagement1.getQualityInspectionManagement().getJiaorenli()!=null?paymentManagement1.getQualityInspectionManagement().getJiaorenli():"0"))) * (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight()))));
+                netWeightPriceTotal = netWeightPriceTotal + (Double.valueOf(String.valueOf(paymentManagement1.getTidalGrainPrice())));
+                netWeightTotal = netWeightTotal + (Double.valueOf(String.valueOf(paymentManagement1.getNetWeight())));
+                amountIngPayableTotal = amountIngPayableTotal + paymentManagement1.getAmountIngPayable();
+
                 rownum++;
             }
-
+            HSSFRow rowp = sheet.createRow((int)(rownum));
+            rowp.setHeightInPoints(20);
+
+            //水分平均值
+            cell = rowp.createCell(11);
+            cell.setCellStyle(contextstyle);
+            cell.setCellValue(waterContentTotal/netWeightTotal);
+            cell = rowp.createCell(12);
+            cell.setCellValue(impurityTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(13);
+            cell.setCellValue(mildewGrainTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(14);
+            cell.setCellValue(imperfectGrainTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(15);
+            cell.setCellValue(bulkDensityTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(16);
+            cell.setCellValue(jiaorenliTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(18);
+            cell.setCellValue(netWeightPriceTotal/paymentManagement.getPaymentManagementList().size());
+            cell.setCellStyle(contextstyle);
+            //净重合计
+            cell = rowp.createCell(22);
+            cell.setCellValue(netWeightTotal);
+            cell = rowp.createCell(26);
+            cell.setCellValue(amountIngPayableTotal);
         }
 
 

+ 289 - 117
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseBaseInfoServiceImpl.java

@@ -1407,6 +1407,13 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         return  warehouseBaseInfoList;
     }
 
+
+    /**
+     * 入库导出
+     * @param warehouseBaseInfo
+     * @param response
+     * @throws Exception
+     */
     @Override
     public void export(WarehouseBaseInfo warehouseBaseInfo, HttpServletResponse response) throws Exception {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@@ -1621,7 +1628,11 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         sheet.setColumnWidth(34, 12 * 256 + 184);
         sheet.setColumnWidth(35, 12 * 256 + 184);
         sheet.setColumnWidth(36, 12 * 256 + 184);
-        sheet.setColumnWidth(37, 1 * 256 + 184);
+        sheet.setColumnWidth(37, 12 * 256 + 184);
+        sheet.setColumnWidth(38, 12 * 256 + 184);
+        sheet.setColumnWidth(39, 12 * 256 + 184);
+        sheet.setColumnWidth(40, 12 * 256 + 184);
+        sheet.setColumnWidth(41, 1 * 256 + 184);
 
         // 创建单元格对象
         HSSFCell cell = null;
@@ -1715,6 +1726,14 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         cell.setCellStyle(styleTitle);
         cell = row0.createCell(36);
         cell.setCellStyle(styleTitle);
+        cell = row0.createCell(37);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(38);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(39);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(40);
+        cell.setCellStyle(styleTitle);
         rownum++;
 
         HSSFRow row1 = sheet.createRow((int) rownum);
@@ -1762,69 +1781,81 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         cell.setCellValue("杂质");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(15);
-        cell.setCellValue("车牌号");
+        cell.setCellValue("霉变粒");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(16);
-        cell.setCellValue("箱号1");
+        cell.setCellValue("不完善粒");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(17);
-        cell.setCellValue("箱号2");
+        cell.setCellValue("容重");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(18);
-        cell.setCellValue("封号1");
+        cell.setCellValue("热损伤");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(19);
-        cell.setCellValue("封号2");
+        cell.setCellValue("车牌号");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(20);
+        cell.setCellValue("箱号1");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(21);
+        cell.setCellValue("箱号2");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(22);
+        cell.setCellValue("封号1");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(23);
+        cell.setCellValue("封号2");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(24);
         cell.setCellValue("净重单价");
         cell.setCellStyle(contextstyle);
-        cell = row1.createCell(21);
+        cell = row1.createCell(25);
         cell.setCellValue("毛重");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(22);
+        cell = row1.createCell(26);
         cell.setCellValue("皮重");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(23);
+        cell = row1.createCell(27);
         cell.setCellValue("扣重");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(24);
+        cell = row1.createCell(28);
         cell.setCellValue("净重");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(25);
+        cell = row1.createCell(29);
         cell.setCellValue("发货净重");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(26);
+        cell = row1.createCell(30);
         cell.setCellValue("发货库");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(27);
+        cell = row1.createCell(31);
         cell.setCellValue("运输单价");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(28);
+        cell = row1.createCell(32);
         cell.setCellValue("运费");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(29);
+        cell = row1.createCell(33);
         cell.setCellValue("扣单价");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(30);
+        cell = row1.createCell(34);
         cell.setCellValue("纯重单价");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(31);
+        cell = row1.createCell(35);
         cell.setCellValue("纯重");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(32);
+        cell = row1.createCell(36);
         cell.setCellValue("合计应付");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(33);
+        cell = row1.createCell(37);
         cell.setCellValue("实付金额");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(34);
+        cell = row1.createCell(38);
         cell.setCellValue("姓名");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(35);
+        cell = row1.createCell(39);
         cell.setCellValue("卡号");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(36);
+        cell = row1.createCell(40);
         cell.setCellValue("开户支行");
         cell.setCellStyle(styleDetail);
 
@@ -1841,6 +1872,15 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         List<ExportVView> dataList = baseMapper.getListByCondition(pageView);
         // 详情信息
         if (!CollectionUtils.isEmpty(dataList)) {
+            Double waterContentTotal = 0d;//水分合计
+            Double impurityTotal = 0d;//杂质合计
+            Double mildewGrainTotal = 0d;//霉变粒合计
+            Double imperfectGrainTotal = 0d;//不完善粒合计
+            Double bulkDensityTotal = 0d;//容重合计
+            Double jiaorenliTotal = 0d;//热损伤合计
+            Double netWeightPriceTotal = 0d;//净重单价合计
+            Double netWeightTotal = 0d;//净重合计
+            Double amountIngPayableTotal = 0d;//合计应付合计
             for (int i = 0; i < dataList.size(); i++) {
                 ExportVView exportVView = dataList.get(i);
                 HSSFRow rowx = sheet.createRow((int) rownum);
@@ -1887,85 +1927,136 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 cell.setCellValue(editString(exportVView.getGrade()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(13);
-                cell.setCellValue(editString(exportVView.getWaterContent()));
-                cell.setCellStyle(styleDetail);
+                cell.setCellValue(Double.parseDouble(exportVView.getWaterContent()!=null?exportVView.getWaterContent():"0"));
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(14);
-                cell.setCellValue(editString(exportVView.getImpurity()));
-                cell.setCellStyle(styleDetail);
+                cell.setCellValue(Double.parseDouble(exportVView.getImpurity()!=null?exportVView.getImpurity():"0"));
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(15);
+                cell.setCellValue(Double.parseDouble(exportVView.getMildewGrain()!=null?exportVView.getMildewGrain():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(16);
+                cell.setCellValue(Double.parseDouble(exportVView.getImperfectGrain()!=null?exportVView.getImperfectGrain():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(17);
+                cell.setCellValue(Double.parseDouble(exportVView.getBulkDensity()!=null?exportVView.getBulkDensity():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(18);
+                cell.setCellValue(Double.parseDouble(exportVView.getJiaorenli()!=null?exportVView.getJiaorenli():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(19);
                 cell.setCellValue(editString(exportVView.getCarNo()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(16);
+                cell = rowx.createCell(20);
                 cell.setCellValue(editString(exportVView.getBoxNo()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(17);
+                cell = rowx.createCell(21);
                 cell.setCellValue(editString(exportVView.getBoxNoOther()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(18);
+                cell = rowx.createCell(22);
                 cell.setCellValue(editString(exportVView.getTitleNo()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(19);
+                cell = rowx.createCell(23);
                 cell.setCellValue(editString(exportVView.getTitleNoOther()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(20);
+                cell = rowx.createCell(24);
                 cell.setCellValue(Double.parseDouble(exportVView.getNetWeightPrice()!=null?exportVView.getNetWeightPrice():"0"));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(21);
+                cell = rowx.createCell(25);
                 HSSFDataFormat df = wb.createDataFormat(); // 此处设置数据格式
                 contextstyle.setDataFormat(df.getBuiltinFormat("#,##0.00"));//保留两位小数点
                 cell.setCellValue(Double.parseDouble(exportVView.getGrossWeight()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(22);
+                cell = rowx.createCell(26);
                 cell.setCellValue(Double.parseDouble(exportVView.getTare()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(23);
+                cell = rowx.createCell(27);
                 cell.setCellValue(editFloat(exportVView.getBuckleWeight()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(24);
+                cell = rowx.createCell(28);
                 cell.setCellValue(Double.parseDouble(exportVView.getNetWeight()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(25);
-                cell.setCellValue(new Formatter().format("%.2f", editDouble(exportVView.getDeliveryVolume())).toString());
+                cell = rowx.createCell(29);
+                cell.setCellValue(editDouble(exportVView.getDeliveryVolume()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(26);
+                cell = rowx.createCell(30);
                 cell.setCellValue(editString(exportVView.getSendWarehouse()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(27);
+                cell = rowx.createCell(31);
                 cell.setCellValue(new Formatter().format("%.2f", editDouble(exportVView.getTranPrice())).toString());
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(28);
+                cell = rowx.createCell(32);
                 cell.setCellValue(editFloat(exportVView.getFreight()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(29);
+                cell = rowx.createCell(33);
                 cell.setCellValue(editDouble(exportVView.getUnitDeduction()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(30);
+                cell = rowx.createCell(34);
                 cell.setCellValue(new Formatter().format("%.3f", editDouble(exportVView.getPureWeightPrice())).toString());
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(31);
+                cell = rowx.createCell(35);
                 cell.setCellValue(editFloat(exportVView.getPureWeight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(32);
-                cell.setCellValue(new Formatter().format("%.2f", editDouble(exportVView.getAmountIngPayable())).toString());
-//                cell.setCellValue(editDouble(exportVView.getAmountIngPayable()));
-                cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(33);
+                cell = rowx.createCell(36);
+                cell.setCellValue(editDouble(exportVView.getAmountIngPayable()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(37);
                 cell.setCellValue(new Formatter().format("%.2f", editDouble(exportVView.getAmountEdPayable())).toString());
 //                cell.setCellValue(editDouble(exportVView.getAmountEdPayable()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(34);
+                cell = rowx.createCell(38);
                 cell.setCellValue(editString(exportVView.getCustomerName()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(35);
+                cell = rowx.createCell(39);
                 cell.setCellValue(editString(exportVView.getCardNo()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(36);
+                cell = rowx.createCell(40);
                 cell.setCellValue(editString(exportVView.getBankDeposit() + "-" +exportVView.getBankDepositBranch()));
                 cell.setCellStyle(styleDetail);
 
+                //水分累计和
+                waterContentTotal = waterContentTotal + ((Double.valueOf(String.valueOf(exportVView.getWaterContent()!=null?exportVView.getWaterContent():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                impurityTotal = impurityTotal + ((Double.valueOf(String.valueOf(exportVView.getImpurity()!=null?exportVView.getImpurity():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                mildewGrainTotal = mildewGrainTotal + ((Double.valueOf(String.valueOf(exportVView.getMildewGrain()!=null?exportVView.getMildewGrain():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                imperfectGrainTotal = imperfectGrainTotal + ((Double.valueOf(String.valueOf(exportVView.getImperfectGrain()!=null?exportVView.getImperfectGrain():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                bulkDensityTotal = bulkDensityTotal + ((Double.valueOf(String.valueOf(exportVView.getBulkDensity()!=null?exportVView.getBulkDensity():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                jiaorenliTotal = jiaorenliTotal + ((Double.valueOf(String.valueOf(exportVView.getJiaorenli()!=null?exportVView.getJiaorenli():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                netWeightPriceTotal = netWeightPriceTotal + (Double.valueOf(String.valueOf(exportVView.getNetWeightPrice()!=null?exportVView.getNetWeightPrice():"0")));
+                netWeightTotal = netWeightTotal + (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0")));
+                amountIngPayableTotal = amountIngPayableTotal + exportVView.getAmountIngPayable();
+
                 rownum++;
             }
-
+            HSSFRow rowp = sheet.createRow((int)(rownum));
+            rowp.setHeightInPoints(20);
+            //水分平均值
+
+            cell = rowp.createCell(13);
+            cell.setCellStyle(contextstyle);
+            cell.setCellValue(waterContentTotal/netWeightTotal);
+            cell = rowp.createCell(14);
+            cell.setCellValue(impurityTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(15);
+            cell.setCellValue(mildewGrainTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(16);
+            cell.setCellValue(imperfectGrainTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(17);
+            cell.setCellValue(bulkDensityTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(18);
+            cell.setCellValue(jiaorenliTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(24);
+            cell.setCellValue(netWeightPriceTotal/dataList.size());
+            cell.setCellStyle(contextstyle);
+            //纯重合计
+            cell = rowp.createCell(28);
+            cell.setCellValue(netWeightTotal);
+            cell = rowp.createCell(36);
+            cell.setCellValue(amountIngPayableTotal);
         }
 
 
@@ -2216,7 +2307,11 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         sheet.setColumnWidth(38, 12 * 256 + 184);
         sheet.setColumnWidth(39, 12 * 256 + 184);
         sheet.setColumnWidth(40, 12 * 256 + 184);
-        sheet.setColumnWidth(41, 1 * 256 + 184);
+        sheet.setColumnWidth(41, 12 * 256 + 184);
+        sheet.setColumnWidth(42, 12 * 256 + 184);
+        sheet.setColumnWidth(43, 12 * 256 + 184);
+        sheet.setColumnWidth(44, 12 * 256 + 184);
+        sheet.setColumnWidth(45, 1 * 256 + 184);
 
         // 创建单元格对象
         HSSFCell cell = null;
@@ -2318,6 +2413,14 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         cell.setCellStyle(styleTitle);
         cell = row0.createCell(40);
         cell.setCellStyle(styleTitle);
+        cell = row0.createCell(41);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(42);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(43);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(44);
+        cell.setCellStyle(styleTitle);
         rownum++;
 
         HSSFRow row1 = sheet.createRow((int) rownum);
@@ -2368,86 +2471,94 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         cell.setCellValue("杂质");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(16);
-        cell.setCellValue("车厢号");
+        cell.setCellValue("霉变粒");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(17);
-        cell.setCellValue("箱号1");
+        cell.setCellValue("不完善粒");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(18);
-        cell.setCellValue("箱号2");
+        cell.setCellValue("容重");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(19);
-        cell.setCellValue("封号1");
+        cell.setCellValue("热损伤");
         cell.setCellStyle(styleDetail);
         cell = row1.createCell(20);
+        cell.setCellValue("车厢号");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(21);
+        cell.setCellValue("箱号1");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(22);
+        cell.setCellValue("箱号2");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(23);
+        cell.setCellValue("封号1");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(24);
         cell.setCellValue("封号2");
         cell.setCellStyle(contextstyle);
-        cell = row1.createCell(21);
+        cell = row1.createCell(25);
         cell.setCellValue("船名");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(22);
+        cell = row1.createCell(26);
         cell.setCellValue("航次");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(23);
+        cell = row1.createCell(27);
         cell.setCellValue("车牌号");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(24);
+        cell = row1.createCell(28);
         cell.setCellValue("毛重(吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(25);
+        cell = row1.createCell(29);
         cell.setCellValue("皮重(吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(26);
+        cell = row1.createCell(30);
         cell.setCellValue("出库净重(吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(27);
+        cell = row1.createCell(31);
         cell.setCellValue("反馈重量(吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(28);
+        cell = row1.createCell(32);
         cell.setCellValue("反馈日期");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(29);
+        cell = row1.createCell(33);
         cell.setCellValue("结算重量(吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(30);
+        cell = row1.createCell(34);
         cell.setCellValue("结算单价(元/吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(31);
+        cell = row1.createCell(35);
         cell.setCellValue("汽运运费(元/吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(32);
+        cell = row1.createCell(36);
         cell.setCellValue("火运运费(元/吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(33);
+        cell = row1.createCell(37);
         cell.setCellValue("船运运费(元/吨)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(34);
+        cell = row1.createCell(38);
         cell.setCellValue("运费");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(35);
+        cell = row1.createCell(39);
         cell.setCellValue("应收金额(元)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(36);
+        cell = row1.createCell(40);
         cell.setCellValue("已收金额(元)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(37);
+        cell = row1.createCell(41);
         cell.setCellValue("未收金额(元)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(38);
+        cell = row1.createCell(42);
         cell.setCellValue("收款日期");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(39);
+        cell = row1.createCell(43);
         cell.setCellValue("已开票金额(元)");
         cell.setCellStyle(styleDetail);
-        cell = row1.createCell(40);
+        cell = row1.createCell(44);
         cell.setCellValue("状态");
         cell.setCellStyle(styleDetail);
-
-
-
-
-
         rownum++;
+
         DecimalFormat decimalFormat=new DecimalFormat(".00");
         Map<String, Object> pageView = new HashMap<>();
         //  公司ID
@@ -2459,6 +2570,15 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         List<ExportVView> dataList = baseMapper.getListByConditionOut(pageView);
         // 详情信息
         if (!CollectionUtils.isEmpty(dataList)) {
+            Double waterContentTotal = 0d;//水分合计
+            Double impurityTotal = 0d;//杂质合计
+            Double mildewGrainTotal = 0d;//霉变粒合计
+            Double imperfectGrainTotal = 0d;//不完善粒合计
+            Double bulkDensityTotal = 0d;//容重合计
+            Double jiaorenliTotal = 0d;//热损伤合计
+            Double netWeightPriceTotal = 0d;//单价合计
+            Double netWeightTotal = 0d;//净重合计
+            Double amountIngPayableTotal = 0d;//应收合计
             for (int i = 0; i < dataList.size(); i++) {
                 ExportVView exportVView = dataList.get(i);
                 HSSFRow rowx = sheet.createRow((int) rownum);
@@ -2505,92 +2625,144 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(14);
                 cell.setCellValue(Double.parseDouble(exportVView.getWaterContent()!=null?exportVView.getWaterContent():"0"));
-                cell.setCellStyle(styleDetail);
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(15);
                 cell.setCellValue(Double.parseDouble(exportVView.getImpurity()!=null?exportVView.getImpurity():"0"));
-                cell.setCellStyle(styleDetail);
+                cell.setCellStyle(contextstyle);
                 cell = rowx.createCell(16);
+                cell.setCellValue(Double.parseDouble(exportVView.getMildewGrain()!=null?exportVView.getMildewGrain():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(17);
+                cell.setCellValue(Double.parseDouble(exportVView.getImperfectGrain()!=null?exportVView.getImperfectGrain():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(18);
+                cell.setCellValue(Double.parseDouble(exportVView.getBulkDensity()!=null?exportVView.getBulkDensity():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(19);
+                cell.setCellValue(Double.parseDouble(exportVView.getJiaorenli()!=null?exportVView.getJiaorenli():"0"));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(20);
                 cell.setCellValue(editString(exportVView.getWingNumber()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(17);
+                cell = rowx.createCell(21);
                 cell.setCellValue(editString(exportVView.getBoxNo()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(18);
+                cell = rowx.createCell(22);
                 cell.setCellValue(editString(exportVView.getBoxNoOther()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(19);
+                cell = rowx.createCell(23);
                 cell.setCellValue(editString(exportVView.getTitleNo()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(20);
+                cell = rowx.createCell(24);
                 cell.setCellValue(editString(exportVView.getTitleNoOther()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(21);
+                cell = rowx.createCell(25);
                 cell.setCellValue(editString(exportVView.getShipNumber()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(22);
+                cell = rowx.createCell(26);
                 cell.setCellValue(editString(exportVView.getShipName()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(23);
+                cell = rowx.createCell(27);
                 cell.setCellValue(editString(exportVView.getCarNo()));
                 cell.setCellStyle(styleDetail);
                 HSSFDataFormat df = wb.createDataFormat(); // 此处设置数据格式
                 contextstyle.setDataFormat(df.getBuiltinFormat("#,##0.00"));//保留两位小数点
-                cell = rowx.createCell(24);
+                cell = rowx.createCell(28);
                 cell.setCellValue(Double.parseDouble(exportVView.getGrossWeight()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(25);
+                cell = rowx.createCell(29);
                 cell.setCellValue(Double.parseDouble(exportVView.getTare()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(26);
+                cell = rowx.createCell(30);
                 cell.setCellValue(Double.parseDouble(exportVView.getNetWeight()));
-                cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(27);
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(31);
                 cell.setCellValue(editFloat(exportVView.getFeedbackWeight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(28);
+                cell = rowx.createCell(32);
                 String date1 = addDateOneDay(exportVView.getFeedbackDate()!=null?exportVView.getFeedbackDate():new Date());
                 cell.setCellValue(date1);
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(29);
+                cell = rowx.createCell(33);
                 cell.setCellValue(editFloat(exportVView.getSettlementWeight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(30);
+                cell = rowx.createCell(34);
                 cell.setCellValue(editFloat(exportVView.getSettlementPrice()));
-                cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(31);
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(35);
                 cell.setCellValue(editFloat(exportVView.getCarFreight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(32);
+                cell = rowx.createCell(36);
                 cell.setCellValue(editFloat(exportVView.getTrainFreight()));
                 cell.setCellStyle(contextstyle);
-                cell = rowx.createCell(33);
+                cell = rowx.createCell(37);
                 cell.setCellValue(editFloat(exportVView.getShipFreight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(34);
+                cell = rowx.createCell(38);
                 cell.setCellValue(editFloat(exportVView.getShipFreight()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(35);
-                cell.setCellValue(editFloat(exportVView.getAmountIngReceivable()));
-                cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(36);
-                cell.setCellValue(editFloat(exportVView.getAmountEdReceivable()));
-                cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(37);
-                cell.setCellValue(editFloat(exportVView.getAmountNotReceivable()));
-                cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(38);
+                cell = rowx.createCell(39);
+                cell.setCellValue(editDouble(exportVView.getAmountIngReceivable()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(40);
+                cell.setCellValue(editDouble(exportVView.getAmountEdReceivable()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(41);
+                cell.setCellValue(editDouble(exportVView.getAmountNotReceivable()));
+                cell.setCellStyle(contextstyle);
+                cell = rowx.createCell(42);
                 String date2 = addDateOneDay(exportVView.getCollectionDate()!=null?exportVView.getCollectionDate():new Date());
                 cell.setCellValue(date2);
-                cell = rowx.createCell(39);
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(43);
                 cell.setCellValue(editFloat(exportVView.getMoney()));
                 cell.setCellStyle(styleDetail);
-                cell = rowx.createCell(40);
+                cell = rowx.createCell(44);
                 cell.setCellValue(editString(exportVView.getStatus()));
                 cell.setCellStyle(styleDetail);
 
+                //水分累计和
+                waterContentTotal = waterContentTotal + ((Double.valueOf(String.valueOf(exportVView.getWaterContent()!=null?exportVView.getWaterContent():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                impurityTotal = impurityTotal + ((Double.valueOf(String.valueOf(exportVView.getImpurity()!=null?exportVView.getImpurity():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                mildewGrainTotal = mildewGrainTotal + ((Double.valueOf(String.valueOf(exportVView.getMildewGrain()!=null?exportVView.getMildewGrain():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                imperfectGrainTotal = imperfectGrainTotal + ((Double.valueOf(String.valueOf(exportVView.getImperfectGrain()!=null?exportVView.getImperfectGrain():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                bulkDensityTotal = bulkDensityTotal + ((Double.valueOf(String.valueOf(exportVView.getBulkDensity()!=null?exportVView.getBulkDensity():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                jiaorenliTotal = jiaorenliTotal + ((Double.valueOf(String.valueOf(exportVView.getJiaorenli()!=null?exportVView.getJiaorenli():"0"))) * (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0"))));
+                netWeightPriceTotal = netWeightPriceTotal + (Double.valueOf(exportVView.getUnitContractPrice()));
+                netWeightTotal = netWeightTotal + (Double.valueOf(String.valueOf(exportVView.getNetWeight()!=null?exportVView.getNetWeight():"0")));
+                amountIngPayableTotal = amountIngPayableTotal + exportVView.getAmountIngReceivable();
+
                 rownum++;
             }
-
+            HSSFRow rowp = sheet.createRow((int)(rownum));
+            rowp.setHeightInPoints(20);
+            //水分平均值
+            cell = rowp.createCell(9);
+            cell.setCellValue(netWeightPriceTotal/dataList.size());
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(14);
+            cell.setCellStyle(contextstyle);
+            cell.setCellValue(waterContentTotal/netWeightTotal);
+            cell = rowp.createCell(15);
+            cell.setCellValue(impurityTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(16);
+            cell.setCellValue(mildewGrainTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(17);
+            cell.setCellValue(imperfectGrainTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(18);
+            cell.setCellValue(bulkDensityTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            cell = rowp.createCell(19);
+            cell.setCellValue(jiaorenliTotal/netWeightTotal);
+            cell.setCellStyle(contextstyle);
+            //纯重合计
+            cell = rowp.createCell(30);
+            cell.setCellValue(netWeightTotal);
+            cell = rowp.createCell(39);
+            cell.setCellValue(amountIngPayableTotal);
         }
 
 

+ 20 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml

@@ -42,6 +42,10 @@
         q.grade as grade,
         q.water_content as waterContent,
         q.impurity as impurity,
+        q.mildew_grain as mildewGrain,
+        q.imperfect_grain as imperfectGrain,
+        q.bulk_density as bulkDensity,
+        q.jiaorenli as jiaorenli,
         a.car_no as carNo,
         q.box_no as boxNo,
         q.box_no_other as boxNoOther,
@@ -103,6 +107,10 @@
         w.grade as grade,
         wd.water_content as waterContent,
         wd.impurity as impurity,
+        wd.mildew_grain as mildewGrain,
+        wd.imperfect_grain as imperfectGrain,
+        wd.bulk_density as bulkDensity,
+        wd.jiaorenli as jiaorenli,
         s.car_no as carNo,
         w.box_no as boxNo,
         w.box_no_other as boxNoOther,
@@ -165,6 +173,10 @@
         w.grade as grade,
         d.water_content as waterContent,
         d.impurity as impurity,
+        d.mildew_grain as mildewGrain,
+        d.imperfect_grain as imperfectGrain,
+        d.bulk_density as bulkDensity,
+        d.jiaorenli as jiaorenli,
         w.car_no as carNo,
         w.box_no as boxNo,
         w.box_no_other as boxNoOther,
@@ -227,6 +239,10 @@
         w.grade as grade,
         d.water_content as waterContent,
         d.impurity as impurity,
+        d.mildew_grain as mildewGrain,
+        d.imperfect_grain as imperfectGrain,
+        d.bulk_density as bulkDensity,
+        d.jiaorenli as jiaorenli,
         w.car_no as carNo,
         w.box_no as boxNo,
         w.box_no_other as boxNoOther,
@@ -288,6 +304,10 @@
         g.grade as grade,
         g.water_content as waterContent,
         g.impurity as impurity,
+        g.mildew_grain as mildewGrain,
+        g.imperfect_grain as imperfectGrain,
+        g.bulk_density as bulkDensity,
+        g.jiaorenli as jiaorenli,
         s.car_no as carNo,
         s.case_no as boxNo,
         s.case_no_other as boxNoOther,