示例#1
0
 /// <summary>
 /// 初始化实体数据
 /// </summary>
 /// <param name="pBJCollection">数据源集合</param>
 /// <param name="pHDayStaInfo">RP_HDayAADTSta实体</param>
 /// <param name="enstations">进京收费站列表</param>
 /// <param name="exstations">出京收费站列表</param>
 /// <param name="equval">设计交通量</param>
 /// <param name="type">路线名称类型</param>
 /// <returns>RP_HDayAADTSta实体</returns>
 private void SetInfo(List <DS_DataSource> collection, RP_HDayAADTSta info, List <int> enstations, List <int> exstations, int equval, int type)
 {
     //货车车型集合
     int[] truks = StationConfiguration.GetTruks();
     //大货车以上车型
     int[] overtruks = StationConfiguration.GetOverTruks();
     //出京自然交通辆
     info.ExNat = collection.Where(s => exstations.Contains(s.StaID.Value)).Sum(s => s.InNum);
     //进京自然交通辆
     info.EnNat = collection.Where(s => enstations.Contains(s.StaID.Value)).Sum(s => s.OutNum);
     //出京当量交通辆
     info.ExEqu = this.GetEqu(collection, exstations, 0);
     //进京当量交通辆
     info.EnEqu   = this.GetEqu(collection, enstations, 1);
     info.CrowDeg = double.Parse(string.Format("{0:0.0000}", (info.ExEqu + info.EnEqu) / equval));//拥挤度
     //小型车出京
     info.SmaEx = collection.Where(s => exstations.Contains(s.StaID.Value) && (s.VehType == 1 || s.VehType == 11)).Sum(s => s.InNum);
     //小型车进京
     info.SmaEn = collection.Where(s => enstations.Contains(s.StaID.Value) && (s.VehType == 1 || s.VehType == 11)).Sum(s => s.OutNum);
     //中型车出京
     info.MedEx = collection.Where(s => exstations.Contains(s.StaID.Value) && (s.VehType == 2 || s.VehType == 12)).Sum(s => s.InNum);
     //中型车进京
     info.MedEn = collection.Where(s => enstations.Contains(s.StaID.Value) && (s.VehType == 2 || s.VehType == 12)).Sum(s => s.OutNum);
     //大型车出京
     info.LarEx = collection.Where(s => exstations.Contains(s.StaID.Value) && (s.VehType == 3 || s.VehType == 13)).Sum(s => s.InNum);
     //大型车进京
     info.LarEn = collection.Where(s => enstations.Contains(s.StaID.Value) && (s.VehType == 3 || s.VehType == 13)).Sum(s => s.OutNum);
     //重型车出京
     info.HeaEx = collection.Where(s => exstations.Contains(s.StaID.Value) && (s.VehType == 4 || s.VehType == 14)).Sum(s => s.InNum);
     //重型车进京
     info.HeaEn = collection.Where(s => enstations.Contains(s.StaID.Value) && (s.VehType == 4 || s.VehType == 14)).Sum(s => s.OutNum);
     //超大型车出京
     info.SupEx = collection.Where(s => exstations.Contains(s.StaID.Value) && s.VehType == 15).Sum(s => s.InNum);
     //超大型车进京
     info.SupEn = collection.Where(s => enstations.Contains(s.StaID.Value) && s.VehType == 15).Sum(s => s.OutNum);
     //进出京货车数量
     info.EnExTrukNum = collection.Where(s => enstations.Contains(s.StaID.Value) && truks.Contains(s.VehType.Value)).Sum(s => s.OutNum)
                        + collection.Where(s => exstations.Contains(s.StaID.Value) && truks.Contains(s.VehType.Value)).Sum(s => s.InNum);
     //客车货车比例
     //int ptemp = int.Parse(pHDayStaInfo.EnExTrukNum.ToString());
     info.CarTrukPer = double.Parse(string.Format("{0:0.0000}", (info.ExNat + info.EnNat - info.EnExTrukNum) / info.EnExTrukNum));
     //进出京大货车以上车型的数量
     info.SupTruNum = collection.Where(s => enstations.Contains(s.StaID.Value) && overtruks.Contains(s.VehType.Value)).Sum(s => s.OutNum)
                      + collection.Where(s => exstations.Contains(s.StaID.Value) && overtruks.Contains(s.VehType.Value)).Sum(s => s.InNum);
     //大货车以上占货车交通量比例
     info.SupTruPer = double.Parse(string.Format("{0:0.0000}", info.SupTruNum / info.EnExTrukNum));
     //路线名称类型
     info.LineType = type;
 }