Browse Source

修改。

master
yibo 8 years ago
parent
commit
231f5eb6b6
7 changed files with 195 additions and 107 deletions
  1. +2
    -0
      BO/BO/Bill/OrderDetail/HurryRecord.cs
  2. +16
    -1
      BO/Utils/BillRpc/OrderDetailRpc.cs
  3. +11
    -0
      OrderConfirm/OrderConfirmForm.Designer.cs
  4. +46
    -3
      OrderConfirm/OrderConfirmForm.cs
  5. +3
    -0
      OrderConfirm/OrderConfirmForm.resx
  6. +114
    -103
      QualityAndOrder/QualityOrderForm.Designer.cs
  7. +3
    -0
      QualityAndOrder/QualityOrderForm.resx

+ 2
- 0
BO/BO/Bill/OrderDetail/HurryRecord.cs View File

@ -23,5 +23,7 @@ namespace BO.BO.Bill
public int HurryNumber { get; set; }
public DateTime Time { get; set; }
public long? ToOrderDetail_ID { get; set; }
}
}

+ 16
- 1
BO/Utils/BillRpc/OrderDetailRpc.cs View File

@ -75,7 +75,7 @@ namespace BO.Utils.BillRpc
public static List<HurryRecord> 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<string>(method, weightBillID);
result = result.ESerializeDateTime();
return serializer.Deserialize<List<HurryRecord>>(result);
@ -120,5 +120,20 @@ namespace BO.Utils.BillRpc
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/SetOrderState";
RpcFacade.Call<int>(method, id, state);
}
public static HurryRecord GetHurryRecord(long id)
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderDetailRpc/GetHurryRecord";
var result = RpcFacade.Call<string>(method, id);
return serializer.Deserialize<HurryRecord>(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<long>(method, serializer.Serialize(orderDetail),hurryOrderID);
}
}
}

+ 11
- 0
OrderConfirm/OrderConfirmForm.Designer.cs View File

@ -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;


+ 46
- 3
OrderConfirm/OrderConfirmForm.cs View File

@ -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();
}
}
}

+ 3
- 0
OrderConfirm/OrderConfirmForm.resx View File

@ -132,6 +132,9 @@
<metadata name="C_OrderState.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="C_Date.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="C_Order.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>


+ 114
- 103
QualityAndOrder/QualityOrderForm.Designer.cs View File

@ -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;


+ 3
- 0
QualityAndOrder/QualityOrderForm.resx View File

@ -219,6 +219,9 @@
<metadata name="O_SecondarySplit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="O_Date.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="O_Order.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>


Loading…
Cancel
Save