修改试车
This commit is contained in:
@@ -28,8 +28,6 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
/// </summary>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
|
||||
|
||||
this.tvControlItem.Nodes.Clear();
|
||||
TreeNode rootNode = new TreeNode();
|
||||
rootNode.Text = "检查表";
|
||||
@@ -48,9 +46,39 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
join c in Funs.DB.PreRun_WorkPackage on b.WorkPackId equals c.WorkPackId
|
||||
where a.ProjectId == this.CurrUser.LoginProjectId && subSystemIds.Contains(a.PreRunId) && workPackIds.Contains(c.WorkPackId)
|
||||
select new { a.PreRunId, a.PreRunCode, a.PreRunName, a.ProjectId, c.WorkPackId, c.WorkPackName };
|
||||
|
||||
if (list.Count() > 0)
|
||||
{
|
||||
var selectlist = new List<SelectPropertyTechnology>();
|
||||
var sysPipingData = from proper in Funs.DB.PreRun_PropertySysPiping
|
||||
join selectproper in Funs.DB.PreRun_SubPropertySelect on proper.PropertyId equals selectproper.PropertyId
|
||||
join inspectterm in Funs.DB.PreRun_SubInspectTerm on selectproper.PropertyId equals inspectterm.PropertyTechnologyId
|
||||
where subSystemIds.Contains(selectproper.SubSystemId)
|
||||
select new SelectPropertyTechnology()
|
||||
{
|
||||
Id = proper.PropertyId,
|
||||
Code = $"管道:({proper.PipingCode})",
|
||||
WorkPackId = inspectterm.WorkPackId,
|
||||
SubSystemId = selectproper.SubSystemId
|
||||
};
|
||||
if (sysPipingData.Count() > 0)
|
||||
{
|
||||
selectlist.AddRange(sysPipingData);
|
||||
}
|
||||
var technologylist = from technology in Funs.DB.PreRun_TechnologySysPiping
|
||||
join selecttechnology in Funs.DB.PreRun_SubTechnologySelect on technology.TechnologyId equals selecttechnology.TechnologyId
|
||||
join inspectterm in Funs.DB.PreRun_SubInspectTerm on selecttechnology.TechnologyId equals inspectterm.PropertyTechnologyId
|
||||
where subSystemIds.Contains(selecttechnology.SubSystemId)
|
||||
select new SelectPropertyTechnology()
|
||||
{
|
||||
Id = technology.TechnologyId,
|
||||
Code = $"设备:({technology.TagNumber})",
|
||||
WorkPackId = inspectterm.WorkPackId,
|
||||
SubSystemId = selecttechnology.SubSystemId
|
||||
};
|
||||
if (technologylist.Count() > 0)
|
||||
{
|
||||
selectlist.AddRange(technologylist);
|
||||
}
|
||||
var subList = list.GroupBy(x => new { x.PreRunId, x.PreRunCode, x.PreRunName });
|
||||
foreach (var item in subList)
|
||||
{
|
||||
@@ -59,8 +87,8 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
rootUnitNode.Text = item.Key.PreRunName;
|
||||
rootUnitNode.ToolTip = item.Key.PreRunName;
|
||||
rootUnitNode.CommandName = "";
|
||||
rootUnitNode.EnableClickEvent = true;
|
||||
rootUnitNode.EnableExpandEvent = true;
|
||||
rootUnitNode.EnableClickEvent = false;
|
||||
rootUnitNode.EnableExpandEvent = false;
|
||||
rootNode.Nodes.Add(rootUnitNode);
|
||||
rootUnitNode.Expanded = true;
|
||||
var worklist = list.Where(a => a.PreRunId == item.Key.PreRunId).GroupBy(x => new { x.WorkPackId, x.WorkPackName }).ToList();
|
||||
@@ -73,13 +101,31 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
newNode.NodeID = itemWork.Key.WorkPackId + "|" + item.Key.PreRunId;
|
||||
newNode.ToolTip = itemWork.Key.WorkPackName;
|
||||
newNode.CommandName = "";
|
||||
newNode.EnableClickEvent = true;
|
||||
newNode.EnableClickEvent = false;
|
||||
newNode.EnableExpandEvent = false;
|
||||
rootUnitNode.Nodes.Add(newNode);
|
||||
newNode.Expanded = true;
|
||||
if (selectlist.Count > 0)
|
||||
{
|
||||
var workselects = selectlist.Where(x => x.SubSystemId == item.Key.PreRunId && x.WorkPackId == itemWork.Key.WorkPackId);
|
||||
foreach (var itemSelect in workselects)
|
||||
{
|
||||
TreeNode newNodeSelect = new TreeNode();
|
||||
newNodeSelect.Text = itemSelect.Code;
|
||||
newNodeSelect.NodeID = itemWork.Key.WorkPackId + "|" + item.Key.PreRunId + "|" + itemSelect.Id;
|
||||
newNodeSelect.ToolTip = itemSelect.Code;
|
||||
newNodeSelect.CommandName = "";
|
||||
newNodeSelect.EnableClickEvent = true;
|
||||
newNodeSelect.EnableExpandEvent = true;
|
||||
newNode.Nodes.Add(newNodeSelect);
|
||||
newNodeSelect.Expanded = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -100,10 +146,11 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
public void BindGrid()
|
||||
{
|
||||
var workPackId = this.tvControlItem.SelectedNodeID.Split('|').First();
|
||||
var subSystemId = this.tvControlItem.SelectedNodeID.Split('|').Last();
|
||||
var subSystemId = this.tvControlItem.SelectedNodeID.Split('|')[1];
|
||||
var propertytechnologyid = this.tvControlItem.SelectedNodeID.Split('|').Last();
|
||||
//获取子系统
|
||||
var subSysModel = Funs.DB.PreRun_SysDevice.FirstOrDefault(x => x.PreRunId == subSystemId);
|
||||
var list = Funs.DB.PreRun_SubInspectTermItem.Where(x => x.WorkPackId == workPackId && x.SubSystemId == subSystemId && x.InspectedUser == this.CurrUser.UserId).ToList();
|
||||
var list = Funs.DB.PreRun_SubInspectTermItem.Where(x => x.WorkPackId == workPackId && x.SubSystemId == subSystemId && x.PropertyTechnologyId == propertytechnologyid && x.InspectedUser == this.CurrUser.UserId).OrderBy(x => x.Sort).ToList();
|
||||
Grid1.DataSource = list;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
@@ -120,6 +167,8 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
@@ -134,13 +183,15 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
int i = mergedRow.Value<int>("index");
|
||||
var subItemId = this.Grid1.Rows[i].DataKeys[0].ToString();
|
||||
|
||||
//获取子系统信息
|
||||
var model = Funs.DB.PreRun_SubInspectTermItem.FirstOrDefault(x => x.SubItemId == subItemId);
|
||||
var model = Funs.DB.PreRun_SubInspectTermItem.FirstOrDefault(x => x.TermItemId == subItemId);
|
||||
if (model != null)
|
||||
{
|
||||
model.InspectionIllustrate = !string.IsNullOrWhiteSpace(values.Value<string>("InspectionIllustrate")) ? values.Value<string>("InspectionIllustrate") : string.Empty;
|
||||
model.InspectionResults = !string.IsNullOrWhiteSpace(values.Value<string>("InspectionResults")) ? int.Parse(values.Value<string>("InspectionResults")) : -1;
|
||||
if (!string.IsNullOrWhiteSpace(values.Value<string>("InspectionResults")))
|
||||
{
|
||||
model.InspectionResults = int.Parse(values.Value<string>("InspectionResults"));
|
||||
}
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
@@ -152,5 +203,31 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun
|
||||
ShowNotify(ex.Message, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 子系统选择的管道/设备
|
||||
/// </summary>
|
||||
public class SelectPropertyTechnology
|
||||
{
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string Id { get; set; }
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
/// <summary>
|
||||
/// 工作包主键
|
||||
/// </summary>
|
||||
public string WorkPackId { get; set; }
|
||||
/// <summary>
|
||||
/// 子系统主键
|
||||
/// </summary>
|
||||
public string SubSystemId { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user