From 15c0ee1acfadbd7e03ec2f55fd53a275a679f0ae Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Mon, 8 Jan 2024 15:19:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E6=96=B9=E6=AF=94=E5=AF=B9=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/CompareService.cs | 6 +- .../Entities/BQ/VmiAppService.cs | 260 +++++++++++++++++- .../JisBBACSaSeEdiCompareExportService.cs | 4 +- .../JisHBPOSaSeEdiCompareExportService.cs | 4 +- .../MaiDanBBACSaSeCompareExportService.cs | 2 +- .../Report/PubSaSeCompareExportService.cs | 2 +- .../Report/SaSeCompareExportBaseService.cs | 2 +- 7 files changed, 271 insertions(+), 9 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs index 73bcc454..acd71d14 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs @@ -105,7 +105,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var customConditionList = new List(); customConditionList.Add(new CustomCondition() { Name = "Version", Value = saSeCompareRequestDto.Version }); customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)saSeCompareRequestDto.BusinessType).ToString() }); - customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = DateTime.MinValue.ToString("yyyy-MM-dd 00:00:00") }); + + //customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = DateTime.MinValue.ToString("yyyy-MM-dd 00:00:00") }); + + customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = "2023-09-25 00:00:00" }); + customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = saSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd 23:59:59") }); customConditionList.Add(new CustomCondition() { Name = "LU", Value = saSeCompareRequestDto.LU }); customConditionList.Add(new CustomCondition() { Name = "PN", Value = saSeCompareRequestDto.PN }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs index cf84202b..7501c707 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs @@ -801,6 +801,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var logList = tupleList.Select(o => o.Item1).ToList(); logList.AsParallel().ForEach(Update); List seDetails = new List(); + List hbpo_seDetails=new List(); + List pub_seDetails=new List(); + foreach (var item in logList) { if(item.DeliverBillType== EnumDeliverBjBmpBillType.JIS件&&item.DeliverSubBillType== EnumDeliverSubBillType.保险杠BBAC) @@ -838,7 +841,259 @@ namespace Win.Sfs.SettleAccount.Entities.BQ seDetails.Add(seDetail); } - + + if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && item.DeliverSubBillType == EnumDeliverSubBillType.买单件小件BBAC) + { + BBAC_SE_DETAIL seDetail = new BBAC_SE_DETAIL(); + seDetail.SetId(item.Id); + seDetail.BeginDate = DateTime.Now; + seDetail.CreationTime = DateTime.Now; + seDetail.IsDeleted = false; + seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); + seDetail.ShippingDate = (DateTime)item.BillTime; + seDetail.Qty = item.Qty; + seDetail.IsHaveEdiData = false; + seDetail.BusinessType = EnumBusinessType.MaiDanJianBBAC; + seDetail.AssembleData = (DateTime)item.AssembleData; + seDetail.BillType = 0; + seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; + seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; + seDetail.ProType = 0; + seDetail.State = 0; + seDetail.SubBillType = 0; + seDetail.TransType = EnumDelTransType.发货; + seDetail.UID = 000; + seDetail.FactoryPartCode = item.RealPartCode; + seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); + seDetail.ErpToLoc = item.ErpToLoc; + seDetail.Qty = item.Qty; + seDetail.VinCode = item.VinCode; + seDetail.PN = item.VinCode; + seDetail.LU = item.CustPartCode; + seDetail.CustPartCode = item.CustPartCode; + seDetail.BillTime = item.BillTime; + + seDetail.Remark = "期初初始化"; + + seDetails.Add(seDetail); + } + + if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && item.DeliverSubBillType == EnumDeliverSubBillType.保险杠HBPO) + { + HBPO_SE_DETAIL seDetail = new HBPO_SE_DETAIL(); + seDetail.SetId(item.Id); + seDetail.BeginDate = DateTime.Now; + seDetail.CreationTime = DateTime.Now; + seDetail.IsDeleted = false; + seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); + seDetail.ShippingDate = (DateTime)item.BillTime; + seDetail.Qty = item.Qty; + seDetail.IsHaveEdiData = false; + seDetail.BusinessType = EnumBusinessType.JisHBPO; + seDetail.AssembleData = (DateTime)item.AssembleData; + seDetail.BillType = 0; + seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; + seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; + seDetail.ProType = 0; + seDetail.State = 0; + seDetail.SubBillType = 0; + seDetail.TransType = EnumDelTransType.发货; + seDetail.UID = 000; + seDetail.FactoryPartCode = item.RealPartCode; + seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); + seDetail.ErpToLoc = item.ErpToLoc; + seDetail.Qty = item.Qty; + seDetail.VinCode = item.VinCode; + seDetail.PN = item.VinCode; + seDetail.LU = item.CustPartCode; + seDetail.CustPartCode = item.CustPartCode; + seDetail.BillTime = item.BillTime; + + seDetail.Remark = "期初初始化"; + + hbpo_seDetails.Add(seDetail); + } + + if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIS件 && item.DeliverSubBillType == EnumDeliverSubBillType.买单件小件HBPO) + { + HBPO_SE_DETAIL seDetail = new HBPO_SE_DETAIL(); + seDetail.SetId(item.Id); + seDetail.BeginDate = DateTime.Now; + seDetail.CreationTime = DateTime.Now; + seDetail.IsDeleted = false; + seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); + seDetail.ShippingDate = (DateTime)item.BillTime; + seDetail.Qty = item.Qty; + seDetail.IsHaveEdiData = false; + seDetail.BusinessType = EnumBusinessType.MaiDanJianHBPO; + seDetail.AssembleData = (DateTime)item.AssembleData; + seDetail.BillType = 0; + seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; + seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; + seDetail.ProType = 0; + seDetail.State = 0; + seDetail.SubBillType = 0; + seDetail.TransType = EnumDelTransType.发货; + seDetail.UID = 000; + seDetail.FactoryPartCode = item.RealPartCode; + seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); + seDetail.ErpToLoc = item.ErpToLoc; + seDetail.Qty = item.Qty; + seDetail.VinCode = item.VinCode; + seDetail.PN = item.VinCode; + seDetail.LU = item.CustPartCode; + seDetail.CustPartCode = item.CustPartCode; + seDetail.BillTime = item.BillTime; + + seDetail.Remark = "期初初始化"; + + hbpo_seDetails.Add(seDetail); + } + + if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIT直供件 && item.DeliverSubBillType == EnumDeliverSubBillType.JIT直供件BBAC) + { + PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL(); + seDetail.SetId(item.Id); + seDetail.BeginDate = DateTime.Now; + seDetail.CreationTime = DateTime.Now; + seDetail.IsDeleted = false; + seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); + seDetail.ShippingDate = (DateTime)item.BillTime; + seDetail.Qty = item.Qty; + //seDetail.IsHaveEdiData = false; + seDetail.BusinessType = EnumBusinessType.ZhiGongJianBBAC; + seDetail.AssembleData = (DateTime)item.AssembleData; + seDetail.BillType = 0; + seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; + seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; + seDetail.ProType = 0; + seDetail.State = 0; + seDetail.SubBillType = 0; + seDetail.TransType = EnumDelTransType.发货; + seDetail.UID = 000; + seDetail.FactoryPartCode = item.RealPartCode; + seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); + seDetail.ToErpLocCode = item.ErpToLoc; + seDetail.Qty = item.Qty; + //seDetail.VinCode = item.VinCode; + seDetail.PN = item.VinCode; + seDetail.LU = item.CustPartCode; + seDetail.CustPartCode = item.CustPartCode; + seDetail.BillTime = item.BillTime; + + seDetail.Remark = "期初初始化"; + + pub_seDetails.Add(seDetail); + } + + if (item.DeliverBillType == EnumDeliverBjBmpBillType.JIT直供件 && item.DeliverSubBillType == EnumDeliverSubBillType.JIT直供件HBPO) + { + PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL(); + seDetail.SetId(item.Id); + seDetail.BeginDate = DateTime.Now; + seDetail.CreationTime = DateTime.Now; + seDetail.IsDeleted = false; + seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); + seDetail.ShippingDate = (DateTime)item.BillTime; + seDetail.Qty = item.Qty; + //seDetail.IsHaveEdiData = false; + seDetail.BusinessType = EnumBusinessType.ZhiGongJianHBPO; + seDetail.AssembleData = (DateTime)item.AssembleData; + seDetail.BillType = 0; + seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; + seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; + seDetail.ProType = 0; + seDetail.State = 0; + seDetail.SubBillType = 0; + seDetail.TransType = EnumDelTransType.发货; + seDetail.UID = 000; + seDetail.FactoryPartCode = item.RealPartCode; + seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); + seDetail.ToErpLocCode = item.ErpToLoc; + seDetail.Qty = item.Qty; + //seDetail.VinCode = item.VinCode; + seDetail.PN = item.VinCode; + seDetail.LU = item.CustPartCode; + seDetail.CustPartCode = item.CustPartCode; + seDetail.BillTime = item.BillTime; + + seDetail.Remark = "期初初始化"; + + pub_seDetails.Add(seDetail); + } + + if (item.DeliverBillType == EnumDeliverBjBmpBillType.北汽4S备件 && item.DeliverSubBillType == EnumDeliverSubBillType.北汽4S备件BBAC) + { + PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL(); + seDetail.SetId(item.Id); + seDetail.BeginDate = DateTime.Now; + seDetail.CreationTime = DateTime.Now; + seDetail.IsDeleted = false; + seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); + seDetail.ShippingDate = (DateTime)item.BillTime; + seDetail.Qty = item.Qty; + //seDetail.IsHaveEdiData = false; + seDetail.BusinessType = EnumBusinessType.BeiJian; + seDetail.AssembleData = (DateTime)item.AssembleData; + seDetail.BillType = 0; + seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; + seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; + seDetail.ProType = 0; + seDetail.State = 0; + seDetail.SubBillType = 0; + seDetail.TransType = EnumDelTransType.发货; + seDetail.UID = 000; + seDetail.FactoryPartCode = item.RealPartCode; + seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); + seDetail.ToErpLocCode = item.ErpToLoc; + seDetail.Qty = item.Qty; + //seDetail.VinCode = item.VinCode; + seDetail.PN = item.VinCode; + seDetail.LU = item.CustPartCode; + seDetail.CustPartCode = item.CustPartCode; + seDetail.BillTime = item.BillTime; + + seDetail.Remark = "期初初始化"; + + pub_seDetails.Add(seDetail); + } + + if (item.DeliverBillType == EnumDeliverBjBmpBillType.印度件 && item.DeliverSubBillType == EnumDeliverSubBillType.印度件BBAC) + { + PUB_SE_DETAIL seDetail = new PUB_SE_DETAIL(); + seDetail.SetId(item.Id); + seDetail.BeginDate = DateTime.Now; + seDetail.CreationTime = DateTime.Now; + seDetail.IsDeleted = false; + seDetail.Version = int.Parse(item.BillTime?.ToString("yyyyMM")); + seDetail.ShippingDate = (DateTime)item.BillTime; + seDetail.Qty = item.Qty; + //seDetail.IsHaveEdiData = false; + seDetail.BusinessType = EnumBusinessType.YinDuJian; + seDetail.AssembleData = (DateTime)item.AssembleData; + seDetail.BillType = 0; + seDetail.DeliverBillType = (EnumDeliverBjBmpBillType)item.DeliverBillType; + seDetail.DeliverSubBillType = (EnumDeliverSubBillType)item.DeliverSubBillType; + seDetail.ProType = 0; + seDetail.State = 0; + seDetail.SubBillType = 0; + seDetail.TransType = EnumDelTransType.发货; + seDetail.UID = 000; + seDetail.FactoryPartCode = item.RealPartCode; + seDetail.CustomerPartCodeNoSpace = item.RealPartCode.Replace("-", ""); + seDetail.ToErpLocCode = item.ErpToLoc; + seDetail.Qty = item.Qty; + //seDetail.VinCode = item.VinCode; + seDetail.PN = item.VinCode; + seDetail.LU = item.CustPartCode; + seDetail.CustPartCode = item.CustPartCode; + seDetail.BillTime = item.BillTime; + + seDetail.Remark = "期初初始化"; + + pub_seDetails.Add(seDetail); + } + } @@ -864,6 +1119,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ await context.BulkInsertAsync(logList).ConfigureAwait(false); //await context.BulkInsertAsync(messageList).ConfigureAwait(false); await context.BulkInsertAsync(seDetails).ConfigureAwait(false); + await context.BulkInsertAsync(hbpo_seDetails).ConfigureAwait(false); + await context.BulkInsertAsync(pub_seDetails).ConfigureAwait(false); + transaction.Commit(); } catch (Exception ex) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs index b8b7786c..ec4cdc0d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs @@ -157,7 +157,7 @@ namespace SettleAccount.Job.Services.Report }; //发运 var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime + where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State==0 group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { @@ -173,7 +173,7 @@ namespace SettleAccount.Job.Services.Report }).Where(t => t.Qty != 0M); //Edi var ediGroup = from edi in _settleAccountDbContext.Set() - where edi.IsDeleted == false && edi.IsHaveSeData == true + where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0 group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem select new { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs index a1ebed59..2702a544 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs @@ -152,7 +152,7 @@ namespace SettleAccount.Job.Services.Report }; //发运 var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime + where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0 group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { @@ -168,7 +168,7 @@ namespace SettleAccount.Job.Services.Report }).Where(t => t.Qty != 0M); //Edi var ediGroup = from edi in _settleAccountDbContext.Set() - where edi.IsDeleted == false && edi.IsHaveSeData == true + where edi.IsDeleted == false && edi.IsHaveSeData == true && edi.State == 0 group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem select new { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs index fa8e451b..93a5314e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs @@ -203,7 +203,7 @@ namespace SettleAccount.Job.Services.Report }; //发运 var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime + where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0 group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs index ce773686..20bf9a96 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs @@ -252,7 +252,7 @@ namespace SettleAccount.Job.Services.Report }; //发运 var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType + where se.BusinessType == businessType && se.State==0 group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs index 970ebe6f..2ae58924 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs @@ -95,7 +95,7 @@ namespace SettleAccount.Job.Services.Report }; //发运 var seGroup = (from se in _settleAccountDbContext.Set() - where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime + where se.BusinessType == businessType && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime && se.State == 0 group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem select new {