金蝶同步数据调整

This commit is contained in:
18942506660
2024-03-06 11:53:39 +08:00
parent 252e7926ac
commit 4221de3d75
2 changed files with 26 additions and 0 deletions

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;
@@ -195,6 +196,24 @@ namespace WMS.Web.Domain.Services
/// <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();
}