diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs new file mode 100644 index 00000000..5a548264 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs @@ -0,0 +1,166 @@ +using Magicodes.ExporterAndImporter.Core; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos +{ + /// + /// HBPO发运单 + /// + public class HBPO_SE_DETAIL_DTO + { + /// + /// 期间 + /// + [Display(Name = "期间")] + public int Version { set; get; } + + /// + /// 发货时间 + /// + [Display(Name = "发货时间")] + public DateTime ShippingDate { set; get; } + + /// + /// 发运单号 + /// + [Display(Name = "发运单号")] + public string WmsBillNum { set; get; } + + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string LU { get; set; } + + /// + /// 生产号 + /// + [Display(Name = "生产号")] + public string PN { get; set; } + + /// + /// 组合键值(LU+PN) + /// + [Display(Name = "组合键值(LU+PN)")] + public string KeyCode { get; set; } + + /// + /// 数量 + /// + [Display(Name = "数量")] + public decimal Qty { get; set; } + + /// + /// 日顺序号 + /// + [Display(Name = "日顺序号")] + public string SeqNumber { get; set; } + + /// + /// 小总成号 + /// + [Display(Name = "小总成号")] + public string AssemblyCode { get; set; } + + /// + /// 注塑码 + /// + [Display(Name = "注塑码")] + public string InjectionCode { get; set; } + + /// + /// 订单时间 + /// + [Display(Name = "订单时间")] + public DateTime BeginDate { get; set; } + } + + /// + /// 导出 + /// + public class HBPO_SE_DETAIL_EXPORT_DTO + { + /// + /// 期间 + /// + [Display(Name = "期间")] + [ExporterHeader(DisplayName = "{0}")] + public int Version { set; get; } + + /// + /// 发货时间 + /// + [Display(Name = "发货时间")] + [ExporterHeader(DisplayName = "{0}")] + public DateTime ShippingDate { set; get; } + + /// + /// 发运单号 + /// + [Display(Name = "发运单号")] + [ExporterHeader(DisplayName = "{0}")] + public string WmsBillNum { set; get; } + + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [ExporterHeader(DisplayName = "{0}")] + public string LU { get; set; } + + /// + /// 生产号 + /// + [Display(Name = "生产号")] + [ExporterHeader(DisplayName = "{0}")] + public string PN { get; set; } + + /// + /// 组合键值(LU+PN) + /// + [Display(Name = "组合键值(LU+PN)")] + [ExporterHeader(DisplayName = "{0}")] + public string KeyCode { get; set; } + + /// + /// 数量 + /// + [Display(Name = "数量")] + [ExporterHeader(DisplayName = "{0}")] + public decimal Qty { get; set; } + + /// + /// 日顺序号 + /// + [Display(Name = "日顺序号")] + [ExporterHeader(DisplayName = "{0}")] + public string SeqNumber { get; set; } + + /// + /// 小总成号 + /// + [Display(Name = "小总成号")] + [ExporterHeader(DisplayName = "{0}")] + public string AssemblyCode { get; set; } + + /// + /// 注塑码 + /// + [Display(Name = "注塑码")] + [ExporterHeader(DisplayName = "{0}")] + public string InjectionCode { get; set; } + + /// + /// 订单时间 + /// + [Display(Name = "订单时间")] + [ExporterHeader(DisplayName = "{0}")] + public DateTime BeginDate { get; set; } + } + +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_DETAIL_SERVICE.cs new file mode 100644 index 00000000..e67248dc --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_DETAIL_SERVICE.cs @@ -0,0 +1,77 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using SettleAccount.Domain.BQ; +using Shouldly; +using System; +using System.Collections.Generic; +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.SettleAccount.ExcelImporter; +using Win.Sfs.Shared.RepositoryBase; + +namespace Win.Sfs.SettleAccount.Entities.BQ +{ + /// + /// HBPO发运单 + /// + [AllowAnonymous] + [Route("api/settleaccount/HBPO_SE_DETAIL_SERVICE")] + public class HBPO_SE_DETAIL_SERVICE : ApplicationService + { + /// + /// HBPO发运单仓储 + /// + private readonly INormalEfCoreRepository _repository; + + /// + /// excel服务 + /// + private readonly IExcelImportAppService _excelImportService; + + public HBPO_SE_DETAIL_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService) + { + _repository = repository; + _excelImportService = excelImportService; + } + + #region 导出 + /// + /// 导出 + /// + [HttpPost] + [Route("Export")] + public async Task ExportAsync(RequestDto input) + { + string fileName = $"HBPO发运单_{Guid.NewGuid()}.xlsx"; + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var dtos = ObjectMapper.Map, List>(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 查询 + /// + /// 获取列表 + /// + [HttpPost] + [Route("list")] + public async Task> 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>(entities); + return new PagedResultDto(totalCount, dtos); + } + #endregion + + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs index 0c8729f4..40fdbf9e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs @@ -9,6 +9,9 @@ using Volo.Abp.Application.Services; namespace Win.Sfs.SettleAccount.Entities.BQ { + /// + /// HBPO的EDI数据 + /// [AllowAnonymous] [Route("api/settleaccount/hbpo_se_edi_service")] public class HBPO_SE_EDI_SERVICE : ApplicationService diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 84012d2a..e2b523c1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -138,6 +138,8 @@ namespace Win.Sfs.SettleAccount CreateMapTB_RePartsRelationship(); CreateMapBBAC_SE_DETAIL(); CreateMapBBAC_SE_EDI(); + CreateMapHBPO_SE_DETAIL(); + CreateMapHBPO_SE_EDI(); } #region 北汽 @@ -777,5 +779,23 @@ namespace Win.Sfs.SettleAccount CreateMap(); } + /// + /// HBPO发运单 + /// + private void CreateMapHBPO_SE_DETAIL() + { + CreateMap(); + CreateMap(); + } + + /// + /// HBPO EDI + /// + private void CreateMapHBPO_SE_EDI() + { + //CreateMap(); + //CreateMap(); + } + } }