xulisong 6 jaren geleden
bovenliggende
commit
1f976318f9
2 gewijzigde bestanden met toevoegingen van 19 en 9 verwijderingen
  1. 12 3
      MBI/SAGA.DotNetUtils/NPOI/NPOIHelper.cs
  2. 7 6
      MBI/SAGA.GplotManage/GplotCommand.cs

+ 12 - 3
MBI/SAGA.DotNetUtils/NPOI/NPOIHelper.cs

@@ -358,11 +358,20 @@ namespace SAGA.DotNetUtils.NPOI
                 if (index !=null)
                 {
                     int i = (int) index;
-                    value = row.GetCell(i)?.StringCellValue;
+                    var baseCell = row.GetCell(i);
+                    if (baseCell == null)
+                    {
+                        item.SetValue(model, "");
+                        continue;
+                    }                   
                     //如果读取到的值为null,则判断是否为合并单元格,读取合并单元格的值
-                    if (value.IsNullOrEmpty())
+                    if (baseCell.IsMergedCell)
+                    {
+                        value = row.GetDataCell(i)?.ToString();
+                    }
+                    else
                     {
-                        value = row.GetDataCell(i)?.StringCellValue;
+                        value = row.GetCell(i)?.ToString();
                     }
                     item.SetValue(model, value);
                 }

+ 7 - 6
MBI/SAGA.GplotManage/GplotCommand.cs

@@ -152,12 +152,13 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
-            var relationType = RelationTypeManager.GetRelationTypeItem("ChillWaterLoop");
-            SystemComputerHandler handler1 = new SystemComputerHandler();
-            SystemComputerContext context = new SystemComputerContext();
-            context.Relations.Add("ChillWaterLoop");
-            handler1.GetParseData(context);
-            return Result.Succeeded;
+            //var relationType = RelationTypeManager.GetRelationTypeItem("ChillWaterLoop");
+            //return Result.Succeeded;
+            //SystemComputerHandler handler1 = new SystemComputerHandler();
+            //SystemComputerContext context = new SystemComputerContext();
+            //context.Relations.Add("ChillWaterLoop");
+            //handler1.GetParseData(context);
+            //return Result.Succeeded;
             RoomShowHandler handler = new RoomShowHandler("ChillWaterLoop");
             handler.Show();
             ;