optimize
wet 2 years ago
parent 9bd70346c1
commit 14d0c0099f

@ -834,7 +834,7 @@ namespace Myshipping.Application
public async Task<List<BookingStatusLogDto>> GetBookingStatusLog(long Id) public async Task<List<BookingStatusLogDto>> GetBookingStatusLog(long Id)
{ {
var statuslog = await _repStatuslog.AsQueryable().Filter(null, true).Where(x => x.BookingId == Id).ToListAsync(); var statuslog = await _repStatuslog.AsQueryable().Filter(null, true).Where(x => x.BookingId == Id&&(x.Category== "yunzong"|| x.Category == "dingyue")).ToListAsync();
var dto = statuslog.Adapt<List<BookingStatusLogDto>>(); var dto = statuslog.Adapt<List<BookingStatusLogDto>>();
foreach (var item in dto) foreach (var item in dto)
{ {
@ -852,7 +852,7 @@ namespace Myshipping.Application
public async Task<List<BookingStatus>> GetBookingStatus(long Id) public async Task<List<BookingStatus>> GetBookingStatus(long Id)
{ {
var dto = await _repBookingStatus.AsQueryable().Filter(null, true).Where(x => x.BookingId == Id).ToListAsync(); var dto = await _repBookingStatus.AsQueryable().Where(x => x.BookingId == Id).ToListAsync();
return dto; return dto;
} }
@ -948,7 +948,7 @@ namespace Myshipping.Application
}); });
var bookingStatusLog = new BookingStatusLog(); var bookingStatusLog = new BookingStatusLog();
bookingStatusLog.BookingId = Convert.ToInt64(item.BusinessId); bookingStatusLog.BookingId = Convert.ToInt64(item.BusinessId);
bookingStatusLog.Category = "ship"; bookingStatusLog.Category = "dingyue";
bookingStatusLog.CreatedTime = DateTime.Now; bookingStatusLog.CreatedTime = DateTime.Now;
if (string.IsNullOrWhiteSpace(item.YardCode) && !string.IsNullOrWhiteSpace(item.CARRIERID)) if (string.IsNullOrWhiteSpace(item.YardCode) && !string.IsNullOrWhiteSpace(item.CARRIERID))
{ {
@ -1012,8 +1012,8 @@ namespace Myshipping.Application
public async Task AddBookingStatusLog(List<BookingStatusLogDto> all) public async Task AddBookingStatusLog(List<BookingStatusLogDto> all)
{ {
//清空原有数据 //清空原有数据
var old = await _repStatuslog.AsQueryable().Where(x => x.BookingId == all[0].BookingId && x.Category == "ship").ToListAsync(); var old = await _repStatuslog.AsQueryable().Where(x => x.BookingId == all[0].BookingId && x.Category == "yunzong").ToListAsync();
await _repStatuslog.DeleteAsync(x => x.BookingId == all[0].BookingId && x.Category == "ship"); await _repStatuslog.DeleteAsync(x => x.BookingId == all[0].BookingId && x.Category == "yunzong");
foreach (var ot in old) foreach (var ot in old)
{ {
await _statuslogdetail.DeleteAsync(x => x.PId == ot.Id); await _statuslogdetail.DeleteAsync(x => x.PId == ot.Id);
@ -1025,7 +1025,7 @@ namespace Myshipping.Application
//新增数据 //新增数据
var bookingStatusLog = new BookingStatusLog(); var bookingStatusLog = new BookingStatusLog();
bookingStatusLog.BookingId = item.BookingId; bookingStatusLog.BookingId = item.BookingId;
bookingStatusLog.Category = "ship"; bookingStatusLog.Category = "yunzong";
bookingStatusLog.CreatedTime = DateTime.Now; bookingStatusLog.CreatedTime = DateTime.Now;
bookingStatusLog.Status = item.Status; bookingStatusLog.Status = item.Status;
bookingStatusLog.OpTime = item.OpTime; bookingStatusLog.OpTime = item.OpTime;

Loading…
Cancel
Save