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); } }