修改订单删除

master
jianghaiqing 1 week ago
parent f36ba19cbd
commit 5385a0d4f7

@ -115,6 +115,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingSlotAllocation> _repSlotAllocation; private readonly SqlSugarRepository<BookingSlotAllocation> _repSlotAllocation;
private readonly SqlSugarRepository<BookingSlotAllocationCtn> _repSlotAllocationCtn; private readonly SqlSugarRepository<BookingSlotAllocationCtn> _repSlotAllocationCtn;
private readonly SqlSugarRepository<BookingGoodsStatusSubscribe> _repBookingStatusSubscribe; private readonly SqlSugarRepository<BookingGoodsStatusSubscribe> _repBookingStatusSubscribe;
private readonly SqlSugarRepository<TaskBCInfo> _repTaskBCInfo;
private readonly SqlSugarRepository<BookingExtendState> _repextendstate; private readonly SqlSugarRepository<BookingExtendState> _repextendstate;
@ -162,6 +163,7 @@ namespace Myshipping.Application
IServiceWorkFlowManageService serviceWorkFlowManageService, IDjyUserConfigService djyUserConfigService, IEventPublisher publisher, SqlSugarRepository<BookingSlotBase> repSlotBase, IServiceWorkFlowManageService serviceWorkFlowManageService, IDjyUserConfigService djyUserConfigService, IEventPublisher publisher, SqlSugarRepository<BookingSlotBase> repSlotBase,
SqlSugarRepository<BookingSlotAllocation> repSlotAllocation, SqlSugarRepository<BookingSlotAllocationCtn> repSlotAllocationCtn, IBookingSlotService bookingSlotService, SqlSugarRepository<BookingSlotAllocation> repSlotAllocation, SqlSugarRepository<BookingSlotAllocationCtn> repSlotAllocationCtn, IBookingSlotService bookingSlotService,
SqlSugarRepository<BookingGoodsStatusSubscribe> repBookingStatusSubscribe, SqlSugarRepository<DjyTenantParamValue> repTenantParamValue, IBookingValueAddedService bookingValueAddedService, SqlSugarRepository<BookingGoodsStatusSubscribe> repBookingStatusSubscribe, SqlSugarRepository<DjyTenantParamValue> repTenantParamValue, IBookingValueAddedService bookingValueAddedService,
SqlSugarRepository<TaskBCInfo> repTaskBCInfo,
SqlSugarRepository<BookingCustomerOrder> repCustomerOrder, IDjyTenantParamService djyTenantParamService, SqlSugarRepository<DjyCustomerContact> repCustomerContact, SqlSugarRepository<PingTaiCustFee> repPingTaiCustFee, SqlSugarRepository<BookingMultiLineSplitRecord> repBookingMultiLineSplitRecord) SqlSugarRepository<BookingCustomerOrder> repCustomerOrder, IDjyTenantParamService djyTenantParamService, SqlSugarRepository<DjyCustomerContact> repCustomerContact, SqlSugarRepository<PingTaiCustFee> repPingTaiCustFee, SqlSugarRepository<BookingMultiLineSplitRecord> repBookingMultiLineSplitRecord)
{ {
this._logger = logger; this._logger = logger;
@ -222,6 +224,7 @@ namespace Myshipping.Application
_repCustomerContact = repCustomerContact; _repCustomerContact = repCustomerContact;
_repPingTaiCustFee = repPingTaiCustFee; _repPingTaiCustFee = repPingTaiCustFee;
_repBookingMultiLineSplitRecord = repBookingMultiLineSplitRecord; _repBookingMultiLineSplitRecord = repBookingMultiLineSplitRecord;
_repTaskBCInfo = repTaskBCInfo;
} }
#region 主表和箱信息 #region 主表和箱信息
@ -2482,6 +2485,21 @@ namespace Myshipping.Application
await CancelAllocationSlot(Id); await CancelAllocationSlot(Id);
} }
var taskbcList = _repTaskBCInfo.AsQueryable().Where(a => a.MBL_NO == mblno && a.TenantId == UserManager.TENANT_ID).ToList();
if (taskbcList.Count > 0)
{
foreach(var tbc in taskbcList)
{
tbc.BOOKING_ORDER_ID = null;
_repTaskBCInfo.AsUpdateable(tbc).UpdateColumns(x => new
{
x.BOOKING_ORDER_ID
}).ExecuteCommand();
}
}
// 记录日志 // 记录日志
var newOrder = order.Adapt<BookingOrder>(); var newOrder = order.Adapt<BookingOrder>();
newOrder.IsDeleted = true; newOrder.IsDeleted = true;
@ -2524,12 +2542,29 @@ namespace Myshipping.Application
await CancelAllocationSlot(Id); await CancelAllocationSlot(Id);
} }
var taskbcList = _repTaskBCInfo.AsQueryable().Where(a => a.MBL_NO == mblno && a.TenantId == UserManager.TENANT_ID).ToList();
if (taskbcList.Count > 0)
{
foreach (var tbc in taskbcList)
{
tbc.BOOKING_ORDER_ID = null;
_repTaskBCInfo.AsUpdateable(tbc).UpdateColumns(x => new
{
x.BOOKING_ORDER_ID
}).ExecuteCommand();
}
}
// 记录日志 // 记录日志
var newOrder = order.Adapt<BookingOrder>(); var newOrder = order.Adapt<BookingOrder>();
newOrder.IsDeleted = true; newOrder.IsDeleted = true;
newOrder.DeleteTime = deleteTime; newOrder.DeleteTime = deleteTime;
await SaveLog(newOrder, order, "删除"); await SaveLog(newOrder, order, "删除");
} }
} }
catch (Exception) catch (Exception)
{ {
@ -13786,6 +13821,8 @@ namespace Myshipping.Application
TenantId = item.TenantId TenantId = item.TenantId
})); }));
} }
} }
} }
#endregion #endregion

@ -783,7 +783,7 @@ namespace Myshipping.Application
fileList.ForEach(file => fileList.ForEach(file =>
{ {
if (file.FILE_CATEGORY == TaskFileCategoryEnum.SI_SUBMITTED.ToString()) if (file.FILE_CATEGORY == TaskFileCategoryEnum.VERIFY_COPY.ToString())
{ {
var fileFullPath = Path.Combine(dirAbs, file.FILE_PATH); var fileFullPath = Path.Combine(dirAbs, file.FILE_PATH);

Loading…
Cancel
Save