zhangyuewww 1 jaar geleden
bovenliggende
commit
b08cadce52

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

@@ -2452,22 +2452,52 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         cell.setCellStyle(styleDetail);
         //水分平均值
         cell = rowp.createCell(14);
-        cell.setCellValue(Double.parseDouble(df.format(bulkDensityTotal / netWeightTmp)));
+        if (bulkDensityTotal!=0){
+            cell.setCellValue(Double.parseDouble(df.format(bulkDensityTotal / netWeightTmp)));
+        }
+        else {
+            cell.setCellValue(bulkDensityTotal / netWeightTmp);
+        }
         cell.setCellStyle(contextstyle2);
         cell = rowp.createCell(15);
-        cell.setCellValue(Double.parseDouble(df.format(waterContentTotal / netWeightTmp)));
+        if (waterContentTotal!=0){
+            cell.setCellValue(Double.parseDouble(df.format(waterContentTotal / netWeightTmp)));
+        }
+        else {
+            cell.setCellValue(waterContentTotal / netWeightTmp);
+        }
         cell.setCellStyle(contextstyle2);
         cell = rowp.createCell(16);
-        cell.setCellValue(Double.parseDouble(df.format(mildewGrainTotal / netWeightTmp)));
+        if (mildewGrainTotal!=0){
+            cell.setCellValue(Double.parseDouble(df.format(mildewGrainTotal / netWeightTmp)));
+        }
+        else {
+            cell.setCellValue(mildewGrainTotal / netWeightTmp);
+        }
         cell.setCellStyle(contextstyle2);
         cell = rowp.createCell(17);
-        cell.setCellValue(Double.parseDouble(df.format(impurityTotal / netWeightTmp)));
+        if (impurityTotal!=0){
+            cell.setCellValue(Double.parseDouble(df.format(impurityTotal / netWeightTmp)));
+        }
+        else {
+            cell.setCellValue(impurityTotal / netWeightTmp);
+        }
         cell.setCellStyle(contextstyle2);
         cell = rowp.createCell(18);
-        cell.setCellValue(Double.parseDouble(df.format(jiaorenliTotal / netWeightTmp)));
+        if (jiaorenliTotal!=0){
+            cell.setCellValue(Double.parseDouble(df.format(jiaorenliTotal / netWeightTmp)));
+        }
+        else {
+            cell.setCellValue(jiaorenliTotal / netWeightTmp);
+        }
         cell.setCellStyle(contextstyle2);
         cell = rowp.createCell(19);
-        cell.setCellValue(Double.parseDouble(df.format(imperfectGrainTotal / netWeightTmp)));
+        if (imperfectGrainTotal!=0){
+            cell.setCellValue(Double.parseDouble(df.format(imperfectGrainTotal / netWeightTmp)));
+        }
+        else {
+            cell.setCellValue(imperfectGrainTotal / netWeightTmp);
+        }
         cell.setCellStyle(contextstyle2);
         cell = rowp.createCell(20);
         cell.setCellStyle(styleDetail);