修改派车回写

optimize
jianghaiqing 2 years ago
parent 542de57052
commit 5e396b907c

@ -182,35 +182,54 @@ namespace Myshipping.Application
{ {
//校验 //校验
ValidateTruck(OperateTypeEnum.Save, new BookingTruck[] { model }); 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 else
{ {
ValidateTruck(OperateTypeEnum.DispatchBackSave, new BookingTruck[] { model }); ValidateTruck(OperateTypeEnum.DispatchBackSave, new BookingTruck[] { model });
entity.Status = BookingTruckStatus.SEND_DISPATCH.ToString(); entity.Status = BookingTruckStatus.SEND_DISPATCH.ToString();
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.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); await _bookingTruckContaRepository.DeleteAsync(x => x.TruckId == model.Id);
if (entityCtnList != null && entityCtnList.Count > 0) if (entityCtnList != null && entityCtnList.Count > 0)

Loading…
Cancel
Save