|
|
|
@ -522,6 +522,7 @@ namespace Myshipping.Application
|
|
|
|
|
*/
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//先保存
|
|
|
|
|
var id = InnerSave(info);
|
|
|
|
|
|
|
|
|
@ -537,6 +538,46 @@ namespace Myshipping.Application
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 校验派车
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="operateType">操作类型</param>
|
|
|
|
|
/// <param name="entityArg">派车信息列表</param>
|
|
|
|
|
private void ValidateTruck(OperateTypeEnum operateType, BookingTruck[] entityArg)
|
|
|
|
|
{
|
|
|
|
|
if (operateType == OperateTypeEnum.Save)
|
|
|
|
|
{
|
|
|
|
|
if (entityArg.Any(a => a.Status != BookingTruckStatus.TEMP.ToString()
|
|
|
|
|
&& a.Status != BookingTruckStatus.CANCELED.ToString()))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"派车状态只有暂存、已撤销才能保存");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operateType == OperateTypeEnum.Submit)
|
|
|
|
|
{
|
|
|
|
|
if (entityArg.Any(a => a.Status != BookingTruckStatus.TEMP.ToString()
|
|
|
|
|
&& a.Status != BookingTruckStatus.CANCELED.ToString()))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"派车状态只有暂存、已撤销才能提交");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operateType == OperateTypeEnum.Cancel)
|
|
|
|
|
{
|
|
|
|
|
if (entityArg.Any(a => a.Status != BookingTruckStatus.SUBMITED.ToString()))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"派车状态只有已提交才能撤销派车");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operateType == OperateTypeEnum.Delete)
|
|
|
|
|
{
|
|
|
|
|
if (entityArg.Any(a => a.Status != BookingTruckStatus.TEMP.ToString()
|
|
|
|
|
&& a.Status != BookingTruckStatus.CANCELED.ToString()))
|
|
|
|
|
{
|
|
|
|
|
throw Oops.Oh($"派车状态只有暂存、已撤销才能作废");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 批量提交派车
|
|
|
|
|
/// </summary>
|
|
|
|
|