diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IQrPrintService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IWorklineCommService.cs
similarity index 83%
rename from ProductionMgr/Tnb.ProductionMgr.Interfaces/IQrPrintService.cs
rename to ProductionMgr/Tnb.ProductionMgr.Interfaces/IWorklineCommService.cs
index 5ef9e4a6..a32b2420 100644
--- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IQrPrintService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IWorklineCommService.cs
@@ -5,7 +5,7 @@ namespace Tnb.ProductionMgr.Interfaces
///
/// 工单生成
///
- public interface IQrPrintService
+ public interface IWorklineCommService
{
Task GetCartonQrcode(string workline);
}
diff --git a/ProductionMgr/Tnb.ProductionMgr/QrPrintService.cs b/ProductionMgr/Tnb.ProductionMgr/WorklineCommService.cs
similarity index 84%
rename from ProductionMgr/Tnb.ProductionMgr/QrPrintService.cs
rename to ProductionMgr/Tnb.ProductionMgr/WorklineCommService.cs
index ce19eacd..ac7ba7c1 100644
--- a/ProductionMgr/Tnb.ProductionMgr/QrPrintService.cs
+++ b/ProductionMgr/Tnb.ProductionMgr/WorklineCommService.cs
@@ -29,18 +29,18 @@ using Tnb.ProductionMgr.Interfaces;
namespace Tnb.ProductionMgr;
///
-/// 外包装线条码打印接口
+/// 产线自动化通信接口
///
[ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 704)]
[Route("api/produce")]
-public class QrPrintService : IQrPrintService, IDynamicApiController, ITransient
+public class WorklineCommService : IWorklineCommService, IDynamicApiController, ITransient
{
private readonly ISqlSugarRepository _repository;
private readonly IDataBaseManager _dataBaseManager;
private readonly IUserManager _userManager;
private readonly IDictionaryDataService _dictionaryDataService;
- public QrPrintService(
+ public WorklineCommService(
ISqlSugarRepository repository,
IDataBaseManager dataBaseManager,
IUserManager userManager,
@@ -55,7 +55,7 @@ public class QrPrintService : IQrPrintService, IDynamicApiController, ITransient
- #region Get
+ #region 外包装条码打印接口
///
/// 获取产线当前生产的箱号条码
@@ -67,7 +67,12 @@ public class QrPrintService : IQrPrintService, IDynamicApiController, ITransient
public async Task GetCartonQrcode(string workline)
{
var line = await _repository.GetFirstAsync(a => a.id == workline);
- var productNo = line?.process_code ?? "16945155732431";
+ var productNo = line?.product_code;
+ //TODO 仅测试接口用
+ if (string.IsNullOrEmpty(productNo))
+ {
+ productNo = "16945" + Random.Shared.Next(0, 999999999).ToString(); //"16945155732431";
+ }
var pd = DateTime.Now;
var exp = pd.AddYears(3);
var lotNo = pd.ToString("yyMMddHH");