|
|
@ -87,8 +87,8 @@ namespace ButcherFactory.SegmentProductionAuto_ |
|
|
uploadData.Abort(); |
|
|
uploadData.Abort(); |
|
|
if (checkInStoreState != null && checkInStoreState.IsAlive) |
|
|
if (checkInStoreState != null && checkInStoreState.IsAlive) |
|
|
checkInStoreState.Abort(); |
|
|
checkInStoreState.Abort(); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
WeightDetails mCache; |
|
|
protected override void OnLoad(EventArgs e) |
|
|
protected override void OnLoad(EventArgs e) |
|
|
{ |
|
|
{ |
|
|
base.OnLoad(e); |
|
|
base.OnLoad(e); |
|
|
@ -98,8 +98,27 @@ namespace ButcherFactory.SegmentProductionAuto_ |
|
|
checkInStoreState = new Thread(CheckInStored); |
|
|
checkInStoreState = new Thread(CheckInStored); |
|
|
checkInStoreState.Start(); |
|
|
checkInStoreState.Start(); |
|
|
|
|
|
|
|
|
uploadData = new Thread(UpLoadLocalData); |
|
|
|
|
|
uploadData.Start(); |
|
|
|
|
|
|
|
|
uploadData = new Thread(UpLoadLocalData); |
|
|
|
|
|
uploadData.Start(); |
|
|
|
|
|
mCache = XmlUtil.DeserializeFromFile<WeightDetails>(); |
|
|
|
|
|
var del = new List<long>(); |
|
|
|
|
|
if (mCache.Cache == null) |
|
|
|
|
|
{ |
|
|
|
|
|
mCache.Cache = new Dictionary<long, List<decimal>>(); |
|
|
|
|
|
} |
|
|
|
|
|
foreach (var item in mCache.Cache) |
|
|
|
|
|
{ |
|
|
|
|
|
if (item.Value == null || item.Value.Count == 0) |
|
|
|
|
|
{ |
|
|
|
|
|
del.Add(item.Key); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
foreach (var v in del) |
|
|
|
|
|
{ |
|
|
|
|
|
mCache.Cache.Remove(v); |
|
|
|
|
|
} |
|
|
|
|
|
wDic = mCache.Cache; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void LoadBind() |
|
|
void LoadBind() |
|
|
@ -183,12 +202,24 @@ namespace ButcherFactory.SegmentProductionAuto_ |
|
|
if ((item.EachNumber ?? 0) > 0) |
|
|
if ((item.EachNumber ?? 0) > 0) |
|
|
{ |
|
|
{ |
|
|
bTag.Label.MaxCount = item.EachNumber.Value; |
|
|
bTag.Label.MaxCount = item.EachNumber.Value; |
|
|
bTag.Label.Text = string.Format("{0}-0", item.EachNumber.Value); |
|
|
|
|
|
|
|
|
if (wDic.ContainsKey(item.Goods_ID)) |
|
|
|
|
|
{ |
|
|
|
|
|
var l = wDic[item.Goods_ID]; |
|
|
|
|
|
bTag.Label.Text = string.Format("{0}-{1}", item.EachNumber.Value, l.Count); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
bTag.Label.Text = string.Format("{0}-0", item.EachNumber.Value); |
|
|
|
|
|
} |
|
|
bTag.Button.Click += delegate |
|
|
bTag.Button.Click += delegate |
|
|
{ |
|
|
{ |
|
|
if (batchID == null) |
|
|
if (batchID == null) |
|
|
throw new Exception("请先选择批次"); |
|
|
throw new Exception("请先选择批次"); |
|
|
var weight = uWeightControl1.Weight; |
|
|
|
|
|
|
|
|
var weight = uWeightControl1.Weight; |
|
|
|
|
|
//#if DEBUG
|
|
|
|
|
|
// if (weight == 0)
|
|
|
|
|
|
// weight = (item.StandardWeightLow ?? 4.0m) + 0.1m;
|
|
|
|
|
|
//#endif
|
|
|
if (weight == 0) |
|
|
if (weight == 0) |
|
|
throw new Exception("重量不能为0"); |
|
|
throw new Exception("重量不能为0"); |
|
|
if (item.StandardWeight.HasValue) |
|
|
if (item.StandardWeight.HasValue) |
|
|
@ -217,6 +248,8 @@ namespace ButcherFactory.SegmentProductionAuto_ |
|
|
weight = l.Sum(x => x); |
|
|
weight = l.Sum(x => x); |
|
|
InsertSegmentProduction(item, weight); |
|
|
InsertSegmentProduction(item, weight); |
|
|
} |
|
|
} |
|
|
|
|
|
mCache.Cache = wDic; |
|
|
|
|
|
XmlUtil.SerializerObjToFile(mCache); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
bTag.Label.Click += delegate |
|
|
bTag.Label.Click += delegate |
|
|
@ -256,6 +289,10 @@ namespace ButcherFactory.SegmentProductionAuto_ |
|
|
var btn = sender as ColorButton; |
|
|
var btn = sender as ColorButton; |
|
|
var detail = btn.Tag as ClientGoodsSet_Detail; |
|
|
var detail = btn.Tag as ClientGoodsSet_Detail; |
|
|
var weight = uWeightControl1.Weight; |
|
|
var weight = uWeightControl1.Weight; |
|
|
|
|
|
//#if DEBUG
|
|
|
|
|
|
// if (weight == 0)
|
|
|
|
|
|
// weight = (detail.StandardWeightLow ?? 4.0m) + 0.1m;
|
|
|
|
|
|
//#endif
|
|
|
if (weight == 0) |
|
|
if (weight == 0) |
|
|
throw new Exception("重量不能为0"); |
|
|
throw new Exception("重量不能为0"); |
|
|
if (detail.StandardWeight.HasValue) |
|
|
if (detail.StandardWeight.HasValue) |
|
|
|