|
@ -1,7 +1,5 @@ |
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
|
|
using Shouldly; |
|
|
using Shouldly; |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
@ -10,16 +8,8 @@ using Volo.Abp.Application.Dtos; |
|
|
using Volo.Abp.Caching; |
|
|
using Volo.Abp.Caching; |
|
|
using Win.Abp.Snowflakes; |
|
|
using Win.Abp.Snowflakes; |
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
|
using Win.Sfs.BaseData.ImportExcelCommon; |
|
|
using Win.Sfs.SettleAccount.Boms; |
|
|
|
|
|
using Win.Sfs.SettleAccount.CommonManagers; |
|
|
using Win.Sfs.SettleAccount.CommonManagers; |
|
|
using Win.Sfs.SettleAccount.Constant; |
|
|
|
|
|
using Win.Sfs.SettleAccount.Entities.Boms; |
|
|
|
|
|
using Win.Sfs.SettleAccount.Entities.ImportMap; |
|
|
|
|
|
using Win.Sfs.SettleAccount.Entities.Prices; |
|
|
|
|
|
using Win.Sfs.SettleAccount.Entities.TaskJobs; |
|
|
|
|
|
using Win.Sfs.SettleAccount.ExcelImporter; |
|
|
using Win.Sfs.SettleAccount.ExcelImporter; |
|
|
using Win.Sfs.SettleAccount.ExportReports; |
|
|
|
|
|
using Win.Sfs.SettleAccount.MaterialRelationships; |
|
|
|
|
|
using Win.Sfs.Shared.RepositoryBase; |
|
|
using Win.Sfs.Shared.RepositoryBase; |
|
|
|
|
|
|
|
|
namespace Win.Sfs.SettleAccount.Entities.Materials |
|
|
namespace Win.Sfs.SettleAccount.Entities.Materials |
|
@ -27,50 +17,27 @@ namespace Win.Sfs.SettleAccount.Entities.Materials |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 物料主数据
|
|
|
/// 物料主数据
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
//[Authorize(SettleAccountPermissions.Materials.Default)]
|
|
|
|
|
|
[AllowAnonymous] |
|
|
[AllowAnonymous] |
|
|
[Route("api/settleaccount/MaterialAppService")] |
|
|
[Route("api/settleaccount/MaterialAppService")] |
|
|
public class MaterialAppService : SettleAccountApplicationBase<Material> |
|
|
public class MaterialAppService : SettleAccountApplicationBase<Material> |
|
|
{ |
|
|
{ |
|
|
private readonly IExcelImportAppService _excelImportService; |
|
|
/// <summary>
|
|
|
|
|
|
/// 物料主数据仓储
|
|
|
|
|
|
/// </summary>
|
|
|
private readonly INormalEfCoreRepository<Material, Guid> _repository; |
|
|
private readonly INormalEfCoreRepository<Material, Guid> _repository; |
|
|
|
|
|
|
|
|
private readonly ISettleAccountBranchEfCoreRepository<Bom, Guid> _bomRepository; |
|
|
|
|
|
private readonly ISettleAccountBranchEfCoreRepository<BomVersion, Guid> _bomversionRepository; |
|
|
|
|
|
private readonly ISettleAccountBranchEfCoreRepository<PriceList, Guid> _priceRepository; |
|
|
|
|
|
private readonly ISettleAccountBranchEfCoreRepository<PriceListVersion, Guid> _priceversionRepository; |
|
|
|
|
|
private readonly ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> _mapRepository; |
|
|
|
|
|
private readonly ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> _relationshipRepository; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 构建方法
|
|
|
/// 构造
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public MaterialAppService( |
|
|
public MaterialAppService( |
|
|
INormalEfCoreRepository<Material, Guid> repository, |
|
|
INormalEfCoreRepository<Material, Guid> repository, |
|
|
ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> mapRepository, |
|
|
IDistributedCache<Material> cache, |
|
|
ISettleAccountBranchEfCoreRepository<Bom, Guid> bomRepository, |
|
|
|
|
|
ISettleAccountBranchEfCoreRepository<BomVersion, Guid> bomversionRepository, |
|
|
|
|
|
TaskJobService service, |
|
|
|
|
|
ISettleAccountBranchEfCoreRepository<MaterialRelationship, Guid> relationshipRepository, |
|
|
|
|
|
ISettleAccountBranchEfCoreRepository<PriceList, Guid> priceRepository, |
|
|
|
|
|
ISettleAccountBranchEfCoreRepository<PriceListVersion, Guid> priceversionRepository, |
|
|
|
|
|
|
|
|
|
|
|
IDistributedCache<Material> cache, |
|
|
|
|
|
IExcelImportAppService excelImportService, |
|
|
IExcelImportAppService excelImportService, |
|
|
ISnowflakeIdGenerator snowflakeIdGenerator, |
|
|
ISnowflakeIdGenerator snowflakeIdGenerator, |
|
|
ICommonManager commonManager |
|
|
ICommonManager commonManager |
|
|
|
|
|
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) |
|
|
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) |
|
|
|
|
|
{ |
|
|
{ |
|
|
_priceRepository = priceRepository; |
|
|
|
|
|
_priceversionRepository = priceversionRepository; |
|
|
|
|
|
_bomRepository = bomRepository; |
|
|
|
|
|
_excelImportService = excelImportService; |
|
|
|
|
|
_repository = repository; |
|
|
_repository = repository; |
|
|
_relationshipRepository = relationshipRepository; |
|
|
|
|
|
_mapRepository = mapRepository; |
|
|
|
|
|
_bomversionRepository = bomversionRepository; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#region 导入、导出
|
|
|
#region 导入、导出
|
|
@ -79,7 +46,6 @@ namespace Win.Sfs.SettleAccount.Entities.Materials |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
[Route("Export")] |
|
|
[Route("Export")] |
|
|
//[Authorize(SettleAccountPermissions.Materials.Default)]
|
|
|
|
|
|
public virtual async Task<string> ExportAsync(MaterialRequestDto input) |
|
|
public virtual async Task<string> ExportAsync(MaterialRequestDto input) |
|
|
{ |
|
|
{ |
|
|
string _fileName = string.Format("物料主数据_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd")); |
|
|
string _fileName = string.Format("物料主数据_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd")); |
|
@ -112,7 +78,6 @@ namespace Win.Sfs.SettleAccount.Entities.Materials |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
[Route("list")] |
|
|
[Route("list")] |
|
|
//[Authorize(SettleAccountPermissions.Materials.Default)]
|
|
|
|
|
|
virtual public async Task<PagedResultDto<MaterialDto>> GetListAsync(MaterialRequestDto input) |
|
|
virtual public async Task<PagedResultDto<MaterialDto>> GetListAsync(MaterialRequestDto input) |
|
|
{ |
|
|
{ |
|
|
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, |
|
|
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, |
|
|