//创建关键零件合格率标签 protected KeyPartPassrateChartTag CreateKeyPartPassrateTag(XmlNode nodeTag) { string strPart = nodeTag.Attributes["PartName"].Value; string strImage = nodeTag.Attributes["ImageURL"].Value; string[] arrPartName = strPart.Split('|'); string[] arrImage = strImage.Split('|'); KeyPartPassrateChartTag tag = new KeyPartPassrateChartTag(); tag.PartArray = new PartInfo[arrPartName.Length]; tag.Passrate = new float[arrPartName.Length]; for (int i = 0; i < arrPartName.Length; i++) { tag.PartArray[i] = new PartInfo(); tag.PartArray[i].PartName = arrPartName[i]; tag.PartArray[i].ThumbnailURL = arrImage[i]; tag.Passrate[i] = 0; } return(tag); }
protected void StatKeyPartPassrate(ServerConnection conn, ProjectInfo projectInfo, KeyPartPassrateChartTag tag, ref string strError) { //统计最近一次的合格率 Period period = new Period(); period.LastNum = 1; for (int i = 0; i < tag.PartArray.Length; i++) { PartInfo partInfo = tag.PartArray[i]; List <DM_ModelPassRate> arrPassrate = CmdStat.StatPassRate(conn, projectInfo.ProjectID, partInfo.PartID, period, ref strError); if (arrPassrate != null && arrPassrate.Count > 0) { tag.Passrate[i] = arrPassrate[0].PassRate; } } }