From 4fbcbfb056f881f0d09b7ba73096aeb8a0a870d3 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Fri, 14 Jul 2023 15:05:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E7=94=B3=E8=AF=B7=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=EF=BC=8C=E6=8F=90=E6=8A=A5=E5=A2=9E=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BasicData/Tnb.BasicData/BasMbomService.cs | 2 +- .../Dto/PrdManage/PrdReportCrInput.cs | 5 +++ .../Entity/PrdReport.cs | 34 +++++++++++++++++++ .../Tnb.ProductionMgr/PrdInstockService.cs | 2 +- .../Tnb.ProductionMgr/PrdMoTaskService.cs | 14 ++++++-- .../Tnb.ProductionMgr.csproj | 1 + 6 files changed, 53 insertions(+), 5 deletions(-) diff --git a/BasicData/Tnb.BasicData/BasMbomService.cs b/BasicData/Tnb.BasicData/BasMbomService.cs index 787c8bbf..4183e0d3 100644 --- a/BasicData/Tnb.BasicData/BasMbomService.cs +++ b/BasicData/Tnb.BasicData/BasMbomService.cs @@ -26,7 +26,7 @@ namespace Tnb.BasicData [OverideVisualDev(ModelId)] public class BasMbomService : IBasMbomService, IOverideVisualDevService, IDynamicApiController, ITransient { - public const string ModelId = "25574817510421"; + public const string ModelId = "27204627275029"; private readonly ISqlSugarRepository _repository; private readonly DataBaseManager _dbManager; private readonly IDictionaryDataService _dictionaryDataService; diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs index a2a6b049..cfc83410 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/PrdReportCrInput.cs @@ -98,6 +98,11 @@ namespace Tnb.ProductionMgr.Entities.Dto.PrdManage /// Nullable:True /// public int icmo_qty { get; set; } + + /// + /// 工位 + /// + public string? station { get; set; } } } diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs index 1763bbe3..8128efe1 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Entity/PrdReport.cs @@ -78,5 +78,39 @@ public partial class PrdReport : BaseEntity /// 生产任务量 /// public int? icmo_qty { get; set; } + + /// + /// 批次 + /// + public string? batch { get; set; } + + /// + /// 设备id + /// + public string? equip_id { get; set; } + /// + /// 工位id + /// + public string? station { get; set; } + + /// + /// 生产bom工序id + /// + public string? mbom_process_id { get; set; } + + /// + /// 状态 0 未入库 1 已入库 + /// + public int status { get; set; } + + /// + /// 物料id + /// + public string? material_id { get; set; } + + /// + /// 物料单位 + /// + public string? unit_id { get; set; } } diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs index e19f083e..5e8a2a63 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs @@ -11,7 +11,7 @@ using Tnb.ProductionMgr.Interfaces; namespace Tnb.ProductionMgr { /// - /// mes入库申请 + /// mes生产入库申请 /// [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs index 4ac5daf9..f73b3872 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoTaskService.cs @@ -141,7 +141,7 @@ namespace Tnb.ProductionMgr { eqp_id = b.id, eqp_code = b.code, - eqp_type_code = SqlFunc.Subqueryable().Where(iit => iit.id == b.equip_type_id).Select(iit => iit.code), + eqp_type_code = SqlFunc.Subqueryable().Where(iit => iit.id == b.equip_type_id).Select(iit => iit.name), eqp_machine_num = b.eqp_machine_num, tonnage = b.tonnage, task_list_qty = SqlFunc.Subqueryable().Where(x => x.eqp_id == b.id).Count(), @@ -1254,16 +1254,24 @@ namespace Tnb.ProductionMgr { var row = -1; var report = await db.Queryable().FirstAsync(it => it.mo_task_id == input.mo_task_id); + var prdMoTask = await db.Queryable().SingleAsync(x => x.id == input.mo_task_id); report = input.Adapt(); report.id = SnowflakeIdHelper.NextId(); report.reported_qty = input.reported_qty; report.create_id = _userManager.UserId; report.create_time = DateTime.Now; - + report.batch = input.mo_task_code + DateTimeOffset.Now.ToUnixTimeSeconds().ToString(); + report.equip_id = prdMoTask.eqp_id; + report.mbom_process_id = prdMoTask.mbom_process_id; + report.station = input.station; + report.status = 0; + report.material_id = prdMoTask.material_id; + report.unit_id = prdMoTask.unit_id; + row = await db.Insertable(report).ExecuteCommandAsync(); - var prdMoTask = await db.Queryable().SingleAsync(x => x.id == input.mo_task_id); + if (prdMoTask.reported_work_qty == null) { await db.Updateable() diff --git a/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj b/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj index 6316cd83..832c4f03 100644 --- a/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj +++ b/ProductionMgr/Tnb.ProductionMgr/Tnb.ProductionMgr.csproj @@ -15,6 +15,7 @@ +