wet 1 year ago
commit b945057789

@ -846,6 +846,28 @@ namespace Myshipping.Application
throw Oops.Oh($"请求派车调度失败,原因={taskRlt.msg}", typeof(InvalidOperationException));
}
//更新派车订单为已提交
model.Status = BookingTruckStatus.SUBMITED.ToString();
model.UpdatedTime = DateTime.Now;
model.UpdatedUserId = UserManager.UserId;
model.UpdatedUserName = UserManager.Name;
//提取任务流水号
if (taskRlt.ext != null)
model.TaskNo = taskRlt.ext.ToString();
await _bookingTruckRepository.AsUpdateable(model).UpdateColumns(it => new
{
it.Status,
it.UpdatedTime,
it.UpdatedUserId,
it.UpdatedUserName,
it.TaskNo
}).ExecuteCommandAsync();
result.succ = true;
result.msg = "提交成功";
//这里直接调用订舱服务的功能,担心有异常所以这里单独做了异常捕获
try
{
@ -874,28 +896,6 @@ namespace Myshipping.Application
_logger.LogInformation("批次={no} id={id} 触发发送东胜完成,原因:{erro}", batchNo, bookingOrder.Id, bkException.Message);
}
//更新派车订单为已提交
model.Status = BookingTruckStatus.SUBMITED.ToString();
model.UpdatedTime = DateTime.Now;
model.UpdatedUserId = UserManager.UserId;
model.UpdatedUserName = UserManager.Name;
//提取任务流水号
if (taskRlt.ext != null)
model.TaskNo = taskRlt.ext.ToString();
await _bookingTruckRepository.AsUpdateable(model).UpdateColumns(it => new
{
it.Status,
it.UpdatedTime,
it.UpdatedUserId,
it.UpdatedUserName,
it.TaskNo
}).ExecuteCommandAsync();
result.succ = true;
result.msg = "提交成功";
}
catch (Exception ex)
{
@ -1146,7 +1146,7 @@ namespace Myshipping.Application
_logger.LogInformation("批次={no} 请求报文msg={msg}", batchNo, JSON.Serialize(messageInfo));
//推送新增派车任务接口
//推送取消派车任务接口
var taskRlt = await _taskManageExternalService.CancelTruckDispatchAsync(messageInfo);
DateTime eDate = DateTime.Now;
@ -1758,9 +1758,10 @@ namespace Myshipping.Application
}
else if (operateType == OperateTypeEnum.Cancel)
{
if (entityArg.Any(a => a.Status != BookingTruckStatus.SUBMITED.ToString()))
if (entityArg.Any(a => a.Status != BookingTruckStatus.SUBMITED.ToString()
&& a.Status != BookingTruckStatus.SEND_DISPATCH.ToString()))
{
throw Oops.Oh($"派车状态只有已提交才能撤销派车", typeof(InvalidOperationException));
throw Oops.Oh($"派车状态只有已提交、已派车才能撤销派车", typeof(InvalidOperationException));
}
}
else if (operateType == OperateTypeEnum.Delete)

@ -4862,10 +4862,10 @@ namespace Myshipping.Application
*/
try
{
var taskInfo = _taskBaseInfoRepository.AsQueryable()
var taskInfo = _taskBaseInfoRepository.AsQueryable().OrderByDescending(a => a.CreatedTime)
.First(t => t.OUT_BUSI_NO == $"{info.Head.SenderId}_{info.Head.GID}");
if(taskInfo == null)
if (taskInfo == null)
throw Oops.Oh($"任务不存在");
if(new string[] { TaskStatusEnum.Complete.ToString(), TaskStatusEnum.Pending.ToString(),TaskStatusEnum.Pending.ToString() }
@ -4877,8 +4877,8 @@ namespace Myshipping.Application
if (truckInfo == null)
throw Oops.Oh($"派车任务不存在");
if(truckInfo.Status == BookingTruckStatus.SEND_DISPATCH.ToString())
throw Oops.Oh($"派车任务状态是已派车不能撤销");
//if(truckInfo.Status == BookingTruckStatus.SEND_DISPATCH.ToString())
// throw Oops.Oh($"派车任务状态是已派车不能撤销");
DateTime nowDate = DateTime.Now;

Loading…
Cancel
Save