修复BUG

This commit is contained in:
zhangzhuo 2025-03-26 15:02:43 +08:00
parent e06cf5cba4
commit e3e12cb62b
2 changed files with 35 additions and 25 deletions

View File

@ -132,23 +132,23 @@ public class HyosungPlcService(ILogger<HyosungPlcService> logger) : IHyosungPlcS
switch (slave)
{
case 0:
masterCount = 1;
slaveCount = 1;
break;
case 1:
masterCount = 2;
slaveCount = 2;
break;
case 2:
masterCount = 6;
slaveCount = 6;
break;
case 3:
masterCount = 14;
slaveCount = 14;
break;
case 4:
masterCount = 30;
slaveCount = 30;
break;
}
await _writer.WriteShortsAsync(13050, [1, 1, slaveCount, masterCount]);
await _writer.WriteShortsAsync(13050, [1, 1, 1, masterCount]);
}
public async Task WritePrintLabelResultAsync(int index, bool result)

View File

@ -365,25 +365,35 @@ public class HyosungRuntime(
private async Task OnRequestGetPrintLabel(string arg)
{
currentPrintTrayCode = arg;
var tray = await trayService.GetByCode(arg);
var variety = await varietyService.GetById(tray.VarietyId);
var mod = await hyosungWmsService.GetItemInfoByItemCode(variety.Code);
// var grade = "1";
// if (mod.GRADE != "AA") grade = mod.GRADE;
// int? controlNo;
// if (tray.ControlNo is null || tray.ControlNo == 0)
// {
// controlNo = await varietyService.GetLastNo(variety.Id);
// if (controlNo is null)
// controlNo = await hyosungWmsService.GetControlNo(variety, grade);
// else
// controlNo += 1;
//
// }
tray = await trayService.PrintTrayAsync(arg, mod,variety);
await dictService.SetValue("System", "CurrentPackingTrayCode", arg);
await hyosungPlcService.WritePrintLableOptionsAsync(variety.MasterLabelCount,variety.SubLabelCount);
try
{
logger.LogInformation("request print option");
currentPrintTrayCode = arg;
var tray = await trayService.GetByCode(arg);
var variety = await varietyService.GetById(tray.VarietyId);
var mod = await hyosungWmsService.GetItemInfoByItemCode(variety.Code);
// var grade = "1";
// if (mod.GRADE != "AA") grade = mod.GRADE;
// int? controlNo;
// if (tray.ControlNo is null || tray.ControlNo == 0)
// {
// controlNo = await varietyService.GetLastNo(variety.Id);
// if (controlNo is null)
// controlNo = await hyosungWmsService.GetControlNo(variety, grade);
// else
// controlNo += 1;
//
// }
tray = await trayService.PrintTrayAsync(arg, mod, variety);
await dictService.SetValue("System", "CurrentPackingTrayCode", arg);
await hyosungPlcService.WritePrintLableOptionsAsync(variety.MasterLabelCount, variety.SubLabelCount);
logger.LogInformation("request print option succeed");
}
catch(Exception e)
{
logger.LogError(e, "GetPrintOptionError");
}
}
/// <summary>