|
|
|
@ -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);
|
|
|
|
|
|
|
|
|
|