Просмотр исходного кода

修改配置文件及相关代码,修改输出报告样式以满足修改意见

liyang 3 месяцев назад
Родитель
Сommit
7a65d2b471

+ 1 - 1
Models/SimulationCommon/EditorConfig.cs

@@ -52,7 +52,7 @@ public struct AircraftParameter
     [JsonProperty("任务载荷型号")]
     public TaskLoadType taskLoadType;
     [JsonProperty("任务载荷")]
-    public TaskLoad taskLoad;
+    public string[] taskLoad;
     [JsonProperty("最大起飞重量")]
     public double MaxTakeoffWeight;
     [JsonProperty("最大载油量")]

+ 2 - 3
SimulationServer/Component/SJStaticCapacityComponent.cs

@@ -265,7 +265,6 @@ public class SJStaticCapacityComponent : Component
     public void FillData7(AircraftDB db,Dictionary<string, string> reportInfo)
     {
         var aircraft = GetParent<AircraftXCJJ>();
-
         SJStaticCapacity.准备时间 = reportInfo["准备时间"];
         SJStaticCapacity.到达时间 = reportInfo["到达时间"];
         SJStaticCapacity.任务周期时间 = reportInfo["任务周期时间"];
@@ -280,8 +279,8 @@ public class SJStaticCapacityComponent : Component
         SJStaticCapacity.单机总油耗 = (FXJHGenerate.GetHoverFuelConsumptionRate(aircraft.FlightPlanEditor, 50) + FXJHGenerate.GetCruisingVelocity(aircraft.FlightPlanEditor, 50)).ToString();
         SJStaticCapacity.单机机场使用情况 = reportInfo["单机机场使用情况"];
         SJStaticCapacity.单机导航使用情况 = "";
-        SJStaticCapacity.医疗任务设备 = "";
-        SJStaticCapacity.医疗药品 = "";
+        SJStaticCapacity.医疗任务设备 = reportInfo["医疗任务设备"];
+        SJStaticCapacity.医疗药品 = reportInfo["医疗药品"];
         SJStaticCapacity.任务缓急情况 = reportInfo["任务缓急情况"];
     }
 

+ 39 - 3
SimulationServer/Entity/AircraftXCJJ.cs

@@ -18,7 +18,12 @@ public class AircraftXCJJ : AircraftEntity
 
     public List<double> jiuzhuTimes = new List<double>();
 
-    public Dictionary<string,string> reportInfo = new Dictionary<string,string>();
+    public Dictionary<string, string> reportInfo = new Dictionary<string, string>();
+
+    public List<string> load = new List<string>();
+    public string device;
+    public string medicine;
+
 
     public override void End()
     {
@@ -32,6 +37,8 @@ public class AircraftXCJJ : AircraftEntity
         Success = false;
         TotalTime = 0;
         reportInfo = new Dictionary<string, string>();
+        device = string.Empty;
+        medicine = string.Empty;
     }
 
     public override void Start()
@@ -48,7 +55,7 @@ public class AircraftXCJJ : AircraftEntity
         {
             diseaseTypes.Add(FlightPlanEditor.medicalTargetPoint[0].TargetType.diseaseTypes[i]);
         }
-        int medicCount = taskParameter.MedicalStaffCount; // 医护人员数量  
+        int medicCount = taskParameter.doctorPersonnel + taskParameter.nursePersonnel + taskParameter.nurseSeverePersonnel;//taskParameter.MedicalStaffCount; // 医护人员数量  
 
         // 交接时间为5分钟  
         double handoverTime = 5;
@@ -119,7 +126,7 @@ public class AircraftXCJJ : AircraftEntity
         {
             time += TurningPoints[i].SegmentFlightTime;
             c++;
-            if(c == 4)
+            if (c == 4)
             {
                 jiuzhuTimes.Add(time);
                 c = 0;
@@ -149,6 +156,35 @@ public class AircraftXCJJ : AircraftEntity
         reportInfo.Add("单机地面保障人数", "1");
         reportInfo.Add("单机总任务时长", TotalTime.ToString());
         reportInfo.Add("单机机场使用情况", Airport);
+        for (int i = 0; i < load.Count; i++)
+        {
+            if (load[i].Split(":")[0].Contains("装备"))
+            {
+                device += load[i].Split(":")[1];
+                if(i != load.Count - 1)
+                {
+                    device += "\r\n";
+                }
+            }
+            else if (load[i].Split(":")[0].Contains("药品"))
+            {
+                medicine += load[i].Split(":")[1] + "\r\n";
+                if (i != load.Count - 1)
+                {
+                    medicine += "\r\n";
+                }
+            }
+        }
+        //Console.WriteLine("医疗任务设备:" + device);
+        //Console.WriteLine("医疗药品:" + medicine);
+        if (device != null)
+            reportInfo.Add("医疗任务设备", device);
+        else
+            reportInfo.Add("医疗任务设备", "");
+        if (medicine != null)
+            reportInfo.Add("医疗药品", medicine);
+        else
+            reportInfo.Add("医疗药品", "");
         reportInfo.Add("任务缓急情况", "紧急");
 
         IsOver = true;

+ 7 - 3
SimulationServer/EventHandler/CreateTaskEventHandler.cs

@@ -649,7 +649,7 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSXTask>
             {
                 //飞机参数
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                    a => a.AircraftID == config.XCJJTask.aircraftInfos[i].AircraftType);
+                    a => a.Id == config.XCJJTask.aircraftInfos[i].AircraftId);
                 //基地
                 var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
 
@@ -664,6 +664,10 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSXTask>
                 aircraft.taskContent = config.XCJJTask;
                 aircraft.AircraftId = config.XCJJTask.aircraftInfos[i].AircraftId;
                 aircraft.Airport = originBase.BaseName;
+                for (int j = 0; j < aircraftParameter.taskLoad.Length; j++)
+                {
+                    aircraft.load.Add(aircraftParameter.taskLoad[j]);
+                }
                 var hospital = config.EditorConfig.hospitals.Find(t => t.BaseName == config.XCJJTask.missionInformation.Hospital);
                 aircraft.hospitalPoint = new MissionEndPoint()
                 {
@@ -704,7 +708,7 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSXTask>
             {
                 //飞机参数
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                    a => a.AircraftID == config.YLZYTask.aircraftInfos[i].AircraftType);
+                    a => a.Id == config.YLZYTask.aircraftInfos[i].AircraftId);
                 //基地
                 var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
 
@@ -759,7 +763,7 @@ public class CreateLandSJEventHandler : AEvent<CreateLandSXTask>
             {
                 //飞机参数
                 var aircraftParameter = config.EditorConfig.aircraftParameters.Find(
-                    a => a.AircraftID == config.YLWPYSTask.aircraftInfos[i].AircraftType);
+                    a => a.Id == config.YLWPYSTask.aircraftInfos[i].AircraftId);
                 //基地
                 var originBase = config.EditorConfig.bases.Find(b => b.BaseId == aircraftParameter.AirportId);
 

+ 16 - 16
SimulationServer/EventHandler/ServerStartEventHandler.cs

@@ -198,23 +198,23 @@ public class ServerStartEventHandler : AEvent<ServerStart>
             //break;
         }
 
-        //医疗转运任务
-        foreach (var YLZYTask in taskConfig.YLZYTasks)
-        {
-            taskSys.missionCount++;
-            Game.EventSystem.Publish(new CreateYLZYTask
-            { EditorConfig = editorConfig, YLZYTask = YLZYTask });
-            //break;
-        }
+        ////医疗转运任务
+        //foreach (var YLZYTask in taskConfig.YLZYTasks)
+        //{
+        //    taskSys.missionCount++;
+        //    Game.EventSystem.Publish(new CreateYLZYTask
+        //    { EditorConfig = editorConfig, YLZYTask = YLZYTask });
+        //    //break;
+        //}
 
-        //医疗物品运送
-        foreach (var YLWPYSTask in taskConfig.YLWPYSTasks)
-        {
-            taskSys.missionCount++;
-            Game.EventSystem.Publish(new CreateYLWPYSTask
-            { EditorConfig = editorConfig, YLWPYSTask = YLWPYSTask });
-            //break;
-        }
+        ////医疗物品运送
+        //foreach (var YLWPYSTask in taskConfig.YLWPYSTasks)
+        //{
+        //    taskSys.missionCount++;
+        //    Game.EventSystem.Publish(new CreateYLWPYSTask
+        //    { EditorConfig = editorConfig, YLWPYSTask = YLWPYSTask });
+        //    //break;
+        //}
 
         ////绞车吊载转运任务
         //foreach (var JCDZZYTask in taskConfig.JCDZZYTasks)

+ 15 - 0
SimulationServer/Utils/DataTableExtensions.cs

@@ -1,7 +1,9 @@
 using System.Data;
+using System.Linq;
 using KYFramework;
 using MongoDB.Bson;
 using NPOI.HSSF.UserModel;
+using NPOI.SS.Util;
 using NPOIHelper;
 
 namespace SimulationServer.Utils;
@@ -91,6 +93,13 @@ public static class DataTableExtensions
             {
                 var row = sheet.CreateRow(rowIndex);
                 row.CreateCell(0).SetCellValue(kv1.Key);
+                bool t = false;
+                if (kv1.Key == "医疗任务设备" || kv1.Key == "医疗药品")
+                {
+                    //row.GetCell(0).CellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center;
+                    CellUtil.SetCellStyleProperties(row.GetCell(0), new Dictionary<string, object> { { "verticalAlignment", NPOI.SS.UserModel.VerticalAlignment.Center } });
+                    t = true;
+                }
                 if (withA)
                 {
                     for (int i = 0; i < kv1.Value.Count - 1; i++)
@@ -98,6 +107,12 @@ public static class DataTableExtensions
                         var headerCell1 = headerRow.CreateCell(i + 1);
                         headerCell1.SetCellValue($"仿真轮次{i + 1}");
                         row.CreateCell(i + 1).SetCellValue(kv1.Value[i]);
+                        if (t)
+                        {
+                            //row.GetCell(i + 1).CellStyle.WrapText = true;
+                            CellUtil.SetCellStyleProperties(row.GetCell(i + 1), new Dictionary<string, object> { { "wrapText", true } });
+                            CellUtil.SetCellStyleProperties(row.GetCell(i + 1), new Dictionary<string, object> { { "verticalAlignment", NPOI.SS.UserModel.VerticalAlignment.Center } });
+                        }
                     }
                     var headerCell1End = headerRow.CreateCell(kv1.Value.Count);
                     headerCell1End.SetCellValue($"平均值");

+ 1 - 1
SimulationServer/Utils/HttpInterface.cs

@@ -15,6 +15,6 @@ public class HttpInterface
     public static string fuel = $"{baseUrl}rescue-platform-service/api/v1/tbTables/queryOilConsumeInfo";
 
     // 医疗
-    public static string yl = $"{baseUrl}rescue-platform-service/api/v1/tbMeteorology/getInfosByJHName";
+    public static string yl = $"{baseUrl}rescue-platform-service/api/v1/tbTables/querycustom";
 
 }

+ 53 - 19
SimulationServer/bin/Debug/net7.0/Missions/editor_config.json

@@ -1,5 +1,5 @@
 {
-    "仿真次数": 3,
+    "仿真次数": 1,
     "想定信息": {
         "想定日期": "2024年9月11日",
         "想定时间": "00时00分00秒"
@@ -36,13 +36,30 @@
             "类型": "飞机",
             "子类型": "直升机",
             "所属机场ID": 1,
-            "任务载荷": {
-                "急救设备": true,
-                "搬运和固定装备": true,
-                "诊断和监测装备": true,
-                "外伤装备": true,
-                "输液装备": true
-            }
+            "任务载荷": [
+                "急救装备: 氧气供应装置",
+                "急救装备: 多功能除颤器",
+                "急救装备: 便携呼吸机",
+                "急救装备: 吸引器",
+                "急救装备: 小型外科手术器械包",
+                "搬运和固定装备: 上车担架",
+                "搬运和固定装备: 担架固定装置",
+                "诊断和监测装备: 听诊器",
+                "诊断和监测装备: 体温计",
+                "诊断和监测装备: 血压计",
+                "诊断和监测装备: 快速血糖检测仪",
+                "外伤装备: 头部固定器",
+                "外伤装备: 颈托",
+                "外伤装备: 脊椎固定器",
+                "外伤装备: 固定夹板",
+                "外伤装备: 牵引装置",
+                "外伤装备: 三角巾",
+                "外伤装备: 止血带",
+                "外伤装备: 绷带卷",
+                "外伤装备: 一次性纱布敷料",
+                "外伤装备: 创口贴",
+                "输液装备: 注射器和输液器"
+            ]
         },
         {
             "机型": "H155",
@@ -50,9 +67,9 @@
             "类型": "飞机",
             "子类型": "直升机",
             "所属机场ID": 1,
-            "任务载荷": {
-                "绞车型号": "WHDDJXT-102"
-            }
+            "任务载荷": [
+                "绞车型号: WHDDJXT-102"
+            ]
         },
         {
             "机型": "ARJ-21",
@@ -60,14 +77,31 @@
             "类型": "飞机",
             "子类型": "固定翼",
             "所属机场ID": 2,
-            "任务载荷": {
-                "急救设备": true,
-                "搬运和固定装备": true,
-                "诊断和监测装备": true,
-                "外伤装备": true,
-                "输液装备": true,
-                "医疗药品": true
-            }
+            "任务载荷": [
+                "急救装备: 氧气供应装置",
+                "急救装备: 多功能除颤器",
+                "急救装备: 便携呼吸机",
+                "急救装备: 吸引器",
+                "急救装备: 小型外科手术器械包",
+                "搬运和固定装备: 上车担架",
+                "搬运和固定装备: 担架固定装置",
+                "诊断和监测装备: 听诊器",
+                "诊断和监测装备: 体温计",
+                "诊断和监测装备: 血压计",
+                "诊断和监测装备: 快速血糖检测仪",
+                "外伤装备: 头部固定器",
+                "外伤装备: 颈托",
+                "外伤装备: 脊椎固定器",
+                "外伤装备: 固定夹板",
+                "外伤装备: 牵引装置",
+                "外伤装备: 三角巾",
+                "外伤装备: 止血带",
+                "外伤装备: 绷带卷",
+                "外伤装备: 一次性纱布敷料",
+                "外伤装备: 创口贴",
+                "输液装备: 注射器和输液器",
+                "医疗药品: 盐酸肾上腺素注射液"
+            ]
         }
     ],
     "医疗物品需求信息": [

+ 8 - 1
SimulationServer/bin/Debug/net7.0/Missions/task_config.json

@@ -31,7 +31,14 @@
             "任务参数": [
                 {
                     "应用飞机编号": "1-1",
-                    "携带医护人员数量": 2,
+                    //"携带医护人员数量": 2,
+                    "单次转运人数": 1,
+                    "单机飞行员人数": 1,
+                    "单机飞行工程师人数": 1,
+                    "单机医师人数": 1,
+                    "单机护士人数": 1,
+                    "单机重症监护护理人员人数": 1,
+                    "单机地面保障人数": 1,
                     "?后续转运方式": "注释: 地面转运时间用户自定义/空中转运时间默认0,由医疗转运子任务计算",
                     "后续转运方式": "空中",
                     "转运时间": 0

BIN
SimulationServer/bin/Debug/net7.0/SimulationCommon.dll


BIN
SimulationServer/bin/Debug/net7.0/SimulationCommon.pdb


BIN
SimulationServer/bin/Debug/net7.0/SimulationServer.dll


BIN
SimulationServer/bin/Debug/net7.0/SimulationServer.exe


BIN
SimulationServer/bin/Debug/net7.0/SimulationServer.pdb