diff --git a/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs b/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs index 6e5ddec..95a1fee 100644 --- a/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs +++ b/ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs @@ -51,11 +51,7 @@ namespace ButcherFactory.BO [ReferenceTo(typeof(Goods), "EachNumber")] [Join("Goods_ID", "ID")] - public int? EachNumber { get; set; } - - [ReferenceTo(typeof(Goods), "NoTotalCode")] - [Join("Goods_ID", "ID")] - public bool? NoTotalCode { get; set; } + public int? EachNumber { get; set; } public decimal? StandardWeight { get; set; } @@ -64,7 +60,10 @@ namespace ButcherFactory.BO public decimal? StandardWeightLow { get; set; } [DbColumn(DefaultValue = 0)] - public bool StandardPic { get; set; } + public bool StandardPic { get; set; } + + [DbColumn(DefaultValue = 0)] + public bool NoTotalCode { get; set; } [NonDmoProperty] public bool Selected { get; set; } diff --git a/ButcherFactory.BO/Bill/SegmentProduction.cs b/ButcherFactory.BO/Bill/SegmentProduction.cs index 021b25a..ae165af 100644 --- a/ButcherFactory.BO/Bill/SegmentProduction.cs +++ b/ButcherFactory.BO/Bill/SegmentProduction.cs @@ -63,9 +63,8 @@ namespace ButcherFactory.BO [Join("Goods_ID", "ID")] public short? GoodsType { get; set; } - [ReferenceTo(typeof(Goods), "NoTotalCode")] - [Join("Goods_ID", "ID")] - public bool? NoTotalCode { get; set; } + [DbColumn(DefaultValue = 0)] + public bool NoTotalCode { get; set; } public long? GroupID { get; set; } diff --git a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs index cb09521..c065bfc 100644 --- a/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentProductionBL.cs @@ -38,7 +38,8 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("TotalCode_ID")); query.Columns.Add(DQSelectColumn.Field("TotalCode_Code")); query.Columns.Add(DQSelectColumn.Field("CreateTime")); - query.Columns.Add(DQSelectColumn.Field("GoodsType")); + query.Columns.Add(DQSelectColumn.Field("GoodsType")); + query.Columns.Add(DQSelectColumn.Field("NoTotalCode")); query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("InStored", false), DQCondition.EQ("Delete", false), DQCondition.EQ("Submited", submited))); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); if (submited) @@ -72,6 +73,7 @@ namespace ButcherFactory.BO.LocalBL entity.TotalCode_Code = (string)reader[14]; entity.CreateTime = (DateTime)reader[15]; entity.GoodsType = (short?)reader[16]; + entity.NoTotalCode = (bool)reader[17]; list.Add(entity); } } @@ -159,7 +161,7 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("NoTotalCode")); query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("CreateTime", date.Date)); query.Where.Conditions.Add(DQCondition.LessThan("CreateTime", date.Date.AddDays(1))); - query.Where.Conditions.Add(DQCondition.And( DQCondition.EQ("Delete", false) )); + query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Delete", false) )); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("GoodsType")); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("NoTotalCode", true)); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID",true)); @@ -522,6 +524,7 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("MsgID")); query.Columns.Add(DQSelectColumn.Field("StatisticNumber")); query.Columns.Add(DQSelectColumn.Field("TotalCode_Code")); + query.Columns.Add(DQSelectColumn.Field("NoTotalCode")); query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Submited", true), DQCondition.EQ("Sync", false), DQCondition.EQ("Delete", false))); query.Where.Conditions.Add(DQCondition.LessThan("CreateTime", DateTime.Now.AddMinutes(-1))); query.Range = SelectRange.Top(10); @@ -547,6 +550,7 @@ namespace ButcherFactory.BO.LocalBL obj.MsgID = (string)reader[11]; obj.StatisticNumber = (decimal?)reader[12]; obj.TotalCode_Code = (string)reader[13]; + obj.NoTotalCode = (bool)reader[14]; upload.Add(obj); } } @@ -681,7 +685,8 @@ namespace ButcherFactory.BO.LocalBL public bool StandardPic { get; set; } public string MsgID { get; set; } public decimal? StatisticNumber { get; set; } - public string TotalCode_Code { get; set; } + public string TotalCode_Code { get; set; } + public bool NoTotalCode { get; set; } } class TaskTemp diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs index d15874d..fecedae 100644 --- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs +++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs @@ -366,12 +366,12 @@ namespace ButcherFactory.SegmentProductionAuto_ rebuild = true; } } - else if (entity.GoodsType == 1 && entity.NoTotalCode == true) + else if (entity.GoodsType == 1 && entity.NoTotalCode) { entity.TotalCode_ID = _stayTotalCode.ID; thisTotal = _stayTotalCode; thisPanel = _stayPanel; - if (_totalCode.GoodsType != 1 || _totalCode.NoTotalCode != true) + if (_totalCode.GoodsType != 1 || !_totalCode.NoTotalCode) { foreach (var bt in codeButtons) { @@ -524,7 +524,7 @@ namespace ButcherFactory.SegmentProductionAuto_ flowLayoutPanel4.Controls.Clear(); foreach (var item in allCode) { - if (item.GoodsType == 0 || (item.GoodsType == 1 && item.NoTotalCode == true)) + if (item.GoodsType == 0 || (item.GoodsType == 1 && item.NoTotalCode)) { } @@ -612,7 +612,7 @@ namespace ButcherFactory.SegmentProductionAuto_ } continue; } - else if (d.GoodsType == 1 && d.NoTotalCode == true)//暂存区不删除总码 + else if (d.GoodsType == 1 && d.NoTotalCode)//暂存区不删除总码 { if (_stayPanel != null) { @@ -758,7 +758,7 @@ namespace ButcherFactory.SegmentProductionAuto_ MessageBox.Show("鲜品总码不允许删除"); return; } - else if (_totalCode.GoodsType == 1 && _totalCode.NoTotalCode == true) + else if (_totalCode.GoodsType == 1 && _totalCode.NoTotalCode) { MessageBox.Show("暂存区总码不允许删除"); return; @@ -881,7 +881,7 @@ namespace ButcherFactory.SegmentProductionAuto_ n.Text = "鲜品"; _freshPanel = n; } - else if (tCode.GoodsType == 1 && tCode.NoTotalCode == true) + else if (tCode.GoodsType == 1 && tCode.NoTotalCode) { n.Text = "暂存区"; _stayPanel = n;