optimize
wet 1 year ago
parent 7ca2026770
commit 8046705389

@ -1120,6 +1120,12 @@ namespace Myshipping.Application
foreach (var ar in arr) foreach (var ar in arr)
{ {
long Id = Convert.ToInt64(ar); long Id = Convert.ToInt64(ar);
var order = _rep.AsQueryable().Filter(null, true).Where(x => x.Id = Id).First();
var et = await _rep.AsQueryable().Filter(null, true).Where(x => x.IsDeleted == false && x.MBLNO == order.MBLNO && x.TenantId == UserManager.TENANT_ID && x.ParentId == 0 && x.Id != Id).FirstAsync();
if (et != null)
{
throw Oops.Bah("当前主提单号已存在,无法恢复!");
}
var ctnlist = await _repCtn.AsQueryable().Where(x => x.BILLID == Id).Select(x => x.Id).ToListAsync(); var ctnlist = await _repCtn.AsQueryable().Where(x => x.BILLID == Id).Select(x => x.Id).ToListAsync();
await _repCtn.UpdateAsync(x => x.BILLID == Id, x => new BookingCtn { IsDeleted = false }); await _repCtn.UpdateAsync(x => x.BILLID == Id, x => new BookingCtn { IsDeleted = false });
await _ctndetailrep.UpdateAsync(x => ctnlist.Contains((long)x.CTNID), x => new BookingCtnDetail { IsDeleted = false }); await _ctndetailrep.UpdateAsync(x => ctnlist.Contains((long)x.CTNID), x => new BookingCtnDetail { IsDeleted = false });
@ -1128,17 +1134,11 @@ namespace Myshipping.Application
await SendBookingOrder(new long[] { Id }); await SendBookingOrder(new long[] { Id });
_logger.LogInformation(Id + "恢复删除成功!"); _logger.LogInformation(Id + "恢复删除成功!");
} }
//try //try
//{ //{
// SendBookingOrder(Id); // SendBookingOrder(Id);
// const string MqActionExchangeName = "djy.output.dingcang.ds6"; // const string MqActionExchangeName = "djy.output.dingcang.ds6";
// const string MqActionQueueName = "djy.output.dingcang.ds6_recoverdelete"; // const string MqActionQueueName = "djy.output.dingcang.ds6_recoverdelete";

Loading…
Cancel
Save