From 2df010604798133cfaaa5ff2fab43961da035326 Mon Sep 17 00:00:00 2001 From: PhilPan Date: Fri, 12 May 2023 10:18:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E5=8C=85=E8=A3=85=E6=9D=A1=E7=A0=81?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...IQrPrintService.cs => IWorklineCommService.cs} | 2 +- .../{QrPrintService.cs => WorklineCommService.cs} | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) rename ProductionMgr/Tnb.ProductionMgr.Interfaces/{IQrPrintService.cs => IWorklineCommService.cs} (83%) rename ProductionMgr/Tnb.ProductionMgr/{QrPrintService.cs => WorklineCommService.cs} (84%) 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");