Browse Source

添加发运Dto

master
mahao 1 year ago
parent
commit
d663b2174f
  1. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs
  2. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs
  3. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs
  4. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_EDI_DTO.cs
  5. 51
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
  6. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs
  7. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs
  8. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs
  9. 84
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  10. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs

@ -1,13 +1,14 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// BBAC发运
/// </summary>
public class BBAC_SE_DETAIL_DTO
public class BBAC_SE_DETAIL_DTO : EntityDto<Guid>
{
/// <summary>
/// 期间

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs

@ -1,13 +1,14 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// BBAC的EDI数据
/// </summary>
public class BBAC_SE_EDI_DTO
public class BBAC_SE_EDI_DTO : EntityDto<Guid>
{
/// <summary>
/// LU+生产码

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs

@ -5,13 +5,14 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// HBPO发运单
/// </summary>
public class HBPO_SE_DETAIL_DTO
public class HBPO_SE_DETAIL_DTO : EntityDto<Guid>
{
/// <summary>
/// 期间

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_EDI_DTO.cs

@ -1,13 +1,14 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// HBPO的EDI数据
/// </summary>
public class HBPO_SE_EDI_DTO
public class HBPO_SE_EDI_DTO : EntityDto<Guid>
{
/// <summary>
/// LU+生产码

51
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// PUB结算
/// </summary>
public class PUB_SA_DTO : EntityDto<Guid>
{
/// <summary>
/// 期间
/// </summary>
[Display(Name = "期间")]
public int Version { get; set; }
/// <summary>
/// 结算单据
/// </summary>
[Display(Name = "结算单据")]
public string BillNum { get; set; }
/// <summary>
/// 状态
/// </summary>
[Display(Name = "状态")]
public string State { get; set; }
}
/// <summary>
/// 导入
/// </summary>
public class PUB_SA_IMPORT_DTO
{
}
/// <summary>
/// 导出
/// </summary>
public class PUB_SA_EXPORT_DTO
{
}
}

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs

@ -5,13 +5,14 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// PUB发运数据
/// </summary>
public class PUB_SE_DETAIL_DTO
public class PUB_SE_DETAIL_DTO : EntityDto<Guid>
{
/// <summary>
/// 期间

4
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs

@ -1,5 +1,7 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
using Win.Sfs.Shared.DtoBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
@ -7,7 +9,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// <summary>
/// 采购价格单
/// </summary>
public class PURCHASE_PRICE_DTO
public class PURCHASE_PRICE_DTO : EntityDto<Guid>
{
/// <summary>
/// 零件号

4
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs

@ -1,12 +1,14 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// 客户替换件关系
/// </summary>
public class TB_RePartsRelationship_DTO
public class TB_RePartsRelationship_DTO : EntityDto<Guid>
{
/// <summary>
/// 零件号

84
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -1,43 +1,103 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Shouldly;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
/// <summary>
/// 公用结算
/// PUB结算
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class PUB_SA_SERVICE
public class PUB_SA_SERVICE : SettleAccountApplicationBase<TB_RePartsRelationship>
{
/// <summary>
/// 公用结算仓储
/// PUB结算仓储
/// </summary>
private readonly INormalEfCoreRepository<PUB_SA, Guid> _repository;
/// <summary>
/// excel服务
/// 构造
/// </summary>
private readonly IExcelImportAppService _excelImportService;
public PUB_SA_SERVICE(INormalEfCoreRepository<PUB_SA, Guid> repository,
IDistributedCache<TB_RePartsRelationship> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_repository = repository;
}
#region 导入、导出
/// <summary>
/// 构造
/// 导入
/// </summary>
public PUB_SA_SERVICE(INormalEfCoreRepository<PUB_SA, Guid> repository, IExcelImportAppService excelImportService)
[HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files)
{
_repository = repository;
_excelImportService = excelImportService;
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<PUB_SA_IMPORT_DTO>(files, _excelImportService);
var _ls = ObjectMapper.Map<List<PUB_SA_IMPORT_DTO>, List<PUB_SA>>(result);
await _repository.InsertManyAsync(_ls);
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 导出
/// </summary>
[HttpPost]
public async Task<string> ExportAsync(RequestDto input)
{
string fileName = $"HBPO的EDI数据_{Guid.NewGuid()}.xlsx";
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
var dtos = ObjectMapper.Map<List<PUB_SA>, List<PUB_SA_EXPORT_DTO>>(entities);
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExcelExporter(dtos);
result.ShouldNotBeNull();
await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result });
return fileName;
}
#endregion
#region CURD
/// <summary>
/// 获取列表
/// </summary>
[HttpPost]
public async Task<PagedResultDto<PUB_SA_DTO>> GetListAsync(RequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
var dtos = ObjectMapper.Map<List<PUB_SA>, List<PUB_SA_DTO>>(entities);
return new PagedResultDto<PUB_SA_DTO>(totalCount, dtos);
}
/// <summary>
/// 删除
/// </summary>
[HttpPost]
public async Task DeleteAsync(Guid id)
{
await _repository.DeleteAsync(id);
}
#endregion
}
}

12
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -136,11 +136,15 @@ namespace Win.Sfs.SettleAccount
CreateMapPURCHASE_PRICE();
CreateMapTB_RePartsRelationship();
CreateMapBBAC_SE_DETAIL();
CreateMapBBAC_SE_EDI();
CreateMapHBPO_SE_DETAIL();
CreateMapHBPO_SE_EDI();
CreateMapPUB_SE_DETAIL();
CreateMapPUB_SA();
}
#region BQ
@ -809,5 +813,13 @@ namespace Win.Sfs.SettleAccount
CreateMap<PUB_SE_DETAIL, PUB_SE_DETAIL_EXPORT_DTO>();
}
/// <summary>
/// PUB结算
/// </summary>
private void CreateMapPUB_SA()
{
CreateMap<PUB_SA, PUB_SA_DTO>();
}
}
}

Loading…
Cancel
Save