Example #1
0
        public List <Reportlab> getCiRptlabAggDO(string idpat, int num, CiRptLabItmDO[] itms)
        {
            // todo 修改成 检查的 id
            //return service.findById(id_lab);
            if (itms == null || itms.Length == 0)
            {
                return(null);
            }
            string[] srvs = itms.Select(p => p.Id_srv).ToArray();
            LabDTO[] labs = qryservice.getLabItms(idpat, num, srvs);
            if (labs.Count() == 0)
            {
                this.ShowAlert("没有符合要求的数据");
                return(null);
            }

            var lablist = new List <Reportlab>();
            int i       = 0;

            foreach (CiRptLabItmDO s2 in itms)
            {
                if (s2.Sd_restrptlabtp != "0")
                {
                    continue;
                }
                var lab = new Reportlab();
                lab.Name  = s2.Name_srv;
                lab.YUnit = s2.Unit_name;
                i++;

                foreach (LabDTO ldo in labs)
                {
                    if (ldo.Val_rstrptlab == null)
                    {
                        continue;
                    }
                    if (s2.Id_srv.Equals(ldo.Id_srv))
                    {
                        var p = new LabPoint();
                        p.Xvalue        = ldo.Dt_rptlab;
                        p.Yvalue        = Double.Parse(ldo.Val_rstrptlab);
                        p.FlagException = false;
                        lab.AddPoint(p);
                    }
                }

                lablist.Add(lab);
                if (i == 5)
                {
                    break;
                }
            }
            if (lablist.Count == 0 || lablist.Count < itms.Count())
            {
                this.ShowAlert("结果值的类型不是数值");
                return(null);
            }

            return(lablist);
        }