|
|
@ -237,7 +237,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS |
|
|
|
[UnitOfWork(false)] |
|
|
|
public async Task<string> WmsKanbanOutPut([FromForm] IFormFileCollection files, string version) |
|
|
|
{ |
|
|
|
|
|
|
|
var checkList = new List<ErrorExportDto>(); |
|
|
|
//var _count1 = _wmsVersionRepository.Count(p => p.Version == version);
|
|
|
|
//if (_count1 > 0)
|
|
|
|
//{
|
|
|
@ -255,13 +255,51 @@ namespace Win.Sfs.SettleAccount.Entities.WMS |
|
|
|
//var _list = _dapper.GetNoKanbanSettleDetail(input.Version);
|
|
|
|
|
|
|
|
ExportImporter _exportImporter = new ExportImporter(); |
|
|
|
var _list = await _exportImporter.ExtendExcelOfSheetOneImport<WmsHQWithOutKanbanOutPutDetial>(files, _excelImportService); |
|
|
|
var _listOrgin = await _exportImporter.ExtendExcelOfSheetOneImport<WmsHQWithOutKanbanOutPutDetial>(files, _excelImportService); |
|
|
|
|
|
|
|
if (_list == null || _list.Count == 0) |
|
|
|
if (_listOrgin == null || _listOrgin.Count == 0) |
|
|
|
{ |
|
|
|
throw new BusinessException("导入模板数据不能为空!"); |
|
|
|
} |
|
|
|
//物料号不能为空
|
|
|
|
var _list = _listOrgin.Where(p => p.SapMaterialCode != ""); |
|
|
|
|
|
|
|
foreach (var itm in _list) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(itm.IsBack) || string.IsNullOrEmpty(itm.Extend)) |
|
|
|
{ |
|
|
|
checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件及客户号不能为空,影响出库请检查!", itm.SapMaterialCode), string.Empty)); |
|
|
|
} |
|
|
|
} |
|
|
|
if (checkList.Count > 0) |
|
|
|
{ |
|
|
|
return await ExportErrorReportAsync(checkList); |
|
|
|
} |
|
|
|
|
|
|
|
foreach (var itm in _list) |
|
|
|
{ |
|
|
|
if (itm.IsBack != "是" && itm.IsBack != "否") |
|
|
|
{ |
|
|
|
checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件请填写是或否,影响出库请检查!", itm.SapMaterialCode), string.Empty)); |
|
|
|
} |
|
|
|
} |
|
|
|
if (checkList.Count > 0) |
|
|
|
{ |
|
|
|
return await ExportErrorReportAsync(checkList); |
|
|
|
} |
|
|
|
|
|
|
|
//翻译一下是否备件
|
|
|
|
foreach (var itm in _list) |
|
|
|
{ |
|
|
|
if (itm.IsBack == "是") |
|
|
|
{ |
|
|
|
itm.IsBack = "1"; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
itm.IsBack = "0"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var stockList = _wmsDapper.GetSalesStock(); |
|
|
|
var query = from itm in _list |
|
|
@ -270,7 +308,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS |
|
|
|
from tm1 in temp1.DefaultIfEmpty() |
|
|
|
select new WmsHQWithOutKanbanOutPutDetial( |
|
|
|
GuidGenerator.Create(), |
|
|
|
"无看板发货", |
|
|
|
"红旗一轿手工出库", |
|
|
|
itm.SapMaterialCode, |
|
|
|
itm.MaterialDesc, |
|
|
|
version, |
|
|
@ -425,6 +463,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS |
|
|
|
virtual public async Task<string> ExportAsync(WmsKanbanOutPutDetialRequestDto input) |
|
|
|
{ |
|
|
|
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); |
|
|
|
|
|
|
|
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, |
|
|
|
0, true); |
|
|
|
|
|
|
|