yibo 5 years ago
parent
commit
8431c57eac
3 changed files with 358 additions and 284 deletions
  1. +10
    -0
      ButcherFactory.BO/LocalBL/SegmentProductionBL.cs
  2. +6
    -2
      ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs
  3. +342
    -282
      ButcherFactorySolution/ButcherFactorySolution.vdproj

+ 10
- 0
ButcherFactory.BO/LocalBL/SegmentProductionBL.cs View File

@ -30,6 +30,7 @@ namespace ButcherFactory.BO.LocalBL
query.Columns.Add(DQSelectColumn.Field("TrunOutID"));
query.Columns.Add(DQSelectColumn.Field("Goods_Spec"));
query.Columns.Add(DQSelectColumn.Field("StandardPic"));
query.Columns.Add(DQSelectColumn.Field("Goods_ID"));
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)
@ -54,6 +55,7 @@ namespace ButcherFactory.BO.LocalBL
entity.TrunOutID = (long?)reader[6];
entity.Goods_Spec = (string)reader[7];
entity.StandardPic = (bool)reader[8];
entity.Goods_ID = (long)reader[9];
entity.Submited = submited;
list.Add(entity);
}
@ -63,6 +65,14 @@ namespace ButcherFactory.BO.LocalBL
return list;
}
public static short? GetGoodsType(long goodsID)
{
var query = new DQueryDom(new JoinAlias(typeof(Goods)));
query.Where.Conditions.Add(DQCondition.EQ("ID", goodsID));
query.Columns.Add(DQSelectColumn.Field("GoodsType"));
return query.EExecuteScalar<short?>();
}
public static SegmentProduction Insert(long goodsID, decimal weight, long? workUnitID, long productBatchID, DateTime batchDate)
{
using (var session = DmoSession.New())


+ 6
- 2
ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs View File

@ -322,8 +322,12 @@ namespace ButcherFactory.SegmentProductionAuto_
if (row.Count > 0)
item = row[0].DataBoundItem as SegmentProduction;
else
item = historyList.First();
NotAuto.SegmentProductionPrint.Print(item, batchDate, config.Template);
item = historyList.First();
var template = config.Template;
var goodsType = SegmentProductionBL.GetGoodsType(item.Goods_ID);
if (goodsType.HasValue)
template = goodsType == 0 ? "SegmentProductionPrint.html" : "SegmentProductionPrint1.html";
NotAuto.SegmentProductionPrint.Print(item, batchDate, template);
var log = new SegmentLog(item.BarCode, "补打");
log.Message = string.Format("存货名称:{0} 重量:{1:#0.###}", item.Goods_Name, item.Weight);
SegmentProductionBL.InsertLog(log);


+ 342
- 282
ButcherFactorySolution/ButcherFactorySolution.vdproj
File diff suppressed because it is too large
View File


Loading…
Cancel
Save