From ccb267e8538b75a99b7fd8c9c90e3ca3876aaec7 Mon Sep 17 00:00:00 2001 From: cjy Date: Mon, 11 Nov 2024 15:50:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=88=B1=E5=8D=95=E9=9B=86=E8=A3=85=E7=AE=B1?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Op/Entity/SeaExportShippingBill.cs | 2 +- .../DS.WMS.Core/Op/Method/SeaExportService.cs | 10 +++++++++- .../Op/Method/ShippingBillService.cs | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExportShippingBill.cs b/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExportShippingBill.cs index ec2ce0e0..47dc7fe8 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExportShippingBill.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Entity/SeaExportShippingBill.cs @@ -320,5 +320,5 @@ public class SeaExportShippingBill : BaseModel /// 状态 /// [SugarColumn(ColumnDescription = "状态", IsNullable = true, Length = 20)] - public string State { get; set; } + public string State { get; set; } } \ No newline at end of file diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs index bbea8402..722f6617 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/SeaExportService.cs @@ -177,7 +177,7 @@ public partial class SeaExportService : ISeaExportService }; - var statusLog = await tenantDb.Queryable().ToListAsync(); + var statusLog = await tenantDb.Queryable().Where( x=> x.Status == "提箱" || x.Status == "返场").ToListAsync(); var statusLogDetails = await tenantDb.Queryable().ToListAsync(); foreach (var item in data.Data) { @@ -501,6 +501,14 @@ public partial class SeaExportService : ISeaExportService } } + else //删除 + { + var ctnGoods = await tenantDb.Queryable().Where(x => x.BusinessId == req.Id).ToListAsync(); + if (ctnGoods.IsNotNull() && ctnGoods.Count > 0) + { + tenantDb.Deleteable(ctnGoods).ExecuteCommand(); + } + } _logger.Info("执行完订单多品名信息"); #region 241010更新分单 单分单时,后续主单件重尺更新时,分单自动更新,多票分单时不更新; diff --git a/ds-wms-service/DS.WMS.Core/Op/Method/ShippingBillService.cs b/ds-wms-service/DS.WMS.Core/Op/Method/ShippingBillService.cs index c747d031..6b1427cf 100644 --- a/ds-wms-service/DS.WMS.Core/Op/Method/ShippingBillService.cs +++ b/ds-wms-service/DS.WMS.Core/Op/Method/ShippingBillService.cs @@ -23,6 +23,7 @@ using Newtonsoft.Json.Linq; using DS.Module.Core.Helpers; using Org.BouncyCastle.Ocsp; using static AnyDiff.DifferenceLines; +using static DS.WMS.Core.Op.Method.SeaExportTestService; namespace DS.WMS.Core.Op.Method { @@ -223,6 +224,16 @@ namespace DS.WMS.Core.Op.Method if (req.CtnInfo.IsNotNull() && req.CtnInfo.Count > 0) { var ctnList = tenantDb.Queryable().Where(x => x.Pid == req.Id).ToList(); + var existCtns = ctnList.Select(x => x.Id); + var reqCtns = req.CtnInfo.Where(x => x.Id != 0).Select(x => x.Id); + //删除 + IEnumerable delCtns = existCtns.AsQueryable().Except(reqCtns); + if (delCtns.Count() > 0) + { + tenantDb.Deleteable() + .Where(it => it.Pid == info.Id && delCtns.Contains(it.Id)) + .ExecuteCommand(); + } foreach (var item in req.CtnInfo) { if (item.Id == 0) @@ -240,6 +251,14 @@ namespace DS.WMS.Core.Op.Method } } + else //删除 + { + var ctnList = tenantDb.Queryable().Where(x => x.Pid == req.Id).ToList(); + if (ctnList.IsNotNull() && ctnList.Count > 0) + { + tenantDb.Deleteable(ctnList).ExecuteCommand(); + } + } return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess); } }