wet 2 years ago
commit 4b86a53a9d

@ -182,35 +182,52 @@ namespace Myshipping.Application
{
//校验
ValidateTruck(OperateTypeEnum.Save, new BookingTruck[] { model });
entity.UpdatedTime = DateTime.Now;
entity.UpdatedUserId = UserManager.UserId;
entity.UpdatedUserName = UserManager.Name;
await _bookingTruckRepository.AsUpdateable(entity).IgnoreColumns(it => new
{
it.TenantId,
it.CreatedTime,
it.CreatedUserId,
it.CreatedUserName,
it.IsDeleted,
it.BookingId,
it.TruckId,
it.TruckName,
it.TruckCode,
it.Status,
it.TruckFlowNo,
it.TaskNo
}).ExecuteCommandAsync();
}
else
{
ValidateTruck(OperateTypeEnum.DispatchBackSave, new BookingTruck[] { model });
entity.Status = BookingTruckStatus.SEND_DISPATCH.ToString();
entity.UpdatedTime = DateTime.Now;
entity.UpdatedUserId = UserManager.UserId;
entity.UpdatedUserName = UserManager.Name;
entity.Status = info.CallBackStatus;
await _bookingTruckRepository.AsUpdateable(entity).IgnoreColumns(it => new
{
it.TenantId,
it.CreatedTime,
it.CreatedUserId,
it.CreatedUserName,
it.IsDeleted,
it.BookingId,
it.TruckFlowNo,
it.TaskNo
}).ExecuteCommandAsync();
}
entity.UpdatedTime = DateTime.Now;
entity.UpdatedUserId = UserManager.UserId;
entity.UpdatedUserName = UserManager.Name;
await _bookingTruckRepository.AsUpdateable(entity).IgnoreColumns(it => new
{
it.TenantId,
it.CreatedTime,
it.CreatedUserId,
it.CreatedUserName,
it.IsDeleted,
it.BookingId,
it.TruckId,
it.TruckName,
it.TruckCode,
it.Status,
it.TruckFlowNo,
it.TaskNo
}).ExecuteCommandAsync();
await _bookingTruckContaRepository.DeleteAsync(x => x.TruckId == model.Id);
if (entityCtnList != null && entityCtnList.Count > 0)
@ -745,8 +762,8 @@ namespace Myshipping.Application
messageInfo.Main.RecvUserId = model.DispatcherId.ToString();
messageInfo.Main.RecvUserName = model.DispatcherName;
messageInfo.Main.TaskTitle = $"{model.MBLNo}_派车任务";
messageInfo.Main.TaskDesp = $"{model.MBLNo}_派车任务";
messageInfo.Main.TaskTitle = $"{model.TruckFlowNo}_派车任务";
messageInfo.Main.TaskDesp = $"{model.TruckFlowNo}_派车任务";
messageInfo.Main.TaskSource = TaskSourceEnum.CUSTOMER_SUBMIT;
@ -1651,7 +1668,9 @@ namespace Myshipping.Application
}
else if(operateType == OperateTypeEnum.DispatchBackSave)
{
if (entityArg.Any(a => a.Status != BookingTruckStatus.SUBMITED.ToString()))
if (entityArg.Any(a => a.Status != BookingTruckStatus.SUBMITED.ToString()
&& a.Status != BookingTruckStatus.SEND_DISPATCH.ToString()
&& a.Status != BookingTruckStatus.CANCEL_DISPATCH.ToString()))
{
throw Oops.Oh($"派车状态只有已提交才能回写详情", typeof(InvalidOperationException));
}
@ -1682,7 +1701,9 @@ namespace Myshipping.Application
if (bookingTruckInfo == null)
throw Oops.Oh($"派车信息不存在", typeof(InvalidOperationException));
if(bookingTruckInfo.Status != BookingTruckStatus.SUBMITED.ToString())
if(bookingTruckInfo.Status != BookingTruckStatus.SUBMITED.ToString()
&& bookingTruckInfo.Status != BookingTruckStatus.SEND_DISPATCH.ToString()
&& bookingTruckInfo.Status != BookingTruckStatus.CANCEL_DISPATCH.ToString())
throw Oops.Oh($"当前派车信息不是已提交状态不能接收回写", typeof(InvalidOperationException));
var id = await InnerSave(info,true);

@ -182,6 +182,11 @@ namespace Myshipping.Application
/// </summary>
public string FactoryAddr { get; set; }
/// <summary>
/// 回写状态
/// </summary>
public string CallBackStatus { get; set; }
/// <summary>
/// 集装箱列表
/// </summary>

@ -174,9 +174,6 @@ namespace Myshipping.Application
it.CreatedUserName,
it.IsDeleted,
it.BookingId,
it.TruckId,
it.TruckName,
it.TruckCode,
it.Status,
it.TruckFlowNo,
it.TaskNo,
@ -879,13 +876,17 @@ namespace Myshipping.Application
it.TruckFlowNo,
it.TaskNo,
it.TASK_ID,
it.BookingTruckId
it.BookingTruckId,
it.DispatcherId,
it.DispatcherName
}).ExecuteCommandAsync();
var truckCtnList =_taskTruckContaRepository.AsQueryable().Where(a => a.P_ID == info.PK_ID).ToList();
BookingTruckDto model = info.Adapt<BookingTruckDto>();
model.CallBackStatus = info.Status;
if (truckCtnList.Count > 0)
model.ContaList = truckCtnList.Adapt<List<BookingTruckCtnDto>>();
@ -969,8 +970,24 @@ namespace Myshipping.Application
it.TruckCode,
}).ExecuteCommandAsync();
var truckCtnList = _taskTruckContaRepository.AsQueryable().Where(a => a.P_ID == info.PK_ID).ToList();
BookingTruckDto model = info.Adapt<BookingTruckDto>();
model.CallBackStatus = info.Status;
if (truckCtnList.Count > 0)
model.ContaList = truckCtnList.Adapt<List<BookingTruckCtnDto>>();
if (info.BookingTruckId.HasValue)
model.Id = info.BookingTruckId.Value;
//更新完回写订舱的派车信息
var service = _namedServiceProvider.GetService(nameof(BookingTruckService));
var rlt = await service.TruckDispatchCompleteCallBack(model);
result.succ = true;
result.msg = "取消成功";
result.ext = rlt;
}
catch (Exception ex)
{
@ -1118,7 +1135,7 @@ namespace Myshipping.Application
if (operateType == OperateTypeEnum.Save)
{
if (entityArg.Any(a => a.Status != BookingTruckStatus.TEMP.ToString()
&& a.Status != BookingTruckStatus.CANCELED.ToString()))
&& a.Status != BookingTruckStatus.CANCELED.ToString() && a.Status != BookingTruckStatus.CANCEL_DISPATCH.ToString()))
{
throw Oops.Oh($"派车状态只有暂存、已撤销才能保存");
}

Loading…
Cancel
Save