Browse Source

优化及修改。

master
yibo 8 years ago
parent
commit
94e5aa77b9
9 changed files with 152 additions and 165 deletions
  1. +1
    -1
      BO/BO/Bill/WeightBill/WeightBillList.cs
  2. +7
    -0
      BO/Utils/BillRpc/WeightBillRpc.cs
  3. +0
    -2
      ButcherManageClient/Login.cs
  4. +128
    -125
      ButcherWeight/WeightForm.Designer.cs
  5. +8
    -11
      ButcherWeight/WeightForm.cs
  6. +1
    -1
      ButcherWeight/WeightForm.resx
  7. +6
    -6
      QualityAndOrder/QualityOrderForm.cs
  8. +1
    -19
      QualityAndOrder/QualityOrderFormForTab2.cs
  9. BIN
      Setup/Release/Setup.msi

+ 1
- 1
BO/BO/Bill/WeightBill/WeightBillList.cs View File

@ -26,7 +26,7 @@ namespace BO.BO
public string HouseNames { get; set; }
public int? SanctionNumber { get; set; }
public decimal? SanctionMoney { get; set; }
public string Remark { get; set; }


+ 7
- 0
BO/Utils/BillRpc/WeightBillRpc.cs View File

@ -91,5 +91,12 @@ namespace BO.Utils.BillRpc
var json = RpcFacade.Call<string>(method, ids.ToArray());
return serializer.Deserialize<List<CTuple<long, long>>>(json);
}
public static List<CTuple<long, long?, decimal?>> SyncBillB3IdsAndSanctionMoney()
{
const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/SyncBillB3IdsAndSanctionMoney";
var json = RpcFacade.Call<string>(method, DateTime.Today);
return serializer.Deserialize<List<CTuple<long, long?, decimal?>>>(json);
}
}
}

+ 0
- 2
ButcherManageClient/Login.cs View File

@ -122,9 +122,7 @@ namespace ButcherManageClient
private void Login_Load(object sender, EventArgs e)
{
//# if relase
AutoUpdate();
//#endif
}
}
}

+ 128
- 125
ButcherWeight/WeightForm.Designer.cs View File

@ -48,8 +48,9 @@
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = 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 dataGridViewCellStyle20 = 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();
this.panel1 = new System.Windows.Forms.Panel();
this.enableCheckBox = new System.Windows.Forms.CheckBox();
this.weightSet = new System.Windows.Forms.Button();
@ -134,18 +135,6 @@
this.S_AbnormalItem_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.S_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.billGrid = new System.Windows.Forms.DataGridView();
this.M_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_FinishWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Car_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Employee_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_PurchaseType_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_SanctionNumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label15 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
@ -160,6 +149,18 @@
this.farmerMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.farmerDelete = new System.Windows.Forms.ToolStripMenuItem();
this.viewDetailBtn = new System.Windows.Forms.Button();
this.M_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_FinishWeight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Car_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Employee_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_PurchaseType_Name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Number = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_SanctionMoney = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.M_Remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.panel3.SuspendLayout();
@ -1174,118 +1175,22 @@
this.M_Number,
this.M_Weight,
this.M_HouseNames,
this.M_SanctionNumber,
this.M_SanctionMoney,
this.M_Remark});
this.billGrid.Location = new System.Drawing.Point(12, 595);
this.billGrid.MultiSelect = false;
this.billGrid.Name = "billGrid";
this.billGrid.ReadOnly = true;
this.billGrid.RowHeadersVisible = false;
dataGridViewCellStyle20.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.billGrid.RowsDefaultCellStyle = dataGridViewCellStyle20;
dataGridViewCellStyle21.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle21.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218)))));
this.billGrid.RowsDefaultCellStyle = dataGridViewCellStyle21;
this.billGrid.RowTemplate.Height = 23;
this.billGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.billGrid.Size = new System.Drawing.Size(1250, 230);
this.billGrid.TabIndex = 0;
this.billGrid.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.billGrid_CellDoubleClick);
//
// M_ID
//
this.M_ID.DataPropertyName = "ID";
this.M_ID.HeaderText = "ID";
this.M_ID.Name = "M_ID";
this.M_ID.ReadOnly = true;
this.M_ID.Visible = false;
//
// M_FinishWeight
//
this.M_FinishWeight.DataPropertyName = "FinishWeight";
this.M_FinishWeight.HeaderText = "FinishWeight";
this.M_FinishWeight.Name = "M_FinishWeight";
this.M_FinishWeight.ReadOnly = true;
this.M_FinishWeight.Visible = false;
//
// M_B3ID
//
this.M_B3ID.DataPropertyName = "B3ID";
this.M_B3ID.HeaderText = "过磅单号";
this.M_B3ID.Name = "M_B3ID";
this.M_B3ID.ReadOnly = true;
//
// M_Car_Name
//
this.M_Car_Name.DataPropertyName = "Car_Name";
this.M_Car_Name.HeaderText = "车辆";
this.M_Car_Name.Name = "M_Car_Name";
this.M_Car_Name.ReadOnly = true;
this.M_Car_Name.Width = 120;
//
// M_Supplier_Name
//
this.M_Supplier_Name.DataPropertyName = "Supplier_Name";
this.M_Supplier_Name.HeaderText = "供应商";
this.M_Supplier_Name.Name = "M_Supplier_Name";
this.M_Supplier_Name.ReadOnly = true;
this.M_Supplier_Name.Width = 120;
//
// M_Employee_Name
//
this.M_Employee_Name.DataPropertyName = "Employee_Name";
this.M_Employee_Name.HeaderText = "业务员";
this.M_Employee_Name.Name = "M_Employee_Name";
this.M_Employee_Name.ReadOnly = true;
this.M_Employee_Name.Width = 110;
//
// M_PurchaseType_Name
//
this.M_PurchaseType_Name.DataPropertyName = "PurchaseType_Name";
this.M_PurchaseType_Name.HeaderText = "收购类型";
this.M_PurchaseType_Name.Name = "M_PurchaseType_Name";
this.M_PurchaseType_Name.ReadOnly = true;
this.M_PurchaseType_Name.Width = 110;
//
// M_Number
//
this.M_Number.DataPropertyName = "Number";
this.M_Number.HeaderText = "收购头数";
this.M_Number.Name = "M_Number";
this.M_Number.ReadOnly = true;
this.M_Number.Width = 110;
//
// M_Weight
//
this.M_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle19.Format = "#0.######";
this.M_Weight.DefaultCellStyle = dataGridViewCellStyle19;
this.M_Weight.HeaderText = "收购重量";
this.M_Weight.Name = "M_Weight";
this.M_Weight.ReadOnly = true;
this.M_Weight.Width = 120;
//
// M_HouseNames
//
this.M_HouseNames.DataPropertyName = "HouseNames";
this.M_HouseNames.HeaderText = "圈舍";
this.M_HouseNames.Name = "M_HouseNames";
this.M_HouseNames.ReadOnly = true;
this.M_HouseNames.Width = 180;
//
// M_SanctionNumber
//
this.M_SanctionNumber.DataPropertyName = "SanctionNumber";
this.M_SanctionNumber.HeaderText = "异常明细";
this.M_SanctionNumber.Name = "M_SanctionNumber";
this.M_SanctionNumber.ReadOnly = true;
//
// M_Remark
//
this.M_Remark.DataPropertyName = "Remark";
this.M_Remark.HeaderText = "摘要";
this.M_Remark.Name = "M_Remark";
this.M_Remark.ReadOnly = true;
this.M_Remark.Width = 130;
//
// label15
//
this.label15.AutoSize = true;
@ -1421,6 +1326,104 @@
this.viewDetailBtn.UseVisualStyleBackColor = true;
this.viewDetailBtn.Click += new System.EventHandler(this.viewDetailBtn_Click);
//
// M_ID
//
this.M_ID.DataPropertyName = "ID";
this.M_ID.HeaderText = "ID";
this.M_ID.Name = "M_ID";
this.M_ID.ReadOnly = true;
this.M_ID.Visible = false;
//
// M_FinishWeight
//
this.M_FinishWeight.DataPropertyName = "FinishWeight";
this.M_FinishWeight.HeaderText = "FinishWeight";
this.M_FinishWeight.Name = "M_FinishWeight";
this.M_FinishWeight.ReadOnly = true;
this.M_FinishWeight.Visible = false;
//
// M_B3ID
//
this.M_B3ID.DataPropertyName = "B3ID";
this.M_B3ID.HeaderText = "过磅单号";
this.M_B3ID.Name = "M_B3ID";
this.M_B3ID.ReadOnly = true;
//
// M_Car_Name
//
this.M_Car_Name.DataPropertyName = "Car_Name";
this.M_Car_Name.HeaderText = "车辆";
this.M_Car_Name.Name = "M_Car_Name";
this.M_Car_Name.ReadOnly = true;
this.M_Car_Name.Width = 120;
//
// M_Supplier_Name
//
this.M_Supplier_Name.DataPropertyName = "Supplier_Name";
this.M_Supplier_Name.HeaderText = "供应商";
this.M_Supplier_Name.Name = "M_Supplier_Name";
this.M_Supplier_Name.ReadOnly = true;
this.M_Supplier_Name.Width = 120;
//
// M_Employee_Name
//
this.M_Employee_Name.DataPropertyName = "Employee_Name";
this.M_Employee_Name.HeaderText = "业务员";
this.M_Employee_Name.Name = "M_Employee_Name";
this.M_Employee_Name.ReadOnly = true;
this.M_Employee_Name.Width = 110;
//
// M_PurchaseType_Name
//
this.M_PurchaseType_Name.DataPropertyName = "PurchaseType_Name";
this.M_PurchaseType_Name.HeaderText = "收购类型";
this.M_PurchaseType_Name.Name = "M_PurchaseType_Name";
this.M_PurchaseType_Name.ReadOnly = true;
this.M_PurchaseType_Name.Width = 110;
//
// M_Number
//
this.M_Number.DataPropertyName = "Number";
this.M_Number.HeaderText = "收购头数";
this.M_Number.Name = "M_Number";
this.M_Number.ReadOnly = true;
this.M_Number.Width = 110;
//
// M_Weight
//
this.M_Weight.DataPropertyName = "Weight";
dataGridViewCellStyle19.Format = "#0.######";
this.M_Weight.DefaultCellStyle = dataGridViewCellStyle19;
this.M_Weight.HeaderText = "收购重量";
this.M_Weight.Name = "M_Weight";
this.M_Weight.ReadOnly = true;
this.M_Weight.Width = 120;
//
// M_HouseNames
//
this.M_HouseNames.DataPropertyName = "HouseNames";
this.M_HouseNames.HeaderText = "圈舍";
this.M_HouseNames.Name = "M_HouseNames";
this.M_HouseNames.ReadOnly = true;
this.M_HouseNames.Width = 180;
//
// M_SanctionMoney
//
this.M_SanctionMoney.DataPropertyName = "SanctionMoney";
dataGridViewCellStyle20.Format = "#0.######";
this.M_SanctionMoney.DefaultCellStyle = dataGridViewCellStyle20;
this.M_SanctionMoney.HeaderText = "异常明细";
this.M_SanctionMoney.Name = "M_SanctionMoney";
this.M_SanctionMoney.ReadOnly = true;
//
// M_Remark
//
this.M_Remark.DataPropertyName = "Remark";
this.M_Remark.HeaderText = "摘要";
this.M_Remark.Name = "M_Remark";
this.M_Remark.ReadOnly = true;
this.M_Remark.Width = 130;
//
// WeightForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -1541,18 +1544,6 @@
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox jingjianInput;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.DataGridViewTextBoxColumn M_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn M_FinishWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn M_B3ID;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Car_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Supplier_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Employee_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn M_PurchaseType_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn M_HouseNames;
private System.Windows.Forms.DataGridViewTextBoxColumn M_SanctionNumber;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Remark;
private System.Windows.Forms.DataGridViewTextBoxColumn D_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_WeightBill_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn D_Index;
@ -1580,5 +1571,17 @@
private System.Windows.Forms.DataGridViewTextBoxColumn F_Farmer_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn F_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn M_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn M_FinishWeight;
private System.Windows.Forms.DataGridViewTextBoxColumn M_B3ID;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Car_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Supplier_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Employee_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn M_PurchaseType_Name;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Number;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Weight;
private System.Windows.Forms.DataGridViewTextBoxColumn M_HouseNames;
private System.Windows.Forms.DataGridViewTextBoxColumn M_SanctionMoney;
private System.Windows.Forms.DataGridViewTextBoxColumn M_Remark;
}
}

+ 8
- 11
ButcherWeight/WeightForm.cs View File

@ -85,19 +85,16 @@ namespace ButcherWeight
{
Thread.Sleep(5000);
bool changed = false;
var ids = dmoList.Where(x => x.B3ID == null).Select(x => (long?)x.ID).ToList();
if (ids.Any())
var result = WeightBillRpc.SyncBillB3IdsAndSanctionMoney();
foreach (var item in result)
{
var result = WeightBillRpc.SyncBillB3Ids(ids);
foreach (var item in result)
var first = dmoList.FirstOrDefault(x => x.ID == item.Item1);
if (first != null)
{
var first = dmoList.FirstOrDefault(x => x.ID == item.Item1);
if (first != null)
{
first.B3ID = item.Item2;
if (!changed)
changed = true;
}
first.B3ID = item.Item2;
first.SanctionMoney = item.Item3;
if (!changed)
changed = true;
}
}
if (changed)


+ 1
- 1
ButcherWeight/WeightForm.resx View File

@ -228,7 +228,7 @@
<metadata name="M_HouseNames.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="M_SanctionNumber.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="M_SanctionMoney.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="M_Remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">


+ 6
- 6
QualityAndOrder/QualityOrderForm.cs View File

@ -455,7 +455,7 @@ namespace QualityAndOrder
foreach (DataGridViewRow row in sanctionGrid.Rows)
{
var tag = row.DataBoundItem as SanctionSplit3Part;
if (tag.Number1.HasValue)
if( (tag.Number1??0)!=0)
{
var detail = new WeightBill_SanctionDetail();
Dmo.SanctionDetails.Add(detail);
@ -466,7 +466,7 @@ namespace QualityAndOrder
detail.AbnormalItem_Name = tag.AbnormalItem_Name1;
detail.Number = tag.Number1;
}
if (tag.Number2.HasValue)
if ((tag.Number2 ?? 0) != 0)
{
var detail = new WeightBill_SanctionDetail();
Dmo.SanctionDetails.Add(detail);
@ -477,7 +477,7 @@ namespace QualityAndOrder
detail.AbnormalItem_Name = tag.AbnormalItem_Name2;
detail.Number = tag.Number2;
}
if (tag.Number3.HasValue)
if ((tag.Number3 ?? 0) != 0)
{
var detail = new WeightBill_SanctionDetail();
Dmo.SanctionDetails.Add(detail);
@ -668,7 +668,7 @@ namespace QualityAndOrder
var result = new List<Tuple<long, long, string, int>>();
foreach (var item in list)
{
if (item.Number1.HasValue)
if ((item.Number1 ?? 0) != 0)
{
var detail = new Tuple<long, long, string, int>(item.Sanction_ID1, item.AbnormalItem_ID1, item.AbnormalItem_Name1, item.Number1.Value);
result.Add(detail);
@ -676,14 +676,14 @@ namespace QualityAndOrder
if (item.Sanction_ID2 == 0)
break;
if (item.Number2.HasValue)
if ((item.Number2 ?? 0) != 0)
{
var detail = new Tuple<long, long, string, int>(item.Sanction_ID2, item.AbnormalItem_ID2, item.AbnormalItem_Name2, item.Number2.Value);
result.Add(detail);
}
if (item.Sanction_ID3 == 0)
break;
if (item.Number3.HasValue)
if ((item.Number3 ?? 0) != 0)
{
var detail = new Tuple<long, long, string, int>(item.Sanction_ID3, item.AbnormalItem_ID3, item.AbnormalItem_Name3, item.Number3.Value);
result.Add(detail);


+ 1
- 19
QualityAndOrder/QualityOrderFormForTab2.cs View File

@ -117,16 +117,13 @@ namespace QualityAndOrder
{
while (true)
{
if (orderList == null || needOrderList == null)
if (orderList == null)
{
Thread.Sleep(5000);
continue;
}
bool orderChange = false;
bool needListChange = false;
var ids = orderList.Where(x => x.B3WeighBill_ID == null).Select(x => (long?)x.WeightBill_ID).Distinct().ToList();
var needOrderIds = needOrderList.Where(x => x.B3ID == null).Select(x => (long?)x.WeightBill_ID);
ids.AddRange(needOrderIds.Except(ids));
if (ids.Any())
{
var result = WeightBillRpc.SyncBillB3Ids(ids);
@ -139,14 +136,6 @@ namespace QualityAndOrder
if (!orderChange)
orderChange = true;
}
var rFirst = needOrderList.FirstOrDefault(x => x.WeightBill_ID == item.Item1);
if (rFirst != null)
{
rFirst.B3ID = item.Item2;
if (!needListChange)
needListChange = true;
}
}
}
if (orderChange)
@ -156,13 +145,6 @@ namespace QualityAndOrder
orderGrid.Refresh();
}));
}
if (needListChange)
{
this.Invoke(new InvokeHandler(delegate()
{
preOrderGrid.Refresh();
}));
}
Thread.Sleep(5000);
}
}


BIN
Setup/Release/Setup.msi View File


Loading…
Cancel
Save