diff --git a/北京北汽/Controller/SCP_ASK_CONTROLLER.cs b/北京北汽/Controller/SCP_ASK_CONTROLLER.cs index 1698ecd..2b06b77 100644 --- a/北京北汽/Controller/SCP_ASK_CONTROLLER.cs +++ b/北京北汽/Controller/SCP_ASK_CONTROLLER.cs @@ -1532,26 +1532,36 @@ namespace CK.SCP.Controller if (p_list.Count > 0) { + //List list = new List(); + //var detail = p_list[0]; + //foreach (var item in p_list) + //{ + // var list1 = db.V_TB_ASN_DETAIL.Where(p => p.IsDeleted == false && item.AskBillNum == p.AskBillNum).ToList(); + // if (list1!= null) + // { + // list.AddRange(list1); + // } + - var detail = p_list[0]; - var list = db.V_TB_ASN_DETAIL.Where(p => p.IsDeleted == false && detail.AskBillNum == p.AskBillNum).ToList(); - var list_back = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == detail.AskBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.Qty < 0 && p.BillType == 3).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode, p.PoBillNum }).Select(p => new { BackSum = p.Sum(itm => itm.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode, PoBillNum = p.Key.PoBillNum }).ToList(); + //} + //list = db.V_TB_ASN_DETAIL.Where(p => p.IsDeleted == false && detail.AskBillNum == p.AskBillNum).ToList(); + + - var groupList = list.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode, p.AskBillNum }).Select( + p_list.ForEach(itm => + { + var list = db.V_TB_ASN_DETAIL.Where(p => p.IsDeleted == false && itm.AskBillNum == p.AskBillNum).ToList(); + var groupList = list.GroupBy(p => new { p.PoBillNum, p.PoLine, p.PartCode, p.AskBillNum }).Select( p => new { - ShipSum = p.Sum(itm => itm.Qty), + ShipSum = p.Sum(itm2 => itm2.Qty), PoLine = p.Key.PoLine, PoBillNum = p.Key.PoBillNum, PartCode = p.Key.PartCode, AskBillNum = p.Key.AskBillNum }).ToList(); - - p_list.ForEach(itm => - { - groupList.ForEach(p => { if (p.PoBillNum == itm.PoBillNum && p.PoLine == itm.PoLine && p.PartCode == itm.PartCode) @@ -1559,6 +1569,8 @@ namespace CK.SCP.Controller itm.ShippedQty = p.ShipSum; } }); + var list_back = db.TB_ARRIVE_DETAIL.Where(p => p.Remark == itm.AskBillNum && p.IsDeleted == false && p.State == (int)ArriveState.OK && p.Qty < 0 && p.BillType == 3).GroupBy(p => new { p.Remark, p.PoLine, p.PartCode, p.PoBillNum }).Select(p => new { BackSum = p.Sum(itm1 => itm1.Qty), PoLine = p.Key.PoLine, Remark = p.Key.Remark, PartCode = p.Key.PartCode, PoBillNum = p.Key.PoBillNum }).ToList(); + list_back.ForEach(p => { if (p.PoBillNum == itm.PoBillNum && p.PoLine == itm.PoLine && p.PartCode == itm.PartCode) diff --git a/北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs b/北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs index 4f815c1..7f8d8bc 100644 --- a/北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs +++ b/北京北汽/SCP/Views/PlanData/SCP_ASK.aspx.cs @@ -45,6 +45,23 @@ namespace SCP.PlanData var _ls = ScpCache.ADRESSList; DDL_Site.DataSource = _ls; DDL_Site.DataBind(); + List stinglist = new List(); + var list = _ls.Select(q => q.NamePone).ToList(); + if (list != null) + { + list.ForEach(q => + { + if (q.Contains(' ')) + { + stinglist.Add(q.Substring(0, q.IndexOf(' '))); + } + + }); + } + if (stinglist != null) + { + DDL_Site.SelectedIndex = stinglist.IndexOf(CurrentUser.ChineseName) == -1 ? 0 : stinglist.IndexOf(CurrentUser.ChineseName); + } } public void LoadData() { diff --git a/北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs b/北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs index 8d9f5a8..76d7de7 100644 --- a/北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs +++ b/北京北汽/SCP/Views/PlanData/SCP_ASK_DETAIL.aspx.cs @@ -36,7 +36,8 @@ namespace SCP.PlanData { Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count(); var list = SortAndPage(ret, Grid_V_TB_ASK_DETAIL); - Grid_V_TB_ASK_DETAIL.DataSource = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(list.ToList()); + var _ls = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(list.ToList()); + Grid_V_TB_ASK_DETAIL.DataSource = SCP_ASK_CONTROLLER.Get_CAN_SHIPQTY(_ls); ; Grid_V_TB_ASK_DETAIL.DataBind(); }); } diff --git a/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx b/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx index 4cd0af1..8048c75 100644 --- a/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx +++ b/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx @@ -4,11 +4,11 @@ - + -
+ @@ -16,17 +16,17 @@ - - + + - <%-- + <%-- --%> - <%-- + <%-- --%> - <%-- + <%-- --%> - + @@ -35,150 +35,148 @@ - - - - + + + + - - - - + - + diff --git a/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.cs b/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.cs index e9dabd1..2739d32 100644 --- a/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.cs +++ b/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.cs @@ -18,7 +18,7 @@ namespace SCP.PlanData { public partial class SCP_PO_CREATE_ASK : PageBase { - + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -28,21 +28,38 @@ namespace SCP.PlanData SetRoleRule(); CheckRolesMenu(); BindDDL_Site(); - } + } } private void BindDDL_Site() { var _ls = ScpCache.ADRESSList; DDL_Site.DataSource = _ls; DDL_Site.DataBind(); + List stinglist = new List(); + var list = _ls.Select(q => q.NamePone).ToList(); + if (list != null) + { + list.ForEach(q => + { + if (q.Contains(' ')) + { + stinglist.Add(q.Substring(0, q.IndexOf(' '))); + } + + }); + } + if (stinglist != null) + { + DDL_Site.SelectedIndex = stinglist.IndexOf(CurrentUser.ChineseName) == -1?0: stinglist.IndexOf(CurrentUser.ChineseName); + } } private void SetRoleRule() { IsPriceVisible(Grid_V_TB_PO_DETAIL, "价格"); - DDL_ReceivedPort.DataSource = ScpCache.PortList.Where(p=>CurrentUser.FactoryList.Contains(p.FACTORY_ID)); + DDL_ReceivedPort.DataSource = ScpCache.PortList.Where(p => CurrentUser.FactoryList.Contains(p.FACTORY_ID)); DDL_ReceivedPort.DataBind(); - + } private void CheckRolesMenu() { @@ -56,7 +73,7 @@ namespace SCP.PlanData TXT_Site.Hidden = false; } } - protected void BtnClose_Click(object sender, EventArgs e) + protected void BtnClose_Click(object sender, EventArgs e) { gp1.Hidden = true; } @@ -67,14 +84,15 @@ namespace SCP.PlanData public void SearchV_TB_PO_DETAIL(Action> p_action) { V_TB_PO_DETAIL _entity = new V_TB_PO_DETAIL(); - _entity.PoBillNum=Request["PoBillNum"]; - SCP_PO_CONTROLLER.Get_V_TB_PO_DETAIL_List(_entity,(_ret)=> { + _entity.PoBillNum = Request["PoBillNum"]; + SCP_PO_CONTROLLER.Get_V_TB_PO_DETAIL_List(_entity, (_ret) => + { - if (_ret.State == ReturnStatus.Succeed) - { - p_action(_ret.Result); - } - }); + if (_ret.State == ReturnStatus.Succeed) + { + p_action(_ret.Result); + } + }); } public void GetV_TB_POData() @@ -105,7 +123,7 @@ namespace SCP.PlanData this.TXT_VendId.Text = _result.VendId; this.TXT_Site.Text = _result.Site_Desc; this.TXT_State_DESC.Text = _result.State_DESC; - + this.TXT_VendName.Text = _result.VendName; this.txtRemark.Text = _result.Remark; } @@ -114,7 +132,8 @@ namespace SCP.PlanData public void BindDetail() { var qadOrder = Session["order"] as V_TB_PO; - SearchV_TB_PO_DETAIL((ret)=> { + SearchV_TB_PO_DETAIL((ret) => + { if (!string.IsNullOrEmpty(TextArea_PartCode.Text)) { List _strlist = new List(); @@ -125,9 +144,9 @@ namespace SCP.PlanData } ret = ret.Where(p => _strlist.Contains(p.PartCode)); } - this.Grid_V_TB_PO_DETAIL.RecordCount = ret.Count(); - var list = SortAndPage(ret, Grid_V_TB_PO_DETAIL); - var _ls= SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(SCP_PO_CONTROLLER.LOAD_PO_DETAIL_SUM_ASK(list.ToList())); + this.Grid_V_TB_PO_DETAIL.RecordCount = ret.Count(); + var list = SortAndPage(ret, Grid_V_TB_PO_DETAIL); + var _ls = SCP_CONTRACT_CONTROLLER.GET_CONTRACT_PRICE_LIST(SCP_PO_CONTROLLER.LOAD_PO_DETAIL_SUM_ASK(list.ToList())); if (qadOrder != null) { if (qadOrder.ModType == (int)BillModType.Non_Contract) @@ -146,19 +165,19 @@ namespace SCP.PlanData _ls.ForEach(p => { p.EndTime = DateTime.Now; - + }); - + } } - //_ls.ForEach(p => p.EndTime = qadOrder.EndTime); - - Grid_V_TB_PO_DETAIL.DataSource = _ls; - Grid_V_TB_PO_DETAIL.DataBind(); + //_ls.ForEach(p => p.EndTime = qadOrder.EndTime); + + Grid_V_TB_PO_DETAIL.DataSource = _ls; + Grid_V_TB_PO_DETAIL.DataBind(); if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0) { - if(CurrentUser.FactoryList.FirstOrDefault()== "CNS") + if (CurrentUser.FactoryList.FirstOrDefault() == "CNS") { if (qadOrder != null) { @@ -172,8 +191,8 @@ namespace SCP.PlanData } } - - }); + + }); } protected void Grid_V_TB_PO_DETAIL_PageIndexChange(object sender, GridPageEventArgs e) { @@ -197,15 +216,15 @@ namespace SCP.PlanData { var qadOrder = Session["order"] as V_TB_PO; //qadOrder.ReceivedPort = DDL_PORT.SelectedValue; - if (DP_BeginTime.SelectedDate == null ) + if (DP_BeginTime.SelectedDate == null) { Alert.Show("要货日期没有填写!"); - return; + return; } - + qadOrder.BeginTime = DP_BeginTime.SelectedDate; - + List _lineList = new List(); if (!string.IsNullOrEmpty(CurrentUser.Name)) { @@ -235,7 +254,7 @@ namespace SCP.PlanData _entity.UnConv = ConvertHelper.To(rowDataKeys[15]); _entity.DockCode = rowDataKeys[16] as string; _entity.State = ConvertHelper.To(rowDataKeys[17]); - + _entity.Remark = rowDataKeys[18] as string; _entity.CreateTime = ConvertHelper.To(rowDataKeys[19]); _entity.CreateUser = rowDataKeys[20] as string; @@ -255,7 +274,7 @@ namespace SCP.PlanData _entity.PartDesc2 = rowDataKeys[34] as string; _entity.TempQty = ConvertHelper.To(rowDataKeys[35]); _entity.BeginTime = DP_BeginTime.SelectedDate; - _entity.PartState = rowDataKeys[38] as string; + _entity.PartState = rowDataKeys[38] as string; if (qadOrder.ModType == (int)BillModType.Non_Contract) { _entity.PublishQty = ConvertHelper.To(rowDataKeys[36]); @@ -267,14 +286,14 @@ namespace SCP.PlanData if (modifiedDict.Keys.Contains(i)) { var modifyValue = modifiedDict[i]; - var Remark = modifyValue.Keys.Contains("Remark") ? modifyValue["Remark"] :_entity.Remark; - if (Remark!=null) + var Remark = modifyValue.Keys.Contains("Remark") ? modifyValue["Remark"] : _entity.Remark; + if (Remark != null) { _entity.Remark = Remark.ToString(); } - + if (modifyValue.Keys.Contains("PublishQty")) - { + { var _publishQty = modifyValue["PublishQty"]; decimal _out = 0; bool _result = decimal.TryParse(_publishQty.ToString(), out _out); @@ -313,7 +332,12 @@ namespace SCP.PlanData { _lineList.Add(string.Format("产品名称:{0}截至日期:{1}", _entity.PartDesc1, _endTime.ToString())); } - _entity.EndTime = _date; + + else + { + _entity.EndTime = _date; + } + } else @@ -325,6 +349,10 @@ namespace SCP.PlanData } } } + if (DatePicker2.SelectedDate != null) + { + _entity.EndTime = DatePicker2.SelectedDate; + } if (_entity.PublishQty != null && _entity.PublishQty > 0) { qadOrderList.Add(_entity); @@ -351,7 +379,7 @@ namespace SCP.PlanData } if (p.PartState.ToUpper() == "SP") { - _lineList.Add("(" + p.PartCode + ")" +"状态为SP不可以生成要货看板!"); + _lineList.Add("(" + p.PartCode + ")" + "状态为SP不可以生成要货看板!"); } }); if (_lineList.Count > 0) @@ -365,7 +393,7 @@ namespace SCP.PlanData return; } - + string str = string.Empty; if (!string.IsNullOrEmpty(CurrentUser.HomePhone)) { @@ -383,14 +411,15 @@ namespace SCP.PlanData } } - if(CurrentUser.FactoryList!=null && CurrentUser.FactoryList.Count>0) + if (CurrentUser.FactoryList != null && CurrentUser.FactoryList.Count > 0) { - if(CurrentUser.FactoryList.FirstOrDefault()=="CNS") + if (CurrentUser.FactoryList.FirstOrDefault() == "CNS") { if (qadOrder.ModType == 2) { int i = 0; - qadOrderList.ForEach(p => { + qadOrderList.ForEach(p => + { if (p.PlanQty != p.PublishQty) { i = 1; @@ -406,12 +435,12 @@ namespace SCP.PlanData } } - var _ls=qadOrderList.Where(itm => string.IsNullOrEmpty(itm.PartDesc1) && string.IsNullOrEmpty(itm.PartDesc2)).ToList(); + var _ls = qadOrderList.Where(itm => string.IsNullOrEmpty(itm.PartDesc1) && string.IsNullOrEmpty(itm.PartDesc2)).ToList(); if (_ls.Count > 0) { string _str = "不能生成要货看板原因\n\r"; - _str=_str+string.Join("\n\r", _ls.Select(itm => itm.PartCode).ToArray()); + _str = _str + string.Join("\n\r", _ls.Select(itm => itm.PartCode).ToArray()); _str = _str + "零件不存在!"; Alert.Show(_str); return; @@ -424,14 +453,14 @@ namespace SCP.PlanData qadOrderList.ForEach(p => { p.Remark = string.Empty; }); } } - string Ssite=""; + string Ssite = ""; if (CurrentUser.FactoryList.Contains("CQBMPT")) { - Ssite = DDL_Site.SelectedValue; + Ssite = DDL_Site.SelectedValue; } string Stremark = txtRemark.Text; - - var ret = SCP_PO_CONTROLLER.Save_PO_TO_ASK_CQ(qadOrder, qadOrderList, CurrentUser.ChineseName, str,CurrentUser.Name, Stremark, Ssite); + + var ret = SCP_PO_CONTROLLER.Save_PO_TO_ASK_CQ(qadOrder, qadOrderList, CurrentUser.ChineseName, str, CurrentUser.Name, Stremark, Ssite); if (ret.Result == true) { if (ret.MessageList.Count > 0) @@ -444,15 +473,15 @@ namespace SCP.PlanData Alert.Show("生成要货看板成功!"); } } - } + } //} } - + protected void Grid_V_TB_PO_DETAIL_RowDataBound(object sender, GridRowEventArgs e) { - + } diff --git a/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.designer.cs b/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.designer.cs index 8e40533..4ef7db9 100644 --- a/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.designer.cs +++ b/北京北汽/SCP/Views/PlanData/SCP_PO_CREATE_ASK.aspx.designer.cs @@ -140,6 +140,15 @@ namespace SCP.PlanData /// protected global::FineUI.TextBox txtRemark; + /// + /// DatePicker2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUI.DatePicker DatePicker2; + /// /// gp1 控件。 ///