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