|
|
@ -508,7 +508,7 @@ namespace CK.SCP.Controller |
|
|
|
foreach (var po1 in p_list1) |
|
|
|
{ |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
@ -1067,17 +1067,17 @@ namespace CK.SCP.Controller |
|
|
|
ErrorList.Add(string.Format("供应商编号【{0}】有填写为空!", p_excel.供应商编号)); |
|
|
|
} |
|
|
|
return ErrorList; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
private static List<string> CheckExcelMode_Vender1(ScpEntities db, SCP_PRICE_EXPORT p_excel) |
|
|
|
{ |
|
|
|
List<string> ErrorList = new List<string>(); |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
string.IsNullOrEmpty(p_excel.零件最新价格) || |
|
|
|
string.IsNullOrEmpty(p_excel.最新开始时间)) |
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
string.IsNullOrEmpty(p_excel.零件最新价格) || |
|
|
|
string.IsNullOrEmpty(p_excel.最新开始时间)) |
|
|
|
|
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("标识【{0}】供应商编号【{1}】有填写为空!", p_excel.标识, p_excel.供应商编号)); |
|
|
@ -1096,14 +1096,14 @@ namespace CK.SCP.Controller |
|
|
|
DateTime st1 = DateTime.Parse(st7.ToShortDateString()); |
|
|
|
|
|
|
|
DateTime st5 = DateTime.Parse(p_excel.开始时间); |
|
|
|
DateTime st3=DateTime.Parse( st5.ToShortDateString()); |
|
|
|
DateTime st3 = DateTime.Parse(st5.ToShortDateString()); |
|
|
|
|
|
|
|
Decimal st4 = Decimal.Parse(p_excel.零件基础价格); |
|
|
|
DateTime dd = st2.AddDays(1); |
|
|
|
DateTime dd1 = st1.AddYears(10); |
|
|
|
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.零件编码 |
|
|
|
&& 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) |
|
|
|
{ |
|
|
@ -1111,14 +1111,14 @@ namespace CK.SCP.Controller |
|
|
|
} |
|
|
|
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.供应商编号)); |
|
|
|
} |
|
|
|
DateTime STA =DateTime.Parse(Th.StartTime.ToString()); |
|
|
|
if(DateTime.Parse(STA.ToShortDateString())!= st3) |
|
|
|
DateTime STA = DateTime.Parse(Th.StartTime.ToString()); |
|
|
|
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.供应商编号)); |
|
|
|
} |
|
|
|
if (Th.State != (int)PriceState.FConfirm) |
|
|
|
{ |
|
|
@ -1128,7 +1128,7 @@ namespace CK.SCP.Controller |
|
|
|
{ |
|
|
|
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.供应商编号)); |
|
|
|
} |
|
|
@ -1144,14 +1144,14 @@ 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(); |
|
|
|
int a = 0; |
|
|
|
int.TryParse(p_excel.标识, out a); |
|
|
|
if (a < _second1) |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("标识【{0}】供应商编号为【{1}】的零件编号【{2}】价格表里已经存在!", p_excel.标识, p_excel.供应商编号, p_excel.零件编码)); |
|
|
|
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.TryParse(p_excel.标识, out a); |
|
|
|
if (a < _second1) |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("标识【{0}】供应商编号为【{1}】的零件编号【{2}】价格表里已经存在!", p_excel.标识, p_excel.供应商编号, p_excel.零件编码)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
return ErrorList; |
|
|
|
} |
|
|
@ -1179,12 +1179,12 @@ namespace CK.SCP.Controller |
|
|
|
} |
|
|
|
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.零件编码)); |
|
|
|
} |
|
|
|
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 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(); |
|
|
|
if (_first == null) |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("供应商编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.供应商编号, p_excel.零件编码)); |
|
|
@ -1197,16 +1197,16 @@ namespace CK.SCP.Controller |
|
|
|
ErrorList.Add(string.Format("零件编号【{0}】状态为SP,无法导入!", p_excel.零件编码)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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) |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("未找到供应商编号为【{0}】无法导入!", p_excel.供应商编号)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime st = DateTime.Parse(p_excel.开始时间); |
|
|
|
DateTime et = DateTime.Parse(p_excel.结束时间); |
|
|
|
DateTime st_st = Convert.ToDateTime(st.ToShortDateString()); |
|
|
@ -1251,10 +1251,10 @@ namespace CK.SCP.Controller |
|
|
|
// ErrorList.Add(string.Format("供应商{0}零件编号{1},新添价格的上期价格不是审批状态", p_excel.供应商编号, p_excel.零件编码));
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
return ErrorList; |
|
|
|
} |
|
|
@ -1313,7 +1313,7 @@ namespace CK.SCP.Controller |
|
|
|
// 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.State.ToUpper() != "SP") |
|
|
@ -1323,21 +1323,21 @@ namespace CK.SCP.Controller |
|
|
|
else |
|
|
|
{ |
|
|
|
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) |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("订单编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.订单编号, p_excel.零件号)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime _d = DateTime.Now; |
|
|
|
|
|
|
|
#region 日程单验证
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (p_modtype == BillModType.Contract) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(p_excel.订单编号) || string.IsNullOrEmpty(p_excel.行号) || string.IsNullOrEmpty(p_excel.订单创建时间) || |
|
|
@ -1348,7 +1348,7 @@ namespace CK.SCP.Controller |
|
|
|
} |
|
|
|
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.订单编号)); |
|
|
|
} |
|
|
@ -1413,7 +1413,7 @@ namespace CK.SCP.Controller |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -1423,12 +1423,12 @@ namespace CK.SCP.Controller |
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】零件号【{2}】的订单编号不正确,请更换订单编号!", p_excel.订单编号, p_excel.行号, p_excel.零件号)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int _polinr = Int32.Parse(p_excel.行号); |
|
|
|
if (string.IsNullOrEmpty(subsite)) |
|
|
|
{ |
|
|
|
var _partlist = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel.订单编号 && p.PartCode == p_excel.零件号.Trim() && p.PoLine != _polinr && p.PoBillNum.Substring(0, 1) == "S").ToList(); |
|
|
|
var _partlist = db.TB_PO_DETAIL.Where(p => p.PoBillNum == p_excel.订单编号 && p.PartCode == p_excel.零件号.Trim() && p.PoLine != _polinr && p.PoBillNum.Substring(0, 1) == "S").ToList(); |
|
|
|
if (_partlist.Count > 0) |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】零件号【{1}】已经存在(系统:行号-【{2}】),请更换零件号!", p_excel.订单编号, p_excel.零件号, _partlist[0].PoLine)); |
|
|
@ -1437,8 +1437,8 @@ namespace CK.SCP.Controller |
|
|
|
// 判断北汽多次导入 是否存在零件号重复现象
|
|
|
|
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(); |
|
|
|
if (_partlist.Count > 0 ) |
|
|
|
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) |
|
|
|
{ |
|
|
|
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)); |
|
|
@ -1447,7 +1447,7 @@ namespace CK.SCP.Controller |
|
|
|
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; |
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】在【{2}】订单中已经存在,请更换行号!", p_excel.订单编号, p_excel.行号,pobillnum)); |
|
|
|
ErrorList.Add(string.Format("订单编号【{0}】行号【{1}】在【{2}】订单中已经存在,请更换行号!", p_excel.订单编号, p_excel.行号, pobillnum)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -1564,13 +1564,13 @@ namespace CK.SCP.Controller |
|
|
|
if (!string.IsNullOrEmpty(p_excel.库位) && p_excel.库位.Length > 8) |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】库位最大8位字符!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
#region 离散单验证
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (p_modtype == BillModType.Non_Contract) |
|
|
|
{ |
|
|
|
//if (!string.IsNullOrEmpty(p_excel.订单编号))
|
|
|
@ -1612,7 +1612,7 @@ namespace CK.SCP.Controller |
|
|
|
} |
|
|
|
if (!string.IsNullOrEmpty(p_excel.订单截至日期)) |
|
|
|
{ |
|
|
|
DateTime year =DateTime.Parse(p_excel.订单截至日期); |
|
|
|
DateTime year = DateTime.Parse(p_excel.订单截至日期); |
|
|
|
if (year.Year > 2049) |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】的订单截止日期必须大于等于2049年!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号)); |
|
|
@ -1628,8 +1628,8 @@ namespace CK.SCP.Controller |
|
|
|
p_excel.单价 = checkcount[0].Amt.ToString(); |
|
|
|
p_excel.单位 = checkcount[0].Unit; |
|
|
|
p_excel.币种 = checkcount[0].Curr; |
|
|
|
} |
|
|
|
if (!Regex.IsMatch(p_excel.税率, "^[0-9]{1,2}$")) |
|
|
|
} |
|
|
|
if (!Regex.IsMatch(p_excel.税率, "^[0-9]{1,2}$")) |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】税率最大2位整数!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号)); |
|
|
|
} |
|
|
@ -1643,7 +1643,7 @@ namespace CK.SCP.Controller |
|
|
|
else |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】的订单创建日期或要求到货日期要求为文本格式!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号)); |
|
|
|
} |
|
|
|
} |
|
|
|
//if (DateTime.Parse(p_excel.零件开始时间) > DateTime.Parse(p_excel.零件截至日期))
|
|
|
|
//{
|
|
|
|
// ErrorList.Add(string.Format("订单编号【{2}】零件名称【{0}】供应编码【{1}】零件截止日期不能小于零件开始日期!", p_excel.零件号, p_excel.供应商编号, p_excel.订单编号));
|
|
|
@ -1689,7 +1689,7 @@ namespace CK.SCP.Controller |
|
|
|
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>(); |
|
|
|
|
|
|
@ -1705,7 +1705,7 @@ namespace CK.SCP.Controller |
|
|
|
// 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.State.ToUpper() != "SP") |
|
|
@ -1723,7 +1723,7 @@ namespace CK.SCP.Controller |
|
|
|
|
|
|
|
ErrorList.Add(string.Format("订单编号为【{0}】的零件编号【{1}】零件表里无数据,无法导入!", p_excel.订单编号, p_excel.零件号)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime _d = DateTime.Now; |
|
|
|
|
|
|
@ -1761,7 +1761,7 @@ namespace CK.SCP.Controller |
|
|
|
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) |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Format("订单号【{1}】零件号【{0}】已存在!", p_excel.零件号, p_excel.订单编号)); |
|
|
@ -2840,15 +2840,15 @@ namespace CK.SCP.Controller |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
List<string> PartList = _lst.Select(q => q.零件编码.Trim()).ToList(); |
|
|
|
List<TA_PART> _partList = db.TA_PART.Where(q => PartList.Contains(q.PartCode)).ToList(); |
|
|
|
List<string> PartList = _lst.Select(q => q.零件编码.Trim()).ToList(); |
|
|
|
List<TA_PART> _partList = db.TA_PART.Where(q => PartList.Contains(q.PartCode)).ToList(); |
|
|
|
_lst.ForEach(p => |
|
|
|
{ |
|
|
|
var _price = new TB_PRICE(); |
|
|
|
string starttime = DateTime.Parse(p.开始时间).ToShortDateString(); |
|
|
|
string starttime = DateTime.Parse(p.开始时间).ToShortDateString(); |
|
|
|
string endtime = DateTime.Parse(p.结束时间).ToShortDateString(); |
|
|
|
DateTime st = DateTime.Parse(p.开始时间); |
|
|
|
|
|
|
|
|
|
|
|
DateTime et = DateTime.Parse(p.结束时间); |
|
|
|
#region 201909011修改
|
|
|
|
var _Site = new SqlParameter("@Site", p.域); |
|
|
@ -2874,10 +2874,10 @@ namespace CK.SCP.Controller |
|
|
|
_price.StartTime = DateTime.Parse(starttime); |
|
|
|
_price.EndTime = DateTime.Parse(endtime); |
|
|
|
_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.Site = p.域.Trim(); |
|
|
|
_price.SubSite = p.地点.Trim(); |
|
|
|
_price.SubSite = p.地点.Trim(); |
|
|
|
_price.Remarks = p.备注; |
|
|
|
_price.TemporaryPrice = Int32.Parse(p.是否临时价格); |
|
|
|
_price.Creator = p_createuser; |
|
|
@ -3034,20 +3034,20 @@ namespace CK.SCP.Controller |
|
|
|
else |
|
|
|
{ |
|
|
|
_lst.ForEach(p => |
|
|
|
{ |
|
|
|
var _part = db.TA_PART.SingleOrDefault(t => t.PartCode == p.零件编号.ToUpper() && t.Site == p.域) ?? |
|
|
|
new TA_PART { PartCode = p.零件编号.ToUpper(), Site = p.域 }; |
|
|
|
_part.PartCode = p.零件编号; |
|
|
|
_part.ErpPartCode = p.零件编号; |
|
|
|
_part.PartDesc1 = p.零件名称; |
|
|
|
_part.PartDesc2 = ""; |
|
|
|
_part.ProjectId = p.项目编号; |
|
|
|
_part.Unit = p.单位; |
|
|
|
_part.PartGroup = p.零件类型; |
|
|
|
_part.State = p.状态; |
|
|
|
_part.Remark = p.备注; |
|
|
|
db.TA_PART.AddOrUpdate(_part); |
|
|
|
}); |
|
|
|
{ |
|
|
|
var _part = db.TA_PART.SingleOrDefault(t => t.PartCode == p.零件编号.ToUpper() && t.Site == p.域) ?? |
|
|
|
new TA_PART { PartCode = p.零件编号.ToUpper(), Site = p.域 }; |
|
|
|
_part.PartCode = p.零件编号; |
|
|
|
_part.ErpPartCode = p.零件编号; |
|
|
|
_part.PartDesc1 = p.零件名称; |
|
|
|
_part.PartDesc2 = ""; |
|
|
|
_part.ProjectId = p.项目编号; |
|
|
|
_part.Unit = p.单位; |
|
|
|
_part.PartGroup = p.零件类型; |
|
|
|
_part.State = p.状态; |
|
|
|
_part.Remark = p.备注; |
|
|
|
db.TA_PART.AddOrUpdate(_part); |
|
|
|
}); |
|
|
|
if (_ret.MessageList.Count == 0) |
|
|
|
{ |
|
|
|
int state = db.SaveChanges(); |
|
|
@ -3177,8 +3177,8 @@ namespace CK.SCP.Controller |
|
|
|
{ |
|
|
|
lineError.Add(string.Format("供应商编号{0}零件编号{3}数据不存在", p.供应商编号, p.开始时间, p.结束时间, p.零件编码.Trim())); |
|
|
|
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)); |
|
|
@ -3221,9 +3221,9 @@ namespace CK.SCP.Controller |
|
|
|
} |
|
|
|
db.TS_UNI_API.Add(TS); |
|
|
|
} |
|
|
|
|
|
|
|
db.TB_PRICE.AddOrUpdate(_vender); |
|
|
|
} |
|
|
|
|
|
|
|
db.TB_PRICE.AddOrUpdate(_vender); |
|
|
|
} |
|
|
|
TB_PRICE tb = new TB_PRICE(); |
|
|
|
tb.State = 0; |
|
|
|
tb.Extend3 = "价格表修改增加"; |
|
|
@ -3231,12 +3231,12 @@ namespace CK.SCP.Controller |
|
|
|
tb.PartCode = p.零件编码.Trim(); |
|
|
|
tb.Curr = p.币种; |
|
|
|
tb.Unit = _partList.Where(q => q.PartCode == p.零件编码.Trim()) != null ? _partList.First(q => q.PartCode == p.零件编码.Trim()).Unit : p.单位; |
|
|
|
tb.Remarks = p.备注; |
|
|
|
tb.Remarks = p.备注; |
|
|
|
tb.Amt = Convert.ToDecimal(p.零件最新价格); |
|
|
|
tb.Site = p.域; |
|
|
|
tb.SubSite = p.地点; |
|
|
|
tb.StartTime = Convert.ToDateTime(starttime); |
|
|
|
tb.EndTime = Convert.ToDateTime(endtime); |
|
|
|
tb.StartTime = Convert.ToDateTime(starttime); |
|
|
|
tb.EndTime = Convert.ToDateTime(endtime); |
|
|
|
tb.Creator = p_createuser; |
|
|
|
tb.IsPost = 0; |
|
|
|
tb.TemporaryPrice = Int32.Parse(p.是否临时价格); |
|
|
@ -3247,10 +3247,10 @@ namespace CK.SCP.Controller |
|
|
|
if (_ret.MessageList.Count == 0) |
|
|
|
{ |
|
|
|
|
|
|
|
db.BulkSaveChanges(); |
|
|
|
|
|
|
|
_ret.State = ReturnStatus.Succeed; |
|
|
|
_ret.Result = true; |
|
|
|
db.BulkSaveChanges(); |
|
|
|
|
|
|
|
_ret.State = ReturnStatus.Succeed; |
|
|
|
_ret.Result = true; |
|
|
|
//}
|
|
|
|
//else
|
|
|
|
//{
|
|
|
@ -3365,7 +3365,7 @@ namespace CK.SCP.Controller |
|
|
|
_lst.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) |
|
|
|
{ |
|
|
|
lineError.Add(number.ToString()); |
|
|
@ -3617,17 +3617,17 @@ namespace CK.SCP.Controller |
|
|
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|
|
|
{ |
|
|
|
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) |
|
|
|
{ |
|
|
|
ErrorList.Add("订单号【{0}】零件号【{1}】已生成看板,不能关闭"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (ErrorList.Count > 0) |
|
|
|
{ |
|
|
|
_ret.State = ReturnStatus.Failed; |
|
|
@ -3842,9 +3842,9 @@ namespace CK.SCP.Controller |
|
|
|
// 导入规则校验
|
|
|
|
var _ls = CheckExcelMode_Po(db, p, p_modtype, site, subsite); |
|
|
|
if (_ls.Count > 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ErrorList.Add(string.Join("<br>", _ls.ToArray())); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
var groupList = _lst.GroupBy(g => new { g.订单编号, g.行号, g.零件号 }).Where(g => g.Count() > 1).ToList(); |
|
|
@ -3960,8 +3960,8 @@ namespace CK.SCP.Controller |
|
|
|
{ |
|
|
|
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.行号)); |
|
|
@ -3971,8 +3971,8 @@ namespace CK.SCP.Controller |
|
|
|
{ |
|
|
|
lineError.Add(string.Format("导入订单编号【{0}】零件编码【{1}】有重复", p.订单编号, p.零件号.Trim())); |
|
|
|
ErrorList = lineError; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
p_order_list.ForEach |
|
|
|
(p => |
|
|
@ -4074,8 +4074,8 @@ namespace CK.SCP.Controller |
|
|
|
var list = p.ToList(); |
|
|
|
if (list.Count > 0) |
|
|
|
{ |
|
|
|
#region 日程单
|
|
|
|
if (p_modtype == BillModType.Contract) |
|
|
|
#region 日程单
|
|
|
|
if (p_modtype == BillModType.Contract) |
|
|
|
{ |
|
|
|
var _entity = list.FirstOrDefault(); |
|
|
|
var _po = db.TB_PO.SingleOrDefault(t => t.PoBillNum == _entity.订单编号/* && t.State == state*/ && t.Site == site && t.SubSite == subsite && t.VendId == _entity.供应商编号.ToUpper()) ?? |
|
|
@ -4083,8 +4083,8 @@ namespace CK.SCP.Controller |
|
|
|
_po.ErpBillNum = _entity.订单编号.ToUpper(); |
|
|
|
_po.ModType = (int)p_modtype; |
|
|
|
_po.Contacter = p_chineseName;// _entity.联系人;
|
|
|
|
_po.Buyer = p_chineseName;// _entity.联系人;
|
|
|
|
_po.BuyerPhone = p_buyerPhone; |
|
|
|
_po.Buyer = p_chineseName;// _entity.联系人;
|
|
|
|
_po.BuyerPhone = p_buyerPhone; |
|
|
|
_po.Site = site; |
|
|
|
_po.Remark = _entity.备注; |
|
|
|
_po.IsDeleted = false; |
|
|
@ -4120,7 +4120,7 @@ namespace CK.SCP.Controller |
|
|
|
_PO_Detail.Scheduledays = string.IsNullOrEmpty(itm.日程天数) ? 7 : 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.Supplieritem =string.IsNullOrEmpty(itm.供应商零件)? itm.供应商零件 :itm.供应商零件.ToUpper(); |
|
|
|
_PO_Detail.Supplieritem = string.IsNullOrEmpty(itm.供应商零件) ? itm.供应商零件 : itm.供应商零件.ToUpper(); |
|
|
|
_PO_Detail.Dliverypatterncode = itm.发货样式; |
|
|
|
_PO_Detail.Deliverytimecode = itm.发货时间样式; |
|
|
|
_PO_Detail.Transportdays = string.IsNullOrEmpty(itm.运输周期) ? 0 : int.Parse(itm.运输周期); |
|
|
@ -4129,9 +4129,9 @@ namespace CK.SCP.Controller |
|
|
|
}); |
|
|
|
_polist = _polist + _po.PoBillNum + ","; |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
#region 离散单
|
|
|
|
if (p_modtype == BillModType.Non_Contract) |
|
|
|
#endregion
|
|
|
|
#region 离散单
|
|
|
|
if (p_modtype == BillModType.Non_Contract) |
|
|
|
{ |
|
|
|
var _entity = list.FirstOrDefault(); |
|
|
|
TB_PO _po = new TB_PO(); |
|
|
@ -4144,8 +4144,8 @@ namespace CK.SCP.Controller |
|
|
|
_po.ErpBillNum = _po.PoBillNum; |
|
|
|
_po.ModType = (int)p_modtype; |
|
|
|
_po.Contacter = p_chineseName;// _entity.联系人;
|
|
|
|
_po.Buyer = p_chineseName;// _entity.联系人;
|
|
|
|
_po.BuyerPhone = p_buyerPhone; |
|
|
|
_po.Buyer = p_chineseName;// _entity.联系人;
|
|
|
|
_po.BuyerPhone = p_buyerPhone; |
|
|
|
_po.Site = site; |
|
|
|
_po.Remark = _entity.备注; |
|
|
|
_po.IsDeleted = false; |
|
|
@ -4166,7 +4166,7 @@ namespace CK.SCP.Controller |
|
|
|
_ask.CreateUser = p_creator; |
|
|
|
_ask.Site = site; |
|
|
|
_ask.ReceivedPort = "";//交货口
|
|
|
|
_ask.State = (int)AskState.New; |
|
|
|
_ask.State = (int)AskState.New; |
|
|
|
_ask.Remark = _entity.备注; |
|
|
|
_ask.ModType = (int)p_modtype; |
|
|
|
_ask.ErpBillNum = _po.PoBillNum; |
|
|
@ -4241,8 +4241,8 @@ namespace CK.SCP.Controller |
|
|
|
}); |
|
|
|
_polist = _polist + _po.PoBillNum + "</br>"; |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
} |
|
|
|
#endregion
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_ret.MessageList.Add("ERP订单编号已存在,请重新导入!"); |
|
|
@ -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>(); |
|
|
|
try |
|
|
@ -4740,7 +4740,7 @@ namespace CK.SCP.Controller |
|
|
|
_t.CreateTime = DateTime.Now; |
|
|
|
_t.CreateUser = p_creator; |
|
|
|
_t.Site = p_order.Site; |
|
|
|
_t.ReceivedPort = p_order.ReceivedPort; |
|
|
|
_t.ReceivedPort = p_order.ReceivedPort; |
|
|
|
_t.State = (int)AskState.New; |
|
|
|
_t.Remark = remark; |
|
|
|
_t.GUID = Guid.NewGuid(); |
|
|
@ -4783,15 +4783,15 @@ namespace CK.SCP.Controller |
|
|
|
_tDetail.Site = itm.Site; |
|
|
|
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 pri = db.TB_PRICE.FirstOrDefault(t=>t.UID==price); |
|
|
|
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); |
|
|
|
_tDetail.Price = pri.Amt; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_tDetail.Price = itm.Price; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_tDetail.Remark = itm.Remark; |
|
|
|
_tDetail.GUID = Guid.NewGuid(); |
|
|
|
_tDetail.Currency = itm.Currency; |
|
|
@ -5519,7 +5519,7 @@ namespace CK.SCP.Controller |
|
|
|
.Select(p => new { AsSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode }); |
|
|
|
var arrive = db.TB_ARRIVE_DETAIL.Where(p => p.PoBillNum == _detail.PoBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.BillType == (int)ArriveBillType.Receive) |
|
|
|
.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode, p.SubSite }).Select(p => new { ArriveSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode, Subsite = p.Key.SubSite }); |
|
|
|
|
|
|
|
|
|
|
|
rec.ToList().ForEach(itm => |
|
|
|
{ |
|
|
|
if (_detail.PoBillNum == itm.PoBillNum && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode) |
|
|
@ -5527,7 +5527,7 @@ namespace CK.SCP.Controller |
|
|
|
_detail.ReceivedQty = itm.ReceiveSum; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
asn.ToList().ForEach(itm => |
|
|
|
{ |
|
|
|
if (_detail.PoBillNum == itm.PoBillNum && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode) |
|
|
@ -5535,7 +5535,7 @@ namespace CK.SCP.Controller |
|
|
|
_detail.ShippedQty = itm.AsSum; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
arrive.ToList().ForEach(itm => |
|
|
|
{ |
|
|
|
if (_detail.PoBillNum == itm.PoBillNum && _detail.PoLine == itm.PoLine && _detail.PartCode == itm.PartCode && _detail.SubSite == itm.Subsite) |
|
|
@ -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>(); |
|
|
|
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) |
|
|
@ -5564,97 +5564,10 @@ namespace CK.SCP.Controller |
|
|
|
errorlist.Add(string.Format("零件编号【{0}】供应编码【{1}】价格表没有维护信息!", item.PartCode.Trim(), po.VendId)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
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; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|