zhangyuewww 4 år sedan
förälder
incheckning
3bb306bb90

+ 45 - 11
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java

@@ -517,40 +517,40 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                 cell.setCellValue(i + 1);
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(2);
-                cell.setCellValue(contractManagementInfo.getContractNo());
+                cell.setCellValue(editString(contractManagementInfo.getContractNo()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(3);
-                cell.setCellValue(contractManagementInfo.getGoodsName());
+                cell.setCellValue(editString(contractManagementInfo.getGoodsName()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(4);
-                cell.setCellValue(contractManagementInfo.getGrade());
+                cell.setCellValue(editString(contractManagementInfo.getGrade()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(5);
-                cell.setCellValue(contractManagementInfo.getWeight());
+                cell.setCellValue(editFloat(contractManagementInfo.getWeight()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(6);
-                cell.setCellValue(contractManagementInfo.getUnitContractPrice());
+                cell.setCellValue(editDouble(contractManagementInfo.getUnitContractPrice()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(7);
-                cell.setCellValue(contractManagementInfo.getPackingMethod());
+                cell.setCellValue(editString(contractManagementInfo.getPackingMethod()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(8);
-                cell.setCellValue(contractManagementInfo.getBuyer());
+                cell.setCellValue(editString(contractManagementInfo.getBuyer()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(9);
-                cell.setCellValue(contractManagementInfo.getSeller());
+                cell.setCellValue(editString(contractManagementInfo.getSeller()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(10);
-                cell.setCellValue((contractManagementInfo.getImperfectGrain()!=null ? contractManagementInfo.getImperfectGrain() : 0f));
+                cell.setCellValue(editFloat(contractManagementInfo.getImperfectGrain()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(11);
-                cell.setCellValue(contractManagementInfo.getStatus());
+                cell.setCellValue(editString(contractManagementInfo.getStatus()));
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(12);
                 cell.setCellValue(contractManagementInfo.getSigningDate());
                 cell.setCellStyle(styleDetail);
                 cell = rowx.createCell(13);
-                cell.setCellValue(contractManagementInfo.getMildewGrain());
+                cell.setCellValue(editFloat(contractManagementInfo.getMildewGrain()));
                 cell.setCellStyle(styleDetail);
                 rownum++;
             }
@@ -582,6 +582,40 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
 
     }
 
+    /**
+     * 判断字符串
+     * @param example
+     * @return
+     */
+    private String  editString(String example){
+        String exampleOne = example !=null?example:"";
+        return exampleOne;
+    }
+
+
+    /**
+     * 判断浮点数
+     * @param example
+     * @return
+     */
+    private Float editFloat(Float example){
+        Float exampleOne = example !=null?example:0f;
+        return exampleOne;
+    }
+
+    /**
+     * 判断浮点数
+     * @param example
+     * @return
+     */
+    private Double editDouble(Double example){
+        Double exampleOne = example !=null?example:0.00;
+        return exampleOne;
+    }
+
+
+
+
     /**
      * 下载
      *