diff --git a/SlnMesnac.Business/ProdCompletionBusiness.cs b/SlnMesnac.Business/ProdCompletionBusiness.cs index a2ee039..95e4c05 100644 --- a/SlnMesnac.Business/ProdCompletionBusiness.cs +++ b/SlnMesnac.Business/ProdCompletionBusiness.cs @@ -52,6 +52,7 @@ namespace SlnMesnac.Business private readonly IMesProductPlanService _mesProductPlanService; private readonly IMesProductOrderService _mesProductOrderService; private readonly IMesPrdBarCodeService _barCodeTaskService; + private readonly IBaseMaterialInfoService _baseMaterialInfoService; private readonly IMesBaseBarcodeInfoService _mesBaseBarcodeInfoService; public readonly IMesPrdBarCodeService _mesPrdBarCodeService; private readonly IRealPalletTaskService _realPalletTaskService; @@ -67,6 +68,7 @@ namespace SlnMesnac.Business _mesBaseBarcodeInfoService = serviceProvider.GetRequiredService(); _mesPrdBarCodeService = serviceProvider.GetRequiredService(); _mesProductOrderService = serviceProvider.GetRequiredService(); + _baseMaterialInfoService = serviceProvider.GetRequiredService(); Init(); } @@ -220,8 +222,12 @@ namespace SlnMesnac.Business mesBaseBarcodeInfo.updateTime = DateTime.Now; mesBaseBarcodeInfo.completeFlag = "1"; mesBaseBarcodeInfo.singleFlag = "0"; + var materialInfo = _baseMaterialInfoService.Query(x => x.MaterialId == productPlanDto.MaterialId).FirstOrDefault(); // 改成spec - mesBaseBarcodeInfo.barcodeSpec = productPlanDto.MaterialName; + if(materialInfo != null) + { + mesBaseBarcodeInfo.barcodeSpec = materialInfo.MaterialSpec; + } sqlSugarClient.AsTenant().GetConnection("mes").Insertable(mesBaseBarcodeInfo).ExecuteCommand(); return bigBarcode; }