From cbda1c9f8f6545002fe4522cb6122c48a4420de4 Mon Sep 17 00:00:00 2001 From: lihanbo Date: Mon, 13 Jan 2025 17:16:02 +0800 Subject: [PATCH] =?UTF-8?q?105040=20Update=20=E5=A2=9E=E5=8A=A0=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=BA=BF=E4=B8=BA=E5=B7=B2=E5=AE=8C=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/LectotypeLineModel.cs | 4 +++- .../Service/MotorLectotypeService.cs | 24 ++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Models/LectotypeLineModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Models/LectotypeLineModel.cs index bb112b6..c619aec 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Models/LectotypeLineModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Models/LectotypeLineModel.cs @@ -10,6 +10,8 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models { public string CableLectotypeId { get; set; } + public string LectotypeLineId { get; set; } + /// /// 机械机构号 /// public string MechanicalNo { get; set; } @@ -460,7 +462,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models { return MotorExcelHelper.Instance.GetBomList(drawingNo).Where(it => { - return it.Name == "编码器线" || it.Name == "动力线"; + return it.Name == "编码器线" || it.Name == "动力线" || it.Name == "刹车线"; }).Select(it => new LectotypeLineModel { SeqNo = 0, diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Service/MotorLectotypeService.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Service/MotorLectotypeService.cs index 7e85fb1..7e016d1 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Service/MotorLectotypeService.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Service/MotorLectotypeService.cs @@ -92,6 +92,7 @@ namespace Sinvo.EplanHpD.Plugin.Service viewModel.SelectedLines = selectedLines.Select(line => new LectotypeLineModel { CableLectotypeId = line.CableLectotypeId, + LectotypeLineId = line.LectotypeLineId, SeqNo = line.SeqNo, AxisNo = line.AxisNo, CableConnectionClass = line.CableConnectionClass, @@ -248,6 +249,27 @@ namespace Sinvo.EplanHpD.Plugin.Service } } - + public int SetLineDone(string motorId,string lineId) + { + var db = DBHelper.DB; + + try + { + db.BeginTran(); + + int changeCount = db.Updateable() + .Where(mt => mt.MotorId == motorId && mt.LectotypeLineId == lineId) + .SetColumns(it => it.IsChecked == true) + .ExecuteCommand(); + + db.CommitTran(); + return changeCount; + } + catch (Exception) + { + db.RollbackTran(); + return 0; + } + } } }