导入昭阳港口信息

dev
cjy 2 months ago
parent 444f596465
commit 459751ce6c

@ -6,6 +6,7 @@ using System.Threading.Tasks;
namespace DS.WMS.Core.Code.Import
{
[SqlSugar.SugarTable("code_port_import_zy", "港口信息导入-昭阳")]
public class PortImportZY
{
/// <summary>
@ -19,6 +20,7 @@ namespace DS.WMS.Core.Code.Import
/// <summary>
///
/// </summary>
[SqlSugar.SugarColumn(IsPrimaryKey = true, Length = 100, ColumnDescription = "主键ID")]
public int PortId { get; set; }
/// <summary>
///

@ -37,20 +37,20 @@ namespace DS.WMS.Core.Code.Method
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = new List<CodeGoods>();
foreach (var item in req.Hscode)
{
var data = new CodeGoods()
{
//GoodsCode = PinYinUtil.GetFristLetter((Regex.Unescape(item.HscodeName).Replace("\\","/"))),
GoodsCode = item.Hscode,
GoodName = Regex.Unescape(item.HscodeName.Replace("\\", "/")).Replace("\n", " ").Trim(),
HSCode = item.Hscode,
};
list.Add(data);
}
//Console.WriteLine(list);
await tenantDb.Insertable(list).ExecuteCommandAsync();
//var list = new List<CodeGoods>();
//foreach (var item in req.Hscode)
//{
// var data = new CodeGoods()
// {
// //GoodsCode = PinYinUtil.GetFristLetter((Regex.Unescape(item.HscodeName).Replace("\\","/"))),
// GoodsCode = item.Hscode,
// GoodName = Regex.Unescape(item.HscodeName.Replace("\\", "/")).Replace("\n", " ").Trim(),
// HSCode = item.Hscode,
// };
// list.Add(data);
//}
////Console.WriteLine(list);
//await tenantDb.Insertable(list).ExecuteCommandAsync();
//var list = new List<CodeLanes>();
//foreach (var item in req.RouteList)
@ -93,7 +93,7 @@ namespace DS.WMS.Core.Code.Method
//}
//await tenantDb.Insertable(carrierlist).ExecuteCommandAsync();
//var portlist = new List<CodePort>();
var portlist = new List<CodePort>();
//var laneList = tenantDb.Queryable<CodeLanes>().ToList();
//foreach (var item in req.PortList)
//{
@ -107,7 +107,7 @@ namespace DS.WMS.Core.Code.Method
// var data = new CodePort()
// {
// PortName = item.PortNameEn,
// CnName = item.PortNameZh.IsNotNull() ? Regex.Unescape(item.PortNameZh) : "",
// CnName = item.PortNameZh.IsNotNull() ? Regex.Unescape(item.PortNameZh) : "",
// EdiCode = item.PortCode,
// CountryId = country.IsNotNull() ? country.Id : 0,
// CountryName = country.IsNotNull() ? country.CountryName : "",
@ -119,6 +119,13 @@ namespace DS.WMS.Core.Code.Method
// portlist.Add(data);
//}
//await tenantDb.Insertable(portlist).ExecuteCommandAsync();
foreach (var item in req.PortList)
{
item.PortNameZh = item.PortNameZh.IsNotNull() ? Regex.Unescape(item.PortNameZh) : "";
item.CountryNameCh = item.CountryNameCh.IsNotNull() ? Regex.Unescape(item.CountryNameCh) : "";
item.CountryNameCn = item.CountryNameCn.IsNotNull() ? Regex.Unescape(item.CountryNameCn) : "";
}
await tenantDb.Insertable(req.PortList).ExecuteCommandAsync();
return await Task.FromResult(DataResult<string>.Failed("导入成功!", MultiLanguageConst.DataImportSuccess));

@ -346,7 +346,7 @@ namespace DS.WMS.PrintApi.Service
{
var param = JsonHelper.Instance.Deserialize<Dictionary<string, dynamic>>(req.ParamJsonStr);
foreach (var p in param)
{
{
sugarParams.Add(new SugarParameter($"@{p.Key}", p.Value));
}
}

Loading…
Cancel
Save