Browse Source

3.19 红旗一轿手工出库单相关检验

FoShanPG
44673626 3 years ago
parent
commit
fafed81594
  1. 5
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs
  2. 47
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs

5
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQCarAppService.cs

@ -540,8 +540,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[Route("Export")] [Route("Export")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)] //[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<string> ExportAsync(WmsKanbanOutPutDetialRequestDto input) virtual public async Task<string> ExportAsync(WmsKanbanOutPutDetialRequestDto input)
{
if (!string.IsNullOrEmpty(input.BillNum))
{ {
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); 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, var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true); 0, true);

47
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs

@ -237,7 +237,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[UnitOfWork(false)] [UnitOfWork(false)]
public async Task<string> WmsKanbanOutPut([FromForm] IFormFileCollection files, string version) public async Task<string> WmsKanbanOutPut([FromForm] IFormFileCollection files, string version)
{ {
var checkList = new List<ErrorExportDto>();
//var _count1 = _wmsVersionRepository.Count(p => p.Version == version); //var _count1 = _wmsVersionRepository.Count(p => p.Version == version);
//if (_count1 > 0) //if (_count1 > 0)
//{ //{
@ -255,13 +255,51 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
//var _list = _dapper.GetNoKanbanSettleDetail(input.Version); //var _list = _dapper.GetNoKanbanSettleDetail(input.Version);
ExportImporter _exportImporter = new ExportImporter(); 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("导入模板数据不能为空!"); 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 stockList = _wmsDapper.GetSalesStock();
var query = from itm in _list var query = from itm in _list
@ -270,7 +308,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
from tm1 in temp1.DefaultIfEmpty() from tm1 in temp1.DefaultIfEmpty()
select new WmsHQWithOutKanbanOutPutDetial( select new WmsHQWithOutKanbanOutPutDetial(
GuidGenerator.Create(), GuidGenerator.Create(),
"无看板发货", "红旗一轿手工出库",
itm.SapMaterialCode, itm.SapMaterialCode,
itm.MaterialDesc, itm.MaterialDesc,
version, version,
@ -425,6 +463,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
virtual public async Task<string> ExportAsync(WmsKanbanOutPutDetialRequestDto input) virtual public async Task<string> ExportAsync(WmsKanbanOutPutDetialRequestDto input)
{ {
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); 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, var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true); 0, true);

Loading…
Cancel
Save