public IList <CV_BPM_TERMINAL> GetVTerminals(CV_BPM_TERMINAL_QueryParam terminal) { IList <CV_BPM_TERMINAL> list = new List <CV_BPM_TERMINAL>(); if (terminal != null) { list = VTerminalBO.GetLikeEntities(terminal); list = list.OrderBy(P => P.TerminalID).ToList(); } return(list); }
public IList <CV_BPM_TERMINAL> GetTerminals(CV_BPM_TERMINAL_QueryParam terminal) { IList <CV_BPM_TERMINAL> list = new List <CV_BPM_TERMINAL>(); if (terminal != null) { //获取工位视图相关信息 list = terminalBO.GetEntities(terminal); return(list); } else { return(null); } }
public CustParentNode createTerminalTree() { CustParentNode parentNode = new CustParentNode() { value = "root", title = "工位设备管理", children = new List <CustLeafNode>() }; CV_BPM_LINE_QueryParam cv_lineParam = new CV_BPM_LINE_QueryParam(); CV_BPM_TERMINAL_QueryParam cv_terminalParam = new CV_BPM_TERMINAL_QueryParam(); FactoryModelerController modeler = new FactoryModelerController(); //获得所有工厂 IList <PM_BPM_PLANT> plants = modeler.GetAllPlant(); if (plants != null && plants.Count > 0) { //获得所有车间 IList <FactoryModelerController.WORKSHOP> workshops = modeler.GetAllWorkShop(); if (workshops != null && workshops.Count > 0) { foreach (PM_BPM_PLANT plant in plants) { CustParentNode plantNode = new CustParentNode() { value = plant.PlantGuid.ToString(), title = plant.PlantName, children = new List <CustLeafNode>() }; cv_lineParam.PlantGuid = plant.PlantGuid; foreach (FactoryModelerController.WORKSHOP workshop in workshops) { //根据车间,产线Guid获得产线 cv_lineParam.WorkshopID = workshop.WorkshopID; IList <CV_BPM_LINE> lines = modeler.GetVLine(cv_lineParam); if (lines != null && lines.Count > 0) { CustParentNode workshopNode = new CustParentNode() { value = workshop.WorkshopID, title = workshop.WorkshopID, children = new List <CustLeafNode>() }; plantNode.children.Add(workshopNode); foreach (CV_BPM_LINE line in lines) { //获得某产线的工位 cv_terminalParam.LineGuid = line.LineGuid; IList <CV_BPM_TERMINAL> terminals = modeler.GetVTerminals(cv_terminalParam); if (terminals != null && terminals.Count > 0) { CustParentNode lineNode = new CustParentNode() { value = line.LineGuid.ToString(), title = line.LineName, children = new List <CustLeafNode>() }; workshopNode.children.Add(lineNode); foreach (CV_BPM_TERMINAL terminal in terminals) { CustLeafNode terminalNode = new CustLeafNode() { value = terminal.TerminalGuid.ToString(), id = terminal.TerminalID, title = terminal.TerminalName + " " + terminal.TerminalID, isLeaf = true }; lineNode.children.Add(terminalNode); } } else { CustLeafNode lineNode = new CustLeafNode() { value = line.LineGuid.ToString(), title = line.LineName }; workshopNode.children.Add(lineNode); } } } else { CustLeafNode workshopNode = new CustLeafNode() { value = workshop.WorkshopID, title = workshop.WorkshopID }; plantNode.children.Add(workshopNode); } } parentNode.children.Add(plantNode); } } else { foreach (PM_BPM_PLANT plant in plants) { CustLeafNode plantNode = new CustLeafNode() { value = plant.PlantGuid.ToString(), title = plant.PlantName }; parentNode.children.Add(plantNode); } } } return(parentNode); }