|
@ -508,7 +508,7 @@ namespace CK.SCP.Controller |
|
|
foreach (var po1 in p_list1) |
|
|
foreach (var po1 in p_list1) |
|
|
{ |
|
|
{ |
|
|
var PoDetail = db.TB_ASK_DETAIL.SingleOrDefault(p => p.PoBillNum == po && p.PartCode == po1); |
|
|
var PoDetail = db.TB_ASK_DETAIL.SingleOrDefault(p => p.PoBillNum == po && p.PartCode == po1); |
|
|
PoDetail.AskQty=0; |
|
|
PoDetail.AskQty = 0; |
|
|
db.TB_ASK_DETAIL.AddOrUpdate(PoDetail); |
|
|
db.TB_ASK_DETAIL.AddOrUpdate(PoDetail); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -1096,14 +1096,14 @@ namespace CK.SCP.Controller |
|
|
DateTime st1 = DateTime.Parse(st7.ToShortDateString()); |
|
|
DateTime st1 = DateTime.Parse(st7.ToShortDateString()); |
|
|
|
|
|
|
|
|
DateTime st5 = DateTime.Parse(p_excel.开始时间); |
|
|
DateTime st5 = DateTime.Parse(p_excel.开始时间); |
|
|
DateTime st3=DateTime.Parse( st5.ToShortDateString()); |
|
|
DateTime st3 = DateTime.Parse(st5.ToShortDateString()); |
|
|
|
|
|
|
|
|
Decimal st4 = Decimal.Parse(p_excel.零件基础价格); |
|
|
Decimal st4 = Decimal.Parse(p_excel.零件基础价格); |
|
|
DateTime dd = st2.AddDays(1); |
|
|
DateTime dd = st2.AddDays(1); |
|
|
DateTime dd1 = st1.AddYears(10); |
|
|
DateTime dd1 = st1.AddYears(10); |
|
|
int b = int.Parse(p_excel.是否临时价格); |
|
|
int b = int.Parse(p_excel.是否临时价格); |
|
|
var Th = db.TB_PRICE.SingleOrDefault(p => p.UID.ToString() == p_excel.标识 && p.VendId == p_excel.供应商编号 && p.PartCode == p_excel.零件编码 |
|
|
var Th = db.TB_PRICE.SingleOrDefault(p => p.UID.ToString() == p_excel.标识 && p.VendId == p_excel.供应商编号 && p.PartCode == p_excel.零件编码 |
|
|
&& p.Amt == st4 && p.SubSite == p_excel.地点 &&p.Curr==p_excel.币种&&p.Unit==p_excel.单位 |
|
|
&& p.Amt == st4 && p.SubSite == p_excel.地点 && p.Curr == p_excel.币种 && p.Unit == p_excel.单位 |
|
|
); |
|
|
); |
|
|
if (Th == null) |
|
|
if (Th == null) |
|
|
{ |
|
|
{ |
|
@ -1111,12 +1111,12 @@ namespace CK.SCP.Controller |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
if ((DateTime.Parse(Th.StartTime.ToString())).ToShortDateString()!=st3.ToShortDateString()|| (DateTime.Parse(Th.EndTime.ToString())).ToShortDateString() != st2.ToShortDateString()) |
|
|
if ((DateTime.Parse(Th.StartTime.ToString())).ToShortDateString() != st3.ToShortDateString() || (DateTime.Parse(Th.EndTime.ToString())).ToShortDateString() != st2.ToShortDateString()) |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】的导出数据不能修改!", p_excel.标识, p_excel.供应商编号)); |
|
|
ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】的导出数据不能修改!", p_excel.标识, p_excel.供应商编号)); |
|
|
} |
|
|
} |
|
|
DateTime STA =DateTime.Parse(Th.StartTime.ToString()); |
|
|
DateTime STA = DateTime.Parse(Th.StartTime.ToString()); |
|
|
if(DateTime.Parse(STA.ToShortDateString())!= st3) |
|
|
if (DateTime.Parse(STA.ToShortDateString()) != st3) |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】的导出数据不能修改!", p_excel.标识, p_excel.供应商编号)); |
|
|
ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】的导出数据不能修改!", p_excel.标识, p_excel.供应商编号)); |
|
|
} |
|
|
} |
|
@ -1128,7 +1128,7 @@ namespace CK.SCP.Controller |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】最新开始时间填写错误!", p_excel.标识, p_excel.供应商编号)); |
|
|
ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】最新开始时间填写错误!", p_excel.标识, p_excel.供应商编号)); |
|
|
} |
|
|
} |
|
|
if(st1>st2&& st1 < dd) |
|
|
if (st1 > st2 && st1 < dd) |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】最新开始时间填写错误!", p_excel.标识, p_excel.供应商编号)); |
|
|
ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】最新开始时间填写错误!", p_excel.标识, p_excel.供应商编号)); |
|
|
} |
|
|
} |
|
@ -1144,7 +1144,7 @@ namespace CK.SCP.Controller |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
var _second1 = db.TB_PRICE.Where(p => p.PartCode == p_excel.零件编码 && p.VendId == p_excel.供应商编号&&p.SubSite== p_excel.地点&&p.State!=-1).Select(r => r.UID).Max(); |
|
|
var _second1 = db.TB_PRICE.Where(p => p.PartCode == p_excel.零件编码 && p.VendId == p_excel.供应商编号 && p.SubSite == p_excel.地点 && p.State != -1).Select(r => r.UID).Max(); |
|
|
int a = 0; |
|
|
int a = 0; |
|
|
int.TryParse(p_excel.标识, out a); |
|
|
int.TryParse(p_excel.标识, out a); |
|
|
if (a < _second1) |
|
|
if (a < _second1) |
|
@ -1179,12 +1179,12 @@ namespace CK.SCP.Controller |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
if (p_excel.币种 != "CNY"&& p_excel.币种 != "EUR" && p_excel.币种 != "USD") |
|
|
if (p_excel.币种 != "CNY" && p_excel.币种 != "EUR" && p_excel.币种 != "USD") |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("供应商编号为【{0}】的零件编号【{1}】币种填写错误,只能是CNY或者EUR或者USD!", p_excel.供应商编号, p_excel.零件编码)); |
|
|
ErrorList.Add(string.Format("供应商编号为【{0}】的零件编号【{1}】币种填写错误,只能是CNY或者EUR或者USD!", p_excel.供应商编号, p_excel.零件编码)); |
|
|
} |
|
|
} |
|
|
var Site = db.TB_FACTORY.Where(p=>p.ErpSite== p_excel.域).FirstOrDefault(); |
|
|
var Site = db.TB_FACTORY.Where(p => p.ErpSite == p_excel.域).FirstOrDefault(); |
|
|
var _first = db.TA_PART.Where(p => p.PartCode == p_excel.零件编码.Trim() &&p.Site== p_excel.域).FirstOrDefault(); |
|
|
var _first = db.TA_PART.Where(p => p.PartCode == p_excel.零件编码.Trim() && p.Site == p_excel.域).FirstOrDefault(); |
|
|
if (_first == null) |
|
|
if (_first == null) |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("供应商编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.供应商编号, p_excel.零件编码)); |
|
|
ErrorList.Add(string.Format("供应商编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.供应商编号, p_excel.零件编码)); |
|
@ -1200,7 +1200,7 @@ namespace CK.SCP.Controller |
|
|
|
|
|
|
|
|
p_excel.供应商编号 = !string.IsNullOrEmpty(p_excel.供应商编号) ? p_excel.供应商编号.Trim() : string.Empty; |
|
|
p_excel.供应商编号 = !string.IsNullOrEmpty(p_excel.供应商编号) ? p_excel.供应商编号.Trim() : string.Empty; |
|
|
|
|
|
|
|
|
var _count = db.TA_VENDER.Where(p => p.VendId == p_excel.供应商编号&&p.Site== p_excel.域).Count(); |
|
|
var _count = db.TA_VENDER.Where(p => p.VendId == p_excel.供应商编号 && p.Site == p_excel.域).Count(); |
|
|
if (_count == 0) |
|
|
if (_count == 0) |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("未找到供应商编号为【{0}】无法导入!", p_excel.供应商编号)); |
|
|
ErrorList.Add(string.Format("未找到供应商编号为【{0}】无法导入!", p_excel.供应商编号)); |
|
@ -1313,7 +1313,7 @@ namespace CK.SCP.Controller |
|
|
// ErrorList.Add(string.Format("订单编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.订单编号,p_excel.零件号 ));
|
|
|
// ErrorList.Add(string.Format("订单编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.订单编号,p_excel.零件号 ));
|
|
|
//}
|
|
|
//}
|
|
|
|
|
|
|
|
|
var _checkpart = db.TA_PART.FirstOrDefault(p => p.PartCode == p_excel.零件号.Trim()&&p.Site== site); |
|
|
var _checkpart = db.TA_PART.FirstOrDefault(p => p.PartCode == p_excel.零件号.Trim() && p.Site == site); |
|
|
if (_checkpart != null) |
|
|
if (_checkpart != null) |
|
|
{ |
|
|
{ |
|
|
if (_checkpart.State.ToUpper() != "SP") |
|
|
if (_checkpart.State.ToUpper() != "SP") |
|
@ -1325,7 +1325,7 @@ namespace CK.SCP.Controller |
|
|
ErrorList.Add(string.Format("订单编号为【{0}】的零件编号【{1}】零件表零件停用,无法导入!", p_excel.订单编号, p_excel.零件号)); |
|
|
ErrorList.Add(string.Format("订单编号为【{0}】的零件编号【{1}】零件表零件停用,无法导入!", p_excel.订单编号, p_excel.零件号)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
var _checkpart1= db.TA_PART.Count(p => p.PartCode == p_excel.零件号.Trim() && p.Site == site); |
|
|
var _checkpart1 = db.TA_PART.Count(p => p.PartCode == p_excel.零件号.Trim() && p.Site == site); |
|
|
if (_checkpart1 == 0) |
|
|
if (_checkpart1 == 0) |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("订单编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.订单编号, p_excel.零件号)); |
|
|
ErrorList.Add(string.Format("订单编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.订单编号, p_excel.零件号)); |
|
@ -1348,7 +1348,7 @@ namespace CK.SCP.Controller |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
if (!string.IsNullOrEmpty(p_excel.备注)&&p_excel.备注.Length > 50) |
|
|
if (!string.IsNullOrEmpty(p_excel.备注) && p_excel.备注.Length > 50) |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】的备注长度必须小于50", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号)); |
|
|
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】的备注长度必须小于50", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号)); |
|
|
} |
|
|
} |
|
@ -1437,8 +1437,8 @@ namespace CK.SCP.Controller |
|
|
// 判断北汽多次导入 是否存在零件号重复现象
|
|
|
// 判断北汽多次导入 是否存在零件号重复现象
|
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
var _partlist = db.V_TB_PO_DETAIL.Where(p => p.VendId == p_excel.供应商编号.Trim()&&p.SubSite == subsite && p.PartCode == p_excel.零件号.Trim() && p.PoBillNum.Substring(0,1) =="S").ToList(); |
|
|
var _partlist = db.V_TB_PO_DETAIL.Where(p => p.VendId == p_excel.供应商编号.Trim() && p.SubSite == subsite && p.PartCode == p_excel.零件号.Trim() && p.PoBillNum.Substring(0, 1) == "S").ToList(); |
|
|
if (_partlist.Count > 0 ) |
|
|
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() && p.PoBillNum.Substring(0, 1) == "S").PoBillNum; |
|
|
var pobillnum = db.V_TB_PO_DETAIL.FirstOrDefault(p => p.VendId == p_excel.供应商编号.Trim() && p.SubSite == subsite && p.PartCode == p_excel.零件号.Trim() && p.PoBillNum.Substring(0, 1) == "S").PoBillNum; |
|
|
ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】在【{2}】中存在,请更换零件号!", p_excel.订单编号, p_excel.零件号, pobillnum)); |
|
|
ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】在【{2}】中存在,请更换零件号!", p_excel.订单编号, p_excel.零件号, pobillnum)); |
|
@ -1447,7 +1447,7 @@ namespace CK.SCP.Controller |
|
|
if (lcount > 0) |
|
|
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() && p.PoBillNum.Substring(0, 1) == "S").PoBillNum; |
|
|
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() && p.PoBillNum.Substring(0, 1) == "S").PoBillNum; |
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】在【{2}】订单中已经存在,请更换行号!", p_excel.订单编号, p_excel.行号,pobillnum)); |
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】在【{2}】订单中已经存在,请更换行号!", p_excel.订单编号, p_excel.行号, pobillnum)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1612,7 +1612,7 @@ namespace CK.SCP.Controller |
|
|
} |
|
|
} |
|
|
if (!string.IsNullOrEmpty(p_excel.订单截至日期)) |
|
|
if (!string.IsNullOrEmpty(p_excel.订单截至日期)) |
|
|
{ |
|
|
{ |
|
|
DateTime year =DateTime.Parse(p_excel.订单截至日期); |
|
|
DateTime year = DateTime.Parse(p_excel.订单截至日期); |
|
|
if (year.Year > 2049) |
|
|
if (year.Year > 2049) |
|
|
{ |
|
|
{ |
|
|
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.订单编号)); |
|
@ -1689,7 +1689,7 @@ namespace CK.SCP.Controller |
|
|
return ErrorList; |
|
|
return ErrorList; |
|
|
} |
|
|
} |
|
|
//重庆订单导入验证
|
|
|
//重庆订单导入验证
|
|
|
private static List<string> CheckExcelMode_Po_CQ(ScpEntities db, SCP_PO_EXPORT_IMPORT_MODEL p_excel, BillModType p_modtype, string site , string subsite ) |
|
|
private static List<string> CheckExcelMode_Po_CQ(ScpEntities db, SCP_PO_EXPORT_IMPORT_MODEL p_excel, BillModType p_modtype, string site, string subsite) |
|
|
{ |
|
|
{ |
|
|
List<string> ErrorList = new List<string>(); |
|
|
List<string> ErrorList = new List<string>(); |
|
|
|
|
|
|
|
@ -1705,7 +1705,7 @@ namespace CK.SCP.Controller |
|
|
// ErrorList.Add(string.Format("订单编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.订单编号,p_excel.零件号 ));
|
|
|
// ErrorList.Add(string.Format("订单编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.订单编号,p_excel.零件号 ));
|
|
|
//}
|
|
|
//}
|
|
|
|
|
|
|
|
|
var _checkpart = db.TA_PART.FirstOrDefault(p => p.PartCode == p_excel.零件号.Trim()&&p.Site== site); |
|
|
var _checkpart = db.TA_PART.FirstOrDefault(p => p.PartCode == p_excel.零件号.Trim() && p.Site == site); |
|
|
if (_checkpart != null) |
|
|
if (_checkpart != null) |
|
|
{ |
|
|
{ |
|
|
if (_checkpart.State.ToUpper() != "SP") |
|
|
if (_checkpart.State.ToUpper() != "SP") |
|
@ -1761,7 +1761,7 @@ 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.订单编号)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
var pode = db.TB_PO_DETAIL.Count(p=>p.PoBillNum== p_excel.订单编号&&p.PartCode==p_excel.零件号.Trim()); |
|
|
var pode = db.TB_PO_DETAIL.Count(p => p.PoBillNum == p_excel.订单编号 && p.PartCode == p_excel.零件号.Trim()); |
|
|
if (pode > 0) |
|
|
if (pode > 0) |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add(string.Format("订单号【{1}】零件号【{0}】已存在!", p_excel.零件号, p_excel.订单编号)); |
|
|
ErrorList.Add(string.Format("订单号【{1}】零件号【{0}】已存在!", p_excel.零件号, p_excel.订单编号)); |
|
@ -2874,7 +2874,7 @@ namespace CK.SCP.Controller |
|
|
_price.StartTime = DateTime.Parse(starttime); |
|
|
_price.StartTime = DateTime.Parse(starttime); |
|
|
_price.EndTime = DateTime.Parse(endtime); |
|
|
_price.EndTime = DateTime.Parse(endtime); |
|
|
_price.Curr = p.币种; |
|
|
_price.Curr = p.币种; |
|
|
_price.Unit = _partList.Where(q=>q.PartCode == p.零件编码.Trim()) != null? _partList.First(q => q.PartCode == p.零件编码.Trim()).Unit : p.单位; |
|
|
_price.Unit = _partList.Where(q => q.PartCode == p.零件编码.Trim()) != null ? _partList.First(q => q.PartCode == p.零件编码.Trim()).Unit : p.单位; |
|
|
_price.Amt = decimal.Parse(p.零件基础价格); |
|
|
_price.Amt = decimal.Parse(p.零件基础价格); |
|
|
_price.Site = p.域.Trim(); |
|
|
_price.Site = p.域.Trim(); |
|
|
_price.SubSite = p.地点.Trim(); |
|
|
_price.SubSite = p.地点.Trim(); |
|
@ -3178,7 +3178,7 @@ namespace CK.SCP.Controller |
|
|
lineError.Add(string.Format("供应商编号{0}零件编号{3}数据不存在", p.供应商编号, p.开始时间, p.结束时间, p.零件编码.Trim())); |
|
|
lineError.Add(string.Format("供应商编号{0}零件编号{3}数据不存在", p.供应商编号, p.开始时间, p.结束时间, p.零件编码.Trim())); |
|
|
ErrorList = lineError; |
|
|
ErrorList = lineError; |
|
|
} |
|
|
} |
|
|
if (DateTime.Parse(p.最新开始时间)< DateTime.Parse(p.结束时间) && DateTime.Parse(p.最新开始时间) >DateTime.Parse(p.开始时间)) |
|
|
if (DateTime.Parse(p.最新开始时间) < DateTime.Parse(p.结束时间) && DateTime.Parse(p.最新开始时间) > DateTime.Parse(p.开始时间)) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
_vender.EndTime = Convert.ToDateTime(DateTime.Parse(starttime).AddDays(-1)); |
|
|
_vender.EndTime = Convert.ToDateTime(DateTime.Parse(starttime).AddDays(-1)); |
|
@ -3365,7 +3365,7 @@ namespace CK.SCP.Controller |
|
|
_lst.ForEach |
|
|
_lst.ForEach |
|
|
(p => |
|
|
(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) |
|
|
{ |
|
|
{ |
|
|
lineError.Add(number.ToString()); |
|
|
lineError.Add(number.ToString()); |
|
@ -3617,11 +3617,11 @@ namespace CK.SCP.Controller |
|
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|
|
{ |
|
|
{ |
|
|
List<string> ErrorList = new List<string>(); |
|
|
List<string> ErrorList = new List<string>(); |
|
|
foreach(var po in p_list) |
|
|
foreach (var po in p_list) |
|
|
{ |
|
|
{ |
|
|
foreach(var po1 in p_list1) |
|
|
foreach (var po1 in p_list1) |
|
|
{ |
|
|
{ |
|
|
var _ls = db.TB_ASK_DETAIL.Count(p =>p.PoBillNum==po&&p.PartCode==po1 && p.IsDeleted == false); |
|
|
var _ls = db.TB_ASK_DETAIL.Count(p => p.PoBillNum == po && p.PartCode == po1 && p.IsDeleted == false); |
|
|
if (_ls > 0) |
|
|
if (_ls > 0) |
|
|
{ |
|
|
{ |
|
|
ErrorList.Add("订单号【{0}】零件号【{1}】已生成看板,不能关闭"); |
|
|
ErrorList.Add("订单号【{0}】零件号【{1}】已生成看板,不能关闭"); |
|
@ -4120,7 +4120,7 @@ namespace CK.SCP.Controller |
|
|
_PO_Detail.Scheduledays = string.IsNullOrEmpty(itm.日程天数) ? 7 : int.Parse(itm.日程天数); |
|
|
_PO_Detail.Scheduledays = string.IsNullOrEmpty(itm.日程天数) ? 7 : int.Parse(itm.日程天数); |
|
|
_PO_Detail.Scheduleweeks = string.IsNullOrEmpty(itm.日程周数) ? 2 : int.Parse(itm.日程周数); |
|
|
_PO_Detail.Scheduleweeks = string.IsNullOrEmpty(itm.日程周数) ? 2 : int.Parse(itm.日程周数); |
|
|
_PO_Detail.Schedulemonth = string.IsNullOrEmpty(itm.日程月数) ? 1 : int.Parse(itm.日程月数); |
|
|
_PO_Detail.Schedulemonth = string.IsNullOrEmpty(itm.日程月数) ? 1 : int.Parse(itm.日程月数); |
|
|
_PO_Detail.Supplieritem =string.IsNullOrEmpty(itm.供应商零件)? itm.供应商零件 :itm.供应商零件.ToUpper(); |
|
|
_PO_Detail.Supplieritem = string.IsNullOrEmpty(itm.供应商零件) ? itm.供应商零件 : itm.供应商零件.ToUpper(); |
|
|
_PO_Detail.Dliverypatterncode = itm.发货样式; |
|
|
_PO_Detail.Dliverypatterncode = itm.发货样式; |
|
|
_PO_Detail.Deliverytimecode = itm.发货时间样式; |
|
|
_PO_Detail.Deliverytimecode = itm.发货时间样式; |
|
|
_PO_Detail.Transportdays = string.IsNullOrEmpty(itm.运输周期) ? 0 : int.Parse(itm.运输周期); |
|
|
_PO_Detail.Transportdays = string.IsNullOrEmpty(itm.运输周期) ? 0 : int.Parse(itm.运输周期); |
|
@ -4711,7 +4711,7 @@ namespace CK.SCP.Controller |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static ResultObject<bool> Save_PO_TO_ASK_CQ(V_TB_PO p_order, List<V_TB_PO_DETAIL> p_order_list, string p_buyer, string p_buyerPhone, string p_creator,string remark,string Ssite) |
|
|
public static ResultObject<bool> Save_PO_TO_ASK_CQ(V_TB_PO p_order, List<V_TB_PO_DETAIL> p_order_list, string p_buyer, string p_buyerPhone, string p_creator, string remark, string Ssite) |
|
|
{ |
|
|
{ |
|
|
ResultObject<bool> _ret = new ResultObject<bool>(); |
|
|
ResultObject<bool> _ret = new ResultObject<bool>(); |
|
|
try |
|
|
try |
|
@ -4783,8 +4783,8 @@ namespace CK.SCP.Controller |
|
|
_tDetail.Site = itm.Site; |
|
|
_tDetail.Site = itm.Site; |
|
|
if (itm.Site == "BJBMPT") |
|
|
if (itm.Site == "BJBMPT") |
|
|
{ |
|
|
{ |
|
|
var price = db.TB_PRICE.Where(p => p.PartCode == itm.PartCode&&p.State>-1&&p.VendId== p_order.VendId).Max(p => p.UID); |
|
|
var price = db.TB_PRICE.Where(p => p.PartCode == itm.PartCode && p.State > -1 && p.VendId == p_order.VendId).Max(p => p.UID); |
|
|
var pri = db.TB_PRICE.FirstOrDefault(t=>t.UID==price); |
|
|
var pri = db.TB_PRICE.FirstOrDefault(t => t.UID == price); |
|
|
_tDetail.Price = pri.Amt; |
|
|
_tDetail.Price = pri.Amt; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
@ -5551,7 +5551,7 @@ namespace CK.SCP.Controller |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static List<string> GetPriceError(List<V_TB_PO_DETAIL> details,V_TB_PO po) |
|
|
public static List<string> GetPriceError(List<V_TB_PO_DETAIL> details, V_TB_PO po) |
|
|
{ |
|
|
{ |
|
|
List<string> errorlist = new List<string>(); |
|
|
List<string> errorlist = new List<string>(); |
|
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|
@ -5569,92 +5569,5 @@ namespace CK.SCP.Controller |
|
|
|
|
|
|
|
|
return errorlist; |
|
|
return errorlist; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void Get_V_TB_PO_PLAN_List_BJKFT(V_TB_PO_PLAN_BJBMPT p_entity, Action<ResultObject<IQueryable<V_TB_PO_PLAN_BJBMPT>>> p_action) |
|
|
|
|
|
{ |
|
|
|
|
|
ResultObject<IQueryable<V_TB_PO_PLAN_BJBMPT>> _ret = new ResultObject<IQueryable<V_TB_PO_PLAN_BJBMPT>>(); |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|
|
|
|
|
{ |
|
|
|
|
|
IQueryable<V_TB_PO_PLAN_BJBMPT> q = db.V_TB_PO_PLAN_BJBMPT; |
|
|
|
|
|
if (!string.IsNullOrEmpty(p_entity.Domain)) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.Domain.Contains(p_entity.Domain)); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(p_entity.PartCode)) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode)); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(p_entity.PoBillNum)) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.PoBillNum.Contains(p_entity.PoBillNum)); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(p_entity.Site)) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.Site.Contains(p_entity.Site)); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(p_entity.Buyer)) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.Buyer.Contains(p_entity.Buyer)); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(p_entity.ProjectId)) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.ProjectId.Contains(p_entity.ProjectId)); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(p_entity.AskBillNum)) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.AskBillNum.Contains(p_entity.AskBillNum)); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(p_entity.Version)) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.Version.Contains(p_entity.Version)); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(p_entity.PartDesc)) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.PartDesc.Contains(p_entity.PartDesc)); |
|
|
|
|
|
} |
|
|
|
|
|
if (!string.IsNullOrEmpty(p_entity.VendId)) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.VendId.Contains(p_entity.VendId)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p_entity.UserInAddress.Contains(p.Domain)); |
|
|
|
|
|
} |
|
|
|
|
|
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId)); |
|
|
|
|
|
} |
|
|
|
|
|
if (p_entity.EndTime_Begin != null) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.EndTime >= p_entity.EndTime_Begin.Value); |
|
|
|
|
|
} |
|
|
|
|
|
if (p_entity.EndTime_End != null) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.EndTime <= p_entity.EndTime_End.Value); |
|
|
|
|
|
} |
|
|
|
|
|
if (p_entity.EndTime_Begin1 != null) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.CreateTime >= p_entity.EndTime_Begin1.Value); |
|
|
|
|
|
} |
|
|
|
|
|
if (p_entity.EndTime_End1 != null) |
|
|
|
|
|
{ |
|
|
|
|
|
q = q.Where(p => p.CreateTime <= p_entity.EndTime_End1.Value); |
|
|
|
|
|
} |
|
|
|
|
|
_ret.State = ReturnStatus.Succeed; |
|
|
|
|
|
_ret.Result = q; |
|
|
|
|
|
p_action(_ret); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception e) |
|
|
|
|
|
{ |
|
|
|
|
|
_ret.State = ReturnStatus.Failed; |
|
|
|
|
|
_ret.ErrorList.Add(e); |
|
|
|
|
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(V_TB_PO_PLAN), "Get_V_TB_PO_PLAN_List", e.Message); |
|
|
|
|
|
throw e; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|