From 13ff2997f01f01f3ae3891b53285f6f248a1b2ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 25 Sep 2023 09:45:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=91=E7=A5=A8=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E4=B8=AD=E6=96=87=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bases/BA_SERVICE.cs | 12 +++++++---- .../Entities/BQ/BBAC_NOT_SA_SERVICE.cs | 1 - .../Entities/BQ/INVOICE_SERVICE.cs | 20 +++++++++---------- .../BaseDomainServices/BaseDomainService.cs | 16 ++++++++++++--- .../Entities/BQ/Managers/PUB_NOT_SA_MNG.cs | 5 ----- 5 files changed, 30 insertions(+), 24 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs index 0611e8af..0044b45f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -133,11 +133,17 @@ namespace Win.Sfs.SettleAccount.Bases public virtual async Task DetailQueryAsync(INVOICE_GRP_REQ_DTO input) { INVOICE_GRP_DETAIL_DTO entity = new INVOICE_GRP_DETAIL_DTO(); - var materialList = await _baseservice.GetMaterialList().ConfigureAwait(false); + var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var mdtos = ObjectMapper.Map, List>(m); var first = invs.FirstOrDefault(); + var materialList = await _baseservice.GetMaterialList(first.BusinessType).ConfigureAwait(false); + //if (materialList.Count == 0) + //{ + // throw new UserFriendlyException($" 零件关系表无对应业务,零件关系记录!", "400"); + //} + if (invs.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC) { @@ -150,7 +156,7 @@ namespace Win.Sfs.SettleAccount.Bases select new INVOICE_WAIT_DETAIL_BBAC_DTO() { - PartDesc = tm == null ? string.Empty : itm.PartDesc, + PartDesc = tm == null ? string.Empty : tm.MaterialDesc, InvDate = itm1.CreationTime, RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, Version = itm.Version, @@ -422,14 +428,12 @@ namespace Win.Sfs.SettleAccount.Bases [HttpPost] public virtual async Task ReceivedAsync(List p_ins) { - bool issuc = await _invMng.ReceivedAsync(p_ins).ConfigureAwait(false); if (issuc == true) { return new JsonResult(new { Code = 200, Message = "收票成功" }); } - return new JsonResult(new { Code = 400, Message = "收票失败" }); } protected virtual async Task> GetMapGroupAsync(INVOICE_GRP_REQ_DTO input) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs index 0c889c03..4a481eac 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs @@ -48,7 +48,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } else { - var errors = await _bbacNotMng.GenerateSettlementOrder(entitys).ConfigureAwait(false); if (errors.Count > 0) { 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 d9d62bcc..7ea30593 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 @@ -17,6 +17,7 @@ using SettleAccount.Domain.BQ; using ShardingCore.Extensions; using Shouldly; using SqlSugar; +using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Data; @@ -154,19 +155,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public virtual async Task DetailQueryAsync(INVOICE_GRP_REQ_DTO input) { INVOICE_GRP_DETAIL_DTO entity = new INVOICE_GRP_DETAIL_DTO(); - input.Filters.Add(new FilterCondition("InvoiceState", "1", EnumFilterAction.Equal, EnumFilterLogic.And)); - - - var materialList = await _baseservice.GetMaterialList().ConfigureAwait(false); var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var mdtos = ObjectMapper.Map, List>(m); var first = invs.FirstOrDefault(); - - - - + var materialList = await _baseservice.GetMaterialList(first.BusinessType).ConfigureAwait(false); + //if (materialList.Count == 0) + //{ + // throw new UserFriendlyException($" 零件关系表无对应业务,零件关系记录!", "400"); + //} if (invs.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC) { var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); @@ -178,7 +176,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ select new INVOICE_WAIT_DETAIL_BBAC_DTO() { - PartDesc = tm == null ? string.Empty : itm.PartDesc, + PartDesc = tm == null ? string.Empty : tm.MaterialDesc, InvDate = itm1.CreationTime, RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, Version = itm.Version, @@ -286,7 +284,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ select new INVOICE_WAIT_DETAIL_DTO() { - PartDesc = tm == null ? string.Empty : itm.PartDesc, + PartDesc = tm == null ? string.Empty : tm.MaterialDesc, InvDate = itm1.CreationTime, RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, Version = itm.Version, @@ -456,7 +454,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { IExporter _csv = new CsvExporter(); ExcelExporter _excel = new ExcelExporter(); - var materialList = await _baseservice.GetMaterialList().ConfigureAwait(false); + // var materialList = await _baseservice.GetMaterialList().ConfigureAwait(false); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); var first = entities.FirstOrDefault(); var dtoDetails = ObjectMapper.Map, List>(entities); 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 2d980eb4..d943db3b 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 @@ -43,15 +43,25 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices _bomshipRepository = bomshipRepository; } - public async Task> GetMaterialList() + public async Task> GetMaterialList(EnumBusinessType businessType) { List ls = new List(); - var lst = await _relationshipRepository.Where(p => !string.IsNullOrEmpty(p.SettleMaterialCode)).ToListAsync().ConfigureAwait(false); - + var lst = await _relationshipRepository.Where(p => !string.IsNullOrEmpty(p.SettleMaterialCode) && p.BusinessType==businessType).ToListAsync().ConfigureAwait(false); var l = lst.GroupBy(p => p.SettleMaterialCode).Select(g => g.First()); return l.ToList(); } + //public async Task> CheckRelationlList(EnumBusinessType businessType,) + //{ + // List ls = new List(); + // var lst = await _relationshipRepository.Where(p => !string.IsNullOrEmpty(p.SettleMaterialCode) && p.BusinessType == businessType).ToListAsync().ConfigureAwait(false); + + // var l = lst.GroupBy(p => p.SettleMaterialCode).Select(g => g.First()); + // return l.ToList(); + //} + + + public static async Task DoWorkBulkWithTransaction(DbContext dbContext, Action p_dowork) { using (var transaction = await dbContext.Database.BeginTransactionAsync().ConfigureAwait(false)) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs index d072b567..2adccc6f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs @@ -91,9 +91,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode==site).ToList();//价格单 } - - - if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC || first.BusinessType == EnumBusinessType.BeiJian || first.BusinessType == EnumBusinessType.YinDuJian ) @@ -123,8 +120,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers return errors; } - - var billNumber = OrderNumberGenerator.GenerateOrderNumber("N"); var _entity = new PUB_CAN_SA(); _entity.SetId(Guid.NewGuid());