Browse Source

更新基类服务

master
学 赵 1 year ago
parent
commit
3bdcb188f8
  1. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs
  2. 15
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_BA_SERVICE.cs
  3. 126
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs
  4. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  5. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs
  6. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs
  7. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs
  8. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  9. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs
  10. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  11. 134
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  12. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  13. 126
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs

14
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<FilterCondition> Filters { get; set; } = new List<FilterCondition>();
}
@ -140,7 +142,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
public List<INVOICE_WAIT_DETAIL_DTO> INVOICE_WAIT_DETAIL { get; set; }
public List<INVOICE_MAP_GROUP_DTO> INVOICE_MAP_GROUP { get; set; }
public List<INVOICE_NOT_SETTLE_DTO> INVOICE_NOT_SETTLE_DTO { get; set; }
public List<INVOICE_NOT_SETTLE_DTO> 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<FilterCondition> Filters { get; set; } = new List<FilterCondition>();
}

15
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<bool> GenerateInvoice(INVOICE_GRP_REQ_DTO input);
Task<PagedResultDto<INVOICE_GRP_DTO>> MainQueryAsync(INVOICE_GRP_REQ_DTO input);
Task<INVOICE_GRP_DTO> DetailQueryAsync(INVOICE_GRP_REQ_DTO input);
Task<string> ExportAsync(INVOICE_GRP_REQ_DTO input);
Task<bool> RejectAsync(INVOICE_GRP_REQ_DTO input);
}
}

126
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<INVOICE_GRP, Guid> _repository;
private readonly INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> _wRepository;
private readonly INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> _sRepository;
private readonly INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> _mRepository;
//private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
private readonly IExcelImportAppService _excelImportService;
protected BA_SERVICE(
INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,
INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository,
IExcelImportAppService excelImportService
//INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
)
{
_excelImportService = excelImportService;
_repository = repository;
_wRepository = wRepository;
_mRepository = mRepository;
_sRepository = sRepository;
}
public virtual async Task<string> GenerateInvoice(INVOICE_GRP_REQ_DTO input)
{
return ApplicationConsts.SuccessStr;
}
[HttpPost]
//[Route("mainquery")]
public virtual async Task<PagedResultDto<INVOICE_GRP_DTO>> 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<INVOICE_GRP>, List<INVOICE_GRP_DTO>>(entitys);
return new PagedResultDto<INVOICE_GRP_DTO>(totalCount, dtos);
}
[HttpPost]
public virtual async Task<INVOICE_GRP_DETAIL_DTO> 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<INVOICE_MAP_GROUP>, List<INVOICE_MAP_GROUP_DTO>>(m);
var w=await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var wdtos = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(w);
var s=await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var sdtos = ObjectMapper.Map<List<INVOICE_NOT_SETTLE>, List<INVOICE_NOT_SETTLE_DTO>>(s);
_entity.INVOICE_NOT_SETTLE = sdtos;
_entity.INVOICE_WAIT_DETAIL = wdtos;
_entity.INVOICE_MAP_GROUP = mdtos;
return _entity;
}
[HttpPost]
public virtual async Task<string> 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<INVOICE_GRP>, List<INVOICE_GRP_EXPORT_DTO>>(entities);
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.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<string> RejectAsync(INVOICE_GRP_REQ_DTO input)
{
return ApplicationConsts.SuccessStr; ;
}
}
}

5
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<bool> GenerateInvoice(TRequestMainInput input)
public virtual async Task<string> GenerateInvoice(TRequestMainInput input)
{
throw new NotImplementedException();
return ApplicationConsts.SuccessStr;
}
[HttpPost]
//[Route("mainquery")]

7
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<string> GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input)
{
return ApplicationConsts.SuccessStr;
}
}

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs

@ -7,6 +7,12 @@ using System.Threading.Tasks;
namespace Win.Sfs.SettleAccount.Bases
{
/// <summary>
/// 单号生成类
/// 结算单类型录入SA
/// 可结算单单号INV
/// 不可结算生成可结算单CINV
/// </summary>
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;
}

12
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
{
}
}

9
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
/// </summary>
[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<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, IExcelImportAppService excelImportService) : base(repository, wRepository, sRepository, mRepository, excelImportService)
{
}
}
}

5
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<bool> GenerateInvoice(BBAC_CAN_SA_REQ_DTO input)
public async override Task<string> GenerateInvoice(BBAC_CAN_SA_REQ_DTO input)
{
List<BBAC_CAN_SA_DETAIL_DTO> _ls = new List<BBAC_CAN_SA_DETAIL_DTO>();
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;

9
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<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, IExcelImportAppService excelImportService) : base(repository, wRepository, sRepository, mRepository, excelImportService)
{
}
}
}

134
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<INVOICE_GRP, Guid> _repository;
private readonly INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> _wRepository;
private readonly INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> _sRepository;
private readonly INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> _mRepository;
//private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
private readonly IExcelImportAppService _excelImportService;
protected INVOICE_SERVICE(
INormalEfCoreRepository<INVOICE_GRP, Guid> repository,
INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository,
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository,
INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository,
IExcelImportAppService excelImportService
//INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
)
{
_excelImportService = excelImportService;
_repository = repository;
_wRepository = wRepository;
_mRepository = mRepository;
_sRepository = sRepository;
}
public virtual async Task<string> ApprovalPassed(INVOICE_GRP_REQ_DTO input)
{
return string.Empty;
}
[HttpPost]
//[Route("mainquery")]
public virtual async Task<PagedResultDto<INVOICE_GRP_DTO>> 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<INVOICE_GRP>, List<INVOICE_GRP_DTO>>(entitys);
return new PagedResultDto<INVOICE_GRP_DTO>(totalCount, dtos);
}
public virtual async Task<INVOICE_GRP_DETAIL_DTO> 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<INVOICE_MAP_GROUP>, List<INVOICE_MAP_GROUP_DTO>>(m);
var w = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var wdtos = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(w);
var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var sdtos = ObjectMapper.Map<List<INVOICE_NOT_SETTLE>, List<INVOICE_NOT_SETTLE_DTO>>(s);
_entity.INVOICE_NOT_SETTLE = sdtos;
_entity.INVOICE_WAIT_DETAIL = wdtos;
_entity.INVOICE_MAP_GROUP = mdtos;
return _entity;
}
public virtual async Task<string> 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<INVOICE_GRP>, List<INVOICE_GRP_EXPORT_DTO>>(entities);
var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute<DisplayAttribute>()?.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<string> RejectAsync(INVOICE_GRP_REQ_DTO input)
{
return string.Empty;
}
public virtual async Task<string> Sync_QAD(INVOICE_GRP_REQ_DTO input)
{
return string.Empty;
}
}
}

9
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<INVOICE_GRP, Guid> repository, INormalEfCoreRepository<INVOICE_WAIT_DETAIL, Guid> wRepository, INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> sRepository, INormalEfCoreRepository<INVOICE_MAP_GROUP, Guid> mRepository, IExcelImportAppService excelImportService) : base(repository, wRepository, sRepository, mRepository, excelImportService)
{
}
}
}

126
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<List<string>> CheckBase<TEntity>(List<string> p_list, BASE_CONF p_config)
//{
// //List<string> errorList = new List<string>();
// //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<List<string>> CheckBase<TEntity>(List<string> p_list, BASE_CONF p_config)
{
List<string> errorList = new List<string>();
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;
}
}

Loading…
Cancel
Save