fix 时间变更,在线订单转离线情况
This commit is contained in:
@@ -61,7 +61,7 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
{
|
||||
if (handler.Acquired)
|
||||
{
|
||||
if (!await DbContext.Queryable<CanteenOrderEntity>().Where(x => x.ThirdNo == request.ThirdNo).AnyAsync())
|
||||
if (await ToCheckAsync(request.ThirdNo))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -128,6 +128,26 @@ public class OrderService : BaseOrderService, IOrderService
|
||||
};
|
||||
}
|
||||
|
||||
private async Task<bool> ToCheckAsync(string thirdNo)
|
||||
{
|
||||
var order = await DbContext.Queryable<CanteenOrderEntity>()
|
||||
.Where(x => x.ThirdNo == thirdNo)
|
||||
.OrderBy(x => x.CreateTime, OrderByType.Desc)
|
||||
.FirstAsync();
|
||||
|
||||
if (order == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!order.IsOffline && order.OrderStatus != CanteenOrderStatusEnumType.Success)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private async Task HandleOfflineAsync(ConsumeRequest request, GainfoEntity gainfo)
|
||||
{
|
||||
|
||||
@@ -59,7 +59,6 @@ public class DeviceTaskAssignmentService : IDeviceTaskAssignmentService
|
||||
})
|
||||
.ToPageListAsync(request);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var tenantResult = await _tenantApi.GetTenantsInternalAsync();
|
||||
@@ -94,6 +93,7 @@ public class DeviceTaskAssignmentService : IDeviceTaskAssignmentService
|
||||
//更新任务状态
|
||||
await _dbContext.Updateable<DeviceTaskEntity>()
|
||||
.SetColumns(x => x.Status == DeviceTaskStatusEnumType.Wait)
|
||||
.SetColumns(x => x.ModifiedTime == DateTime.Now)
|
||||
.Where(x => request.Ids.Contains(x.Id))
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user