mahao
1 year ago
10 changed files with 460 additions and 26 deletions
@ -0,0 +1,135 @@ |
|||||
|
using Magicodes.ExporterAndImporter.Core; |
||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// HBPO的EDI数据
|
||||
|
/// </summary>
|
||||
|
public class HBPO_SE_EDI_DTO |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// LU+生产码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "LU+生产码")] |
||||
|
public string KeyCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 期间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "期间")] |
||||
|
public int Version { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 零件号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "零件号")] |
||||
|
public string LU { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "生产码")] |
||||
|
public string PN { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 日顺序号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "日顺序号")] |
||||
|
public string SeqNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 小总成号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "小总成号")] |
||||
|
public string AssemblyCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 注塑码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "注塑码")] |
||||
|
public string InjectionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// EDI数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "EDI数量")] |
||||
|
public decimal Qty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 订货时间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "订货时间")] |
||||
|
public DateTime BeginDate { get; set; } |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 导出
|
||||
|
/// </summary>
|
||||
|
public class HBPO_SE_EDI_EXPORT_DTO |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// LU+生产码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "LU+生产码")] |
||||
|
[ExporterHeader(DisplayName = "LU+生产码")] |
||||
|
public string KeyCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 期间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "期间")] |
||||
|
[ExporterHeader(DisplayName = "期间")] |
||||
|
public int Version { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 零件号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "零件号")] |
||||
|
[ExporterHeader(DisplayName = "零件号")] |
||||
|
public string LU { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "生产码")] |
||||
|
[ExporterHeader(DisplayName = "生产码")] |
||||
|
public string PN { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 日顺序号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "日顺序号")] |
||||
|
[ExporterHeader(DisplayName = "日顺序号")] |
||||
|
public string SeqNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 小总成号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "小总成号")] |
||||
|
[ExporterHeader(DisplayName = "小总成号")] |
||||
|
public string AssemblyCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 注塑码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "注塑码")] |
||||
|
[ExporterHeader(DisplayName = "注塑码")] |
||||
|
public string InjectionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// EDI数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "EDI数量")] |
||||
|
[ExporterHeader(DisplayName = "EDI数量")] |
||||
|
public decimal Qty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 订货时间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "订货时间")] |
||||
|
[ExporterHeader(DisplayName = "订货时间")] |
||||
|
public DateTime BeginDate { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,159 @@ |
|||||
|
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 |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// PUB发运数据
|
||||
|
/// </summary>
|
||||
|
public class PUB_SE_DETAIL_DTO |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 期间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "期间")] |
||||
|
public int Version { set; get; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 发货时间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "发货时间")] |
||||
|
public DateTime ShippingDate { set; get; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 发运单号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "发运单号")] |
||||
|
public string WmsBillNum { set; get; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 零件号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "零件号")] |
||||
|
public string LU { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "生产号")] |
||||
|
public string PN { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 组合键值(LU+PN)
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "组合键值(LU+PN)")] |
||||
|
public string KeyCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "数量")] |
||||
|
public decimal Qty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 日顺序号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "日顺序号")] |
||||
|
public string SeqNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 小总成号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "小总成号")] |
||||
|
public string AssemblyCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 注塑码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "注塑码")] |
||||
|
public string InjectionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 订单时间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "订单时间")] |
||||
|
public DateTime BeginDate { get; set; } |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 导出
|
||||
|
/// </summary>
|
||||
|
public class PUB_SE_DETAIL_EXPORT_DTO |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 期间
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "日顺序号")] |
||||
|
public int Version { set; get; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 发货时间
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "日顺序号")] |
||||
|
public DateTime ShippingDate { set; get; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 发运单号
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "日顺序号")] |
||||
|
public string WmsBillNum { set; get; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 零件号
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "日顺序号")] |
||||
|
public string LU { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产号
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "日顺序号")] |
||||
|
public string PN { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 组合键值(LU+PN)
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "日顺序号")] |
||||
|
public string KeyCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 数量
|
||||
|
/// </summary>
|
||||
|
[ExporterHeader(DisplayName = "日顺序号")] |
||||
|
public decimal Qty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 日顺序号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "日顺序号")] |
||||
|
[ExporterHeader(DisplayName = "日顺序号")] |
||||
|
public string SeqNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 小总成号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "小总成号")] |
||||
|
[ExporterHeader(DisplayName = "小总成号")] |
||||
|
public string AssemblyCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 注塑码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "注塑码")] |
||||
|
[ExporterHeader(DisplayName = "注塑码")] |
||||
|
public string InjectionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 订单时间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "订单时间")] |
||||
|
[ExporterHeader(DisplayName = "订单时间")] |
||||
|
public DateTime BeginDate { get; set; } |
||||
|
} |
||||
|
|
||||
|
} |
@ -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 |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// PUB发运数据
|
||||
|
/// </summary>
|
||||
|
[AllowAnonymous] |
||||
|
[Route("api/settleaccount/[controller]/[action]")]
|
||||
|
public class PUB_SE_DETAIL_SERVICE : ApplicationService |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// PUB发运单仓储
|
||||
|
/// </summary>
|
||||
|
private readonly INormalEfCoreRepository<PUB_SE_DETAIL, Guid> _repository; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// excel服务
|
||||
|
/// </summary>
|
||||
|
private readonly IExcelImportAppService _excelImportService; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造
|
||||
|
/// </summary>
|
||||
|
public PUB_SE_DETAIL_SERVICE(INormalEfCoreRepository<PUB_SE_DETAIL, Guid> repository, IExcelImportAppService excelImportService) |
||||
|
{ |
||||
|
_repository = repository; |
||||
|
_excelImportService = excelImportService; |
||||
|
} |
||||
|
|
||||
|
#region 导出
|
||||
|
/// <summary>
|
||||
|
/// 导出
|
||||
|
/// </summary>
|
||||
|
[HttpPost] |
||||
|
public async Task<string> ExportAsync(RequestDto input) |
||||
|
{ |
||||
|
string fileName = $"PUB发运单_{Guid.NewGuid()}.xlsx"; |
||||
|
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); |
||||
|
var dtos = ObjectMapper.Map<List<PUB_SE_DETAIL>, List<PUB_SE_DETAIL_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 查询
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
[HttpPost] |
||||
|
public async Task<PagedResultDto<PUB_SE_DETAIL_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_SE_DETAIL>, List<PUB_SE_DETAIL_DTO>>(entities); |
||||
|
return new PagedResultDto<PUB_SE_DETAIL_DTO>(totalCount, dtos); |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
} |
||||
|
} |
Loading…
Reference in new issue