|
|
|
@ -54,6 +54,7 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly SqlSugarRepository<BookingPrintTemplate> _bookingPrintTemplateTemplate;
|
|
|
|
|
private readonly SqlSugarRepository<DjyUserConfig> _djyUserConfigConfig;
|
|
|
|
|
private readonly SqlSugarRepository<BookingExcelTemplate> _bookingExcelTemplateRepository;
|
|
|
|
|
private readonly SqlSugarRepository<SysUser> _sysUserRepository;
|
|
|
|
|
private readonly ITaskManageExternalService _taskManageExternalService;
|
|
|
|
|
|
|
|
|
|
const string PRINT_LIST_TYPE_KEY = "booking_truck_print_list";
|
|
|
|
@ -67,6 +68,7 @@ namespace Myshipping.Application
|
|
|
|
|
SqlSugarRepository<BookingPrintTemplate> bookingPrintTemplateTemplate,
|
|
|
|
|
SqlSugarRepository<DjyUserConfig> djyUserConfigConfig,
|
|
|
|
|
SqlSugarRepository<BookingExcelTemplate> bookingExcelTemplateRepository,
|
|
|
|
|
SqlSugarRepository<SysUser> sysUserRepository,
|
|
|
|
|
ITaskManageExternalService taskManageExternalService)
|
|
|
|
|
{
|
|
|
|
|
_cache = cache;
|
|
|
|
@ -81,6 +83,7 @@ namespace Myshipping.Application
|
|
|
|
|
_bookingPrintTemplateTemplate = bookingPrintTemplateTemplate;
|
|
|
|
|
_djyUserConfigConfig = djyUserConfigConfig;
|
|
|
|
|
_bookingExcelTemplateRepository = bookingExcelTemplateRepository;
|
|
|
|
|
_sysUserRepository = sysUserRepository;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -136,6 +139,15 @@ namespace Myshipping.Application
|
|
|
|
|
}).ToArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (entity.DispatcherId.HasValue && entity.DispatcherId.Value > 0)
|
|
|
|
|
{
|
|
|
|
|
var dispatchUser = _sysUserRepository.AsQueryable().First(a => a.Id == entity.DispatcherId.Value);
|
|
|
|
|
|
|
|
|
|
if (dispatchUser != null)
|
|
|
|
|
entity.DispatcherName = dispatchUser.Name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (entity.Id == 0)
|
|
|
|
|
{
|
|
|
|
|
entity.Status = BookingTruckStatus.TEMP.ToString();
|
|
|
|
@ -819,7 +831,7 @@ namespace Myshipping.Application
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.succ = false;
|
|
|
|
|
result.msg = $"撤销异常,原因:{ex.Message}";
|
|
|
|
|
result.msg = ex.GetMessage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
@ -922,7 +934,7 @@ namespace Myshipping.Application
|
|
|
|
|
var model = _bookingTruckRepository.AsQueryable().First(a => a.Id == id);
|
|
|
|
|
|
|
|
|
|
if (model == null)
|
|
|
|
|
throw Oops.Oh($"派车信息获取失败,派车信息不存在或已作废");
|
|
|
|
|
throw Oops.Oh($"派车信息获取失败,派车信息不存在或已作废", typeof(InvalidOperationException));
|
|
|
|
|
|
|
|
|
|
//校验
|
|
|
|
|
ValidateTruck(OperateTypeEnum.Cancel, new BookingTruck[] { model });
|
|
|
|
@ -972,7 +984,7 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
if (!taskRlt.succ)
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"请求撤销派车调度失败,原因={taskRlt.msg}");
|
|
|
|
|
throw Oops.Oh($"请求撤销派车调度失败,原因={taskRlt.msg}", typeof(InvalidOperationException));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新派车订单为已提交
|
|
|
|
@ -998,7 +1010,7 @@ namespace Myshipping.Application
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
result.succ = false;
|
|
|
|
|
result.msg = $"撤销异常,原因:{ex.Message}";
|
|
|
|
|
result.msg = ex.GetMessage("撤销失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|