|
|
|
@ -131,7 +131,7 @@ namespace ButcherFactory.SegmentProductionAuto_ |
|
|
|
var arr = goodsSetDic[groupBtn.Text]; |
|
|
|
foreach (var item in arr) |
|
|
|
{ |
|
|
|
var btn = new ColorButton() { Width = 127, Height = 75, Text = item.Goods_Name, Tag = item, Font = new Font("宋体", 15), BackColor = goodsColor, Margin = new Padding(20, 10, 20, 35), PlaySound = true }; |
|
|
|
var btn = new ColorButton() { Width = 140, Height = 90, Text = item.Goods_Name, Tag = item, Font = new Font("黑体", 15, FontStyle.Bold), BackColor = Color.Black, Margin = new Padding(20, 10, 20, 35), PlaySound = true, ForeColor = Color.White }; |
|
|
|
btn.Click += GoodsBtnClick; |
|
|
|
flowLayoutPanel2.Controls.Add(btn); |
|
|
|
} |
|
|
|
@ -152,7 +152,13 @@ namespace ButcherFactory.SegmentProductionAuto_ |
|
|
|
throw new Exception(string.Format("重量必须在{0:#0.######}-{1:#0.######}之间", detail.StandardWeightLow, detail.StandardWeightUp)); |
|
|
|
weight = detail.StandardWeight.Value; |
|
|
|
} |
|
|
|
var entity = SegmentProductionBL.InsertAndSetGroupID(detail.Goods_ID, weight, config.WorkUnitID, batchID.Value, batchDate.Value, testCkBox.Checked); |
|
|
|
var entity = new SegmentProduction(); |
|
|
|
entity.Goods_ID = detail.Goods_ID; |
|
|
|
entity.Weight = weight; |
|
|
|
entity.WorkUnit_ID = config.WorkUnitID; |
|
|
|
entity.ProductBatch_ID = batchID.Value; |
|
|
|
entity.StandardPic = detail.StandardPic; |
|
|
|
SegmentProductionBL.InsertAndSetGroupID(entity, batchDate.Value, testCkBox.Checked); |
|
|
|
entity.Goods_Code = detail.Goods_Code; |
|
|
|
entity.Goods_Name = detail.Goods_Name; |
|
|
|
entity.Goods_Spec = detail.Goods_Spec; |
|
|
|
@ -182,10 +188,10 @@ namespace ButcherFactory.SegmentProductionAuto_ |
|
|
|
|
|
|
|
void RefreshTask(object obj) |
|
|
|
{ |
|
|
|
var entity = obj as SegmentProduction; |
|
|
|
taskDataGrid.DataSource = SegmentProductionBL.GetProductTask(batchDate ?? DateTime.Today, entity); |
|
|
|
this.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
var entity = obj as SegmentProduction; |
|
|
|
taskDataGrid.DataSource = SegmentProductionBL.GetProductTask(batchDate ?? DateTime.Today, entity); |
|
|
|
taskDataGrid.Refresh(); |
|
|
|
})); |
|
|
|
} |
|
|
|
@ -207,11 +213,11 @@ namespace ButcherFactory.SegmentProductionAuto_ |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
this.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
if (netStateWatch1.NetState) |
|
|
|
SegmentProductionBL.UploadSegmentInfo(); |
|
|
|
})); |
|
|
|
//this.Invoke(new Action(() =>
|
|
|
|
//{
|
|
|
|
if (netStateWatch1.NetState) |
|
|
|
SegmentProductionBL.UploadSegmentInfo(); |
|
|
|
//}));
|
|
|
|
} |
|
|
|
catch { } |
|
|
|
Thread.Sleep(2000); |
|
|
|
@ -224,25 +230,25 @@ namespace ButcherFactory.SegmentProductionAuto_ |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
this.Invoke(new Action(() => |
|
|
|
if (netStateWatch1.NetState) |
|
|
|
{ |
|
|
|
if (netStateWatch1.NetState) |
|
|
|
if (historyList.Any()) |
|
|
|
{ |
|
|
|
if (historyList.Any()) |
|
|
|
var arr = historyList.Reverse().Take(20).ToList(); |
|
|
|
var inStored = SegmentProductionBL.GetInStoreState(arr.Select(x => x.BarCode).ToList()); |
|
|
|
var tag = arr.Where(x => inStored.Contains(x.BarCode)); |
|
|
|
if (tag.Any()) |
|
|
|
{ |
|
|
|
var arr = historyList.Reverse().Take(20).ToList(); |
|
|
|
var inStored = SegmentProductionBL.GetInStoreState(arr.Select(x => x.BarCode).ToList()); |
|
|
|
var tag = arr.Where(x => inStored.Contains(x.BarCode)); |
|
|
|
if (tag.Any()) |
|
|
|
SegmentProductionBL.SetInStored(tag.Select(x => x.ID).ToList()); |
|
|
|
this.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
SegmentProductionBL.SetInStored(tag.Select(x => x.ID).ToList()); |
|
|
|
foreach (var item in tag) |
|
|
|
historyList.Remove(item); |
|
|
|
historyDataGrid.Refresh(); |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
} |
|
|
|
})); |
|
|
|
} |
|
|
|
} |
|
|
|
catch { } |
|
|
|
Thread.Sleep(5000); |
|
|
|
|