客户订舱查询

optimize
wanghaomei 1 year ago
parent 9c4627bcc5
commit d176bc8456

@ -79,10 +79,13 @@ namespace Myshipping.Application
.WhereIF(!string.IsNullOrEmpty(input.PORTDISCHARGE), x => x.PORTDISCHARGE.Contains(input.PORTDISCHARGE))
.WhereIF(!string.IsNullOrEmpty(input.CARRIERID), x => x.CARRIERID == input.CARRIERID)
.WhereIF(!string.IsNullOrEmpty(input.CARRIER), x => x.CARRIER.Contains(input.CARRIER))
.WhereIF(!string.IsNullOrEmpty(input.BookingTenantName), x => x.BookingTenantName.Contains(input.BookingTenantName))
.WhereIF(input.ETDStart.HasValue, x => x.ETD >= input.ETDStart)
.WhereIF(input.ETDEnd.HasValue, x => x.ETD < input.ETDEnd.Value.Date.AddDays(1))
.WhereIF(input.CreatedTimeStart.HasValue, x => x.CreatedTime >= input.CreatedTimeStart)
.WhereIF(input.CreatedTimeEnd.HasValue, x => x.CreatedTime < input.CreatedTimeEnd.Value.Date.AddDays(1))
.WhereIF(input.UpdateTimeStart.HasValue, x => x.UpdatedTime >= input.UpdateTimeStart)
.WhereIF(input.UpdateTimeEnd.HasValue, x => x.UpdatedTime < input.UpdateTimeEnd.Value.Date.AddDays(1))
.WhereIF(input.BSStatusList != null && input.BSStatusList.Count > 0, x => input.BSStatusList.Contains(x.BSSTATUS))
;
@ -103,7 +106,7 @@ namespace Myshipping.Application
var staLogList = _repStatuslog.Where(x => bkIdList.Contains(x.BookingId.Value) && x.Category == StaLogCateAudit).ToList();
foreach (var item in list.Items)
{
item.LogList = staLogList.Where(x => x.BookingId == item.Id).OrderBy(x => x.OpTime).Adapt<List<BookingCustomerLogDto>>();
item.LogList = staLogList.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.OpTime).Adapt<List<BookingCustomerLogDto>>();
}
return list;
@ -263,7 +266,7 @@ namespace Myshipping.Application
var dicFile = new Dictionary<long, string>();
_repFile.AsQueryable().Where(x => x.BookingId == entity.Id).ForEach(x => dicFile.Add(x.Id, x.FileName));
outModel.Files = dicFile;
outModel.LogList = _repStatuslog.AsQueryable().Where(x => x.BookingId == entity.Id && x.Category == StaLogCateAudit).ToList().Adapt<List<BookingCustomerLogDto>>();
outModel.LogList = _repStatuslog.AsQueryable().Where(x => x.BookingId == entity.Id && x.Category == StaLogCateAudit).OrderByDescending(x => x.OpTime).ToList().Adapt<List<BookingCustomerLogDto>>();
outModel.ServiceItemList = _repServiceItem.AsQueryable().Where(x => x.BookingId == entity.Id).ToList().Adapt<List<BookingServiceItemCustomerDto>>();
return outModel;
@ -285,7 +288,7 @@ namespace Myshipping.Application
var dicFile = new Dictionary<long, string>();
_repFile.AsQueryable().Where(x => x.BookingId == entity.Id).ForEach(x => dicFile.Add(x.Id, x.FileName));
outModel.Files = dicFile;
outModel.LogList = _repStatuslog.AsQueryable().Where(x => x.BookingId == entity.Id && x.Category == StaLogCateAudit).ToList().Adapt<List<BookingCustomerLogDto>>();
outModel.LogList = _repStatuslog.AsQueryable().Where(x => x.BookingId == entity.Id && x.Category == StaLogCateAudit).OrderByDescending(x => x.OpTime).ToList().Adapt<List<BookingCustomerLogDto>>();
outModel.ServiceItemList = _repServiceItem.AsQueryable().Where(x => x.BookingId == entity.Id).ToList().Adapt<List<BookingServiceItemCustomerDto>>();
return outModel;
@ -647,6 +650,15 @@ namespace Myshipping.Application
await _repCtn.InsertAsync(ctn);
}
//服务项目
var servList = await _repServiceItem.Where(x => x.BookingId == model.Id).ToListAsync();
foreach (var serv in servList)
{
serv.Id = YitIdHelper.NextId();
serv.BookingId = bkOrder.Id;
await _repServiceItem.InsertAsync(serv);
}
return bkOrder.Id;
}
@ -788,7 +800,7 @@ namespace Myshipping.Application
var idBackup = order.Id; //防止覆盖
var bsnoBackup = order.BSNO; //防止覆盖
order = order.Adapt(order);
order = item.Adapt(order);
order.Id = idBackup;
order.BSNO = bsnoBackup;
order.BSSTATUS = "已接收";
@ -973,6 +985,15 @@ namespace Myshipping.Application
ctn.BILLID = bkOrder.Id;
await _repCtn.InsertAsync(ctn);
}
//服务项目
var servList = await _repServiceItem.Where(x => x.BookingId == model.Id).ToListAsync();
foreach (var serv in servList)
{
serv.Id = YitIdHelper.NextId();
serv.BookingId = bkOrder.Id;
await _repServiceItem.InsertAsync(serv);
}
}
}

@ -67,10 +67,26 @@ namespace Myshipping.Application
/// </summary>
public DateTime? CreatedTimeEnd { get; set; }
/// <summary>
/// 修改日期起始
/// </summary>
public DateTime? UpdateTimeStart { get; set; }
/// <summary>
/// 修改日期截止
/// </summary>
public DateTime? UpdateTimeEnd { get; set; }
/// <summary>
/// 业务状态
/// </summary>
public List<string> BSStatusList { get; set; }
/// <summary>
/// 订舱租户名称
/// </summary>
public string BookingTenantName { get; set; }
}
//dto
@ -237,9 +253,10 @@ namespace Myshipping.Application
/// </summary>
public string TEMPMAX { get; set; }
/// <summary>
/// SO备注
/// 订舱要求
/// </summary>
public string SOREMARK { get; set; }
}
//保存dto
@ -278,6 +295,26 @@ namespace Myshipping.Application
/// </summary>
public string BSSTATUS { get; set; }
/// <summary>
/// 订舱租户名称
/// </summary>
public string BookingTenantName { get; set; }
/// <summary>
/// 订舱用户名称
/// </summary>
public string BookingUserName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreatedTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public string UpdatedTime { get; set; }
/// <summary>
/// 日志信息
@ -298,6 +335,26 @@ namespace Myshipping.Application
/// </summary>
public string BSSTATUS { get; set; }
/// <summary>
/// 订舱租户名称
/// </summary>
public string BookingTenantName { get; set; }
/// <summary>
/// 订舱用户名称
/// </summary>
public string BookingUserName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreatedTime { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public string UpdatedTime { get; set; }
/// <summary>
/// 文件列表
/// </summary>

Loading…
Cancel
Save