diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs index 8f925174..dfc574f7 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs @@ -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>(); + item.LogList = staLogList.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.OpTime).Adapt>(); } return list; @@ -263,7 +266,7 @@ namespace Myshipping.Application var dicFile = new Dictionary(); _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>(); + outModel.LogList = _repStatuslog.AsQueryable().Where(x => x.BookingId == entity.Id && x.Category == StaLogCateAudit).OrderByDescending(x => x.OpTime).ToList().Adapt>(); outModel.ServiceItemList = _repServiceItem.AsQueryable().Where(x => x.BookingId == entity.Id).ToList().Adapt>(); return outModel; @@ -285,7 +288,7 @@ namespace Myshipping.Application var dicFile = new Dictionary(); _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>(); + outModel.LogList = _repStatuslog.AsQueryable().Where(x => x.BookingId == entity.Id && x.Category == StaLogCateAudit).OrderByDescending(x => x.OpTime).ToList().Adapt>(); outModel.ServiceItemList = _repServiceItem.AsQueryable().Where(x => x.BookingId == entity.Id).ToList().Adapt>(); 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); + } } } diff --git a/Myshipping.Application/Service/BookingCustomerOrder/Dto/Dtos.cs b/Myshipping.Application/Service/BookingCustomerOrder/Dto/Dtos.cs index 424f877f..7b3d1052 100644 --- a/Myshipping.Application/Service/BookingCustomerOrder/Dto/Dtos.cs +++ b/Myshipping.Application/Service/BookingCustomerOrder/Dto/Dtos.cs @@ -67,10 +67,26 @@ namespace Myshipping.Application /// public DateTime? CreatedTimeEnd { get; set; } + /// + /// 修改日期起始 + /// + public DateTime? UpdateTimeStart { get; set; } + + /// + /// 修改日期截止 + /// + public DateTime? UpdateTimeEnd { get; set; } + /// /// 业务状态 /// public List BSStatusList { get; set; } + + + /// + /// 订舱租户名称 + /// + public string BookingTenantName { get; set; } } //dto @@ -237,9 +253,10 @@ namespace Myshipping.Application /// public string TEMPMAX { get; set; } /// - /// SO备注 + /// 订舱要求 /// public string SOREMARK { get; set; } + } //保存dto @@ -278,6 +295,26 @@ namespace Myshipping.Application /// public string BSSTATUS { get; set; } + /// + /// 订舱租户名称 + /// + public string BookingTenantName { get; set; } + + /// + /// 订舱用户名称 + /// + public string BookingUserName { get; set; } + + /// + /// 创建时间 + /// + public string CreatedTime { get; set; } + + /// + /// 更新时间 + /// + public string UpdatedTime { get; set; } + /// /// 日志信息 @@ -298,6 +335,26 @@ namespace Myshipping.Application /// public string BSSTATUS { get; set; } + /// + /// 订舱租户名称 + /// + public string BookingTenantName { get; set; } + + /// + /// 订舱用户名称 + /// + public string BookingUserName { get; set; } + + /// + /// 创建时间 + /// + public string CreatedTime { get; set; } + + /// + /// 更新时间 + /// + public string UpdatedTime { get; set; } + /// /// 文件列表 ///