修正自动标签代码

This commit is contained in:
anerx 2025-03-27 11:24:42 +08:00
parent 872c678b10
commit ea434ac8b9
3 changed files with 28 additions and 9 deletions

View File

@ -9,25 +9,32 @@ public class LabelResult
public string BE_ID { get; set; } = "2240";
public string BAR_CODE { get; set; } = "";
public string ITEM_CODE { get; set; } = "";
public string LABEL_ID { get; set; } = "";
public string LABEL_ID { get; set; } = "TY_CN_PRODUCT";
public string WMS_UOM { get; set; } = "";
public string ERP_UOM { get; set; } = "";
public string MFG_DATE { get; set; } = "";
public decimal NET_WEIGHT { get; set; } = 0;
public decimal GROSS_WEIGHT { get; set; } = 0;
public string MFG_LINE { get; set; } = "";
public string MFG_LINE { get; set; } = "TYJP11";
public string GRADE { get; set; } = "";
public string LOT { get; set; } = "";
public string BOX_NO { get; set; } = "";
// public string DENIER { get; set; } = "";
// public string FILA { get; set; } = "";
// public string DENIER { get; set; } = "";
// public string FILA { get; set; } = "";
public string CUSTOMER_NAME { get; set; } = "";
// public string REMARKS { get; set; } = "";
// public string TRI_INTERFACE_YN { get; set; } = "";
public string TRI_TYPE { get; set; } = "zp10";
// public string REMARKS { get; set; } = "";
// public string TRI_INTERFACE_YN { get; set; } = "";
public string TRI_TYPE { get; set; } = "ZP10";
public string COMMON_S1 { get; set; } = "";
public string COMMON_S2 { get; set; } = "";
public string COMMON_S3 { get; set; } = "";
public string COMMON_S4 { get; set; } = "";
public string COMMON_S5 { get; set; } = "";
//public string COMMON_S4 { get; set; } = "";
//public string COMMON_S5 { get; set; } = "";
//public string COMMON_N1 { get; set; } = "";
@ -36,6 +43,8 @@ public class LabelResult
public string CREATED_ON { get; set; } = DateTime.Now.ToString("yyyy-MM-dd");
public string MODIFIED_BY { get; set; } = "seyounth";
public string MODIFIED_ON { get; set; } = DateTime.Now.ToString("yyyy-MM-dd");
public double COMMON_N1 { get; set; } = 0;
public LabelResult(Tray tray, Variety variety)
{
@ -43,7 +52,7 @@ public class LabelResult
BE_ID = "2240";
BAR_CODE = tray.Barcode ?? "";
ITEM_CODE = variety.Code;
MFG_DATE = DateTime.Now.ToString("yyyy-MM-dd");
MFG_DATE = DateTime.Now.ToString("yyyyMMdd");
NET_WEIGHT = (decimal)tray.NetWeight;
GROSS_WEIGHT = (decimal)tray.GrossWeight;
GRADE = tray.Grade ?? "";
@ -51,7 +60,14 @@ public class LabelResult
BOX_NO = $"{DateTime.Now.ToString("yyMMdd" + "J") + tray.ControlNo.ToString()?.PadLeft(3, '0')}";
CREATED_BY = "seyounth";
CREATED_ON = DateTime.Now.ToString("yyyy-MM-dd");
COMMON_S1 = tray.Type?? "";
COMMON_S2 = variety.TotalCount.ToString();
COMMON_S3=tray.DenFila?? "";
COMMON_S4 = tray.DtexFila?? "";
COMMON_S5 = "0";
COMMON_N1 = (double)tray.ControlNo;
MODIFIED_BY = "seyounth";
MODIFIED_ON = DateTime.Now.ToString("yyyy-MM-dd");
}
public LabelResult()

View File

@ -97,8 +97,10 @@ public class HyosungWmsService : IHyosungWmsService
&& t.ITEM_CODE_TYPE == "FERT");
result.WMS_UOM = mst_item.WMS_UOM_ID;
result.ERP_UOM = mst_item.ERP_UOM_ID;
var workCenter = await _db.Queryable<MST_ITEM_VERSION>()
.FirstAsync(v => v.ITEM_CODE == result.ITEM_CODE);
result.MFG_LINE=(workCenter?.WORK_CENTER)??"TYJP11";
await _db.Insertable(result).ExecuteCommandAsync();
}catch(Exception e)
{

View File

@ -422,9 +422,10 @@ public class HyosungRuntime(
{
await printer.PrintAsync(2, tray.TrayCode);
await hyosungPlcService.WritePrintLabelResultAsync(arg1, true);
var version=await hyosungWmsService.GetItemInfoByItemCode(variety.Code);
// await varietyService.SetLastNo(variety.Id, tray.ControlNo.Value);
//await hyosungWmsService.UpdateControlNo(variety, tray.ControlNo.Value);
// await hyosungWmsService.AddLabelResult(new LabelResult(tray, variety));
await hyosungWmsService.AddLabelResult(new LabelResult(tray, variety));
}
logger.LogInformation($"plc request print label success");