diff --git a/BO/BO/Bill/OrderDetail/HurryRecord.cs b/BO/BO/Bill/OrderDetail/HurryRecord.cs index f9686b5..813a67e 100644 --- a/BO/BO/Bill/OrderDetail/HurryRecord.cs +++ b/BO/BO/Bill/OrderDetail/HurryRecord.cs @@ -23,5 +23,7 @@ namespace BO.BO.Bill public int HurryNumber { get; set; } public DateTime Time { get; set; } + + public long? ToOrderDetail_ID { get; set; } } } diff --git a/BO/Utils/BillRpc/OrderDetailRpc.cs b/BO/Utils/BillRpc/OrderDetailRpc.cs index f08bbf9..323dc6b 100644 --- a/BO/Utils/BillRpc/OrderDetailRpc.cs +++ b/BO/Utils/BillRpc/OrderDetailRpc.cs @@ -75,7 +75,7 @@ namespace BO.Utils.BillRpc public static List GetHurryRecordList(long weightBillID) { - const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetHurryRecords"; + const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetHurryRecordList"; var result = RpcFacade.Call(method, weightBillID); result = result.ESerializeDateTime(); return serializer.Deserialize>(result); @@ -120,5 +120,20 @@ namespace BO.Utils.BillRpc const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/SetOrderState"; RpcFacade.Call(method, id, state); } + + public static HurryRecord GetHurryRecord(long id) + { + const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetHurryRecord"; + var result = RpcFacade.Call(method, id); + return serializer.Deserialize(result); + } + + public static void InsertByHurryRecord(OrderDetail orderDetail, long hurryOrderID) + { + orderDetail.AccountingUnit_ID = ButcherAppContext.Context.UserConfig.AccountingUnit_ID; + orderDetail.Creator = ButcherAppContext.Context.UserConfig.UserName; + const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/InsertByHurryRecord"; + orderDetail.ID = RpcFacade.Call(method, serializer.Serialize(orderDetail),hurryOrderID); + } } } diff --git a/OrderConfirm/OrderConfirmForm.Designer.cs b/OrderConfirm/OrderConfirmForm.Designer.cs index 9162747..225f4f8 100644 --- a/OrderConfirm/OrderConfirmForm.Designer.cs +++ b/OrderConfirm/OrderConfirmForm.Designer.cs @@ -47,6 +47,7 @@ this.C_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.C_SecondarySplit = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.C_OrderState = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.C_Date = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.C_Order = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.C_B3WeighBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.C_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -81,6 +82,7 @@ this.C_WeightBill_ID, this.C_SecondarySplit, this.C_OrderState, + this.C_Date, this.C_Order, this.C_B3WeighBill_ID, this.C_Supplier_Name, @@ -230,6 +232,14 @@ this.C_OrderState.ReadOnly = true; this.C_OrderState.Visible = false; // + // C_Date + // + this.C_Date.DataPropertyName = "Date"; + this.C_Date.HeaderText = "Date"; + this.C_Date.Name = "C_Date"; + this.C_Date.ReadOnly = true; + this.C_Date.Visible = false; + // // C_Order // this.C_Order.DataPropertyName = "Order"; @@ -336,6 +346,7 @@ private System.Windows.Forms.DataGridViewTextBoxColumn C_WeightBill_ID; private System.Windows.Forms.DataGridViewTextBoxColumn C_SecondarySplit; private System.Windows.Forms.DataGridViewTextBoxColumn C_OrderState; + private System.Windows.Forms.DataGridViewTextBoxColumn C_Date; private System.Windows.Forms.DataGridViewTextBoxColumn C_Order; private System.Windows.Forms.DataGridViewTextBoxColumn C_B3WeighBill_ID; private System.Windows.Forms.DataGridViewTextBoxColumn C_Supplier_Name; diff --git a/OrderConfirm/OrderConfirmForm.cs b/OrderConfirm/OrderConfirmForm.cs index 965a333..abd7943 100644 --- a/OrderConfirm/OrderConfirmForm.cs +++ b/OrderConfirm/OrderConfirmForm.cs @@ -90,7 +90,7 @@ namespace OrderConfirm row.DefaultCellStyle.BackColor = ColorTranslator.FromHtml("#CC9999"); if ((bool)row.Cells["C_SecondarySplit"].Value) row.DefaultCellStyle.BackColor = ColorTranslator.FromHtml("#6699CC"); - ((DataGridViewButtonCell)row.Cells["C_OK"]).Value = state==0 ? "开始" : "取消"; + ((DataGridViewButtonCell)row.Cells["C_OK"]).Value = state == 0 ? "开始" : "取消"; if (lastOrderDetail != null && lastOrderDetail.ID == (long)row.Cells["C_ID"].Value) { lastOrderDetail = row.DataBoundItem as OrderDetail; @@ -195,15 +195,58 @@ namespace OrderConfirm case Keys.E: if (!start) break; - MessageBox.Show(code); + InsertDetail(); start = false; code = string.Empty; break; default: - if(start) + if (start) code += (char)e.KeyValue; break; } } + + void InsertDetail() + { + if (orderList == null) + throw new Exception("请先同步数据"); + long id = 0; + if (!long.TryParse(code, out id)) + throw new Exception(string.Format("接收扫码输入错误 {0}", code)); + var entity = OrderDetailRpc.GetHurryRecord(id); + if (entity.ToOrderDetail_ID.HasValue) + throw new Exception("该条码已插入过,不能重复插入"); + var currentOrder = 0; + if (!setTop.Checked) + { + if (lastOrderDetail != null && lastOrderDetail.Date != uDatePicker1.Date) + lastOrderDetail = null; + if (lastOrderDetail != null) + currentOrder = OrderDetailRpc.GetCurrentOrder(lastOrderDetail.ID); + else + currentOrder = OrderDetailRpc.GetMaxOrder(uDatePicker1.Date.Value); + currentOrder++; + } + else + { + setTop.Checked = false; + var l = orderList.OrderBy(x => x.Order).OrderBy(x => x.Doing).FirstOrDefault(); + if (l != null) + currentOrder = l.Order; + else + currentOrder = 1; + } + var order = new OrderDetail(); + order.Order = currentOrder; + order.LiveColonyHouse_Name = entity.LiveColonyHouse_Name; + order.PlanNumber = entity.HurryNumber; + order.WeightBill_ID = entity.WeightBill_ID; + order.B3WeighBill_ID = entity.B3WeighBill_ID; + order.Date = uDatePicker1.Date.Value; + order.IsHurryButcher = true; + OrderDetailRpc.InsertByHurryRecord(order, id); + lastOrderDetail = order; + BindOrderGrid(); + } } } diff --git a/OrderConfirm/OrderConfirmForm.resx b/OrderConfirm/OrderConfirmForm.resx index 329ff1b..a58b899 100644 --- a/OrderConfirm/OrderConfirmForm.resx +++ b/OrderConfirm/OrderConfirmForm.resx @@ -132,6 +132,9 @@ True + + True + True diff --git a/QualityAndOrder/QualityOrderForm.Designer.cs b/QualityAndOrder/QualityOrderForm.Designer.cs index 1db1c9e..1cdedab 100644 --- a/QualityAndOrder/QualityOrderForm.Designer.cs +++ b/QualityAndOrder/QualityOrderForm.Designer.cs @@ -43,12 +43,12 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); this.uTabControl1 = new BWP.WinFormControl.UTabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.vScrollBar1 = new System.Windows.Forms.VScrollBar(); @@ -117,16 +117,6 @@ this.P_OKBtn = new System.Windows.Forms.DataGridViewButtonColumn(); this.P_Hidden = new System.Windows.Forms.DataGridViewButtonColumn(); this.orderGrid = new BWP.WinFormControl.UDataGridView(); - this.O_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.O_IsHurryButcher = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.O_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.O_SecondarySplit = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.O_Order = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.O_B3WeighBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.O_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.O_LiveColonyHouse_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.O_PlanNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.O_OKBtn = new System.Windows.Forms.DataGridViewButtonColumn(); this.tab2SyncBtn = new System.Windows.Forms.Button(); this.tab2DateSelect = new BWP.WinFormControl.UDatePicker(); this.label4 = new System.Windows.Forms.Label(); @@ -146,6 +136,17 @@ this.H_HurryNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dataGridViewButtonColumn1 = new System.Windows.Forms.DataGridViewButtonColumn(); this.H_View = new System.Windows.Forms.DataGridViewButtonColumn(); + this.O_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.O_IsHurryButcher = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.O_WeightBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.O_SecondarySplit = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.O_Date = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.O_Order = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.O_B3WeighBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.O_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.O_LiveColonyHouse_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.O_PlanNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.O_OKBtn = new System.Windows.Forms.DataGridViewButtonColumn(); this.uTabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.panel1.SuspendLayout(); @@ -962,6 +963,7 @@ this.O_IsHurryButcher, this.O_WeightBill_ID, this.O_SecondarySplit, + this.O_Date, this.O_Order, this.O_B3WeighBill_ID, this.O_Supplier_Name, @@ -986,89 +988,6 @@ this.orderGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.orderGrid_CellClick); this.orderGrid.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.orderGrid_CellContentClick); // - // O_ID - // - this.O_ID.DataPropertyName = "ID"; - this.O_ID.HeaderText = "ID"; - this.O_ID.Name = "O_ID"; - this.O_ID.ReadOnly = true; - this.O_ID.Visible = false; - // - // O_IsHurryButcher - // - this.O_IsHurryButcher.DataPropertyName = "IsHurryButcher"; - this.O_IsHurryButcher.HeaderText = "IsHurryButcher"; - this.O_IsHurryButcher.Name = "O_IsHurryButcher"; - this.O_IsHurryButcher.ReadOnly = true; - this.O_IsHurryButcher.Visible = false; - // - // O_WeightBill_ID - // - this.O_WeightBill_ID.DataPropertyName = "WeightBill_ID"; - this.O_WeightBill_ID.HeaderText = "WeightBill_ID"; - this.O_WeightBill_ID.Name = "O_WeightBill_ID"; - this.O_WeightBill_ID.ReadOnly = true; - this.O_WeightBill_ID.Visible = false; - // - // O_SecondarySplit - // - this.O_SecondarySplit.DataPropertyName = "SecondarySplit"; - this.O_SecondarySplit.HeaderText = "SecondarySplit"; - this.O_SecondarySplit.Name = "O_SecondarySplit"; - this.O_SecondarySplit.ReadOnly = true; - this.O_SecondarySplit.Visible = false; - // - // O_Order - // - this.O_Order.DataPropertyName = "Order"; - this.O_Order.HeaderText = "序号"; - this.O_Order.Name = "O_Order"; - this.O_Order.ReadOnly = true; - this.O_Order.Width = 70; - // - // O_B3WeighBill_ID - // - this.O_B3WeighBill_ID.DataPropertyName = "B3WeighBill_ID"; - this.O_B3WeighBill_ID.HeaderText = "磅单号"; - this.O_B3WeighBill_ID.Name = "O_B3WeighBill_ID"; - this.O_B3WeighBill_ID.ReadOnly = true; - this.O_B3WeighBill_ID.Width = 80; - // - // O_Supplier_Name - // - this.O_Supplier_Name.DataPropertyName = "Supplier_Name"; - this.O_Supplier_Name.HeaderText = "供应商"; - this.O_Supplier_Name.Name = "O_Supplier_Name"; - this.O_Supplier_Name.ReadOnly = true; - this.O_Supplier_Name.Width = 95; - // - // O_LiveColonyHouse_Name - // - this.O_LiveColonyHouse_Name.DataPropertyName = "LiveColonyHouse_Name"; - this.O_LiveColonyHouse_Name.HeaderText = "圈舍"; - this.O_LiveColonyHouse_Name.Name = "O_LiveColonyHouse_Name"; - this.O_LiveColonyHouse_Name.ReadOnly = true; - // - // O_PlanNumber - // - this.O_PlanNumber.DataPropertyName = "PlanNumber"; - this.O_PlanNumber.HeaderText = "头数"; - this.O_PlanNumber.Name = "O_PlanNumber"; - this.O_PlanNumber.ReadOnly = true; - this.O_PlanNumber.Width = 70; - // - // O_OKBtn - // - dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle15.Padding = new System.Windows.Forms.Padding(7, 10, 7, 10); - this.O_OKBtn.DefaultCellStyle = dataGridViewCellStyle15; - this.O_OKBtn.HeaderText = "确定"; - this.O_OKBtn.Name = "O_OKBtn"; - this.O_OKBtn.ReadOnly = true; - this.O_OKBtn.Text = "确定"; - this.O_OKBtn.UseColumnTextForButtonValue = true; - this.O_OKBtn.Width = 95; - // // tab2SyncBtn // this.tab2SyncBtn.Font = new System.Drawing.Font("宋体", 15F); @@ -1294,6 +1213,97 @@ this.H_View.UseColumnTextForButtonValue = true; this.H_View.Width = 110; // + // O_ID + // + this.O_ID.DataPropertyName = "ID"; + this.O_ID.HeaderText = "ID"; + this.O_ID.Name = "O_ID"; + this.O_ID.ReadOnly = true; + this.O_ID.Visible = false; + // + // O_IsHurryButcher + // + this.O_IsHurryButcher.DataPropertyName = "IsHurryButcher"; + this.O_IsHurryButcher.HeaderText = "IsHurryButcher"; + this.O_IsHurryButcher.Name = "O_IsHurryButcher"; + this.O_IsHurryButcher.ReadOnly = true; + this.O_IsHurryButcher.Visible = false; + // + // O_WeightBill_ID + // + this.O_WeightBill_ID.DataPropertyName = "WeightBill_ID"; + this.O_WeightBill_ID.HeaderText = "WeightBill_ID"; + this.O_WeightBill_ID.Name = "O_WeightBill_ID"; + this.O_WeightBill_ID.ReadOnly = true; + this.O_WeightBill_ID.Visible = false; + // + // O_SecondarySplit + // + this.O_SecondarySplit.DataPropertyName = "SecondarySplit"; + this.O_SecondarySplit.HeaderText = "SecondarySplit"; + this.O_SecondarySplit.Name = "O_SecondarySplit"; + this.O_SecondarySplit.ReadOnly = true; + this.O_SecondarySplit.Visible = false; + // + // O_Date + // + this.O_Date.DataPropertyName = "Date"; + this.O_Date.HeaderText = "Date"; + this.O_Date.Name = "O_Date"; + this.O_Date.ReadOnly = true; + this.O_Date.Visible = false; + // + // O_Order + // + this.O_Order.DataPropertyName = "Order"; + this.O_Order.HeaderText = "序号"; + this.O_Order.Name = "O_Order"; + this.O_Order.ReadOnly = true; + this.O_Order.Width = 70; + // + // O_B3WeighBill_ID + // + this.O_B3WeighBill_ID.DataPropertyName = "B3WeighBill_ID"; + this.O_B3WeighBill_ID.HeaderText = "磅单号"; + this.O_B3WeighBill_ID.Name = "O_B3WeighBill_ID"; + this.O_B3WeighBill_ID.ReadOnly = true; + this.O_B3WeighBill_ID.Width = 80; + // + // O_Supplier_Name + // + this.O_Supplier_Name.DataPropertyName = "Supplier_Name"; + this.O_Supplier_Name.HeaderText = "供应商"; + this.O_Supplier_Name.Name = "O_Supplier_Name"; + this.O_Supplier_Name.ReadOnly = true; + this.O_Supplier_Name.Width = 95; + // + // O_LiveColonyHouse_Name + // + this.O_LiveColonyHouse_Name.DataPropertyName = "LiveColonyHouse_Name"; + this.O_LiveColonyHouse_Name.HeaderText = "圈舍"; + this.O_LiveColonyHouse_Name.Name = "O_LiveColonyHouse_Name"; + this.O_LiveColonyHouse_Name.ReadOnly = true; + // + // O_PlanNumber + // + this.O_PlanNumber.DataPropertyName = "PlanNumber"; + this.O_PlanNumber.HeaderText = "头数"; + this.O_PlanNumber.Name = "O_PlanNumber"; + this.O_PlanNumber.ReadOnly = true; + this.O_PlanNumber.Width = 70; + // + // O_OKBtn + // + dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle15.Padding = new System.Windows.Forms.Padding(7, 10, 7, 10); + this.O_OKBtn.DefaultCellStyle = dataGridViewCellStyle15; + this.O_OKBtn.HeaderText = "确定"; + this.O_OKBtn.Name = "O_OKBtn"; + this.O_OKBtn.ReadOnly = true; + this.O_OKBtn.Text = "确定"; + this.O_OKBtn.UseColumnTextForButtonValue = true; + this.O_OKBtn.Width = 95; + // // QualityOrderForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -1409,25 +1419,26 @@ private System.Windows.Forms.FlowLayoutPanel tab3KeyPanel; private System.Windows.Forms.Label label8; private BWP.WinFormControl.UDataGridView orderGrid3; + private System.Windows.Forms.Button tb3CloseBtn; + private System.Windows.Forms.DataGridViewTextBoxColumn H_WeightBill_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn H_B3WeighBill_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn H_Supplier_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn H_LiveColonyHouse_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn H_WeightNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn H_HurryNumber; + private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn1; + private System.Windows.Forms.DataGridViewButtonColumn H_View; private System.Windows.Forms.DataGridViewTextBoxColumn O_ID; private System.Windows.Forms.DataGridViewTextBoxColumn O_IsHurryButcher; private System.Windows.Forms.DataGridViewTextBoxColumn O_WeightBill_ID; private System.Windows.Forms.DataGridViewTextBoxColumn O_SecondarySplit; + private System.Windows.Forms.DataGridViewTextBoxColumn O_Date; private System.Windows.Forms.DataGridViewTextBoxColumn O_Order; private System.Windows.Forms.DataGridViewTextBoxColumn O_B3WeighBill_ID; private System.Windows.Forms.DataGridViewTextBoxColumn O_Supplier_Name; private System.Windows.Forms.DataGridViewTextBoxColumn O_LiveColonyHouse_Name; private System.Windows.Forms.DataGridViewTextBoxColumn O_PlanNumber; private System.Windows.Forms.DataGridViewButtonColumn O_OKBtn; - private System.Windows.Forms.Button tb3CloseBtn; - private System.Windows.Forms.DataGridViewTextBoxColumn H_WeightBill_ID; - private System.Windows.Forms.DataGridViewTextBoxColumn H_B3WeighBill_ID; - private System.Windows.Forms.DataGridViewTextBoxColumn H_Supplier_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn H_LiveColonyHouse_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn H_WeightNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn H_HurryNumber; - private System.Windows.Forms.DataGridViewButtonColumn dataGridViewButtonColumn1; - private System.Windows.Forms.DataGridViewButtonColumn H_View; diff --git a/QualityAndOrder/QualityOrderForm.resx b/QualityAndOrder/QualityOrderForm.resx index 01d2f56..9cdee26 100644 --- a/QualityAndOrder/QualityOrderForm.resx +++ b/QualityAndOrder/QualityOrderForm.resx @@ -219,6 +219,9 @@ True + + True + True