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 75e980c5..e268913c 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 @@ -1,4 +1,5 @@ using Magicodes.ExporterAndImporter.Core; +using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -6,6 +7,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; +using Win.Sfs.SettleAccount.Bases; using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos @@ -122,7 +124,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos } - public class INVOICE_GRP_REQ_DTO : PagedAndSortedResultRequestDto + public class INVOICE_GRP_REQ_DTO : RequestInputBase { [Display(Name = "实际纸质发票号")] @@ -131,7 +133,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal TaxAmt { get; set; } [Display(Name = "发票分组号")] public string InvGroupNum { get; set; } - public virtual List Filters { get; set; } = new List(); + } @@ -140,7 +142,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { public List INVOICE_WAIT_DETAIL { get; set; } public List INVOICE_MAP_GROUP { get; set; } - public List INVOICE_NOT_SETTLE_DTO { get; set; } + public List INVOICE_NOT_SETTLE { get; set; } } @@ -210,15 +212,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public string Extend4 { get; set; } } - public class INVOICE_WAIT_DETAIL_REQ_DTO : PagedAndSortedResultRequestDto - { + public class INVOICE_WAIT_DETAIL_REQ_DTO : RequestInputBase + { [Display(Name = "发票号")] public string InvbillNum { get; set; } [Display(Name = "发票分组号")] public string InvGroupNum { get; set; } [Display(Name = "零件号")] public string LU { get; set; } - public virtual List Filters { get; set; } = new List(); + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_BA_SERVICE.cs index 6550ba4e..90e2de45 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_BA_SERVICE.cs @@ -12,11 +12,24 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public interface IBBAC_BA_SERVICE { - + + Task GenerateInvoice(INVOICE_GRP_REQ_DTO input); + + Task> MainQueryAsync(INVOICE_GRP_REQ_DTO input); + Task DetailQueryAsync(INVOICE_GRP_REQ_DTO input); + Task ExportAsync(INVOICE_GRP_REQ_DTO input); + + Task RejectAsync(INVOICE_GRP_REQ_DTO input); + + + + + + } } 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 new file mode 100644 index 00000000..cbb70385 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -0,0 +1,126 @@ +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Csv; +using Magicodes.ExporterAndImporter.Excel; +using Microsoft.AspNetCore.Mvc; +using SettleAccount.Bases; +using SettleAccount.Domain.BQ; +using Shouldly; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Entities; +using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount.Constant; +using Win.Sfs.SettleAccount.Entities.BQ.Dtos; +using Win.Sfs.Shared.RepositoryBase; + +namespace Win.Sfs.SettleAccount.Bases +{ + public abstract class BA_SERVICE:ApplicationService + { + + + private readonly INormalEfCoreRepository _repository; + private readonly INormalEfCoreRepository _wRepository; + private readonly INormalEfCoreRepository _sRepository; + private readonly INormalEfCoreRepository _mRepository; + //private readonly INormalEfCoreRepository _detailRepository; + private readonly IExcelImportAppService _excelImportService; + + protected BA_SERVICE( + INormalEfCoreRepository repository, + INormalEfCoreRepository wRepository, + INormalEfCoreRepository sRepository, + INormalEfCoreRepository mRepository, + IExcelImportAppService excelImportService + //INormalEfCoreRepository detailRepository + + ) + { + _excelImportService = excelImportService; + _repository = repository; + _wRepository = wRepository; + _mRepository = mRepository; + _sRepository = sRepository; + } + public virtual async Task GenerateInvoice(INVOICE_GRP_REQ_DTO input) + { + return ApplicationConsts.SuccessStr; + + } + + [HttpPost] + //[Route("mainquery")] + public virtual async Task> MainQueryAsync(INVOICE_GRP_REQ_DTO input) + { + var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var dtos = ObjectMapper.Map, List>(entitys); + return new PagedResultDto(totalCount, dtos); + } + [HttpPost] + public virtual async Task DetailQueryAsync(INVOICE_GRP_REQ_DTO input) + { + + INVOICE_GRP_DETAIL_DTO _entity=new INVOICE_GRP_DETAIL_DTO(); + var m= await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var mdtos = ObjectMapper.Map, List>(m); + var w=await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var wdtos = ObjectMapper.Map, List>(w); + var s=await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var sdtos = ObjectMapper.Map, List>(s); + _entity.INVOICE_NOT_SETTLE = sdtos; + _entity.INVOICE_WAIT_DETAIL = wdtos; + _entity.INVOICE_MAP_GROUP = mdtos; + return _entity; + + + } + [HttpPost] + public virtual async Task ExportAsync(INVOICE_GRP_REQ_DTO input) + { + IExporter _csv = new CsvExporter(); + IExporter _excel = new ExcelExporter(); + + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var dtoDetails = ObjectMapper.Map, List>(entities); + + var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute()?.Name ?? typeof(INVOICE_GRP_DTO).Name; + string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; + byte[] result = null; + + switch (input.FileType) + { + case 0: + result = await _csv.ExportAsByteArray(dtoDetails); + break; + case 1: + result = await _excel.ExportAsByteArray(dtoDetails); + break; + } + result.ShouldNotBeNull(); + + //保存导出文件到服务器存成二进制 + await _excelImportService.SaveBlobAsync( + new SaveExcelImportInputDto + { + Name = _fileName, + Content = result + } + ); + return _fileName; + } + [HttpPost] + public virtual async Task RejectAsync(INVOICE_GRP_REQ_DTO input) + { + return ApplicationConsts.SuccessStr; ; + + } + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs index 78db7e18..925adfe5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs @@ -18,6 +18,7 @@ using Volo.Abp.Domain.Entities; using Volo.Abp.ObjectMapping; using Volo.Abp.TenantManagement.EntityFrameworkCore; using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.Shared.RepositoryBase; @@ -100,9 +101,9 @@ namespace Win.Sfs.SettleAccount.Bases } [HttpPost] //[Route("generateinvoice")] - public virtual async Task GenerateInvoice(TRequestMainInput input) + public virtual async Task GenerateInvoice(TRequestMainInput input) { - throw new NotImplementedException(); + return ApplicationConsts.SuccessStr; } [HttpPost] //[Route("mainquery")] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs index 1a639963..9a7a4271 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs @@ -16,6 +16,7 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Entities; using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.Shared.RepositoryBase; @@ -92,6 +93,12 @@ namespace Win.Sfs.SettleAccount.Bases ); return _fileName; } + [HttpPost] + public virtual async Task GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input) + { + return ApplicationConsts.SuccessStr; + } + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs index 8d5338d0..36133d65 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs @@ -7,6 +7,12 @@ using System.Threading.Tasks; namespace Win.Sfs.SettleAccount.Bases { + /// + /// 单号生成类 + /// 结算单类型录入SA + /// 可结算单单号INV + /// 不可结算生成可结算单CINV + /// public class OrderNumberGenerator { private static readonly object lockObject = new object(); @@ -25,10 +31,10 @@ namespace Win.Sfs.SettleAccount.Bases string currentDate = DateTime.Now.ToString("yyMMddHHmmss"); // 获取序列号部分 - string sequenceNumber = Interlocked.Increment(ref sequence).ToString().PadLeft(6, '0'); + string sequenceNumber = Interlocked.Increment(ref sequence).ToString().PadLeft(3, '0'); // 拼接单号 - string orderNumber = $"{p_OrderType}-{currentDate}-{sequenceNumber}"; + string orderNumber = $"{p_OrderType}{currentDate}-{sequenceNumber}"; return orderNumber; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs new file mode 100644 index 00000000..86112931 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Win.Sfs.SettleAccount.Bases +{ + internal class PD_SERVICE + { + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index 078bee13..0845be4e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -1,11 +1,15 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components; +using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; +using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ { @@ -14,7 +18,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// [AllowAnonymous] [Route("api/settleaccount/bbac_ba_service")] - public class BBAC_BA_SERVICE: ApplicationService + public class BBAC_BA_SERVICE : BA_SERVICE { + public BBAC_BA_SERVICE(INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, IExcelImportAppService excelImportService) : base(repository, wRepository, sRepository, mRepository, excelImportService) + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index 8f289cd4..c0d973bd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -12,6 +12,7 @@ using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.Shared.RepositoryBase; @@ -39,7 +40,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [HttpPost] //[Route("generateinvoice")] - public async override Task GenerateInvoice(BBAC_CAN_SA_REQ_DTO input) + public async override Task GenerateInvoice(BBAC_CAN_SA_REQ_DTO input) { List _ls = new List(); var _query= _ls.GroupBy(p => new { p.GroupNum }).Select(p =>new {GroupNum=p.Key.GroupNum, Qty=p.Sum(itm=>itm.Price)}); @@ -86,7 +87,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } } - throw new NotImplementedException(); + return ApplicationConsts.SuccessStr; // return true; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs index 5b7f88c5..80a19894 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs @@ -1,17 +1,24 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components; +using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; +using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ { [AllowAnonymous] [Route("api/settleaccount/hbpo_ba_service")] - public class HBPO_BA_SERVICE : ApplicationService + public class HBPO_BA_SERVICE : BA_SERVICE { + public HBPO_BA_SERVICE(INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, IExcelImportAppService excelImportService) : base(repository, wRepository, sRepository, mRepository, excelImportService) + { + } } } 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 new file mode 100644 index 00000000..9342573a --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs @@ -0,0 +1,134 @@ +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Csv; +using Magicodes.ExporterAndImporter.Excel; +using Microsoft.AspNetCore.Mvc; +using SettleAccount.Domain.BQ; +using Shouldly; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount.Entities.BQ.Dtos; +using Win.Sfs.Shared.RepositoryBase; + +namespace Win.Sfs.SettleAccount.Entities.BQ +{ + public class INVOICE_SERVICE:ApplicationService + { + private readonly INormalEfCoreRepository _repository; + private readonly INormalEfCoreRepository _wRepository; + private readonly INormalEfCoreRepository _sRepository; + private readonly INormalEfCoreRepository _mRepository; + //private readonly INormalEfCoreRepository _detailRepository; + private readonly IExcelImportAppService _excelImportService; + + protected INVOICE_SERVICE( + INormalEfCoreRepository repository, + INormalEfCoreRepository wRepository, + INormalEfCoreRepository sRepository, + INormalEfCoreRepository mRepository, + IExcelImportAppService excelImportService + //INormalEfCoreRepository detailRepository + + ) + { + _excelImportService = excelImportService; + _repository = repository; + _wRepository = wRepository; + _mRepository = mRepository; + _sRepository = sRepository; + } + public virtual async Task ApprovalPassed(INVOICE_GRP_REQ_DTO input) + { + return string.Empty; + + } + + [HttpPost] + //[Route("mainquery")] + public virtual async Task> MainQueryAsync(INVOICE_GRP_REQ_DTO input) + { + var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var dtos = ObjectMapper.Map, List>(entitys); + return new PagedResultDto(totalCount, dtos); + } + public virtual async Task DetailQueryAsync(INVOICE_GRP_REQ_DTO input) + { + + INVOICE_GRP_DETAIL_DTO _entity = new INVOICE_GRP_DETAIL_DTO(); + var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var mdtos = ObjectMapper.Map, List>(m); + var w = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var wdtos = ObjectMapper.Map, List>(w); + var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var sdtos = ObjectMapper.Map, List>(s); + _entity.INVOICE_NOT_SETTLE = sdtos; + _entity.INVOICE_WAIT_DETAIL = wdtos; + _entity.INVOICE_MAP_GROUP = mdtos; + return _entity; + + + } + public virtual async Task ExportAsync(INVOICE_GRP_REQ_DTO input) + { + IExporter _csv = new CsvExporter(); + IExporter _excel = new ExcelExporter(); + + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var dtoDetails = ObjectMapper.Map, List>(entities); + + var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute()?.Name ?? typeof(INVOICE_GRP_DTO).Name; + string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; + byte[] result = null; + + switch (input.FileType) + { + case 0: + result = await _csv.ExportAsByteArray(dtoDetails); + break; + case 1: + result = await _excel.ExportAsByteArray(dtoDetails); + break; + } + result.ShouldNotBeNull(); + + //保存导出文件到服务器存成二进制 + await _excelImportService.SaveBlobAsync( + new SaveExcelImportInputDto + { + Name = _fileName, + Content = result + } + ); + return _fileName; + } + + public virtual async Task RejectAsync(INVOICE_GRP_REQ_DTO input) + { + return string.Empty; + + } + public virtual async Task Sync_QAD(INVOICE_GRP_REQ_DTO input) + { + return string.Empty; + + } + + + + + + + + + + + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs index 5915724f..3b3c7311 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs @@ -1,17 +1,24 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components; +using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; +using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ { [AllowAnonymous] [Route("api/settleaccount/pub_ba_service")] - public class PUB_BA_SERVICE : ApplicationService + public class PUB_BA_SERVICE : BA_SERVICE { + public PUB_BA_SERVICE(INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, IExcelImportAppService excelImportService) : base(repository, wRepository, sRepository, mRepository, excelImportService) + { + } } } 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 da45f7f7..0f57b2f5 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 @@ -111,76 +111,62 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices return errorList; } - //public async Task> CheckBase(List p_list, BASE_CONF p_config) - //{ - // //List errorList = new List(); - // //var partList = p_list.Select(p => p.LU).Distinct().ToList(); - - // //if (p_config.IsBom == true) - // //{ - // // var bomList = await _bomshipRepository.ToListAsync(); - // // var query = from itm in partList - // // join itm1 in bomList on itm equals itm1.ParentItemCode - // // into temp - // // from tm in temp.DefaultIfEmpty() - // // where tm == null - // // select itm; - - // // foreach (var itm1 in query.ToList()) - // // { - // // errorList.Add(itm1); - // // } - // //} - // //if (p_config.IsMaterial == true) - // //{ - - // // var materialList = await _materialRepository.ToListAsync(); - // // var query = from itm in partList - // // join itm1 in materialList on itm equals itm1.MaterialCode - // // into temp - // // from tm in temp.DefaultIfEmpty() - // // where tm == null - // // select itm; - // // foreach (var partcode in query.ToList()) - // // { - // // errorList.Add(partcode); - // // } - // //} - // //if (p_config.IsRelationShip == true) - // //{ - // // var materialList = await _relationshipRepository.ToListAsync(); - // // var query = from itm in partList - // // join itm1 in materialList on itm equals itm1.SettleMaterialCode - // // into temp - // // from tm in temp.DefaultIfEmpty() - // // where tm == null - // // select itm; - - // // foreach (var partcode in query.ToList()) - // // { - // // errorList.Add(partcode); - // // } - // //} - // //if (p_config.IsRelationShip == true) - // //{ - // // var materialList = await _relationshipRepository.ToListAsync(); - // // var query = from itm in partList - // // join itm1 in materialList on itm equals itm1.SettleMaterialCode - // // into temp - // // from tm in temp.DefaultIfEmpty() - // // where tm == null - // // select itm; - - // // foreach (var partcode in query.ToList()) - // // { - // // errorList.Add(partcode); - // // } - // //} - - - - // //return errorList; - //} + public async Task> CheckBase(List p_list, BASE_CONF p_config) + { + List errorList = new List(); + var partList = p_list; + + if (p_config.IsBom == true) + { + var bomList = await _bomshipRepository.ToListAsync(); + var query = from itm in partList + join itm1 in bomList on itm equals itm1.ParentItemCode + into temp + from tm in temp.DefaultIfEmpty() + where tm == null + select itm; + + foreach (var itm1 in query.ToList()) + { + errorList.Add(itm1); + } + } + if (p_config.IsMaterial == true) + { + + var materialList = await _materialRepository.ToListAsync(); + var query = from itm in partList + join itm1 in materialList on itm equals itm1.MaterialCode + into temp + from tm in temp.DefaultIfEmpty() + where tm == null + select itm; + foreach (var partcode in query.ToList()) + { + errorList.Add(partcode); + } + } + if (p_config.IsRelationShip == true) + { + var materialList = await _relationshipRepository.ToListAsync(); + var query = from itm in partList + join itm1 in materialList on itm equals itm1.SettleMaterialCode + into temp + from tm in temp.DefaultIfEmpty() + where tm == null + select itm; + + foreach (var partcode in query.ToList()) + { + errorList.Add(partcode); + } + } + + + + + return errorList; + } }