任务基础表:添加拓展字段插入及供查询功能

dev
zhangxiaofeng 1 month ago
parent d2edf31a56
commit 0825b125e5

@ -363,5 +363,10 @@ namespace DS.WMS.Core.TaskPlat.Dtos
/// 卸货港 /// 卸货港
/// </summary> /// </summary>
public string? PortDischarge { get; set; } public string? PortDischarge { get; set; }
/// <summary>
/// 拓展数据
/// </summary>
public object? ExtData { get; set; }
} }
} }

@ -302,6 +302,12 @@ namespace DS.WMS.Core.TaskPlat.Entity
[SugarColumn(ColumnDescription = "批次统计", IsNullable = true, Length = 50)] [SugarColumn(ColumnDescription = "批次统计", IsNullable = true, Length = 50)]
public string? BATCH_STATIC { get; set; } public string? BATCH_STATIC { get; set; }
/// <summary>
/// 拓展数据
/// </summary>
[SugarColumn(ColumnDescription = "拓展数据", IsNullable = true, Length = 255, ColumnDataType = "varchar")]
public object? ExtData { get; set; }
///// <summary> ///// <summary>
///// 大简云userid ///// 大简云userid
///// </summary> ///// </summary>

@ -28,6 +28,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SqlSugar; using SqlSugar;
using System.Linq.Expressions; using System.Linq.Expressions;
@ -480,6 +481,12 @@ namespace DS.WMS.Core.TaskPlat.Method
CreateTime = DateTime.Now, CreateTime = DateTime.Now,
}; };
if (info.Main.ExtData != null)
{
taskInfo.ExtData = info.Main.ExtData.ToJson();
}
if (Enum.TryParse(typeof(TaskBaseTypeEnum), taskInfo.TASK_TYPE, out object? taskTypeTemp)) if (Enum.TryParse(typeof(TaskBaseTypeEnum), taskInfo.TASK_TYPE, out object? taskTypeTemp))
{ {
taskInfo.TASK_TYPE_NAME = ((TaskBaseTypeEnum)taskTypeTemp).EnumDescription(); taskInfo.TASK_TYPE_NAME = ((TaskBaseTypeEnum)taskTypeTemp).EnumDescription();
@ -2671,6 +2678,19 @@ namespace DS.WMS.Core.TaskPlat.Method
item.CARRIER_ID = item.orderCarrierId; item.CARRIER_ID = item.orderCarrierId;
item.CARRIER_NAME = null; item.CARRIER_NAME = null;
} }
// 3.ExtData字段从Data转为对象
if (!string.IsNullOrEmpty(item.ExtData))
{
try
{
item.ExtData = JObject.Parse(item.ExtData);
}
catch
{
item.ExtData = new { ParseError = true, ParseMessage = "ExtData为非标准Json导致解析异常" };
}
}
} }
} }
} }

Loading…
Cancel
Save