From f038e55c7a8d7e949f5063ecabeea2bb30a54053 Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Sat, 7 Oct 2023 10:51:12 +0800 Subject: [PATCH 1/5] BUG --- ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs index 4b418519..593aa663 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdMoService.cs @@ -389,7 +389,7 @@ namespace Tnb.ProductionMgr complete_rate = a.reported_work_qty==null?0:SqlFunc.ToDecimal(a.reported_work_qty*100)/SqlFunc.ToDecimal(a.plan_qty), children = SqlFunc.Subqueryable() .LeftJoin((x,y)=>x.mo_task_status==y.EnCode && y.DictionaryTypeId==DictConst.PrdTaskStatusTypeId) - .Where(x=>x.mo_id==a.id && !SqlFunc.IsNullOrEmpty(x.parent_id)) + .Where(x=>x.mo_id==a.id && SqlFunc.IsNullOrEmpty(x.parent_id)) .OrderByDesc((x,y)=>x.create_time) .ToList((x,y)=>new PrdMoStatisticsDetailOutput() { From 861be92ec4f6c22e6f45e4447c25f6fe8cc9c2fe Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Sat, 7 Oct 2023 17:28:47 +0800 Subject: [PATCH 2/5] =?UTF-8?q?andon=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PrdManage/AndonCascaderOptionsOuput.cs | 10 +++++ .../IAndonService.cs | 6 +++ .../Tnb.ProductionMgr/AndonRecordService.cs | 14 +++++++ .../Tnb.ProductionMgr/AndonService.cs | 40 +++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonCascaderOptionsOuput.cs diff --git a/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonCascaderOptionsOuput.cs b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonCascaderOptionsOuput.cs new file mode 100644 index 00000000..861d6a70 --- /dev/null +++ b/ProductionMgr/Tnb.ProductionMgr.Entities/Dto/PrdManage/AndonCascaderOptionsOuput.cs @@ -0,0 +1,10 @@ +namespace Tnb.ProductionMgr.Entities.Dto.PrdManage +{ + public class AndonCascaderOptionsOuput + { + public string label { get; set; } + public string value { get; set; } + public bool disabled { get; set; } = false; + public List children { get; set; } = new List(); + } +} \ No newline at end of file diff --git a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonService.cs b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonService.cs index 31e453dc..c7b815cc 100644 --- a/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonService.cs +++ b/ProductionMgr/Tnb.ProductionMgr.Interfaces/IAndonService.cs @@ -11,5 +11,11 @@ namespace Tnb.ProductionMgr.Interfaces { Task GetPrdTask(string stationId); Task SaveData(AndonRecordInput AndonRecordInput); + + /// + /// 获取andon级联选择项数据 + /// + /// + Task GetAndonCascaderOptions(); } } diff --git a/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs b/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs index 37acd24f..38cbd25a 100644 --- a/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs @@ -24,6 +24,7 @@ using Tnb.ProductionMgr.Interfaces; using Tnb.BasicData.Entities; using JNPF.Systems.Entitys.System; using JNPF.Message.Entitys.Entity; +using Tnb.BasicData.Interfaces; using MessageTemplateEntity = JNPF.Message.Entitys.Entity.MessageTemplateEntity; namespace Tnb.ProductionMgr @@ -35,16 +36,19 @@ namespace Tnb.ProductionMgr private readonly ISqlSugarClient _db; private readonly IUserManager _userManager; private SendMessageService _sendMessageService; + private readonly IBasPushRuleLogService _basPushRuleLogService; private readonly TimeTaskService _timeTaskService; public AndonRecordService(ISqlSugarRepository repository, SendMessageService sendMessageService, TimeTaskService timeTaskService, + IBasPushRuleLogService basPushRuleLogService, IUserManager userManager) { _userManager = userManager; _sendMessageService = sendMessageService; _timeTaskService = timeTaskService; + _basPushRuleLogService = basPushRuleLogService; _db = repository.AsSugarClient(); } @@ -119,6 +123,8 @@ namespace Tnb.ProductionMgr } } + await _db.Insertable(andonRecords).ExecuteCommandAsync(); + }); if (result.IsSuccess) @@ -206,6 +212,11 @@ namespace Tnb.ProductionMgr .SetColumns(x => x.repair_id == _userManager.UserId) .SetColumns(x=>x.response_time==DateTime.Now) .ExecuteCommandAsync(); + Dictionary postData = new Dictionary() + { + ["id"] = andonRecords.id + }; + await _basPushRuleLogService.Stop(postData); return true; } } @@ -224,6 +235,7 @@ namespace Tnb.ProductionMgr { await _db.Updateable() .SetColumns(x=>x.start_repair_time==DateTime.Now) + .Where(x=>x.id==id) .ExecuteCommandAsync(); return true; } @@ -242,6 +254,7 @@ namespace Tnb.ProductionMgr { await _db.Updateable() .SetColumns(x=>x.end_repair_time==DateTime.Now) + .Where(x=>x.id==id) .ExecuteCommandAsync(); return true; } @@ -260,6 +273,7 @@ namespace Tnb.ProductionMgr { await _db.Updateable() .SetColumns(x=>x.confirm_time==DateTime.Now) + .Where(x=>x.id==id) .ExecuteCommandAsync(); return true; } diff --git a/ProductionMgr/Tnb.ProductionMgr/AndonService.cs b/ProductionMgr/Tnb.ProductionMgr/AndonService.cs index 24c38703..e8ca5a9e 100644 --- a/ProductionMgr/Tnb.ProductionMgr/AndonService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/AndonService.cs @@ -16,6 +16,7 @@ using JNPF.Systems.Interfaces.System; using JNPF.TaskScheduler; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; using SqlSugar; using Tnb.BasicData.Entities; using Tnb.EquipMgr.Interfaces; @@ -83,5 +84,44 @@ namespace Tnb.ProductionMgr andonRecord.create_id = _userManager.UserId; await _db.Insertable(andonRecord).ExecuteCommandAsync(); } + + [HttpPost] + public async Task GetAndonCascaderOptions() + { + Dictionary result = new Dictionary(); + List andonTypes = await _db.Queryable().ToListAsync(); + List andonInfos = await _db.Queryable().ToListAsync(); + List andonBreakDowns = await _db.Queryable().ToListAsync(); + List options = new List(); + foreach (var andonType in andonTypes) + { + options.Add(new AndonCascaderOptionsOuput() + { + label = andonType.name, + value = andonType.id, + children = andonInfos.Where(x=>x.andon_type==andonType.id).Select(x=>new AndonCascaderOptionsOuput() + { + label = x.name, + value = x.id, + children = andonBreakDowns.Where(y=>x.breakdown_id.Contains(y.id)).Select(y=>new AndonCascaderOptionsOuput() + { + label = y.name, + value = y.id + }).ToList() + }).ToList() + }); + } + + string defaultValue = ""; + if (!string.IsNullOrEmpty(andonInfos.FirstOrDefault()?.breakdown_id)) + { + string[] breakdownIdArr = JsonConvert.DeserializeObject(andonInfos.FirstOrDefault()?.breakdown_id); + defaultValue = breakdownIdArr[0]; + } + + result.Add("options",options); + result.Add("defaultValue",defaultValue); + return result; + } } } From 64e793df3216f42602f0636dbad3bd5db594677f Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Sat, 7 Oct 2023 17:37:24 +0800 Subject: [PATCH 3/5] 1 --- ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs b/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs index 38cbd25a..c9b2fc87 100644 --- a/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/AndonRecordService.cs @@ -217,6 +217,7 @@ namespace Tnb.ProductionMgr ["id"] = andonRecords.id }; await _basPushRuleLogService.Stop(postData); + return true; } } From 01de378ce20f99ccc4a62deff0045602222646ad Mon Sep 17 00:00:00 2001 From: qianjiawei <1184704771@qq.com> Date: Sat, 7 Oct 2023 17:39:55 +0800 Subject: [PATCH 4/5] 1 --- .../Tnb.EquipMgr.Entities/Entity/ToolMolds.cs | 2 + EquipMgr/Tnb.EquipMgr/ToolMoldsService.cs | 88 ++++++++++++++++++- 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMolds.cs b/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMolds.cs index c93b2913..3674be98 100644 --- a/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMolds.cs +++ b/EquipMgr/Tnb.EquipMgr.Entities/Entity/ToolMolds.cs @@ -138,4 +138,6 @@ public partial class ToolMolds : BaseEntity /// public string item_json { get; set; } + public string qrcode { get; set; } + } diff --git a/EquipMgr/Tnb.EquipMgr/ToolMoldsService.cs b/EquipMgr/Tnb.EquipMgr/ToolMoldsService.cs index 86c41af4..6b010062 100644 --- a/EquipMgr/Tnb.EquipMgr/ToolMoldsService.cs +++ b/EquipMgr/Tnb.EquipMgr/ToolMoldsService.cs @@ -1,20 +1,27 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using Aop.Api.Domain; using Aspose.Cells.Drawing; using JNPF.Common.Core.Manager; +using JNPF.Common.Dtos.VisualDev; using JNPF.Common.Enums; using JNPF.Common.Filter; using JNPF.Common.Security; using JNPF.DependencyInjection; using JNPF.DynamicApiController; using JNPF.FriendlyException; +using JNPF.VisualDev; +using JNPF.VisualDev.Entitys; +using JNPF.VisualDev.Interfaces; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; +using NPOI.SS.Formula.Functions; using SqlSugar; +using Tnb.BasicData.Entities; using Tnb.EquipMgr.Entities; using Tnb.EquipMgr.Entities.Dto; using Tnb.EquipMgr.Interfaces; @@ -26,14 +33,91 @@ namespace Tnb.EquipMgr /// [ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)] [Route("api/[area]/[controller]/[action]")] - public class ToolMoldsService : IToolMoldsService, IDynamicApiController, ITransient + [OverideVisualDev(ModuleId)] + public class ToolMoldsService : IOverideVisualDevService, IToolMoldsService, IDynamicApiController, ITransient { + public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc(); + private const string ModuleId = "26103059189781"; + private readonly IVisualDevService _visualDevService; private readonly IUserManager _userManager; private readonly ISqlSugarRepository _repository; - public ToolMoldsService(IUserManager userManager, ISqlSugarRepository repository) + private readonly IRunService _runService; + public ToolMoldsService(IUserManager userManager, ISqlSugarRepository repository, IVisualDevService visualDevService, IRunService runService) { + _visualDevService = visualDevService; _userManager = userManager; _repository = repository; + _runService = runService; + OverideFuncs.CreateAsync = Create; + OverideFuncs.UpdateAsync = Update; + } + private async Task Create(VisualDevModelDataCrInput visualDevModelDataCrInput) + { + string qrcode = visualDevModelDataCrInput.data.ContainsKey("qrcode") ? visualDevModelDataCrInput.data["qrcode"].ToString() : ""; + if (!string.IsNullOrEmpty(qrcode) && await _repository.AsSugarClient().Queryable().AnyAsync(x => x.code == qrcode)) + { + throw Oops.Bah("二维码总表中已存在该二维码"); + } + else + { + VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true); + await _runService.Create(templateEntity, visualDevModelDataCrInput); + + string ToolId = visualDevModelDataCrInput.data["ReturnIdentity"].ToString() ?? ""; + + if (!string.IsNullOrEmpty(qrcode)) + { + BasQrcode basQrcode = new BasQrcode() + { + code = visualDevModelDataCrInput.data["qrcode"].ToString(), + source_id = ToolId, + source_name = "TOOL_MOLDS", + create_id = _userManager.UserId, + create_time = DateTime.Now, + org_id = _userManager.GetUserInfo().Result.organizeId, + }; + await _repository.AsSugarClient().Insertable(basQrcode).ExecuteCommandAsync(); + } + } + return await Task.FromResult(true); + } + + private async Task Update(string id, VisualDevModelDataUpInput visualDevModelDataUpInput) + { + string qrcode = visualDevModelDataUpInput.data.ContainsKey("qrcode") ? visualDevModelDataUpInput.data["qrcode"].ToString() : ""; + if (!string.IsNullOrEmpty(qrcode) && await _repository.AsSugarClient().Queryable().AnyAsync(x => x.code == visualDevModelDataUpInput.data["qrcode"] && x.source_id != id)) + { + throw Oops.Bah("二维码总表中已存在该二维码"); + } + else + { + VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleId, true); + await _runService.Update(id, templateEntity, visualDevModelDataUpInput); + + if (!string.IsNullOrEmpty(qrcode)) + { + if (await _repository.AsSugarClient().Queryable().AnyAsync(x => x.source_id == id)) + { + await _repository.AsSugarClient().Updateable() + .SetColumns(x => x.code == visualDevModelDataUpInput.data["qrcode"].ToString()).Where(x => x.source_id == id) + .ExecuteCommandAsync(); + } + else + { + BasQrcode basQrcode = new BasQrcode() + { + code = visualDevModelDataUpInput.data["qrcode"].ToString(), + source_id = id, + source_name = "TOOL_MOLDS", + create_id = _userManager.UserId, + create_time = DateTime.Now, + org_id = _userManager.GetUserInfo().Result.organizeId, + }; + await _repository.AsSugarClient().Insertable(basQrcode).ExecuteCommandAsync(); + } + } + } + return await Task.FromResult(true); } /// From 66cbee8bc12c23aa80f0724b90232de2155a44fe Mon Sep 17 00:00:00 2001 From: PhilPan Date: Sat, 7 Oct 2023 18:44:31 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0SolutionDir=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Directory.Build.props | 5 +++++ Tnb.Server.sln | 1 + WmsSignForDeliveryService.txt | 0 3 files changed, 6 insertions(+) create mode 100644 Directory.Build.props delete mode 100644 WmsSignForDeliveryService.txt diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..8e0a6337 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,5 @@ + + + $(MSBuildThisFileDirectory) + + \ No newline at end of file diff --git a/Tnb.Server.sln b/Tnb.Server.sln index ed93b136..9c0c6a8b 100644 --- a/Tnb.Server.sln +++ b/Tnb.Server.sln @@ -24,6 +24,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决 .editorconfig = .editorconfig clear_bin_obj.cmd = clear_bin_obj.cmd common.props = common.props + Directory.Build.props = Directory.Build.props dotnet.ruleset = dotnet.ruleset global.json = global.json nuget.config = nuget.config diff --git a/WmsSignForDeliveryService.txt b/WmsSignForDeliveryService.txt deleted file mode 100644 index e69de29b..00000000