ソースを参照

含水率忽略null

qianxb 1 年間 前
コミット
57203dbb2f

+ 5 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/MixProportionInfoServiceImpl.java

@@ -64,7 +64,7 @@ public class MixProportionInfoServiceImpl extends BaseServiceImpl<MixProportionI
         if (list == null || list.size() <= 0){
             return null;
         }
-        Map<String,Map<String,String>> map = new HashMap<>();
+        Map<String,Map<String,String>> map = new LinkedHashMap<>();
         //包装返回值
         for (String l : list) {
             Map<String,String> m = new HashMap<>();
@@ -243,7 +243,7 @@ public class MixProportionInfoServiceImpl extends BaseServiceImpl<MixProportionI
         //施工配合比计算
         //水泥
         BigDecimal cement = info.getCement();
-        if (StringUtils.isNotBlank(key1)) {
+        if (StringUtils.isNotBlank(key1)  && cement != null) {
             map.put(key1, cement);
         }
 
@@ -256,17 +256,17 @@ public class MixProportionInfoServiceImpl extends BaseServiceImpl<MixProportionI
         }
         //掺加剂
         BigDecimal admixture = info.getAdmixture();
-        if (StringUtils.isNotBlank(key7)) {
+        if (StringUtils.isNotBlank(key7) && admixture != null) {
             map.put(key7, admixture);
         }
         //粉煤灰
         BigDecimal coalAsh = info.getCoalAsh();
-        if (StringUtils.isNotBlank(key8)) {
+        if (StringUtils.isNotBlank(key8) && coalAsh != null) {
             map.put(key8, coalAsh);
         }
         //矿渣粉
         BigDecimal slagPowder = info.getSlagPowder();
-        if (StringUtils.isNotBlank(key9)) {
+        if (StringUtils.isNotBlank(key9) && slagPowder != null) {
             map.put(key9, slagPowder);
         }
         inputStream.close();

+ 24 - 24
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/FileUtils.java

@@ -415,30 +415,30 @@ public class FileUtils {
     }
 
 
-    public static void main(String[] args) throws Exception {
-       String excelUrl = "/Users/hongchuangyanfa/Downloads/D10.1表-隧道总体质量检验单 (1).xlsx";
-        String old_html = "/Users/hongchuangyanfa/Desktop/pdf/old_html.html";
-        String old_xlsx = "/Users/hongchuangyanfa/Desktop/pdf/old_html.xlsx";
-
-   //     excelInfo2(excelUrl,old_xlsx,old_html);
-        com.spire.xls.Workbook wb = new com.spire.xls.Workbook();
-        wb.loadFromMHtml(old_xlsx);
-        Worksheet sheet = wb.getWorksheets().get(0);
-        CellRange[] cells = sheet.getCells();
-        for (int i = 0; i < cells.length; i++) {
-            CellRange oldcell = cells[i];
-            CellRange mergedCell = sheet.getCellRange(oldcell.getRow(), oldcell.getColumn());
-            String data = mergedCell.getDataValidation().getErrorMessage();
-            System.out.println(oldcell.getRow()+"--=--"+oldcell.getColumn()+"--=--"+data);
-        }
-
-/*        String new_html = "/Users/hongchuangyanfa/Desktop/pdf/new_html.html";
-        String new_xlsx = "/Users/hongchuangyanfa/Desktop/pdf/new_html.xlsx";
-
-        File data = new File(old_xlsx);
-        InputStream inputStream = new FileInputStream(data);
-        excelInfo(inputStream,new_xlsx,new_html,"2");*/
-    }
+//    public static void main(String[] args) throws Exception {
+//       String excelUrl = "/Users/hongchuangyanfa/Downloads/D10.1表-隧道总体质量检验单 (1).xlsx";
+//        String old_html = "/Users/hongchuangyanfa/Desktop/pdf/old_html.html";
+//        String old_xlsx = "/Users/hongchuangyanfa/Desktop/pdf/old_html.xlsx";
+//
+//   //     excelInfo2(excelUrl,old_xlsx,old_html);
+//        com.spire.xls.Workbook wb = new com.spire.xls.Workbook();
+//        wb.loadFromMHtml(old_xlsx);
+//        Worksheet sheet = wb.getWorksheets().get(0);
+//        CellRange[] cells = sheet.getCells();
+//        for (int i = 0; i < cells.length; i++) {
+//            CellRange oldcell = cells[i];
+//            CellRange mergedCell = sheet.getCellRange(oldcell.getRow(), oldcell.getColumn());
+//            String data = mergedCell.getDataValidation().getErrorMessage();
+//            System.out.println(oldcell.getRow()+"--=--"+oldcell.getColumn()+"--=--"+data);
+//        }
+//
+///*        String new_html = "/Users/hongchuangyanfa/Desktop/pdf/new_html.html";
+//        String new_xlsx = "/Users/hongchuangyanfa/Desktop/pdf/new_html.xlsx";
+//
+//        File data = new File(old_xlsx);
+//        InputStream inputStream = new FileInputStream(data);
+//        excelInfo(inputStream,new_xlsx,new_html,"2");*/
+//    }
 
 
     /**