Browse Source

红旗一轿车出库单、自定义发货单和一次性寄售出库导入加上检验,不是汇总的数据提示不能导入

FoShanPG
44673626 2 years ago
parent
commit
a38d5c5a9b
  1. 13
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs
  2. 21
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs
  3. 13
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs
  4. 4
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs

13
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs

@ -485,6 +485,19 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.SapMaterialCode));//过滤掉物料号为空的数据 var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.SapMaterialCode));//过滤掉物料号为空的数据
//不是汇总形式出库的不能导入,即导入的数据中如果SAP编号 即厂内零件号有重复不能导入
var sapcodegroup = (from t in filteResult
group t by t.SapMaterialCode into m
where m.Count() >= 2
select m).ToList();
if (sapcodegroup != null && sapcodegroup.Count > 0)
{
foreach (var item in sapcodegroup)
{
checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, item.Key, string.Empty, string.Format("导入模板中SAP编码{0},有重复不是汇总出库请检查!", item.Key), string.Empty));
}
}
//和物料主数据中SAP物料号检验是否存在 //和物料主数据中SAP物料号检验是否存在
var gethqimportdata = filteResult.Select(p => p.SapMaterialCode).Distinct().ToList(); var gethqimportdata = filteResult.Select(p => p.SapMaterialCode).Distinct().ToList();
var getmaterial = _erpdapperRepository.GetMaterialList(); var getmaterial = _erpdapperRepository.GetMaterialList();

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

@ -279,11 +279,30 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
} }
} }
//不是汇总形式出库的不能导入,即导入的数据中如果SAP编号 即厂内零件号有重复不能导入
var sapcodegroup = (from t in _list
group t by new { sapcode = t.SapMaterialCode, isbj = t.IsBack } into m
select new
{
= m.Key.sapcode,
= m.Key.isbj,
rowcount = m.Count()
} into c
where c.rowcount >= 2
select c).ToList();
if (sapcodegroup != null && sapcodegroup.Count > 0)
{
foreach (var item in sapcodegroup)
{
checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, item., string.Empty, string.Format("导入模板中SAP编码{0}并且是否备件值{1},有重复不是汇总出库请检查!", item., item.), string.Empty));
}
}
foreach (var itm in _list) foreach (var itm in _list)
{ {
if (itm.IsBack != "是" && itm.IsBack != "否") 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)); checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件请填写是或否,影响出库请检查!", itm.SapMaterialCode), string.Empty));
} }
} }
//和物料主数据中SAP物料号检验是否存在 //和物料主数据中SAP物料号检验是否存在

13
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs

@ -233,6 +233,19 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, string.Empty, string.Empty, "导入模板中第一页签没有数据,请检查!", string.Empty)); checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, string.Empty, string.Empty, "导入模板中第一页签没有数据,请检查!", string.Empty));
} }
//不是汇总形式出库的不能导入,即导入的数据中如果SAP编号 即厂内零件号有重复不能导入
var sapcodegroup = (from t in _list
group t by t.SapMaterialCode into m
where m.Count() >= 2
select m).ToList();
if (sapcodegroup != null && sapcodegroup.Count > 0)
{
foreach (var item in sapcodegroup)
{
checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, item.Key, string.Empty, string.Format("导入模板中SAP编码{0},有重复不是汇总出库请检查!", item.Key), string.Empty));
}
}
//和物料主数据中SAP物料号检验是否存在 //和物料主数据中SAP物料号检验是否存在
var gethqimportdata = _list.Select(p => p.SapMaterialCode).Distinct().ToList(); var gethqimportdata = _list.Select(p => p.SapMaterialCode).Distinct().ToList();
var getmaterial = _erpdapperRepository.GetMaterialList(); var getmaterial = _erpdapperRepository.GetMaterialList();

4
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs

@ -306,13 +306,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
var en1= entities.Where(p => p.OutputQty == 0).ToList(); var en1= entities.Where(p => p.OutputQty == 0).ToList();
foreach(var itm in en1) foreach(var itm in en1)
{ {
checkList.Add(new ErrorExportDto() { Message = string.Format("结算号:{0}物料号:{1}实际出库数量为0不能同步Sap", itm.BillNum, itm.MaterialCode) }); checkList.Add(new ErrorExportDto() { Version = input.Version, ItemCode = itm.MaterialCode, Model = "结算出库SAP接口", Message = string.Format("结算号:{0}物料号:{1}实际出库数量为0不能同步Sap", itm.BillNum, itm.MaterialCode) });
} }
var en2=entities.Where(p => p.OutputQty != p.Qty && p.OutputQty>0).ToList(); var en2=entities.Where(p => p.OutputQty != p.Qty && p.OutputQty>0).ToList();
foreach (var itm in en2) foreach (var itm in en2)
{ {
checkList.Add(new ErrorExportDto() { Message = string.Format("结算号:{0}物料号:{1}实际出库数量不等于结算数量不能同步Sap", itm.BillNum, itm.MaterialCode) }); checkList.Add(new ErrorExportDto() { Version = input.Version, ItemCode = itm.MaterialCode, Model = "结算出库SAP接口", Message = string.Format("结算号:{0}物料号:{1}实际出库数量不等于结算数量不能同步Sap", itm.BillNum, itm.MaterialCode) });
} }
var _count = entities.Count(p => p.State==2); var _count = entities.Count(p => p.State==2);

Loading…
Cancel
Save