105040 Update 增加更新线为已完成功能

This commit is contained in:
lihanbo 2025-01-13 17:16:02 +08:00
parent 86bb90145f
commit cbda1c9f8f
2 changed files with 26 additions and 2 deletions

View File

@ -10,6 +10,8 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
{
public string CableLectotypeId { get; set; }
public string LectotypeLineId { get; set; }
/// <summary>
/// 机械机构号
/// </summary>
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,

View File

@ -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<LectotypeLine>()
.Where(mt => mt.MotorId == motorId && mt.LectotypeLineId == lineId)
.SetColumns(it => it.IsChecked == true)
.ExecuteCommand();
db.CommitTran();
return changeCount;
}
catch (Exception)
{
db.RollbackTran();
return 0;
}
}
}
}