From 6e0cbdacfc640a39c505619050d5ec1a7d904584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 3 Sep 2020 10:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/SCP_ASK_CONTROLLER.cs | 36 ++++++++++++++++++----- Models/DataCenterTables/TT_LOCATION.cs | 3 +- SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs | 2 +- SCP/Views/PlanData/SCP_PO_EXTEND.aspx.cs | 6 +--- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/Controller/SCP_ASK_CONTROLLER.cs b/Controller/SCP_ASK_CONTROLLER.cs index 6c55e0e..db819a8 100644 --- a/Controller/SCP_ASK_CONTROLLER.cs +++ b/Controller/SCP_ASK_CONTROLLER.cs @@ -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); @@ -1745,8 +1743,6 @@ namespace CK.SCP.Controller } ); db.TB_ASK_DETAIL.AddOrUpdate(itm => itm.UID, _list.ToArray()); - - } ); @@ -1941,6 +1937,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; } @@ -1950,8 +1973,7 @@ namespace CK.SCP.Controller _ret.Result = false; _ret.Message = "数据更新失败!"; } - } - + } } } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 @@ -2152,8 +2174,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); diff --git a/Models/DataCenterTables/TT_LOCATION.cs b/Models/DataCenterTables/TT_LOCATION.cs index 0f35880..a8d34c7 100644 --- a/Models/DataCenterTables/TT_LOCATION.cs +++ b/Models/DataCenterTables/TT_LOCATION.cs @@ -7,7 +7,8 @@ using CK.SCP.Models.Base; using CK.SCP.Models.Enums; using CK.SCP.Models.ExchangeCenterTables; -using CK.SCP.Models.ExchangeCenterTables;namespace CK.SCP.Models.DataCenterTables + +namespace CK.SCP.Models.DataCenterTables { [Description("λ")] public class TT_LOCATION : TED_BASE,ITaskTable diff --git a/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs b/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs index e8b69ce..f63243a 100644 --- a/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs +++ b/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs @@ -224,7 +224,7 @@ namespace SCP.PlanData protected void btnCompleteForce_Click(object sender, EventArgs e) { - SET_PO_STATE("强制归档成功!", AskState.CompleteForce); + SET_PO_STATE("完结看板成功!", AskState.CompleteForce); } protected void btnReject_Click(object sender, EventArgs e) diff --git a/SCP/Views/PlanData/SCP_PO_EXTEND.aspx.cs b/SCP/Views/PlanData/SCP_PO_EXTEND.aspx.cs index 6597746..d14ae03 100644 --- a/SCP/Views/PlanData/SCP_PO_EXTEND.aspx.cs +++ b/SCP/Views/PlanData/SCP_PO_EXTEND.aspx.cs @@ -50,7 +50,6 @@ namespace SCP.PlanData } public void SearchV_TB_PO(Action> p_action) { - var ls=SCPDB.TB_FACTORY.Where(p => p.ErpDomain == CurrentUser.UsedDomain).ToList(); DropDownList1.DataSource = ls; DropDownList1.DataBind(); @@ -74,15 +73,13 @@ namespace SCP.PlanData if (!string.IsNullOrEmpty(rblist.SelectedValue)) { _entity.ModType =ConvertHelper.To (rblist.SelectedValue); - } _entity.ErpBillNum = TXT_ProjectId.Text; _entity.SubSite = DropDownList1.SelectedValue; _entity.Extend1 = TxT_Extend1.Text; _entity.Extend2 = TxT_Extend2.Text; _entity.Extend3 = TxT_Extend3.Text; - _entity.IsDeleted = false; - + _entity.IsDeleted = false; _entity.UserInAddress = CurrentUser.FactoryList; _entity.UserInVendIds = CurrentUser.VenderList; SCP_PO_CONTROLLER.Get_V_TB_PO_List(_entity, (_ret) => { @@ -160,7 +157,6 @@ namespace SCP.PlanData protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e) { Grid_V_TB_PO.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); - BindOrder(); }