qian 10 months ago
parent
commit
6389e624f4
  1. 47
      北京北汽/Controller/SCP_PO_CONTROLLER.cs

47
北京北汽/Controller/SCP_PO_CONTROLLER.cs

@ -3703,9 +3703,6 @@ namespace CK.SCP.Controller
List<string> lineError = new List<string>(); List<string> lineError = new List<string>();
List<string> ErrorList = new List<string>(); List<string> ErrorList = new List<string>();
//var _cl = p_order_list.GroupBy(p => new { p.订单编号, p.供应商编号, p.订单创建时间, p.要求到货日期 }).ToList(); //var _cl = p_order_list.GroupBy(p => new { p.订单编号, p.供应商编号, p.订单创建时间, p.要求到货日期 }).ToList();
//var _ctl = p_order_list.GroupBy(p => p.订单编号).ToList(); //var _ctl = p_order_list.GroupBy(p => p.订单编号).ToList();
//if (_cl.Count != _ctl.Count) //if (_cl.Count != _ctl.Count)
@ -3714,6 +3711,7 @@ namespace CK.SCP.Controller
// ErrorList = lineError; // ErrorList = lineError;
//} //}
//注释结束 //注释结束
var _lst = p_order_list; var _lst = p_order_list;
var PoList = _lst.Select(itm => itm.).Distinct().ToList(); var PoList = _lst.Select(itm => itm.).Distinct().ToList();
foreach (var po in PoList) foreach (var po in PoList)
@ -3725,25 +3723,24 @@ namespace CK.SCP.Controller
ErrorList = lineError; ErrorList = lineError;
} }
} }
//p_order_list.ForEach(p =>
//{
// var _count1 = _lst.Count(itm => itm.订单编号 == p.订单编号 && itm.行号 == p.行号);
// var _count2 = _lst.Count(itm => itm.订单编号 == p.订单编号 && itm.零件号.Trim() == p.零件号.Trim());
// if (_count1 > 1 && p_modtype == BillModType.Contract)
// {
// lineError.Add(string.Format("导入订单编号【{0}】行号【{1}】有重复", p.订单编号, p.行号));
// ErrorList = lineError;
// }
// if (_count2 > 1)
// {
// lineError.Add(string.Format("导入订单编号【{0}】零件编码【{1}】有重复", p.订单编号, p.零件号));
// ErrorList = lineError;
// }
//});
p_order_list.ForEach(p => p_order_list.ForEach(p =>
{
var _count1 = _lst.Count(itm => itm. == p. && itm. == p.);
var _count2 = _lst.Count(itm => itm. == p. && itm..Trim() == p..Trim());
if (_count1 > 1 && p_modtype == BillModType.Contract)
{
lineError.Add(string.Format("导入订单编号【{0}】行号【{1}】有重复", p., p.));
ErrorList = lineError;
}
if (_count2 > 1)
{
lineError.Add(string.Format("导入订单编号【{0}】零件编码【{1}】有重复", p., p.));
ErrorList = lineError;
}
});
p_order_list.ForEach
(p =>
{ {
var _ls = CheckExcelMode_Po(db, p, p_modtype, site, subsite); var _ls = CheckExcelMode_Po(db, p, p_modtype, site, subsite);
if (_ls.Count > 0) if (_ls.Count > 0)
@ -3751,6 +3748,14 @@ namespace CK.SCP.Controller
ErrorList.Add(string.Join("<br>", _ls.ToArray())); ErrorList.Add(string.Join("<br>", _ls.ToArray()));
} }
}); });
var groupList = _lst.GroupBy(g => new { g., g., g. }).Where(g => g.Count() > 1).ToList();
foreach (var gl in groupList)
{
lineError.Add(string.Format("模板中【{0}】相同订单号,相同行号零件号不能重复!", gl.Key));
ErrorList = lineError;
}
if (ErrorList.Count > 0) if (ErrorList.Count > 0)
{ {
_ret.State = ReturnStatus.Failed; _ret.State = ReturnStatus.Failed;

Loading…
Cancel
Save