| | |
| | | using Ao.Lang; |
| | | using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterials; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterial; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Page")] |
| | | public virtual Task<PagedResultDto<WmsMaterialDto>> GetListAsync([FromQuery] GetWmsMaterialsInput input) |
| | | public virtual Task<PagedResultDto<WmsMaterialDto>> GetListAsync([FromQuery] GetWmsMaterialInput input) |
| | | { |
| | | return _wmsmaterialAppService.GetListAsync(input); |
| | | } |
| | |
| | | stream.Seek(0L, SeekOrigin.Begin); |
| | | |
| | | var sheetNames = stream.GetSheetNames(); |
| | | var wmsmaterialRows = sheetNames.Contains("配置") ? MiniExcel.Query<WmsMaterialsImportModel.WmsMaterialImportModel>(stream, sheetName: "配置").ToList() : new(); |
| | | var wmsmaterialRows = sheetNames.Contains("配置") ? MiniExcel.Query<WmsMaterialImportModels.WmsMaterialImportModel>(stream, sheetName: "配置").ToList() : new(); |
| | | |
| | | if (!wmsmaterialRows.Any()) |
| | | { |
| | | throw new UserFriendlyException("请检查导入的表格"); |
| | | } |
| | | |
| | | await _wmsmaterialAppService.ImportAsync(new WmsMaterialsImportModel |
| | | await _wmsmaterialAppService.ImportAsync(new WmsMaterialImportModels |
| | | { |
| | | WmsMaterials = wmsmaterialRows, |
| | | }); |
| | |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Export")] |
| | | public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWmsMaterialsInput input) |
| | | public virtual async Task<IActionResult> ExportAsync([FromQuery] GetWmsMaterialInput input) |
| | | { |
| | | input.MaxResultCount = int.MaxValue; |
| | | var exportData = await _wmsmaterialAppService.ExportAsync(input); |