Browse Source

需求单No.163866 1、鲜品【分割品客户端】打印的标签中的【执行标准】取MES【存货档案】中【自定义执行标准】。

master
yibo 3 years ago
parent
commit
670bcc2f96
6 changed files with 16 additions and 20 deletions
  1. +4
    -0
      ButcherFactory.BO/Bill/SegmentProduction.cs
  2. +3
    -1
      ButcherFactory.BO/LocalBL/SegmentProductionBL.cs
  3. +4
    -11
      ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs
  4. +3
    -6
      ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs
  5. +1
    -1
      ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html
  6. +1
    -1
      ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html

+ 4
- 0
ButcherFactory.BO/Bill/SegmentProduction.cs View File

@ -62,6 +62,10 @@ namespace ButcherFactory.BO
[ReferenceTo(typeof(Goods), "GoodsType")]
[Join("Goods_ID", "ID")]
public short? GoodsType { get; set; }
[ReferenceTo(typeof(Goods), "CustomerDefine")]
[Join("Goods_ID", "ID")]
public string Goods_CustomerDefine { get; set; }
[DbColumn(DefaultValue = 0)]
public bool NoTotalCode { get; set; }


+ 3
- 1
ButcherFactory.BO/LocalBL/SegmentProductionBL.cs View File

@ -40,7 +40,8 @@ namespace ButcherFactory.BO.LocalBL
query.Columns.Add(DQSelectColumn.Field("CreateTime"));
query.Columns.Add(DQSelectColumn.Field("GoodsType"));
query.Columns.Add(DQSelectColumn.Field("NoTotalCode"));
query.Columns.Add(DQSelectColumn.Field("Identify"));
query.Columns.Add(DQSelectColumn.Field("Identify"));
query.Columns.Add(DQSelectColumn.Field("Goods_CustomerDefine"));
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)
@ -76,6 +77,7 @@ namespace ButcherFactory.BO.LocalBL
entity.GoodsType = (short?)reader[16];
entity.NoTotalCode = (bool)reader[17];
entity.Identify = (string)reader[18];
entity.Goods_CustomerDefine = (string)reader[19];
list.Add(entity);
}
}


+ 4
- 11
ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs View File

@ -457,6 +457,7 @@ namespace ButcherFactory.SegmentProductionAuto_
entity.Goods_Spec = detail.Goods_Spec;
entity.MainUnit = detail.MainUnit;
entity.ShotPrintName = detail.ShotPrintName;
entity.Goods_CustomerDefine = detail.Goods_CustomerDefine;
if (rebuild)
{
BindflowLayoutPanel(thisPanel, thisTotal);
@ -474,18 +475,14 @@ namespace ButcherFactory.SegmentProductionAuto_
if (barPrintCheck.Checked)
{
var template = config.Template;
string cd = null;
if (detail.GoodsType.HasValue)
{
if (detail.GoodsType == 0)
template = "SegmentProductionPrint.html";
else
{
cd = detail.Goods_CustomerDefine;
template = "SegmentProductionPrint1.html";
}
}
NotAuto.SegmentProductionPrint.Print(entity, batchDate, template, cd);
NotAuto.SegmentProductionPrint.Print(entity, batchDate, template);
var log = new SegmentLog(entity.BarCode, "打印");
log.Message = string.Format("存货名称:{0} 重量:{1:#0.###}", entity.Goods_Name, entity.Weight);
SegmentProductionBL.InsertLog(log);
@ -779,18 +776,14 @@ namespace ButcherFactory.SegmentProductionAuto_
item = historyList.First();
var template = config.Template;
var goodsInfo = SegmentProductionBL.GetGoodsInfo(item.Goods_ID);
string cd = null;
if (goodsInfo != null && goodsInfo.Item1.HasValue)
{
if (goodsInfo.Item1 == 0)
template = "SegmentProductionPrint.html";
else
{
cd = goodsInfo.Item2;
template = "SegmentProductionPrint1.html";
}
template = "SegmentProductionPrint1.html";
}
NotAuto.SegmentProductionPrint.Print(item, batchDate, template, cd);
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);


+ 3
- 6
ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs View File

@ -16,15 +16,11 @@ namespace ButcherFactory.SegmentProduction_
const string PRINTFILE = @"PrintTemplate\";
const string ENDFILE = @"PrintTemplate\SegmentProductionPrintEnd.html";
const string IMGFILE = @"TempImg\_img{0}.png";
static string CustomerDefine =null;
public static void Print(SegmentProduction entity, DateTime? dt, string template, string customerDefine)
static string CustomerDefine = "GB/T9959.2-2008";
public static void Print(SegmentProduction entity, DateTime? dt, string template)
{
if (AppContext.ConnectInfo.TraceBackUrl == "default")
throw new Exception("请先配置追溯服务器地址");
if (string.IsNullOrEmpty(CustomerDefine) && File.Exists(@"PrintTemplate\CustomerDefine.txt"))
{
CustomerDefine = File.ReadAllText(@"PrintTemplate\CustomerDefine.txt");
}
if (dt == null)
dt = DateTime.Today;
var dic = new Dictionary<string, string>();
@ -37,6 +33,7 @@ namespace ButcherFactory.SegmentProduction_
info = string.Format("重量:{0:#0.##}{1}", entity.Weight, entity.MainUnit);
dic.Add("$Info", info);
dic.Add("$Date", dt.Value.ToString("yyyy/MM/dd"));
var customerDefine = entity.Goods_CustomerDefine;
if (string.IsNullOrEmpty(customerDefine))
customerDefine = CustomerDefine;
dic.Add("$CustomerDefine", customerDefine);


+ 1
- 1
ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html View File

@ -18,7 +18,7 @@
<div style='font-size:15px;'>品名:$Goods_Name</div>
<div style='margin-top:10px;font-size:14px;'>$Info &nbsp;生产日期:$Date</div>
<table align='center' style='width:100%;margin-top:5px;border-collapse:collapse;border-width:1px;'>
<tr><td>执行标准:</td><td>GB/T9959.2-2008</td><td rowspan='6'><img src='$ImageUrl' style='margin:-5px 0px -5px 20px;' /></td></tr>
<tr><td>执行标准:</td><td>$CustomerDefine</td><td rowspan='6'><img src='$ImageUrl' style='margin:-5px 0px -5px 20px;' /></td></tr>
<tr><td>储存条件:</td><td>0~4℃保存</td></tr>
<tr><td>保 质 期:</td><td>7天</td></tr>
<tr><td>生产厂家:</td><td colspan='2'>青岛万福集团股份有限公司</td></tr>


+ 1
- 1
ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html View File

@ -18,7 +18,7 @@
<div style='font-size:15px;'>品名:$Goods_Name</div>
<div style='margin-top:10px;font-size:14px;'>$Info &nbsp;生产日期:$Date</div>
<table align='center' style='width:100%;margin-top:5px;border-collapse:collapse;border-width:1px;'>
<tr><td>执行标准:</td><td>GB/T9959.2-2008</td><td rowspan='6'><img src='$ImageUrl' style='margin:-5px 0px -5px 20px;' /></td></tr>
<tr><td>执行标准:</td><td>$CustomerDefine</td><td rowspan='6'><img src='$ImageUrl' style='margin:-5px 0px -5px 20px;' /></td></tr>
<tr><td>储存条件:</td><td>-18℃以下保存</td></tr>
<tr><td>保 质 期:</td><td>18个月</td></tr>
<tr><td>生产厂家:</td><td colspan='2'>青岛万福集团股份有限公司</td></tr>


Loading…
Cancel
Save