From 97273783657c1f05d6b9c4f1eeb4f08cf4216f6c Mon Sep 17 00:00:00 2001 From: "DEVICE8\\12494" Date: Fri, 28 Apr 2023 14:44:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=86=99=EF=BC=8C=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entity/PrdTask.cs | 2 +- .../Entity/PrdTaskLog.cs | 2 +- .../Tnb.ProductionMgr/PrdMoService.cs | 23 ++++++++++++++++++- .../Tnb.API.Entry/Configurations/Cors.json | 2 +- .../Permission/DepartmentService.cs | 3 +++ visualdev/Tnb.VisualDev/RunService.cs | 19 ++++++++------- visualdev/Tnb.VisualDev/Tnb.VisualDev.csproj | 1 + .../VisualDevModelDataService.cs | 10 ++++++-- 8 files changed, 46 insertions(+), 16 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdTask.cs b/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdTask.cs index 5817e956..3f78ed61 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdTask.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdTask.cs @@ -8,7 +8,7 @@ namespace Tnb.ProductionMgr.Entities /// ///生产任务信息 /// - [SugarTable("prd_task")] + [SugarTable("prd_mo_task")] public partial class PrdTask { public PrdTask() diff --git a/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdTaskLog.cs b/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdTaskLog.cs index d1cd237e..3b49a401 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdTaskLog.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Entitys/Entity/PrdTaskLog.cs @@ -8,7 +8,7 @@ namespace Tnb.ProductionMgr.Entities /// ///生产任务操作记录 /// - [SugarTable("prd_task_log")] + [SugarTable("prd_mo_task_log")] public partial class PrdTaskLog { public PrdTaskLog(){ diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs index 0aba2700..e426fbe7 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs @@ -6,6 +6,7 @@ using JNPF.FriendlyException; using JNPF.Logging; using JNPF.Systems.Interfaces.System; using JNPF.VisualDev; +using JNPF.VisualDev.Entitys.Dto.VisualDevModelData; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; @@ -23,8 +24,10 @@ namespace Tnb.ProductionMgr /// [ApiDescriptionSettings(Tag = ModuleConst.Tag, Area = ModuleConst.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] + [OverideVisualDev(ModuleId)] public class PrdMoService : IOverideVisualDevService, IPrdMoService, IDynamicApiController, ITransient { + private const string ModuleId = "25567924238373"; private readonly ISqlSugarRepository _repository; private readonly IDataBaseManager _dataBaseManager; private readonly IUserManager _userManager; @@ -43,6 +46,7 @@ namespace Tnb.ProductionMgr _dataBaseManager = dataBaseManager; _userManager = userManager; _dictionaryDataService = dictionaryDataService; + OverideFuncs.DeleteAsync = Delete; } @@ -404,7 +408,7 @@ namespace Tnb.ProductionMgr { var obj = (await db.Queryable().FirstAsync(it => it.id == input.mo_id)); obj.input_qty += entity.scheduled_qty; - string moStatus = "",icmoStatus=""; + string moStatus = "", icmoStatus = ""; //判断,已排产数量>=计划数量时将状态改为 已排产 if (obj.input_qty >= obj.plan_qty) @@ -495,5 +499,22 @@ namespace Tnb.ProductionMgr } #endregion + + //public async Task GetList(VisualDevModelListQueryInput input) + //{ + // return null; + //} + + /// + /// 删除 + /// + /// + /// + + private Task Delete(string id) + { + string str = ""; + return Task.CompletedTask; + } } } \ No newline at end of file diff --git a/apihost/Tnb.API.Entry/Configurations/Cors.json b/apihost/Tnb.API.Entry/Configurations/Cors.json index 7e6a366e..3224525c 100644 --- a/apihost/Tnb.API.Entry/Configurations/Cors.json +++ b/apihost/Tnb.API.Entry/Configurations/Cors.json @@ -1,7 +1,7 @@ { "CorsAccessorSettings": { "PolicyName": "JNPFCorsAccessor", - "WithOrigins": [ "http://192.168.10.12:9230", "http://192.168.10.18:9230", "http://localhost:8080", "http://localhost:9230" ], + "WithOrigins": [ "http://192.168.10.12:9230","http://localhost:8080", "http://localhost:9230" ], "WithExposedHeaders": [ "access-token", "x-access-token", "Content-Disposition" ] } } \ No newline at end of file diff --git a/system/Tnb.Systems/Permission/DepartmentService.cs b/system/Tnb.Systems/Permission/DepartmentService.cs index 0a9c36d2..71917ea9 100644 --- a/system/Tnb.Systems/Permission/DepartmentService.cs +++ b/system/Tnb.Systems/Permission/DepartmentService.cs @@ -459,6 +459,9 @@ public class DepartmentService : IDepartmentService, IDynamicApiController, ITra isOK = await _repository.AsSugarClient().Updateable().SetColumns(it => new EqpEquipment { station_code = "" }).Where(it => unbindEqpIds.Contains(it.id)).ExecuteCommandAsync(); } } + //绑定工序 + var procList = input.propertyJson.Value("rowprocess"); + if (!(isOK > 0)) throw Oops.Oh(ErrorCode.COM1001); } diff --git a/visualdev/Tnb.VisualDev/RunService.cs b/visualdev/Tnb.VisualDev/RunService.cs index 2e54bcbd..c1fc04a8 100644 --- a/visualdev/Tnb.VisualDev/RunService.cs +++ b/visualdev/Tnb.VisualDev/RunService.cs @@ -179,20 +179,19 @@ public class RunService : IRunService, ITransient var jArr = JArray.Parse(entity.Tables); if (!input.station_code.IsNullOrWhiteSpace()) { - + if (jArr?.FirstOrDefault()?.Value("table") == "eqp_equipment") { sql += $" where station_code='{input.station_code}' or station_code=''"; } - } - if (!input.process_code.IsNullOrWhiteSpace()) - { if (jArr?.FirstOrDefault()?.Value("table") == "bas_process") { - //sql += $" where station_code='{input.station_code}' or station_code=''"; + //sql += $" and station_code='{input.station_code}' or station_code=''"; } } - + + + realList = _databaseService.GetInterFaceData(link, sql, input, templateInfo.ColumnData.Adapt(), new List(), tableFieldKeyValue); @@ -2902,15 +2901,15 @@ public class RunService : IRunService, ITransient { jarr = JArray.Parse(itemValue); } - + // 多选时为模糊查询 if (model.multiple) { if (jarr?.Children() != null && jarr?.Children().ToList().Count > 1) { var values = string.Join(",", jarr.ToList().Select(t => t.Value())); - conModels.Add(new ConditionalModel { FieldName= item.Key, ConditionalType= ConditionalType.In, FieldValue=values }); - + conModels.Add(new ConditionalModel { FieldName = item.Key, ConditionalType = ConditionalType.In, FieldValue = values }); + } else { @@ -2934,7 +2933,7 @@ public class RunService : IRunService, ITransient { var values = string.Join(",", jarr.ToList().Select(t => t.Value())); conModels.Add(new ConditionalModel { FieldName = item.Key, ConditionalType = ConditionalType.In, FieldValue = values }); - + } else { diff --git a/visualdev/Tnb.VisualDev/Tnb.VisualDev.csproj b/visualdev/Tnb.VisualDev/Tnb.VisualDev.csproj index 0bff7024..10a3c287 100644 --- a/visualdev/Tnb.VisualDev/Tnb.VisualDev.csproj +++ b/visualdev/Tnb.VisualDev/Tnb.VisualDev.csproj @@ -12,6 +12,7 @@ + diff --git a/visualdev/Tnb.VisualDev/VisualDevModelDataService.cs b/visualdev/Tnb.VisualDev/VisualDevModelDataService.cs index 513fd245..3adc169e 100644 --- a/visualdev/Tnb.VisualDev/VisualDevModelDataService.cs +++ b/visualdev/Tnb.VisualDev/VisualDevModelDataService.cs @@ -1,4 +1,5 @@ -using JNPF.Common.Configuration; +using System.Data; +using JNPF.Common.Configuration; using JNPF.Common.Const; using JNPF.Common.Core.Manager; using JNPF.Common.Core.Manager.Files; @@ -33,6 +34,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json.Linq; using SqlSugar; +using Tnb.ProductionMgr.Interfaces; using Yitter.IdGenerator; namespace JNPF.VisualDev @@ -104,6 +106,8 @@ namespace JNPF.VisualDev /// private readonly ITenant _db; + private readonly IPrdMoService _prdMoService; + /// /// 初始化一个类型的新实例. /// @@ -119,7 +123,8 @@ namespace JNPF.VisualDev ICacheManager cacheManager, IFlowTaskService flowTaskService, IFileManager fileManager, - ISqlSugarClient context) + ISqlSugarClient context, + IPrdMoService prdMoService) { _visualDevRepository = visualDevRepository; _visualDevService = visualDevService; @@ -133,6 +138,7 @@ namespace JNPF.VisualDev _fileManager = fileManager; _dataInterfaceService = dataInterfaceService; _db = context.AsTenant(); + _prdMoService = prdMoService; } #region Get