From 489987091cfece1860b84ca3ea5ef2f5aaf6550c Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Fri, 16 Jun 2023 14:11:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AD=BE=E6=94=B6?= =?UTF-8?q?=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dto/PrdManage/MaterialReceiptInput.cs | 5 +++++ .../Entity/PrdMaterialReceiptH.cs | 6 ++++++ .../Tnb.ProductionMgr/PrdMaterialReceiptService.cs | 1 + 3 files changed, 12 insertions(+) diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptInput.cs index 5d0e22ad..91ead988 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/MaterialReceiptInput.cs @@ -4,6 +4,11 @@ namespace Tnb.ProductionMgr.Entities.Dto { public string id { get; set; } + /// + /// 签收单号 + /// + public string code { get; set; } = string.Empty; + /// /// 工位id /// diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptH.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptH.cs index 57ae28fe..94958bc2 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptH.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptH.cs @@ -14,6 +14,12 @@ public partial class PrdMaterialReceiptH : BaseEntity { id = SnowflakeIdHelper.NextId(); } + + /// + /// 签收单号 + /// + public string code { get; set; } = string.Empty; + /// /// 工位id /// diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs index f437c660..8a77672c 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs @@ -78,6 +78,7 @@ namespace Tnb.ProductionMgr PrdMaterialReceiptH prdMaterialReceiptH = new PrdMaterialReceiptH() { + code = input.code, station_id = input.station_id, mo_task_id = input.mo_task_id, process_id = input.process_id, From 3d60c3b912bd86f42fb484284638e920cb80fc7e Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Fri, 16 Jun 2023 14:38:34 +0800 Subject: [PATCH 2/2] bug --- .../Entity/PrdMaterialReceiptD.cs | 2 +- .../Tnb.ProductionMgr/PrdMaterialReceiptService.cs | 12 +++++++++--- .../Consts/WmsCarryConst.cs | 7 +++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs index 76f17cd4..dec2b972 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdMaterialReceiptD.cs @@ -27,7 +27,7 @@ public partial class PrdMaterialReceiptD : BaseEntity /// /// 数量 /// - public int num { get; set; } + public decimal num { get; set; } /// /// 批次 diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs index 8a77672c..5493423d 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMaterialReceiptService.cs @@ -4,6 +4,7 @@ using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; +using JNPF.Systems.Interfaces.System; using Microsoft.AspNetCore.Mvc; using Microsoft.ClearScript.Util.Web; using SqlSugar; @@ -14,6 +15,7 @@ using Tnb.ProductionMgr.Entities.Dto.PrdManage; using Tnb.ProductionMgr.Interfaces; using Tnb.WarehouseMgr.Entities; using Tnb.WarehouseMgr.Entities.Dto; +using Tnb.WarehouseMgr.Entities.Consts; namespace Tnb.ProductionMgr { @@ -26,15 +28,18 @@ namespace Tnb.ProductionMgr { private readonly ISqlSugarRepository _repository; private readonly IUserManager _userManager; + private readonly IBillRullService _billRullService; public PrdMaterialReceiptService( ISqlSugarRepository repository, + IBillRullService billRullService, IUserManager userManager ) { _repository = repository; _userManager = userManager; + _billRullService = billRullService; } @@ -75,10 +80,11 @@ namespace Tnb.ProductionMgr .Where(x => x.mbom_id == moTask.bom_id && x.mbom_process_id == input.mbom_process_id) .Select(x=>x.material_id) .ToListAsync(); - + + string code = await _billRullService.GetBillNumber(WmsCarryConst.MATERIAL_RECEIPT_CODE); PrdMaterialReceiptH prdMaterialReceiptH = new PrdMaterialReceiptH() { - code = input.code, + code = code, station_id = input.station_id, mo_task_id = input.mo_task_id, process_id = input.process_id, @@ -106,7 +112,7 @@ namespace Tnb.ProductionMgr { material_receipt_id = prdMaterialReceiptH.id, material_id = item["material_id"], - num = Convert.ToInt32(item["num"]), + num = Convert.ToDecimal(item["num"]), batch = item["batch"], unit_id = item["unit_id"], }); diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs index 563ee215..468463fd 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsCarryConst.cs @@ -12,5 +12,12 @@ namespace Tnb.WarehouseMgr.Entities.Consts /// 载具更换EnCode业务编码 /// public const string WMS_CARRY_REPLACE_ENCODE = "WmsCarryReplace"; + + /// + /// 物料签收编码 + /// + public const string MATERIAL_RECEIPT_CODE = "MaterialReceipt"; + + } }