Browse Source

默认执行标准

master
yibo 4 years ago
parent
commit
092c8d80dd
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.cs

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

@ -16,10 +16,15 @@ 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)
{
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>();
@ -33,7 +38,7 @@ namespace ButcherFactory.SegmentProduction_
dic.Add("$Info", info);
dic.Add("$Date", dt.Value.ToString("yyyy/MM/dd"));
if (string.IsNullOrEmpty(customerDefine))
customerDefine = "GB/T9959.2-2008";
customerDefine = CustomerDefine;
dic.Add("$CustomerDefine", customerDefine);
var code = entity.BarCode;
if (code.Length > 17)


Loading…
Cancel
Save