public JsonResult GetMachieTypeListAction() { var vmCscList = new List <VM_CscDrop>(); var bllMachType = new MesWeb.BLL.T_MachineType(); var machTypeList = bllMachType.DataTableToList(bllMachType.GetAllList().Tables[0]); if (machTypeList != null) { foreach (var item in machTypeList) { vmCscList.Add(new VM_CscDrop { label = item.MachineType, value = item.MachineTypeID.ToString() }); } } return(Json(vmCscList)); }
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); }