From c20dbd3b25db7dcc1afd1567564f560a48455745 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Tue, 21 Mar 2023 11:42:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=AE=A2=E8=88=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Myshipping.Application/Entity/BookingOrder.cs | 2 +- .../BookingOrder/BookingOrderService.cs | 2 +- .../Service/DataSync/DataSyncService.cs | 79 +++++++++++++++++++ .../Service/DataSync/Dto/BookingOrderDto.cs | 65 +++++++++++++-- 4 files changed, 140 insertions(+), 8 deletions(-) diff --git a/Myshipping.Application/Entity/BookingOrder.cs b/Myshipping.Application/Entity/BookingOrder.cs index ce2d0091..31746862 100644 --- a/Myshipping.Application/Entity/BookingOrder.cs +++ b/Myshipping.Application/Entity/BookingOrder.cs @@ -805,7 +805,7 @@ namespace Myshipping.Application.Entity /// - /// 航线 + /// 仓库 /// [Description("仓库")] public string Warehouse { get; set; } diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 8b7a27ff..ccc2d114 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -317,7 +317,7 @@ namespace Myshipping.Application .WhereIF(!string.IsNullOrWhiteSpace(input.ROUTE), u => u.ROUTE.Contains(input.ROUTE)) .WhereIF(!string.IsNullOrWhiteSpace(input.CreatedUserName), u => u.CreatedUserName.Contains(input.CreatedUserName)) .WhereIF(!string.IsNullOrWhiteSpace(input.FREIGHTPAYER), u => u.FREIGHTPAYER.Contains(input.FREIGHTPAYER)) - .WhereIF(userlist != null && userlist.Count() > 0, u => userlist.Contains((long)u.CreatedUserId) || UserManager.UserId.ToString() == u.ROUTEID || UserManager.UserId.ToString() == u.SALEID || UserManager.UserId.ToString() == u.OPID || UserManager.UserId.ToString() == u.DOCID || UserManager.UserId.ToString() == u.CUSTSERVICEID) + .WhereIF(userlist != null && userlist.Count() > 0, u => userlist.Contains((long)u.CreatedUserId) || UserManager.UserId.ToString() == u.ROUTEID|| UserManager.Name.ToString() == u.ROUTE || UserManager.UserId.ToString() == u.SALEID|| UserManager.Name.ToString() == u.SALE || UserManager.UserId.ToString() == u.OPID || UserManager.Name.ToString() == u.OP || UserManager.UserId.ToString() == u.DOCID|| UserManager.Name.ToString() == u.DOC || UserManager.UserId.ToString() == u.CUSTSERVICEID || UserManager.Name.ToString() == u.CUSTSERVICE) .OrderBy(PageInputOrder.OrderBuilder(input.SortField, input.descSort)) .ToPagedListAsync(input.PageNo, input.PageSize); diff --git a/Myshipping.Application/Service/DataSync/DataSyncService.cs b/Myshipping.Application/Service/DataSync/DataSyncService.cs index 0c328c47..60a650c4 100644 --- a/Myshipping.Application/Service/DataSync/DataSyncService.cs +++ b/Myshipping.Application/Service/DataSync/DataSyncService.cs @@ -192,6 +192,25 @@ namespace Myshipping.Application throw Oops.Bah("当前提单号已存在,请勿重复录入!"); } var entity = model.Adapt(); + if (!string.IsNullOrEmpty(entity.ROUTE)) { + entity.ROUTEID = userlist.Result.Where(x => x.Name == entity.ROUTE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.ROUTE).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(entity.SALE)) + { + entity.SALEID = userlist.Result.Where(x => x.Name == entity.SALE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.SALE).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(entity.OP)) + { + entity.OPID = userlist.Result.Where(x => x.Name == entity.OP).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.OP).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(entity.DOC)) + { + entity.DOCID = userlist.Result.Where(x => x.Name == entity.DOC).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.DOC).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(entity.CUSTSERVICE)) + { + entity.CUSTSERVICEID = userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Select(x => x.Id).FirstOrDefault().ToString(); + } entity.CreatedUserId = user.Result.Id; entity.CreatedUserName = user.Result.Name.ToString(); entity.CreatedTime = DateTime.Now; @@ -276,6 +295,26 @@ namespace Myshipping.Application } var fdentity = item.Adapt(); + if (!string.IsNullOrEmpty(fdentity.ROUTE)) + { + fdentity.ROUTEID = userlist.Result.Where(x => x.Name == entity.ROUTE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.ROUTE).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(fdentity.SALE)) + { + fdentity.SALEID = userlist.Result.Where(x => x.Name == entity.SALE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.SALE).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(fdentity.OP)) + { + fdentity.OPID = userlist.Result.Where(x => x.Name == entity.OP).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.OP).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(fdentity.DOC)) + { + fdentity.DOCID = userlist.Result.Where(x => x.Name == entity.DOC).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.DOC).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(fdentity.CUSTSERVICE)) + { + fdentity.CUSTSERVICEID = userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Select(x => x.Id).FirstOrDefault().ToString(); + } fdentity.CreatedUserId = user.Result.Id; fdentity.CreatedUserName = user.Result.Name; fdentity.CreatedTime = DateTime.Now; @@ -369,6 +408,26 @@ namespace Myshipping.Application entity.UpdatedUserName = user.Result.Name; entity.UpdatedUserId = user.Result.Id; entity.UpdatedTime = DateTime.Now; + if (!string.IsNullOrEmpty(entity.ROUTE)) + { + entity.ROUTEID = userlist.Result.Where(x => x.Name == entity.ROUTE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.ROUTE).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(entity.SALE)) + { + entity.SALEID = userlist.Result.Where(x => x.Name == entity.SALE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.SALE).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(entity.OP)) + { + entity.OPID = userlist.Result.Where(x => x.Name == entity.OP).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.OP).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(entity.DOC)) + { + entity.DOCID = userlist.Result.Where(x => x.Name == entity.DOC).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.DOC).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(entity.CUSTSERVICE)) + { + entity.CUSTSERVICEID = userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Select(x => x.Id).FirstOrDefault().ToString(); + } await _rep.AsUpdateable(entity).IgnoreColumns(it => new { it.ParentId, @@ -517,6 +576,26 @@ namespace Myshipping.Application fdentity.UpdatedUserName = user.Result.Name; fdentity.UpdatedUserId = user.Result.Id; fdentity.UpdatedTime = DateTime.Now; + if (!string.IsNullOrEmpty(fdentity.ROUTE)) + { + fdentity.ROUTEID = userlist.Result.Where(x => x.Name == entity.ROUTE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.ROUTE).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(fdentity.SALE)) + { + fdentity.SALEID = userlist.Result.Where(x => x.Name == entity.SALE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.SALE).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(fdentity.OP)) + { + fdentity.OPID = userlist.Result.Where(x => x.Name == entity.OP).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.OP).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(fdentity.DOC)) + { + fdentity.DOCID = userlist.Result.Where(x => x.Name == entity.DOC).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.DOC).Select(x => x.Id).FirstOrDefault().ToString(); + } + if (!string.IsNullOrEmpty(fdentity.CUSTSERVICE)) + { + fdentity.CUSTSERVICEID = userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Count() == 0 ? "" : userlist.Result.Where(x => x.Name == entity.CUSTSERVICE).Select(x => x.Id).FirstOrDefault().ToString(); + } await _rep.AsUpdateable(fdentity).IgnoreColumns(it => new { it.ParentId, diff --git a/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs b/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs index b4fdfb87..87a59805 100644 --- a/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs +++ b/Myshipping.Application/Service/DataSync/Dto/BookingOrderDto.cs @@ -616,6 +616,58 @@ namespace Myshipping.Application.Service.DataSync.Dto /// 品名 /// public string GOODSNAME { get; set; } + + + + /// + /// 件数合计 + /// + + public string PKGSTOTAL { get; set; } + + + /// + /// 毛重合计 + /// + + public string KGSTOTAL { get; set; } + + + /// + /// 尺寸合计 + /// + + public string CBMTOTAL { get; set; } + + + /// + /// 航线ID + /// + + public string ROUTEID { get; set; } + + + + + public string ROUTE { get; set; } + + + + public string Warehouse { get; set; } + + + + + public string WarehouseID { get; set; } + + /// + /// ep号 + /// + + public string EPCode { get; set; } + + + /// /// 创建者名称 /// @@ -1220,12 +1272,6 @@ namespace Myshipping.Application.Service.DataSync.Dto - public List ctnInputs { get; set; } - - /// - /// EDI扩展信息 - /// - public BookingEDIExtDto BookingEDIExt { get; set; } /// /// 品名代码 @@ -1267,5 +1313,12 @@ namespace Myshipping.Application.Service.DataSync.Dto public string EPCode { get; set; } + + public List ctnInputs { get; set; } + + /// + /// EDI扩展信息 + /// + public BookingEDIExtDto BookingEDIExt { get; set; } } }