|
@ -1368,19 +1368,91 @@ namespace CK.SCP.Controller |
|
|
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】的订单截止日期必须大于等于2049年!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号)); |
|
|
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】的订单截止日期必须大于等于2049年!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
string _ponumber = p_excel.供应商编号.ToUpper() + subsite.Substring(1, 1) + subsite.Substring(3, 1); |
|
|
if (!string.IsNullOrEmpty(subsite)) |
|
|
if (p_excel.订单编号.ToUpper() != _ponumber.ToUpper()) |
|
|
|
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】零件号【{2}】的订单编号不正确,请更换订单编号!", p_excel.订单编号, p_excel.行号, p_excel.零件号)); |
|
|
switch (subsite) |
|
|
|
|
|
{ |
|
|
|
|
|
case "BJ01": |
|
|
|
|
|
string bj01ponum = p_excel.供应商编号.ToUpper() + "J1"; |
|
|
|
|
|
string bj01newponum = p_excel.供应商编号.ToUpper() + "B1"; |
|
|
|
|
|
if (p_excel.订单编号.ToUpper() != bj01ponum.ToUpper() && p_excel.订单编号.ToUpper() != bj01newponum.ToUpper()) |
|
|
|
|
|
{ |
|
|
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】零件号【{2}】的订单编号不正确,请更换订单编号!", p_excel.订单编号, p_excel.行号, p_excel.零件号)); |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
case "BJ02": |
|
|
|
|
|
string bj02ponum = p_excel.供应商编号.ToUpper() + "J2"; |
|
|
|
|
|
string bj02newponum = p_excel.供应商编号.ToUpper() + "B2"; |
|
|
|
|
|
if (p_excel.订单编号.ToUpper() != bj02ponum.ToUpper() && p_excel.订单编号.ToUpper() != bj02newponum.ToUpper()) |
|
|
|
|
|
{ |
|
|
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】零件号【{2}】的订单编号不正确,请更换订单编号!", p_excel.订单编号, p_excel.行号, p_excel.零件号)); |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
case "CQ01": |
|
|
|
|
|
string cq01ponum = p_excel.供应商编号.ToUpper() + "Q1"; |
|
|
|
|
|
string cq01newponum = p_excel.供应商编号.ToUpper() + "Q2"; |
|
|
|
|
|
if (p_excel.订单编号.ToUpper() != cq01ponum.ToUpper() || p_excel.订单编号.ToUpper() != cq01newponum.ToUpper()) |
|
|
|
|
|
{ |
|
|
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】零件号【{2}】的订单编号不正确,请更换订单编号!", p_excel.订单编号, p_excel.行号, p_excel.零件号)); |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
case "ZZ01": |
|
|
|
|
|
string zz01ponum = p_excel.供应商编号.ToUpper() + "Z1"; |
|
|
|
|
|
string zz01newponum = p_excel.供应商编号.ToUpper() + "Z2"; |
|
|
|
|
|
if (p_excel.订单编号.ToUpper() != zz01ponum.ToUpper() && p_excel.订单编号.ToUpper() != zz01newponum.ToUpper()) |
|
|
|
|
|
{ |
|
|
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】零件号【{2}】的订单编号不正确,请更换订单编号!", p_excel.订单编号, p_excel.行号, p_excel.零件号)); |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
case "HF01": |
|
|
|
|
|
string hf01ponum = p_excel.供应商编号.ToUpper() + "F1"; |
|
|
|
|
|
string hf01newponum = p_excel.供应商编号.ToUpper() + "F2"; |
|
|
|
|
|
if (p_excel.订单编号.ToUpper() != hf01ponum.ToUpper() && p_excel.订单编号.ToUpper() != hf01newponum.ToUpper()) |
|
|
|
|
|
{ |
|
|
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】零件号【{2}】的订单编号不正确,请更换订单编号!", p_excel.订单编号, p_excel.行号, p_excel.零件号)); |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
string _ponumber = p_excel.供应商编号.ToUpper() + subsite.Substring(1, 1) + subsite.Substring(3, 1); |
|
|
|
|
|
if (p_excel.订单编号.ToUpper() != _ponumber.ToUpper()) |
|
|
|
|
|
{ |
|
|
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】零件号【{2}】的订单编号不正确,请更换订单编号!", p_excel.订单编号, p_excel.行号, p_excel.零件号)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int _polinr = Int32.Parse(p_excel.行号); |
|
|
int _polinr = Int32.Parse(p_excel.行号); |
|
|
var _partlist = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel.订单编号 && p.PartCode == p_excel.零件号.Trim() && p.PoLine != _polinr).ToList(); |
|
|
if (string.IsNullOrEmpty(subsite)) |
|
|
if (_partlist.Count > 0) |
|
|
|
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】已经存在(系统:行号-【{2}】),请更换零件号!", p_excel.订单编号, p_excel.零件号, _partlist[0].PoLine)); |
|
|
var _partlist = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel.订单编号 && p.PartCode == p_excel.零件号.Trim() && p.PoLine != _polinr).ToList(); |
|
|
|
|
|
if (_partlist.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】已经存在(系统:行号-【{2}】),请更换零件号!", p_excel.订单编号, p_excel.零件号, _partlist[0].PoLine)); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
int linecount = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel.订单编号 && p.PoLine == _polinr && p.PartCode != p_excel.零件号.Trim()); |
|
|
// 判断北汽多次导入 是否存在零件号重复现象
|
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
var _partlist = db.V_TB_PO_DETAIL.Where(p => p.VendId == p_excel.供应商编号.Trim()&&p.SubSite == subsite && p.PartCode == p_excel.零件号.Trim()).ToList(); |
|
|
|
|
|
if (_partlist.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
var pobillnum = db.V_TB_PO_DETAIL.FirstOrDefault(p => p.VendId == p_excel.供应商编号.Trim() && p.SubSite == subsite && p.PartCode == p_excel.零件号.Trim()).PoBillNum; |
|
|
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】在【{2}】中存在,请更换零件号!", p_excel.订单编号, p_excel.零件号, pobillnum)); |
|
|
|
|
|
} |
|
|
|
|
|
int lcount = db.V_TB_PO_DETAIL.Count(p => p.VendId == p_excel.供应商编号.Trim() && p.PoLine == _polinr && p.SubSite == subsite && p.PartCode == p_excel.零件号.Trim()); |
|
|
|
|
|
if (lcount > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
var pobillnum = db.V_TB_PO_DETAIL.FirstOrDefault(p => p.VendId == p_excel.供应商编号.Trim() && p.SubSite == subsite && p.PoLine == _polinr && p.PartCode == p_excel.零件号.Trim()).PoBillNum; |
|
|
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】在【{2}】订单中已经存在,请更换行号!", p_excel.订单编号, p_excel.行号,pobillnum)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int linecount = db.V_TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel.订单编号 && p.PoLine == _polinr && p.PartCode != p_excel.零件号.Trim()); |
|
|
if (linecount > 0) |
|
|
if (linecount > 0) |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】已经存在,请更换行号!", p_excel.订单编号, p_excel.行号)); |
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】已经存在,请更换行号!", p_excel.订单编号, p_excel.行号)); |
|
@ -1701,10 +1773,24 @@ namespace CK.SCP.Controller |
|
|
//}
|
|
|
//}
|
|
|
|
|
|
|
|
|
int _polinr = Int32.Parse(p_excel.行号); |
|
|
int _polinr = Int32.Parse(p_excel.行号); |
|
|
var _partlist = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel.订单编号 && p.PartCode == p_excel.零件号.Trim() && p.PoLine != _polinr).ToList(); |
|
|
|
|
|
|
|
|
//var _partlist = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel.订单编号 && p.PartCode == p_excel.零件号.Trim() && p.PoLine != _polinr).ToList();
|
|
|
|
|
|
//if (_partlist.Count > 0)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】已经存在(系统:行号-【{2}】),请更换零件号!", p_excel.订单编号, p_excel.零件号, _partlist[0].PoLine));
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
var _partlist = db.V_TB_PO_DETAIL.Where(p => p.VendId == p_excel.供应商编号.Trim() && p.SubSite == subsite && p.PartCode == p_excel.零件号.Trim()).ToList(); |
|
|
if (_partlist.Count > 0) |
|
|
if (_partlist.Count > 0) |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】已经存在(系统:行号-【{2}】),请更换零件号!", p_excel.订单编号, p_excel.零件号, _partlist[0].PoLine)); |
|
|
var pobillnum = db.V_TB_PO_DETAIL.FirstOrDefault(p => p.VendId == p_excel.供应商编号.Trim() && p.SubSite == subsite && p.PartCode == p_excel.零件号.Trim()).PoBillNum; |
|
|
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】在【{2}】中存在,请更换零件号!", p_excel.订单编号, p_excel.零件号, pobillnum)); |
|
|
|
|
|
} |
|
|
|
|
|
int lcount = db.V_TB_PO_DETAIL.Count(p => p.VendId == p_excel.供应商编号.Trim() && p.PoLine == _polinr && p.SubSite == subsite && p.PartCode == p_excel.零件号.Trim()); |
|
|
|
|
|
if (lcount > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
var pobillnum = db.V_TB_PO_DETAIL.FirstOrDefault(p => p.VendId == p_excel.供应商编号.Trim() && p.SubSite == subsite && p.PoLine == _polinr && p.PartCode == p_excel.零件号.Trim()).PoBillNum; |
|
|
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】在【{2}】订单中已经存在,请更换行号!", p_excel.订单编号, p_excel.行号, pobillnum)); |
|
|
} |
|
|
} |
|
|
int linecount = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel.订单编号 && p.PoLine == _polinr && p.PartCode != p_excel.零件号.Trim()); |
|
|
int linecount = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel.订单编号 && p.PoLine == _polinr && p.PartCode != p_excel.零件号.Trim()); |
|
|
if (linecount > 0) |
|
|
if (linecount > 0) |
|
@ -3279,7 +3365,7 @@ namespace CK.SCP.Controller |
|
|
_lst.ForEach |
|
|
_lst.ForEach |
|
|
(p => |
|
|
(p => |
|
|
{ |
|
|
{ |
|
|
var _ls = CheckExcelMode_Po(db, p, p_modtype,site); |
|
|
var _ls = CheckExcelMode_Po(db, p, p_modtype,site,subsite); |
|
|
if (_ls.Count > 0) |
|
|
if (_ls.Count > 0) |
|
|
{ |
|
|
{ |
|
|
lineError.Add(number.ToString()); |
|
|
lineError.Add(number.ToString()); |
|
@ -3753,6 +3839,7 @@ namespace CK.SCP.Controller |
|
|
|
|
|
|
|
|
p_order_list.ForEach(p => |
|
|
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) |
|
|
{ |
|
|
{ |
|
|