From 5979bc96e63a07fc3b0a5e4ba0f5dda27ac233b2 Mon Sep 17 00:00:00 2001 From: jianghaiqing Date: Fri, 1 Nov 2024 18:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=A3=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BLIssueManage/BLIssueManageService.cs | 357 ++++++------------ .../Method/BookingSlot/BookingSlotService.cs | 1 + .../DJYChargeFee/DJYChargeFeeService.cs | 2 +- 3 files changed, 119 insertions(+), 241 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs index de3527e5..9b42fd98 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BLIssueManage/BLIssueManageService.cs @@ -109,6 +109,33 @@ namespace DS.WMS.Core.Op.Method */ var tenantDb = saasService.GetBizDbScopeById(user.TenantId); + List whereList = null; + + string blNo = string.Empty; + string etdStart = string.Empty; + string etdEnd = string.Empty; + + if (!querySearch.QueryCondition.IsNullOrEmpty()) + { + whereList = querySearch.GetConditionalModels(db); + + //if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("blNo", StringComparison.OrdinalIgnoreCase))) + //{ + // var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("blNo", StringComparison.OrdinalIgnoreCase)); + // blNo = ((ConditionalModel)t).FieldValue; + + // whereList.Remove(t); + //} + + //if (whereList.Any(t => ((ConditionalModel)t).FieldName.Equals("etd", StringComparison.OrdinalIgnoreCase))) + //{ + // var t = whereList.FirstOrDefault(t => ((ConditionalModel)t).FieldName.Equals("etd", StringComparison.OrdinalIgnoreCase)); + // blNo = ((ConditionalModel)t).FieldValue; + + // whereList.Remove(t); + //} + } + var query = tenantDb.Queryable().ClearFilter(typeof(IOrgId)) .LeftJoin((l, r) => l.Id == r.BookingId) .WhereIF(querySearch.OtherQueryCondition != null && !string.IsNullOrWhiteSpace(querySearch.OtherQueryCondition.QueryTabCode) @@ -129,9 +156,8 @@ namespace DS.WMS.Core.Op.Method BLIssueMangeQueryExtDto otherQuery = null; - if (!querySearch.QueryCondition.IsNullOrEmpty()) + if (whereList != null) { - var whereList = querySearch.GetConditionalModels(db); query = query.Where(whereList); } @@ -204,7 +230,7 @@ namespace DS.WMS.Core.Op.Method } } - return DataResult>.Success(resultList); + return DataResult>.PageList(result.Count, resultList, MultiLanguageConst.DataQuerySuccess); } #endregion @@ -279,40 +305,13 @@ namespace DS.WMS.Core.Op.Method continue; } - resultList.Add(new BLIssueManageBaseDto - { - Id = start, - BookingId = data.order.Id, - BLNo = data.order.MBLNO, - CustomerId = data.order.CustomerId, - CustomerName = data.order.CustomerName, - SaleId = data.order.SaleId, - Sale = data.order.Sale, - IssueType = data.order.IssueType, - IssueTypeCode = data.order.IssueTypeCode, - IssuePlaceCode = data.order.IssuePlaceCode, - IssuePlace = data.order.IssuePlace, - LoadPortId = data.order.LoadPortId, - LoadPortCode = data.order.LoadPortCode, - LoadPort = data.order.LoadPort, - DischargePortId = data.order.DischargePortId, - DischargePortCode = data.order.DischargePortCode, - DischargePort = data.order.DischargePort, - CustomerService = data.order.CustomerService, - CustomerServiceName = data.order.CustomerServiceName, - BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(), - BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(), - BLType = BLTypeEnum.BL.ToString(), - BLTypeName = BLTypeEnum.BL.GetDescription(), - Doc = data.order.Doc, - DocName = data.order.DocName, - }); + resultList.Add(GetInitInfo(start, data.order)); start++; } } - return DataResult>.Success(resultList); + return DataResult>.PageList(result.Count, resultList, MultiLanguageConst.DataQuerySuccess); } #endregion @@ -363,32 +362,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = new BLIssueManageBaseInputDto - { - BookingId = data.order.Id, - BLNo = data.order.MBLNO, - CustomerId = data.order.CustomerId, - CustomerName = data.order.CustomerName, - SaleId = data.order.SaleId, - Sale = data.order.Sale, - IssueType = data.order.IssueType, - IssueTypeCode = data.order.IssueTypeCode, - IssuePlaceCode = data.order.IssuePlaceCode, - IssuePlace = data.order.IssuePlace, - LoadPortId = data.order.LoadPortId, - LoadPortCode = data.order.LoadPortCode, - LoadPort = data.order.LoadPort, - DischargePortId = data.order.DischargePortId, - DischargePortCode = data.order.DischargePortCode, - DischargePort = data.order.DischargePort, - CustomerService = data.order.CustomerService, - CustomerServiceName = data.order.CustomerServiceName, - BLType = BLTypeEnum.BL.ToString(), - BLTypeName = BLTypeEnum.BL.GetDescription(), - BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(), - BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(), - StlDate = data.order.StlDate, - }; + var dto = GetReadSaveInfo(data.order); var saveRlt = await Save(dto); @@ -584,32 +558,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = new BLIssueManageBaseInputDto - { - BookingId = data.order.Id, - BLNo = data.order.MBLNO, - CustomerId = data.order.CustomerId, - CustomerName = data.order.CustomerName, - SaleId = data.order.SaleId, - Sale = data.order.Sale, - IssueType = data.order.IssueType, - IssueTypeCode = data.order.IssueTypeCode, - IssuePlaceCode = data.order.IssuePlaceCode, - IssuePlace = data.order.IssuePlace, - LoadPortId = data.order.LoadPortId, - LoadPortCode = data.order.LoadPortCode, - LoadPort = data.order.LoadPort, - DischargePortId = data.order.DischargePortId, - DischargePortCode = data.order.DischargePortCode, - DischargePort = data.order.DischargePort, - CustomerService = data.order.CustomerService, - CustomerServiceName = data.order.CustomerServiceName, - BLType = BLTypeEnum.BL.ToString(), - BLTypeName = BLTypeEnum.BL.GetDescription(), - BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(), - BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(), - StlDate = data.order.StlDate, - }; + var dto = GetReadSaveInfo(data.order); var saveRlt = await Save(dto); @@ -767,32 +716,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = new BLIssueManageBaseInputDto - { - BookingId = data.order.Id, - BLNo = data.order.MBLNO, - CustomerId = data.order.CustomerId, - CustomerName = data.order.CustomerName, - SaleId = data.order.SaleId, - Sale = data.order.Sale, - IssueType = data.order.IssueType, - IssueTypeCode = data.order.IssueTypeCode, - IssuePlaceCode = data.order.IssuePlaceCode, - IssuePlace = data.order.IssuePlace, - LoadPortId = data.order.LoadPortId, - LoadPortCode = data.order.LoadPortCode, - LoadPort = data.order.LoadPort, - DischargePortId = data.order.DischargePortId, - DischargePortCode = data.order.DischargePortCode, - DischargePort = data.order.DischargePort, - CustomerService = data.order.CustomerService, - CustomerServiceName = data.order.CustomerServiceName, - BLType = BLTypeEnum.BL.ToString(), - BLTypeName = BLTypeEnum.BL.GetDescription(), - BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(), - BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(), - StlDate = data.order.StlDate, - }; + var dto = GetReadSaveInfo(data.order); var saveRlt = await Save(dto); @@ -945,32 +869,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = new BLIssueManageBaseInputDto - { - BookingId = data.order.Id, - BLNo = data.order.MBLNO, - CustomerId = data.order.CustomerId, - CustomerName = data.order.CustomerName, - SaleId = data.order.SaleId, - Sale = data.order.Sale, - IssueType = data.order.IssueType, - IssueTypeCode = data.order.IssueTypeCode, - IssuePlaceCode = data.order.IssuePlaceCode, - IssuePlace = data.order.IssuePlace, - LoadPortId = data.order.LoadPortId, - LoadPortCode = data.order.LoadPortCode, - LoadPort = data.order.LoadPort, - DischargePortId = data.order.DischargePortId, - DischargePortCode = data.order.DischargePortCode, - DischargePort = data.order.DischargePort, - CustomerService = data.order.CustomerService, - CustomerServiceName = data.order.CustomerServiceName, - BLType = BLTypeEnum.BL.ToString(), - BLTypeName = BLTypeEnum.BL.GetDescription(), - BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(), - BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(), - StlDate = data.order.StlDate, - }; + var dto = GetReadSaveInfo(data.order); var saveRlt = await Save(dto); @@ -1133,32 +1032,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = new BLIssueManageBaseInputDto - { - BookingId = data.order.Id, - BLNo = data.order.MBLNO, - CustomerId = data.order.CustomerId, - CustomerName = data.order.CustomerName, - SaleId = data.order.SaleId, - Sale = data.order.Sale, - IssueType = data.order.IssueType, - IssueTypeCode = data.order.IssueTypeCode, - IssuePlaceCode = data.order.IssuePlaceCode, - IssuePlace = data.order.IssuePlace, - LoadPortId = data.order.LoadPortId, - LoadPortCode = data.order.LoadPortCode, - LoadPort = data.order.LoadPort, - DischargePortId = data.order.DischargePortId, - DischargePortCode = data.order.DischargePortCode, - DischargePort = data.order.DischargePort, - CustomerService = data.order.CustomerService, - CustomerServiceName = data.order.CustomerServiceName, - BLType = BLTypeEnum.BL.ToString(), - BLTypeName = BLTypeEnum.BL.GetDescription(), - BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(), - BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(), - StlDate = data.order.StlDate, - }; + var dto = GetReadSaveInfo(data.order); var saveRlt = await Save(dto); @@ -1352,32 +1226,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = new BLIssueManageBaseInputDto - { - BookingId = data.order.Id, - BLNo = data.order.MBLNO, - CustomerId = data.order.CustomerId, - CustomerName = data.order.CustomerName, - SaleId = data.order.SaleId, - Sale = data.order.Sale, - IssueType = data.order.IssueType, - IssueTypeCode = data.order.IssueTypeCode, - IssuePlaceCode = data.order.IssuePlaceCode, - IssuePlace = data.order.IssuePlace, - LoadPortId = data.order.LoadPortId, - LoadPortCode = data.order.LoadPortCode, - LoadPort = data.order.LoadPort, - DischargePortId = data.order.DischargePortId, - DischargePortCode = data.order.DischargePortCode, - DischargePort = data.order.DischargePort, - CustomerService = data.order.CustomerService, - CustomerServiceName = data.order.CustomerServiceName, - BLType = BLTypeEnum.BL.ToString(), - BLTypeName = BLTypeEnum.BL.GetDescription(), - BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(), - BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(), - StlDate = data.order.StlDate, - }; + var dto = GetReadSaveInfo(data.order); var saveRlt = await Save(dto); @@ -1460,32 +1309,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = new BLIssueManageBaseInputDto - { - BookingId = data.order.Id, - BLNo = data.order.MBLNO, - CustomerId = data.order.CustomerId, - CustomerName = data.order.CustomerName, - SaleId = data.order.SaleId, - Sale = data.order.Sale, - IssueType = data.order.IssueType, - IssueTypeCode = data.order.IssueTypeCode, - IssuePlaceCode = data.order.IssuePlaceCode, - IssuePlace = data.order.IssuePlace, - LoadPortId = data.order.LoadPortId, - LoadPortCode = data.order.LoadPortCode, - LoadPort = data.order.LoadPort, - DischargePortId = data.order.DischargePortId, - DischargePortCode = data.order.DischargePortCode, - DischargePort = data.order.DischargePort, - CustomerService = data.order.CustomerService, - CustomerServiceName = data.order.CustomerServiceName, - BLType = BLTypeEnum.BL.ToString(), - BLTypeName = BLTypeEnum.BL.GetDescription(), - BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(), - BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(), - StlDate = data.order.StlDate, - }; + var dto = GetReadSaveInfo(data.order); var saveRlt = await Save(dto); @@ -1566,32 +1390,7 @@ namespace DS.WMS.Core.Op.Method if (blModel == null || blModel.Id == 0) { - var dto = new BLIssueManageBaseInputDto - { - BookingId = data.order.Id, - BLNo = data.order.MBLNO, - CustomerId = data.order.CustomerId, - CustomerName = data.order.CustomerName, - SaleId = data.order.SaleId, - Sale = data.order.Sale, - IssueType = data.order.IssueType, - IssueTypeCode = data.order.IssueTypeCode, - IssuePlaceCode = data.order.IssuePlaceCode, - IssuePlace = data.order.IssuePlace, - LoadPortId = data.order.LoadPortId, - LoadPortCode = data.order.LoadPortCode, - LoadPort = data.order.LoadPort, - DischargePortId = data.order.DischargePortId, - DischargePortCode = data.order.DischargePortCode, - DischargePort = data.order.DischargePort, - CustomerService = data.order.CustomerService, - CustomerServiceName = data.order.CustomerServiceName, - BLType = BLTypeEnum.BL.ToString(), - BLTypeName = BLTypeEnum.BL.GetDescription(), - BusiType = BLIssueBusiTypeEnum.SeaExport.ToString(), - BusiTypeName = BLIssueBusiTypeEnum.SeaExport.GetDescription(), - StlDate = data.order.StlDate, - }; + var dto = GetReadSaveInfo(data.order); var saveRlt = await Save(dto); @@ -1686,5 +1485,83 @@ namespace DS.WMS.Core.Op.Method return DataResult>.Success(list); } #endregion + + #region 获取初始化提单管理详情 + /// + /// 获取初始化提单管理详情 + /// + /// 临时ID + /// 订单详情 + /// 业务类型 + /// + private BLIssueManageBaseDto GetInitInfo(long tempId,SeaExport order, BLIssueBusiTypeEnum busiTypeEnum = BLIssueBusiTypeEnum.SeaExport) + { + return new BLIssueManageBaseDto + { + Id = tempId, + BookingId = order.Id, + BLNo = order.MBLNO, + CustomerId = order.CustomerId, + CustomerName = order.CustomerName, + SaleId = order.SaleId, + Sale = order.Sale, + IssueType = order.IssueType, + IssueTypeCode = order.IssueTypeCode, + IssuePlaceCode = order.IssuePlaceCode, + IssuePlace = order.IssuePlace, + LoadPortId = order.LoadPortId, + LoadPortCode = order.LoadPortCode, + LoadPort = order.LoadPort, + DischargePortId = order.DischargePortId, + DischargePortCode = order.DischargePortCode, + DischargePort = order.DischargePort, + CustomerService = order.CustomerService, + CustomerServiceName = order.CustomerServiceName, + BusiType = busiTypeEnum.ToString(), + BusiTypeName = busiTypeEnum.GetDescription(), + BLType = BLTypeEnum.BL.ToString(), + BLTypeName = BLTypeEnum.BL.GetDescription(), + Doc = order.Doc, + DocName = order.DocName, + }; + } + #endregion + + #region 获取待保存提单管理详情 + /// + /// 获取待保存提单管理详情 + /// + /// 订单详情 + /// 业务类型 + /// + private BLIssueManageBaseInputDto GetReadSaveInfo(SeaExport order, BLIssueBusiTypeEnum busiTypeEnum = BLIssueBusiTypeEnum.SeaExport) + { + return new BLIssueManageBaseInputDto + { + BookingId = order.Id, + BLNo = order.MBLNO, + CustomerId = order.CustomerId, + CustomerName = order.CustomerName, + SaleId = order.SaleId, + Sale = order.Sale, + IssueType = order.IssueType, + IssueTypeCode = order.IssueTypeCode, + IssuePlaceCode = order.IssuePlaceCode, + IssuePlace = order.IssuePlace, + LoadPortId = order.LoadPortId, + LoadPortCode = order.LoadPortCode, + LoadPort = order.LoadPort, + DischargePortId = order.DischargePortId, + DischargePortCode = order.DischargePortCode, + DischargePort = order.DischargePort, + CustomerService = order.CustomerService, + CustomerServiceName = order.CustomerServiceName, + BusiType = busiTypeEnum.ToString(), + BusiTypeName = busiTypeEnum.GetDescription(), + BLType = BLTypeEnum.BL.ToString(), + BLTypeName = BLTypeEnum.BL.GetDescription(), + }; + } + #endregion } } diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs index db84d2e6..2dc732be 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/BookingSlot/BookingSlotService.cs @@ -3060,6 +3060,7 @@ namespace DS.WMS.Core.Op.Method //这里更新订舱的详情 SeaExportOpenEditReq bkModel = new SeaExportOpenEditReq { + Id = model.bookingOrderId, MBLNO = bookingSlotBase.SlotBookingNo.Trim(), ContractNo = !string.IsNullOrWhiteSpace(bookingSlotBase.ContractNo) ? bookingSlotBase.ContractNo : "", Vessel = bookingSlotBase.Vessel?.ToUpper()?.Trim(), diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/DJYChargeFee/DJYChargeFeeService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/DJYChargeFee/DJYChargeFeeService.cs index e97be013..5a97096a 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/DJYChargeFee/DJYChargeFeeService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/DJYChargeFee/DJYChargeFeeService.cs @@ -142,7 +142,7 @@ namespace DS.WMS.Core.Op.Method string feeType = $"{(int)model.BSType}_{(int)model.SendType}"; - var c = tenantDb.Queryable().Filter(null, true).Count(x => x.BillId == id && x.FeeType == feeType); + var c = tenantDb.Queryable().Filter(null, true).Count(x => x.BillId == id && x.MBLNO == orderInfo.MBLNO && x.FeeType == feeType); if (c > 0) { Logger.Log(NLog.LogLevel.Info, $"{batchId}-已存在扣费记录,id:{id},提单号:{orderInfo.MBLNO} feeType={feeType}");