jianghaiqing 4 weeks ago
commit 026a98deab

@ -1845,14 +1845,22 @@ namespace Myshipping.Application
//}
//变更船期
await _vesselinfo.UpdateAsync(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false && x.Vessel == item.Vessel && x.Voyno == item.Voyno && x.PortLoadingId == item.PortLoadId,
x => new DjyVesselInfo
{
ETA = item.ETA,
YgtETD = item.ETD,
ATD = item.ATD,
UpdatedTime = DateTime.Now
});
//await _vesselinfo.UpdateAsync(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false && x.Vessel == item.Vessel && x.Voyno == item.Voyno && x.PortLoadingId == item.PortLoadId,
// x => new DjyVesselInfo
// {
// ETA = item.ETA,
// YgtETD = item.ETD,
// ATD = item.ATD,
// UpdatedTime = DateTime.Now
// });
await _vesselinfo.AsUpdateable()
.SetColumnsIF(item.ETA != null, x => x.ETA == item.ETA)
.SetColumnsIF(item.ETD != null, x => x.YgtETD == item.ETD)
.SetColumnsIF(item.ATD != null, x => x.ATD == item.ATD)
.SetColumns(x => x.UpdatedTime == DateTime.Now)
.Where(x => x.TenantId == UserManager.TENANT_ID && x.IsDeleted == false && x.Vessel == item.Vessel && x.Voyno == item.Voyno && x.PortLoadingId == item.PortLoadId)
.ExecuteCommandAsync();
//没有港口的按青岛港处理
if (string.IsNullOrEmpty(item.PortLoadId))
@ -1906,25 +1914,25 @@ namespace Myshipping.Application
Lazy<IUpdateable<BookingOrder>> update = new(() => _rep.Context.Updateable<BookingOrder>());
Lazy<BookingOrder> newOrder = new(() => order.Adapt<BookingOrder>());
if (order.StartETA != item.ETA)
if (order.StartETA != item.ETA && item.ETA != null)
{
isupdate = true;
newOrder.Value.StartETA = item.ETA;
update.Value.SetColumns(b => b.StartETA == item.ETA);
}
if (order.YgtETD != item.ETD)
if (order.YgtETD != item.ETD && item.ETD != null)
{
isupdate = true;
newOrder.Value.YgtETD = item.ETD;
update.Value.SetColumns(b => b.YgtETD == item.ETD);
}
if (order.ATD != item.ATD && order.ATD == null)
if (order.ATD != item.ATD && item.ATD != null)
{
isupdate = true;
newOrder.Value.ATD = item.ATD;
update.Value.SetColumns(b => b.ATD == item.ATD);
}
if (order.StartATA != item.ATA)
if (order.StartATA != item.ATA && item.ATA != null)
{
isupdate = true;
newOrder.Value.StartATA = item.ATA;

@ -35,6 +35,8 @@ public class RequestActionFilter : IAsyncActionFilter
var httpContext = context.HttpContext;
var httpRequest = httpContext.Request;
string param = context.ActionArguments.Count < 1 ? "" : context.ActionArguments.ToJsonString();
var sw = new Stopwatch();
sw.Start();
var actionContext = await next();
@ -117,7 +119,7 @@ public class RequestActionFilter : IAsyncActionFilter
ClassName = context.Controller.ToString(),
MethodName = actionDescriptor?.ActionName,
ReqMethod = httpRequest.Method,
Param = context.ActionArguments.Count < 1 ? "" : context.ActionArguments.ToJsonString(),
Param = param,
Result = actionContext.Result?.GetType() == typeof(JsonResult) ? actionContext.Result.ToJsonString() : "",
ElapsedTime = sw.ElapsedMilliseconds,
OpTime = DateTime.Now,

@ -432,6 +432,10 @@ where TEntity : class, new()
{
return EntityContext.Updateable<TEntity>(entities.ToArray()).IgnoreColumns(UpdateIgnoreColumns);
}
public virtual IUpdateable<TEntity> AsUpdateable()
{
return EntityContext.Updateable<TEntity>().IgnoreColumns(UpdateIgnoreColumns);
}
#endregion
#region 删除

Loading…
Cancel
Save