From d39581ceaf7ab84bf1e0429a04fde0232c22822b Mon Sep 17 00:00:00 2001 From: dengyu Date: Tue, 5 Nov 2024 15:12:06 +0800 Subject: [PATCH] 20241105 --- .../Dtos/CM_CurrentStateRes.cs | 2 +- .../Method/CMServiceBase.cs | 10 ++++ .../CM_State_Change_TemplatImportService.cs | 57 ++++++++++++------- 3 files changed, 46 insertions(+), 23 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/ContainerManagement/Dtos/CM_CurrentStateRes.cs b/ds-wms-service/DS.WMS.Core/ContainerManagement/Dtos/CM_CurrentStateRes.cs index dc4d56f3..d86de83b 100644 --- a/ds-wms-service/DS.WMS.Core/ContainerManagement/Dtos/CM_CurrentStateRes.cs +++ b/ds-wms-service/DS.WMS.Core/ContainerManagement/Dtos/CM_CurrentStateRes.cs @@ -202,7 +202,7 @@ public class CM_CurrentStateRes: BaseFieldRes public string Remark { get; set; } - + public string PortLoad { get; set; } /// /// Desc:始发港代码 /// diff --git a/ds-wms-service/DS.WMS.Core/ContainerManagement/Method/CMServiceBase.cs b/ds-wms-service/DS.WMS.Core/ContainerManagement/Method/CMServiceBase.cs index 445b2cbe..ced06680 100644 --- a/ds-wms-service/DS.WMS.Core/ContainerManagement/Method/CMServiceBase.cs +++ b/ds-wms-service/DS.WMS.Core/ContainerManagement/Method/CMServiceBase.cs @@ -181,6 +181,7 @@ namespace DS.WMS.ContainerManagement.Info.Method IsHeavy=c.IsHeavy, Portid = c.Portid, Port = c.Port, + PortCode = c.PortCode, Depot = c.Depot, Vessel = c.Vessel, Voyno = c.Voyno, @@ -195,6 +196,15 @@ namespace DS.WMS.ContainerManagement.Info.Method CreateTime= c.CreateTime, ProductionDate= b.ProductionDate, CtnFlowStateId = c.CtnFlowStateId, + PortLoad= c.PortLoad, + PortLoadid= c.PortLoadid, + PortLoadCode= c.PortLoadCode, + PortDelivery= c.PortDelivery, + PortDeliveryid= c.PortDeliveryid, + PortDeliveryCode= c.PortDeliveryCode, + PortDischarge= c.PortDischarge, + PortDischargeCode= c.PortDischargeCode, + PortDischargeid= c.PortDischargeid, }); return query1; diff --git a/ds-wms-service/DS.WMS.Core/ContainerManagement/Method/CM_State_Change_TemplatImportService.cs b/ds-wms-service/DS.WMS.Core/ContainerManagement/Method/CM_State_Change_TemplatImportService.cs index 215d7d2d..13db5cb4 100644 --- a/ds-wms-service/DS.WMS.Core/ContainerManagement/Method/CM_State_Change_TemplatImportService.cs +++ b/ds-wms-service/DS.WMS.Core/ContainerManagement/Method/CM_State_Change_TemplatImportService.cs @@ -1108,10 +1108,9 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha newchange.Pid = req.Id; Type type = newchange.GetType(); - var XXDM = ""; - var XXCM = ""; - var Vessel = ""; - var Voyno = ""; + var XXDM = "";//箱型代码 GP RH + + var XXCM = "";//箱型尺码 20 40 foreach (var 字段 in 模板明细) { @@ -1119,6 +1118,7 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha continue; var field = type.GetProperty(字段.FieldTitle); + if (field != null && dt.Columns.Contains(字段.ColumnTitle)) { var _value = row[字段.ColumnTitle]; @@ -1152,6 +1152,34 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha } } else + if (field.PropertyType.GetGenericArguments()[0] == typeof(bool) || field.PropertyType.GetGenericArguments()[0] == typeof(bool?)) + { + if (_value != null) + { + if (field != null && 字段.FieldTitle == "IsHeavy") + { + if (_value == null || string.IsNullOrWhiteSpace(_value.ToString())) + { + field.SetValue(newchange, null); + } + else + if (_value.ToString() == "重" || _value.ToString() == "1" || _value.ToString().ToUpper() == "TRUE") + { + field.SetValue(newchange, true); + } + else + if (_value.ToString() == "空" || _value.ToString() == "0" || _value.ToString().ToUpper() == "FALSE") + { + field.SetValue(newchange, false); + } + else + { + field.SetValue(newchange, null); + } + } + } + } + else { field.SetValue(newchange, _value); } @@ -1172,7 +1200,7 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha { XXCM = row[字段.ColumnTitle].ToString(); } - else + else if (field == null && 字段.FieldTitle == "CtnFlowState") { //XXCM = row[字段.ColumnTitle].ToString(); @@ -1191,24 +1219,13 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha } } - //else - - //if (field == null && 字段.FieldTitle == "Vessel") - //{ - // Vessel = row[字段.ColumnTitle].ToString(); - //} - //else - //if (field == null && 字段.FieldTitle == "Voyno") - //{ - // Voyno = row[字段.ColumnTitle].ToString(); - //} + else { - continue; - //throw new ArgumentException("Field not found", fieldName); + } } @@ -1216,10 +1233,6 @@ public class CM_State_Change_TemplatImportService : CMServiceBase, ICM_State_Cha newchange.Ctnall= XXCM+ XXDM ; } - //if (Vessel != "" && Voyno != "") - //{ - // newchange.VesselVoyno = Vessel +" : "+ Voyno; - //} newchange.IsOnlineId= CM_IsOnlineEnum.上线; changelist.Add(newchange);