usertest
cjy 4 months ago
parent bc40da9b3e
commit 1d78b16f00

@ -2000,13 +2000,32 @@ namespace DS.WMS.Core.Op.Method
info.Note = "对外开放更新接口";
#region 处理箱型箱量
if (req.CtnInfo.Count > 0)
if (req.CtnInfo.IsNotNull() && req.CtnInfo.Count > 0)
{
//处理箱型箱量
info = UpdateSeaExportCtnInfo(info, req.CtnInfo);
var ctnList = await tenantDb.Queryable<OpCtn>().Where(x => x.BSNO == req.Id.ToString()).ToListAsync();
foreach (var item in req.CtnInfo)
{
if (item.Id == 0)
{
var ctn = item.Adapt<OpCtn>();
ctn.BSNO = info.Id.ToString();
await tenantDb.Insertable(ctn).ExecuteCommandAsync();
}
else
{
var ctn = ctnList.First(x => x.Id == item.Id);
ctn = item.Adapt(ctn);
await tenantDb.Updateable(ctn).ExecuteCommandAsync();
}
}
}
#endregion
await tenantDb.Updateable(info).UpdateColumns(dic).EnableDiffLogEvent().ExecuteCommandAsync();
await tenantDb.Updateable(info).UpdateColumns(dic).EnableDiffLogEvent().ExecuteCommandAsync();
return await Task.FromResult(DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess));
}

Loading…
Cancel
Save