From 5ddf611503882a74fd65a2bb85000778a62fe129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Fri, 18 Aug 2023 15:34:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 10 + .../Bases/ADJ_SERVICE.cs | 50 +-- .../Entities/BQ/BBAC_PD_SERVICE.cs | 22 +- .../Entities/BQ/INVOICE_SERVICE.cs | 25 +- .../Entities/BQ/PUB_CAN_SA_SERVICE.cs | 4 +- .../BQ/Syncs/PendingDeductionService.cs | 61 +++- .../SettleAccountApplicationModule.cs | 194 +++++++++- .../Entities/BQ/INVOICE_NOT_SETTLE.cs | 7 +- .../Entities/BQ/Managers/INV_MNG.cs | 28 +- .../Entities/BQ/Managers/INV_MNG_EXT.cs | 11 +- .../Entities/BQ/Temp/TempClass.cs | 8 + ...FactoryUnSettledDetailDiffExportService.cs | 3 +- .../SettleAccountJobModule.cs | 334 +++++++++--------- 13 files changed, 497 insertions(+), 260 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs index 200d955c..0738520f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs @@ -257,6 +257,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "价格结束日期")] public DateTime EndDate { get; set; } + + public Dictionary ExtraProperties { get; set; } + + + + + + } public class INVOICE_WAIT_DETAIL_REQ_DTO : RequestInputBase { @@ -403,6 +411,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "扩展字段2")] public string Extend2 { get; set; } + public Dictionary ExtraProperties { get; set; } + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs index a98f2ca9..12d2d490 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs @@ -207,11 +207,9 @@ public class ADJ_SERVICE : BASE_SERVICE switch (inv.BusinessType) { case EnumBusinessType.MaiDanJianHBPO: - break; case EnumBusinessType.MaiDanJianBBAC: - break; case EnumBusinessType.ZhiGongJianBBAC: var errors1 = _pubRepository.Where(p => pnlist.Contains(p.PN)); @@ -257,30 +255,11 @@ public class ADJ_SERVICE : BASE_SERVICE errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在发货单{p.PN}数据,不能导入调整表" }); } - break; } } - //ExportImporter _exportImporter = new ExportImporter(); - //var result = await _exportImporter.UploadExcelImport(files, _excelImportService); - //if (result.Count == 0) - //{ - // throw new BusinessException("8989", "导入数据记录为0条"); - //} - // var invs= p_list.Select(p => p.InvBillNum).ToList();//所有发票号 - //var deletels = _repository.Where(p =>invs.Contains(p.OldInvBillNum) ).ToList();//所有关联发票号的调整表 - // var invlist= _invRepository.Where(p => invs.Contains(p.InvbillNum)).ToList();//所有旧发票 - // var dlists= deletels.Where(p=>string.IsNullOrEmpty(p.InvBillNum)).ToList();//所有新发票号不为空的调整记录 - //foreach (var itm in dlists) - //{ - // errorList.Add(new ERR_EXP_DTO() { ItemCode = $"{itm.LU}", Message = $"客户零件号{itm.LU}标识号{itm.PN}下线日期{itm.SettleDate}记录已经被重新开票,新发票号为:{itm.InvBillNum}" }); - //} - //var first = deletels.FirstOrDefault(); - //if (!string.IsNullOrEmpty(first.InvBillNum)) - //{ - // throw new BusinessException("8989", $"调整记录已经生成新发票号:{first.InvBillNum}"); - //} + var entityList = ObjectMapper.Map, List>(p_list); var codelist = entityList.Select(p => p.LU).ToList(); var errors = await _baseDomainService.CheckBase(codelist, new BASE_CONF() { IsRelationShip = true }); @@ -302,32 +281,7 @@ public class ADJ_SERVICE : BASE_SERVICE return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = await ExportErrorReportAsync(errorList) }); } - //var query = from itm in entityList - // join itm1 in invlist - // on itm.InvBillNum equals itm1.InvbillNum - // select new PUB_ADJ_DETAIL( - // id: GuidGenerator.Create(), - // keyCode: itm.PN + itm.LU, - // version: itm.Version, - // settleBillNum: itm.SettleBillNum, - // lU: itm.LU, - // pN: itm.PN, - // site: itm.Site, - // qty: itm.Qty, - // extend1: string.Empty, - // price: 0, - // invGroupNum: itm1.InvGroupNum, - // settleDate: itm.SettleDate, - // businessType: itm1.BusinessType, - // groupNum: itm.GroupNum, - // oldinv: itm.InvBillNum, - // inv: string.Empty, - // partcode:itm.PartCode - - - // ); - //await _repository.DbContext.BulkDeleteAsync(deletels);//删除发票下所有调整明细 - //await _repository.DbContext.BulkInsertAsync(query.ToList()); + return new JsonResult(new { Code = 200, Message = "校验成功" }); ; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs index a70d8c25..dc2197d6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs @@ -49,15 +49,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var detailist = _detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList(); - //List customConditionList = new List(); - ////customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version }); - ////customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode }); - ////customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup }); - ////customConditionList.Add(new CustomCondition() { Name = "State", Value = string.IsNullOrEmpty(input.State) ? string.Empty : input.State }); - //var _taskid = await _service.ExportEnqueueAsync("出库单合计汇总输出", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(WmsOutputSumExportService), customConditionList, (rs) => - //{ - //}); - //return _taskid; + List customConditionList = new List(); + + //var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value; + //var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value; + + customConditionList.Add(new CustomCondition() { Name = "BillNumList", Value =string.Join(",",p_list) }); + customConditionList.Add(new CustomCondition() { Name = "Type", Value = EnumBusinessType.JisBBAC.ToString() }); + //customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup }); + //customConditionList.Add(new CustomCondition() { Name = "State", Value = string.IsNullOrEmpty(input.State) ? string.Empty : input.State }); + var _taskid = await _service.ExportEnqueueAsync("BBAC待扣减任务", ExportExtentsion.Excel, DateTime.Now.ToString("yyyyMM"), string.Empty, CurrentUser, typeof(PendingDeductionService), customConditionList, (rs) => + { + }); + return _taskid; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs index 6152ac6d..90c89eb6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs @@ -180,17 +180,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var adj = invdetail.ADJ_DETAIL; var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute()?.Name ?? typeof(INVOICE_GRP_DTO).Name; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; - var result = _excel - .Append(dtoDetails,"发票表") - .SeparateBySheet() - .Append(m, "发票和结算分组关系") - .SeparateBySheet() - .Append(not, "对应未结结算分组") - .SeparateBySheet() - .Append(detail, "发票明细") - .SeparateBySheet() - .Append(adj,"发票调整单") - .ExportAppendDataAsByteArray(); + + foreach (var itm in entities) + { + var invlist = detail.Where(p => p.InvbillNum == itm.InvbillNum).ToList(); + var mgroup =m.Where(p => p.InvbillNum == itm.InvbillNum).ToList(); + var adjp = adj.Where(p => p.InvBillNum == itm.InvbillNum).ToList(); + _excel.Append(invlist, "发票号" + itm.InvbillNum).SeparateBySheet(); + _excel.Append(mgroup, "发票结算分组对应" + itm.InvbillNum).SeparateBySheet(); + _excel.Append(adj, "发票调整数据" + itm.InvbillNum).SeparateBySheet(); + } + _excel.Append(not, "发票分组未结对应结算分组"); + + + var result = _excel.ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); //保存导出文件到服务器存成二进制 await _excelImportService.SaveBlobAsync( diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs index 3cbfc5f9..f5f1e24a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs @@ -115,7 +115,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ ContractDocID = "no", BeginDate = p.BeginTime, EndDate = p.EndTime, - PartCode=d.PartCode//客户零件号 + PartCode=d.PartCode,//客户零件号 + PoNum="" + }; var dtos = q.ToList(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs index bd12b190..b5df5fe5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs @@ -49,10 +49,20 @@ public class PendingDeductionService : ITransientDependency, IExportJob { var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value; var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value; - var list=billList.Split(","); - if (type == "BBACJIS") + + // /// + //[Display(Name = "JisBBAC")] + // JisBBAC = 1, + ///// + ///// JisHBPO + ///// + //[Display(Name = "JisHBPO")] + // JisHBPO = 2, + + + if (type == "JisBBAC") { var jisdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan==false); var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan ==true); @@ -108,10 +118,9 @@ public class PendingDeductionService : ITransientDependency, IExportJob } } } - else if (type == "HBPOJIS") + else if (type == "JisHBPO") { var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum)).ToList(); - if (detailist != null && detailist.Count > 0) { foreach (var itm in detailist) @@ -143,6 +152,50 @@ public class PendingDeductionService : ITransientDependency, IExportJob { var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum)).ToList(); + switch (type) + { + case "ZhiGongJianBBAC": + + + + + + break; + case "ZhiGongJianHBPO": + + + + + break; + case "MaiDanJianBBAC": + + + + + break; + case "MaiDanJianHBPO": + + + + + break; + case "BeiJian": + + + + + + break; + case "YinDuJian": + + + + + + + + break; + } if (detailist != null && detailist.Count > 0) { foreach (var itm in detailist) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs index fb8b1d93..6085eb0f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs @@ -13,6 +13,8 @@ using Volo.Abp.RabbitMQ; using System; using TaskJob.Interfaces; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; +using SettleAccount.Job.Services.Report; +using SettleAccount.Job.Services; namespace Win.Sfs.SettleAccount { @@ -47,30 +49,216 @@ namespace Win.Sfs.SettleAccount ConfigureJson(context); //context.Services.AddTransient(typeof(INormalEfCoreRepository<,>), - // typeof(SettleAccountNormalEfCoreRepository<,>)); + //typeof(SettleAccountNormalEfCoreRepository<,>)); + context.Services.AddTransient(implementationFactory => { Func accesor = key => { + if (key.Equals(typeof(PubSaSeCompareExportService).FullName)) + { + return implementationFactory.GetService(); + } + if (key.Equals(typeof(JisBBACEdiSeCompareExportService).FullName)) + { + return implementationFactory.GetService(); + } + if (key.Equals(typeof(JisHBPOEdiSeCompareExportService).FullName)) + { + return implementationFactory.GetService(); + } if (key.Equals(typeof(PendingDeductionService).FullName)) { return implementationFactory.GetService(); } + + + + + //if (key.Equals(typeof(InvoiceSettledDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(UnSettledExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(fisUnsettledDiffReport).FullName)) + //{//ERP总成开票报表 + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(PriceQtyDifferenceExportService).FullName)) + //{//量差和价差分析报表 + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(SettledPartAndErpPartPriceDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(SecMatchBaseExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + + //if (key.Equals(typeof(SettleFisDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + + ////大众看板结算与交货核对明细表(有条码) + //if (key.Equals(typeof(SettleKBWithCodeExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + ////大众备件结算核对明细表 + //if (key.Equals(typeof(SettleSparePartExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + ////大众备件未结明细 + //if (key.Equals(typeof(SettleUnSparePartExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + ////大众备件90天核对明细 + //if (key.Equals(typeof(SettleSparePart90ExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(InvoiceSettledDetailDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(UnInvoiceSettledDetailDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(UnSettleDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + + //if (key.Equals(typeof(SettleDoorPanelExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(UnsettledDetailReportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(SettleKBWithOutCodeExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(SharePartUnSettledExport).FullName)) + //{ + // return implementationFactory.GetService(); + //} + ////红旗、一汽轿车结算报表 + //if (key.Equals(typeof(HQFSettledDetailDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(HQFSharePartSettledDetailDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(HQMSettledDetailDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(HQMSharePartSettledDetailDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(HQHSettledDetailDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + ////红旗结算未结明细 + //if (key.Equals(typeof(HQHUnSettledDetailDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + ////红旗未结核对 + //if (key.Equals(typeof(HQFactoryUnSettledDetailDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(HQHSharePartSettledDetailDiffExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + ////红旗、轿车发运报表 + //if (key.Equals(typeof(HQMShippingExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(HQHShippingExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(HQFShippingExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(WmsOutputSumExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + ////大众看板未结输出 + //if (key.Equals(typeof(KanBanUnSettledExport).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(FisUpdateExportService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + //if (key.Equals(typeof(FisOutputService).FullName)) + //{ + // return implementationFactory.GetService(); + //} + + + + else { throw new ArgumentException($"Not Support key:{key}"); } - }; - return accesor; + + + }; return accesor; }); + //context.Services.AddTransient(implementationFactory => + //{ + // Func accesor = key => + // { + // if (key.Equals(typeof(PendingDeductionService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // else + // { + // throw new ArgumentException($"Not Support key:{key}"); + // } + + // }; + // return accesor; + //}); + + + + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs index e7df840f..322e92c6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs @@ -14,6 +14,10 @@ public class INVOICE_NOT_SETTLE : FullAuditedAggregateRoot [Display(Name = "发票分组号")] public string InvGroupNum { get; set; } = null!; + [Display(Name = "发票号")] + public string InvBillNum { get; set; } = null!; + + [Display(Name = "结算分组号")] public string SettleGroupNum { get; set; } = null!; @@ -35,7 +39,7 @@ public class INVOICE_NOT_SETTLE : FullAuditedAggregateRoot - public INVOICE_NOT_SETTLE(Guid guid, int version, string invGroupNum, string settleGroupNum, string lU, string lU1, string extend1, string extend2,decimal qty) + public INVOICE_NOT_SETTLE(Guid guid, int version, string invGroupNum, string settleGroupNum, string lU, string lU1, string extend1, string extend2,decimal qty,string p_invbillnum) { Id = guid; Version = version; @@ -46,6 +50,7 @@ public class INVOICE_NOT_SETTLE : FullAuditedAggregateRoot Extend1 = extend1; Extend2 = extend2; Qty = qty; + InvBillNum = p_invbillnum; } public INVOICE_NOT_SETTLE() diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs index f97ba14c..f1a6b967 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs @@ -14,6 +14,7 @@ using System.Collections.Generic; using System.Linq; using System.Security.Policy; using System.Text; +using System.Text.Json; using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Auditing; @@ -21,6 +22,7 @@ using Volo.Abp.Data; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; +using Volo.Abp.Json; using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.Prices; @@ -1348,7 +1350,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var innotls = new List(); if (p_notlist != null && p_notlist.Count > 0) { - var notls = p_notlist.GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); + var groupnum = itm.Value; + var notls = p_notlist.Where(p=>groupnum.Contains(p.GroupNum)).GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); foreach (var nitm in notls) { innotls.Add(new INVOICE_NOT_SETTLE( @@ -1360,7 +1363,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers lU1: nitm.LU, extend1: string.Empty, extend2: string.Empty, - qty: nitm.Qty + qty: nitm.Qty, + p_invbillnum:itm.Key )); } if (innotls.Count > 0) @@ -1812,7 +1816,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var innotls = new List(); if (p_notlist != null && p_notlist.Count > 0) { - var notls = p_notlist.GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); + var notls = p_notlist.Where(p=>ls.Contains(p.GroupNum)).GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); foreach (var nitm in notls) { innotls.Add(new INVOICE_NOT_SETTLE( @@ -1824,7 +1828,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers lU1: nitm.LU, extend1: string.Empty, extend2: string.Empty, - qty: nitm.Qty + qty: nitm.Qty, + p_invbillnum:key + )); } if (innotls.Count > 0) @@ -2060,7 +2066,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var query = from inv1 in invdetails join dto1 in dtos on - new { inv1.LU, inv1.PN } equals new { dto1.LU, dto1.PN } + new { inv1.LU,inv1.PartCode, inv1.PN } equals new { dto1.LU,dto1.PartCode, dto1.PN } select new { PartCode = inv1.PartCode, @@ -2103,6 +2109,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers groupList.AddRange(mapList); } List _entityDetailList = new List(); + //var txt= JsonSerializer.Serialize(query.ToList()); + foreach (var detail in query.ToList()) { @@ -2123,12 +2131,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers partcode: detail.PartCode); entity.SetProperty("DeliveryNumber", detail.DeliveryIndexNumber);//交货号 entity.SetProperty("VendorCode", detail.VendorCode);//供应商代码 - entity.SetProperty("VendorName", detail.VendorName);//供应商名称 - entity.SetProperty("PurchaseOrderNumber", "");//采购订单号 - entity.SetProperty("DeliveryIndexNumber", "");//交付索引号 - entity.SetProperty("PartName", "");//零件名称 + entity.SetProperty("VendorName", detail.VendorName);//供应商名称 + entity.SetProperty("PurchaseOrderNumber", "");//采购订单号 + entity.SetProperty("DeliveryIndexNumber", "");//交付索引号 + entity.SetProperty("PartName", "");//零件名称 - _entityDetailList.Add( entity + _entityDetailList.Add( entity ); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs index 29e0a34e..8daf8064 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs @@ -408,7 +408,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var innotls = new List(); if (p_notlist != null && p_notlist.Count > 0) { - var notls = p_notlist.GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); + var notls = p_notlist.Where(p=>ls.Contains(p.GroupNum)).GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); foreach (var nitm in notls) { innotls.Add(new INVOICE_NOT_SETTLE( @@ -420,7 +420,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers lU1: nitm.LU, extend1: string.Empty, extend2: string.Empty, - qty: nitm.Qty + qty: nitm.Qty, + p_invbillnum:key + )); } if (innotls.Count > 0) @@ -841,7 +843,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var innotls = new List(); if (p_notlist != null && p_notlist.Count > 0) { - var notls = p_notlist.GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); + var notls = p_notlist.Where(p=>ls.Contains(p.GroupNum)).GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); foreach (var nitm in notls) { innotls.Add(new INVOICE_NOT_SETTLE( @@ -853,7 +855,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers lU1: nitm.LU, extend1: string.Empty, extend2: string.Empty, - qty: nitm.Qty + qty: nitm.Qty, + p_invbillnum:key )); } if (innotls.Count > 0) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs index 99369b3e..106c648b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs @@ -131,6 +131,14 @@ public class TEMP_CAN_SA_DETAIL public string PartCode { get; set; } + /// + /// 订单号 + /// + public string PoNum { get; set; } + + + + } public class TEMP_NOT_SA_DETAIL : SA_NOT_BASE { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs index f216fb65..08b6cd7d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs @@ -1,4 +1,4 @@ -using Magicodes.ExporterAndImporter.Excel; +using Magicodes.ExporterAndImporter.Excel; using Shouldly; using System; using System.Collections.Generic; @@ -23,7 +23,6 @@ namespace SettleAccount.Job.Services.Report private readonly HQFactorySettledDetailDapperRepository _dapperRepository; private readonly ErpPartDapperRepository _erpdapperRepository; private readonly IBlobContainer _fileContainer; - private readonly OutputService _outputService; private readonly InputService _inputService; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs index fb54f867..c96a92e2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs @@ -81,187 +81,187 @@ namespace Win.Sfs.SettleAccount } }; return accesor; }); - context.Services.AddTransient(implementationFactory => - { - Func accesor = key => - { - if (key.Equals(typeof(PubSaSeCompareExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(JisBBACEdiSeCompareExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(JisHBPOEdiSeCompareExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(PD_SERVICE).FullName)) - { - return implementationFactory.GetService(); - } + //context.Services.AddTransient(implementationFactory => + //{ + // Func accesor = key => + // { + // if (key.Equals(typeof(PubSaSeCompareExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(JisBBACEdiSeCompareExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(JisHBPOEdiSeCompareExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(PD_SERVICE).FullName)) + // { + // return implementationFactory.GetService(); + // } - if (key.Equals(typeof(InvoiceSettledDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(UnSettledExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(fisUnsettledDiffReport).FullName)) - {//ERP总成开票报表 - return implementationFactory.GetService(); - } - if (key.Equals(typeof(PriceQtyDifferenceExportService).FullName)) - {//量差和价差分析报表 - return implementationFactory.GetService(); - } - if (key.Equals(typeof(SettledPartAndErpPartPriceDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(SecMatchBaseExportService).FullName)) - { - return implementationFactory.GetService(); - } + // if (key.Equals(typeof(InvoiceSettledDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(UnSettledExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(fisUnsettledDiffReport).FullName)) + // {//ERP总成开票报表 + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(PriceQtyDifferenceExportService).FullName)) + // {//量差和价差分析报表 + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(SettledPartAndErpPartPriceDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(SecMatchBaseExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } - if (key.Equals(typeof(SettleFisDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } + // if (key.Equals(typeof(SettleFisDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } - //大众看板结算与交货核对明细表(有条码) - if (key.Equals(typeof(SettleKBWithCodeExportService).FullName)) - { - return implementationFactory.GetService(); - } - //大众备件结算核对明细表 - if (key.Equals(typeof(SettleSparePartExportService).FullName)) - { - return implementationFactory.GetService(); - } - //大众备件未结明细 - if (key.Equals(typeof(SettleUnSparePartExportService).FullName)) - { - return implementationFactory.GetService(); - } - //大众备件90天核对明细 - if (key.Equals(typeof(SettleSparePart90ExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(InvoiceSettledDetailDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(UnInvoiceSettledDetailDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(UnSettleDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } + // //大众看板结算与交货核对明细表(有条码) + // if (key.Equals(typeof(SettleKBWithCodeExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // //大众备件结算核对明细表 + // if (key.Equals(typeof(SettleSparePartExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // //大众备件未结明细 + // if (key.Equals(typeof(SettleUnSparePartExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // //大众备件90天核对明细 + // if (key.Equals(typeof(SettleSparePart90ExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(InvoiceSettledDetailDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(UnInvoiceSettledDetailDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(UnSettleDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } - if (key.Equals(typeof(SettleDoorPanelExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(UnsettledDetailReportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(SettleKBWithOutCodeExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(SharePartUnSettledExport).FullName)) - { - return implementationFactory.GetService(); - } - //红旗、一汽轿车结算报表 - if (key.Equals(typeof(HQFSettledDetailDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(HQFSharePartSettledDetailDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(HQMSettledDetailDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(HQMSharePartSettledDetailDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(HQHSettledDetailDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - //红旗结算未结明细 - if (key.Equals(typeof(HQHUnSettledDetailDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - //红旗未结核对 - if (key.Equals(typeof(HQFactoryUnSettledDetailDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(HQHSharePartSettledDetailDiffExportService).FullName)) - { - return implementationFactory.GetService(); - } - //红旗、轿车发运报表 - if (key.Equals(typeof(HQMShippingExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(HQHShippingExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(HQFShippingExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(WmsOutputSumExportService).FullName)) - { - return implementationFactory.GetService(); - } - //大众看板未结输出 - if (key.Equals(typeof(KanBanUnSettledExport).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(FisUpdateExportService).FullName)) - { - return implementationFactory.GetService(); - } - if (key.Equals(typeof(FisOutputService).FullName)) - { - return implementationFactory.GetService(); - } + // if (key.Equals(typeof(SettleDoorPanelExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(UnsettledDetailReportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(SettleKBWithOutCodeExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(SharePartUnSettledExport).FullName)) + // { + // return implementationFactory.GetService(); + // } + // //红旗、一汽轿车结算报表 + // if (key.Equals(typeof(HQFSettledDetailDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(HQFSharePartSettledDetailDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(HQMSettledDetailDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(HQMSharePartSettledDetailDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(HQHSettledDetailDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // //红旗结算未结明细 + // if (key.Equals(typeof(HQHUnSettledDetailDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // //红旗未结核对 + // if (key.Equals(typeof(HQFactoryUnSettledDetailDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(HQHSharePartSettledDetailDiffExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // //红旗、轿车发运报表 + // if (key.Equals(typeof(HQMShippingExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(HQHShippingExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(HQFShippingExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(WmsOutputSumExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // //大众看板未结输出 + // if (key.Equals(typeof(KanBanUnSettledExport).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(FisUpdateExportService).FullName)) + // { + // return implementationFactory.GetService(); + // } + // if (key.Equals(typeof(FisOutputService).FullName)) + // { + // return implementationFactory.GetService(); + // } - else - { - throw new ArgumentException($"Not Support key:{key}"); - } + // else + // { + // throw new ArgumentException($"Not Support key:{key}"); + // } - }; return accesor; - }); + // }; return accesor; + //}); Configure(options =>