public JsonResult TestSuccItems(VM_Trace_Search_Cond cond) { var retData = new VM_Result_Data(); var items = SearchTraceBrefAction(cond); List <List <MesWeb.Model.T_HisMain> > listArray = null; List <MesWeb.Model.T_HisMain> hisMainListArray = new List <MesWeb.Model.T_HisMain>(); listArray = getSameYearData(cond.StartTime, cond.EndTime, cond.MachineType); filterListMainArrary(hisMainListArray, listArray, cond.AxisNum); List <VM_JSMind> jsMindList = new List <VM_JSMind>(); hisMainListArray.ForEach(h => { VM_JSMind vmJsMind = new VM_JSMind(); genMindStruct(h.Axis_No.Trim(), "root", ref vmJsMind, isRoot: true); jsMindList.Add(vmJsMind); }); var succTimes = 0; jsMindList.ForEach(mind => { if (mind.data.Count >= 4) { succTimes++; } }); retData.Code = RESULT_CODE.OK; retData.Content = succTimes; return(Json(retData)); }
public ActionResult TraceDetail(string Id) { var axisNumStr = Id; VM_JSMind vmJsMind = new VM_JSMind(); try { genMindStruct(axisNumStr.Trim(), "root", ref vmJsMind, isRoot: true); } catch (Exception e) { } return(View(vmJsMind)); }
public JsonResult GetTraceDataAction(string axisNumStr) { var retData = new VM_Result_Data(); var vmJSMind = new VM_JSMind(); var bllCodeUsed = new MesWeb.BLL.T_CodeUsed(); var bllMachine = new MesWeb.BLL.T_Machine(); var bllMachineType = new MesWeb.BLL.T_MachineType(); VM_JSMind vmJsMind = new VM_JSMind(); retData.Appendix = genMindStruct(axisNumStr.Trim(), "root", ref vmJsMind, isRoot: true); if (vmJsMind.data.Count > 0) { retData.Code = RESULT_CODE.OK; retData.Content = "查询成功"; } else { retData.Content = "查询失败"; } return(Json(retData)); }
public VM_JSMind genMindStruct(string axisNumStr, string id, ref VM_JSMind mind, string parentId = "", bool isRoot = false) { if (string.IsNullOrEmpty(axisNumStr) || !HisMain.IsAxisNum(axisNumStr)) { return(null); } var bllMachine = new MesWeb.BLL.T_Machine(); var bllMachineType = new MesWeb.BLL.T_MachineType(); var bllEmployee = new MesWeb.BLL.T_Employee(); var bllMaterial = new MesWeb.BLL.T_MaterialOutput(); HisMain axisNum = new HisMain(); if (axisNumStr.StartsWith("ZD")) { axisNum.Year = axisNumStr.Substring(2, 4); axisNum.Month = axisNumStr.Substring(6, 2); axisNum.MachineTypeID = "5"; } else if (axisNumStr.StartsWith("CP")) { axisNum = new HisMain(axisNumStr); } var hisTabName = "HISMAIN" + axisNum.Year + axisNum.Month + axisNum.MachineTypeID.Trim(); var bllHisMain = new MesWeb.BLL.T_HisMain(hisTabName); var hisMain = bllHisMain.GetModelList("Axis_No like '%" + axisNumStr + "%'").FirstOrDefault(); if (hisMain == null) { return(null); } var machineType = bllMachineType.GetModel(int.Parse(axisNum.MachineTypeID)); MesWeb.Model.T_MaterialOutput material = null; if (hisMain != null) { material = bllMaterial.GetModelList("MaterialRFID = '" + hisMain.MaterialRFID + "'").FirstOrDefault(); } if (material != null) { hisMain.SpecColor = material.Color; hisMain.SpecName = material.MaterialType; hisMain.Supplier = material.SupplyCompany; hisMain.BatchNo = material.BatchNo; } var employeeCode = hisMain.EmployeeID_Main; var employee = bllEmployee.GetModelList("EmployeeCode = '" + employeeCode + "'").FirstOrDefault(); if (employee != null) { hisMain.EmployeeID_Main = employee.EmployeeName; } var machine = bllMachine.GetModel(hisMain.MachineID.Value); var node = new JSMind_Data(); node.topic = machineType.MachineType + machine.MachineName; node.id = id; node.parentid = parentId; node.isroot = isRoot; node.data = hisMain; mind.data.Add(node); if (hisMain != null) { var startAxisNums = ("" + hisMain.Start_Axis_No).Split(','); foreach (var stNum in startAxisNums) { genMindStruct(stNum, stNum, ref mind, id); } } return(mind); }