This commit is contained in:
tongfei
2024-03-06 14:21:54 +08:00
2 changed files with 37 additions and 0 deletions

View File

@@ -4664,6 +4664,13 @@
<param name="isTransaction"></param>
<returns></returns>
</member>
<member name="M:WMS.Web.Domain.Services.OutStockTaskService.SsynDateComparison(WMS.Web.Domain.Entitys.OutStockTask,System.Collections.Generic.List{WMS.Web.Core.Dto.Erp.OutStock.ErpDeliveryNoticeOutStockResultDto})">
<summary>
金蝶数据同步时比对数据
金蝶单据明细行删除后wms明细数量调整为0
</summary>
<returns></returns>
</member>
<member name="M:WMS.Web.Domain.Services.OutStockTaskService.BillQueryForDeliveryNoticeOutStock(System.Boolean,System.Collections.Generic.List{System.String},System.Nullable{System.DateTime})">
<summary>
发货通知单同步数据

View File

@@ -8,6 +8,7 @@ using System.Threading.Tasks;
using WMS.Web.Core.Dto;
using WMS.Web.Core.Dto.Erp.OutStock;
using WMS.Web.Core.Dto.Login;
using WMS.Web.Core.Help;
using WMS.Web.Core.Internal.Results;
using WMS.Web.Domain.Entitys;
using WMS.Web.Domain.Infrastructure;
@@ -108,6 +109,8 @@ namespace WMS.Web.Domain.Services
var sourcNos = outStockTask.Details.SelectMany(s => s.ErpDetails).Select(s => s.SourceBillNo).ToList();
//仓库不同 拆分成不同的任务单
var erps = erp_list.Where(w => sourcNos.Contains(w.SourceBillNo) && w.StockCode.Equals(outStockTask.StockCode)).ToList();
//比对数据
SsynDateComparison(outStockTask, erps);
foreach (var erp in erps)
{
//仓库不同 拆分成不同的
@@ -186,6 +189,33 @@ namespace WMS.Web.Domain.Services
return Result.ReSuccess();
}
/// <summary>
/// 金蝶数据同步时比对数据
/// 金蝶单据明细行删除后wms明细数量调整为0
/// </summary>
/// <returns></returns>
public Result SsynDateComparison(OutStockTask outStockTask, List<ErpDeliveryNoticeOutStockResultDto> erp_list)
{
var erpDetails = outStockTask.Details.SelectMany(s => s.ErpDetails).ToList().Clone();
foreach (var d in outStockTask.Details)
{
foreach (var ed in d.ErpDetails)
{
//没有找到这条出库任务单里的来源单信息,则跳过这条数据(有些合并的单据,当前没有找到金蝶对应的单据(时间超出范围了等情况))
var erp_o = erp_list.Where(w => w.SourceBillNo == ed.SourceBillNo).ToList();
if (erp_o.Count() == 0) continue;
var erp_d = erp_list.Where(w => w.MaterialId == d.MaterialId && ed.Erp_DetailId == w.Erp_DetailId).ToList();
if (erp_d.Count() == 0)
{
//金蝶删除明细数据后 wms对应数据修改为0
ed.AccruedQty = 0;
d.AccruedQty = d.ErpDetails.Sum(s => s.AccruedQty);
}
}
}
return Result.ReSuccess();
}
/// <summary>
/// 发货通知单同步数据