增加载具导入功能
This commit is contained in:
@@ -48,6 +48,11 @@ namespace Tnb.WarehouseMgr
|
||||
OverideFuncs.ImportAsync = DataImport;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 载具导入
|
||||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
/// <returns></returns>
|
||||
private async Task<dynamic> DataImport(IFormFile file)
|
||||
{
|
||||
int row = 0;
|
||||
@@ -65,9 +70,10 @@ namespace Tnb.WarehouseMgr
|
||||
string carryStdId = string.Empty;
|
||||
foreach (var d in dics)
|
||||
{
|
||||
var stdCodeKey = d["carrystd_code"].ToString();
|
||||
var stdCodeKey = d["carrystd_id"].ToString();
|
||||
carryStdId = carryStdDic.ContainsKey(stdCodeKey) ? carryStdDic[stdCodeKey]?.ToString() ?? "" : "";
|
||||
d.Add("carrystd_id", carryStdId);
|
||||
d.Add("carrystd_code", stdCodeKey??"");
|
||||
d["carrystd_id"] = carryStdId;
|
||||
locCodes.Add(d["location_code"]?.ToString() ?? string.Empty);
|
||||
carryH = d.Adapt<WmsCarryH>();
|
||||
carrys.Add(carryH);
|
||||
@@ -80,17 +86,22 @@ namespace Tnb.WarehouseMgr
|
||||
var c = carrys.Find(x => x.location_code == loc);
|
||||
if (c != null)
|
||||
c.location_id = locs[loc].ToString();
|
||||
|
||||
}
|
||||
}
|
||||
carrys.ForEach(x =>
|
||||
{
|
||||
x.id = SnowflakeIdHelper.NextId();
|
||||
x.org_id = _userManager.User.OrganizeId;
|
||||
x.status = 1;
|
||||
x.is_lock = 0;
|
||||
x.carry_status = ((int)EnumCarryStatus.空闲).ToString();
|
||||
x.out_status = ((int)EnumOutStatus.正常).ToString();
|
||||
x.is_check = 0;
|
||||
x.is_check = 1;
|
||||
x.create_id = _userManager.UserId;
|
||||
x.create_time = DateTime.Now;
|
||||
x.modify_id = null;
|
||||
x.modify_time = null;
|
||||
});
|
||||
}
|
||||
await _db.Ado.BeginTranAsync();
|
||||
|
||||
Reference in New Issue
Block a user