|
|
@ -1490,8 +1490,6 @@ namespace CK.SCP.Controller |
|
|
|
} |
|
|
|
catch (Exception e) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
_ret.State = ReturnStatus.Failed; |
|
|
|
_ret.ErrorList.Add(e); |
|
|
|
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Get_V_TB_ASK_DETAIL_List", e.Message); |
|
|
@ -1766,8 +1764,6 @@ namespace CK.SCP.Controller |
|
|
|
} |
|
|
|
); |
|
|
|
db.TB_ASK_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray()); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
@ -1962,6 +1958,33 @@ namespace CK.SCP.Controller |
|
|
|
{ |
|
|
|
if (db.SaveChanges() != -1) |
|
|
|
{ |
|
|
|
if (p_state == AskState.CompleteForce) { |
|
|
|
|
|
|
|
using (ScpEntities db1 = EntitiesFactory.CreateScpInstance()) |
|
|
|
{ |
|
|
|
if (p_list.Count > 0) |
|
|
|
{ |
|
|
|
var _entityList = db.V_TB_ASK_DETAIL.Where(p => p_list.Contains(p.AskBillNum)).ToList(); |
|
|
|
|
|
|
|
var _item = _entityList.FirstOrDefault(); |
|
|
|
|
|
|
|
if (_item.AskBillNum.Contains("U")) |
|
|
|
{ |
|
|
|
var _planList = db1.TB_PO_PLAN_EXTEND.Where(p => p.Domain == _item.Site && p.EndTime == _item.EndTime && p.PoBillNum == _item.PoBillNum).ToList(); |
|
|
|
_planList.ForEach(p => |
|
|
|
{ |
|
|
|
|
|
|
|
var _first = _entityList.Where(itm => itm.PoBillNum == p.PoBillNum && itm.PartCode == p.PartCode && itm.EndTime == p.EndTime).FirstOrDefault(); |
|
|
|
if (_first != null) |
|
|
|
{ |
|
|
|
p.PlanQty = _first.AskQty; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
db1.SaveChanges(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
_ret.State = ReturnStatus.Succeed; |
|
|
|
_ret.Result = true; |
|
|
|
} |
|
|
@ -1971,8 +1994,7 @@ namespace CK.SCP.Controller |
|
|
|
_ret.Result = false; |
|
|
|
_ret.Message = "数据更新失败!"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
|
|
|
@ -2173,8 +2195,6 @@ namespace CK.SCP.Controller |
|
|
|
_ls.ForEach(p => { |
|
|
|
p.UpdateUser = p_user.ChineseName; |
|
|
|
p.UpdateTime = DateTime.Now; |
|
|
|
|
|
|
|
|
|
|
|
p.State = (int)AskState.Confirm; |
|
|
|
var _list = db.TB_ASK_DETAIL.Where(itm => itm.AskBillNum == p.AskBillNum).ToList(); |
|
|
|
_list.ForEach(itm => itm.State = (int)AskState.Confirm); |
|
|
|