From 7da3ed276032d29307abb8fbabbe58b0ec819439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 17 Aug 2023 17:10:28 +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/BBAC_PD_SERVICE.cs | 81 ++++++++++++------- .../BQ/Syncs/PendingDeductionService.cs | 16 ++-- .../SettleAccountApplicationModule.cs | 29 ++++++- .../BaseDomainServices/BaseDomainService.cs | 2 +- 4 files changed, 90 insertions(+), 38 deletions(-) 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 9bdca903..a70d8c25 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 @@ -1,11 +1,14 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components; using SettleAccount.Domain.BQ; +using SettleAccount.Job.Services.Report; +using SettleAccount.Job.Services; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using TaskJob.EventArgs; using Volo.Abp.Application.Services; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; @@ -16,6 +19,7 @@ using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.Shared.RepositoryBase; +using Win.Sfs.SettleAccount.Entities.TaskJobs; namespace Win.Sfs.SettleAccount.Entities.BQ { @@ -28,8 +32,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ BBAC_PD_DETAIL, BBAC_PD_DETAIL_DTO, BBAC_PD_REQ_DTO, BBAC_PD_DETAIL_REQ_DTO, BBAC_PD_DETAIL_EXP_DTO> { - public BBAC_PD_SERVICE(INormalEfCoreRepository bbacSecRepository, INormalEfCoreRepository hbpoSecRepository, INormalEfCoreRepository pubSecRepository, IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository repository, VmiAppService vimservice, INormalEfCoreRepository detailRepository) : base(bbacSecRepository, hbpoSecRepository, pubSecRepository, excelImportService, snowflakeIdGenerator, commonManager, repository, vimservice, detailRepository) + + private readonly TaskJobService _service; + public BBAC_PD_SERVICE(INormalEfCoreRepository bbacSecRepository, INormalEfCoreRepository hbpoSecRepository, INormalEfCoreRepository pubSecRepository, IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository repository, VmiAppService vimservice, + INormalEfCoreRepository detailRepository, + TaskJobService service + + ) : + base(bbacSecRepository, hbpoSecRepository, pubSecRepository, excelImportService, snowflakeIdGenerator, commonManager, repository, vimservice, detailRepository) { + _service = service; } public override async Task ApprovalPassed(List p_list) @@ -37,33 +49,48 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var detailist = _detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList(); - // _bbacSecRepository.Where(p=>) + //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; + + + + + + + // _bbacSecRepository.Where(p=>) - if (detailist != null && detailist.Count > 0) - { - foreach (var itm in detailist) - { - await _vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() - { - BillTime = itm.CreationTime, - ChangedTime = DateTime.Now, - Qty = itm.Qty, - DeliverTime = itm.CreationTime, - LogType = Entities.BQ.Vmi.VmiLogType.Type200, - ChangedQty = itm.Qty, - ChangedType = VmiType.Out, - SubBillType = EnumDeliverSubBillType.小件BBAC, - BillType = EnumDeliverBjBmpBillType.JIS件, - PartCode = itm.LU, - SettlementVinCode = itm.PN, - PartCode2 = itm.LU, - CustomerPartCode = itm.LU, - VinCode = itm.PN, - OrderNum = itm.GroupNum, - ErpToLoc = "C0001" - }); - } - } + //if (detailist != null && detailist.Count > 0) + //{ + // foreach (var itm in detailist) + // { + // await _vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog() + // { + // BillTime = itm.CreationTime, + // ChangedTime = DateTime.Now, + // Qty = itm.Qty, + // DeliverTime = itm.CreationTime, + // LogType = Entities.BQ.Vmi.VmiLogType.Type200, + // ChangedQty = itm.Qty, + // ChangedType = VmiType.Out, + // SubBillType = EnumDeliverSubBillType.小件BBAC, + // BillType = EnumDeliverBjBmpBillType.JIS件, + // PartCode = itm.LU, + // SettlementVinCode = itm.PN, + // PartCode2 = itm.LU, + // CustomerPartCode = itm.LU, + // VinCode = itm.PN, + // OrderNum = itm.GroupNum, + // ErpToLoc = "C0001" + // }); + // } + //} return ApplicationConsts.SuccessStr; 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 0da57b1f..bd12b190 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 @@ -47,15 +47,18 @@ public class PendingDeductionService : ITransientDependency, IExportJob public string ExportFile(Guid id, List exportName, List property) { - var list = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value; + 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") { var jisdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan==false); var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan ==true); var query = from itm in jisdetail join itm1 in _bbacSecRepository - on new { itm.PN, itm.LU } equals new { itm1.PN,LU= itm1.PrimitiveLU } into temp1 + on new { itm.PN, itm.LU } equals new { itm1.PN, LU = itm1.PrimitiveLU } into temp1 from tm in temp1 where tm == null select @@ -70,10 +73,10 @@ public class PendingDeductionService : ITransientDependency, IExportJob ChangedType = VmiType.Out, SubBillType = EnumDeliverSubBillType.小件BBAC, BillType = EnumDeliverBjBmpBillType.JIS件, - PartCode = tm!=null?tm.ReplaceLU:itm.LU, + PartCode = tm != null ? tm.ReplaceLU : itm.LU, SettlementVinCode = itm.PN, PartCode2 = tm != null ? tm.ReplaceLU : itm.LU, - CustomerPartCode =string.IsNullOrEmpty(itm.Extend4)?string.Empty:itm.Extend4, + CustomerPartCode = string.IsNullOrEmpty(itm.Extend4) ? string.Empty : itm.Extend4, VinCode = itm.PN, OrderNum = itm.GroupNum, ErpToLoc = "C0001" @@ -171,11 +174,6 @@ public class PendingDeductionService : ITransientDependency, IExportJob } - - return ApplicationConsts.SuccessStr; - - - return id.ToString(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs index 257098e2..fb8b1d93 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; using Volo.Abp.Application; @@ -10,6 +10,9 @@ using Volo.Abp.Dapper; using Win.Abp.Snowflakes; using Volo.Abp.EventBus.RabbitMq; using Volo.Abp.RabbitMQ; +using System; +using TaskJob.Interfaces; +using Win.Sfs.SettleAccount.Entities.BQ.Syncs; namespace Win.Sfs.SettleAccount { @@ -46,6 +49,30 @@ namespace Win.Sfs.SettleAccount //context.Services.AddTransient(typeof(INormalEfCoreRepository<,>), // typeof(SettleAccountNormalEfCoreRepository<,>)); + + + 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/Bases/BaseDomainServices/BaseDomainService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs index cf4ad459..9d8902b3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs @@ -44,7 +44,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices //ICommonManager commonManager ) { - _pricebjRepository = pricebjRepository; + _priceRepository = priceRepository; _pricebjRepository= pricebjRepository; _materialRepository = materialRepository; _relationshipRepository = relationshipRepository;