@ -234,14 +234,26 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
}
}
//和物料主数据中SAP物料号检验是否存在
//和物料主数据中SAP物料号检验是否存在
foreach ( var itm in _l ist )
var gethqimportdata = _l ist . Select ( p = > p . SapMaterialCode ) . Distinct ( ) . ToList ( ) ;
{
var getmaterial = _ erpdapperRepository . GetMaterialList ( ) ;
if ( ! _ erpdapperRepository . GetMaterialList ( ) . Any ( p = > p . MaterialCode = = itm . SapMaterialCode ) )
var queryCheck = from itm in gethqimportdata
join itm1 in getmaterial on itm equals itm1 . MaterialCode into temp1
from tm1 in temp1 . DefaultIfEmpty ( )
where tm1 = = null
select itm ;
foreach ( var itm in queryCheck )
{
{
checkList . Add ( new ErrorExportDto ( version , "一次性寄售销售导入" , string . Empty , string . Empty , itm . SapMaterialCode , string . Empty , string . Format ( "物料主数据不存在当前导入的物料号{0}!" , itm . SapMaterialCode ) , string . Empty ) ) ;
checkList . Add ( new ErrorExportDto ( version , "一次性寄售销售导入" , string . Empty , string . Empty , itm , string . Empty , string . Format ( "物料主数据不存在当前导入的物料号{0}!" , itm ) , string . Empty ) ) ;
}
}
//foreach (var itm in _list)
//{
// if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode))
// {
// checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty));
// }
}
//}
if ( checkList . Count > 0 )
if ( checkList . Count > 0 )
{
{
return await ExportErrorReportAsync ( checkList ) ;
return await ExportErrorReportAsync ( checkList ) ;